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

Pd multichannel improvements #1037

Merged
merged 3 commits into from
Jul 12, 2024

Conversation

Spacechild1
Copy link

Continuation of #1034.

Tries to address the issues raised in #1034 (comment).

First, make the first inlet a pure message inlet, so users can not accidentally connect it to a signal.

As a second step, add the MESSAGE_INLET macro to control the behavior of the first inlet at compile time.

If 0, the first inlet is a signal inlet and also takes messages, which is more idiomatic, but not backwards compatible.

If 1, keep the old behavior (= default).

the first inlet only takes messages, there is no reason why it should be a signal inlet.
this makes sure that users get an error when they wrongly try to connect it to a signal chord.
if 1 (default), keep the first inlet as a pure message inlet;
if 0, the first inlet is a signal inlet and also accepts messages.
@Spacechild1
Copy link
Author

Spacechild1 commented Jul 12, 2024

I still can't test, so I hope I didn't break anything :) @sletz @alainbonardi Please test all four combinations:

  1. MESSAGE_INLET=1 without -m
  2. MESSAGE_INLET=1 with -m
  3. MESSAGE_INLET=0 without -m
  4. MESSAGE_INLET=0 with -m

If this works, you could add an option to the faust2puredata script which would enable the new behavior (by passing -D MESSAGE_INLET=<0|1> to the compiler). Note that it can't be enabled by default because it wouldn't be backwards compatible. In particular, the new behavior isn't compatible with the existing faust2pd program - which generates the UI - so the latter would need to be updated as well.

@sletz sletz merged commit a3199a2 into grame-cncm:pd-multichannel Jul 12, 2024
@sletz
Copy link
Member

sletz commented Jul 12, 2024

Thanks. So pd-multichannel branch updated with a new -msi (message and signal inlet) option in faust2puredata to get the new behaviour. @alainbonardi can you test?

@sletz
Copy link
Member

sletz commented Jul 13, 2024

Like here: ef150b9 ?

@alainbonardi
Copy link

Thank you very much Christof and Stéphane. I tested the four options: with/without -msi compilation option and with/without -m object parameter, everything works perfectly.
But the problem of compatibility I mentioned in my first post was not for the inlets but for the outlets. Before our changes, faust2puredata generated an object whose first outlet was not signal (maybe dump results?): signals started on the second outlet. See this screenshot of a Pd patch comparing previous compilation (abc_2d_decoder1_4~ on the right) and new compilation (decoder1~ on the left). With the previous compilation, the 4 signals went out through outlets 2 to 5. Now, the signals go out through outlets 1 to 4...
This creates a problem of backwards compatibility.
Capture d’écran 2024-07-15 à 13 57 08

@Spacechild1
Copy link
Author

I tested the four options: with/without -msi compilation option and with/without -m object parameter, everything works perfectly.

Thanks a lot for testing!

But the problem of compatibility I mentioned in my first post was not for the inlets but for the outlets

Ah, I totally misread your comment...

signals started on the second outlet.

Ouch, thanks for catching that! Indeed, I accidentally changed the order. In Pd externals the signal outlets typically come before the message outlets, so I just did it automatically...

I will restore the old order for the "legacy" behavior, but keep the new order for the "new" behavior. I will update the script accordingly. -msi should probably be called something like -new. (In the future, we might use the new behavior by default, but allow users to get the legacy behavior, e.g. with -legacy.) Will make a PR later that day.

@alainbonardi
Copy link

Thanks a lot Christof!
Why not call -msi something like -mlsi with l for left. Maybe -new is not explicite enough, and imagine if within a few months, something newer arises...

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

Successfully merging this pull request may close these issues.

3 participants