Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kiss to Connect #984

Open
baconpaul opened this issue Jan 14, 2024 · 11 comments
Open

Kiss to Connect #984

baconpaul opened this issue Jan 14, 2024 · 11 comments
Milestone

Comments

@baconpaul
Copy link
Contributor

Over in #983 @ContemporaryInsanity and I got chatting about kiss to connect. This is an idea kinda like how bespoke does connection if you jog two modules into each other they will connect.

It's a super neat idea and NeighborConnectable makes it possible but there's two technical challenges making it hard

  1. Where to store the preference since it is cross module. Tricky. But resovlvable. But then more importantly
  2. My comment in Extended left to right neighbor connectivity #983 on onExpanderChange at loading patches. Much harder.

So putting this in a 2.3 issue instead of a 2.2.n but may swap it around. It may also not be feasible. Lets see.

@baconpaul baconpaul added this to the XT 2.3 milestone Jan 14, 2024
@ContemporaryInsanity
Copy link

I'm not familiar with onExpanderChange.

Have a look here https://github.com/ContemporaryInsanity/RacketScience2/blob/main/src/RSRand.cpp

That's how I detect a new right expander, not sure if this is of any help though.

@baconpaul
Copy link
Contributor Author

yeah basically the very first change from null to non-null you need to ignore on each side otherwise unstream will generate the event. that's the trick but requires some testing.

onExpanderChange is just a function that gets called by rack when the expander changes so you don't have to write code like the code you linked :) The resulting data structure is the same it's just you can let rack tell you rather than poll basically.

@baconpaul
Copy link
Contributor Author

the problem is, of course, ignoring the 'first' connect would be bad when you add a module. you really need to know whether you are in startup or unstream. it's not an easy problem.

@ContemporaryInsanity
Copy link

"So if you saved a patch with a pair of adjacent modules with kiss to connect on and loaded it, the naive implementation would connect them."

Not sure I'm understanding this 100%.

So on patch load, the previously connected, then saved modules would already be connected, and part of doing this involves not auto-connecting if already connected so I don't currently comprehend how this is an issue? I know I'm missing something here...

@baconpaul
Copy link
Contributor Author

If you saved a patch where you had disconnected two modules on unstream the kiss to connect would kick in and override creating the cables which you had removed

@ContemporaryInsanity
Copy link

Got it, thanks.

Forearmed with this knowledge, would that be a real world problem? Certainly not a perfect solution, but knowing that would happen under those circumstances would not be an issue for me. Plus the way I patch with Surge is typically always left to right so with my normal workflow it wouldn't be an issue regardless of this side effect.

@baconpaul
Copy link
Contributor Author

Yes. Save and restore a parch gives the identical result is a more important constraint than any feature.

So I need to figure it out.

but I can. It’s just a bunch of edge cases

@ContemporaryInsanity
Copy link

Save an outputDisconnected flag in the module's JSON, check that on kiss and if true don't connect?

@baconpaul
Copy link
Contributor Author

But then preset load for a vco wouldn’t connect first time
Etc

but yes it’s something like thst then making sure it acts appropriately in all the cases

@ContemporaryInsanity
Copy link

Thanks for indulging me, I'm not as sharp as I once was.

Good luck with it and thanks for everything so far :)

@baconpaul
Copy link
Contributor Author

Ha no problem

like I said it’s not intractable it’s just the easy idea I had doesn’t work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants