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

Multi-instance mode sending note-off commands only #12

Open
riban-bw opened this issue Feb 6, 2023 · 7 comments
Open

Multi-instance mode sending note-off commands only #12

riban-bw opened this issue Feb 6, 2023 · 7 comments

Comments

@riban-bw
Copy link

riban-bw commented Feb 6, 2023

In Multi-instance mode the pattern seems to be continually sent as MIDI note-off commands and there are not any MIDI note-on commands.

  • Add instance of arplinger to chain with MIDI channel 1
  • Configure as [Multi-instance] Global chord instance
  • Add instance of arplinger to chain with MIDI channel 2
  • Configure as [Multi-instance] Pattern instance
  • Add sequence driving MIDI channel 2
  • Monitor output of pattern instance

Expect to see nothing but actually see MIDI Note Off messages on MIDI channel 2.

  • Play a chord on MIDI channel 1
    Expect to hear and see MIDI Note On/Off to match sequence but actually continue to see MIDI Note Off messages only.
@YPares
Copy link
Owner

YPares commented Feb 6, 2023

Thx! Just to be sure, what was your When no chord note setting? Silence ?

Also, in your situation you expected no events at all, right? You haven't been feeding chords as I understand, so either with Silence or Latch last chord you shouldn't be seeing note ON events in any case.

@YPares YPares self-assigned this Feb 6, 2023
@YPares YPares added LV2 bug Something isn't working platform::Zynthian and removed LV2 labels Feb 6, 2023
@YPares
Copy link
Owner

YPares commented Feb 6, 2023

@riban-bw If you want to have a quick try: just comment lines 192 & 193 in Arp.cpp:

    else // No mappings means we add the NOTE OFF as it is:
      midibuf.addEvent(msg, 0);

(I added that because it seemed to fix some rare stuck notes cases, but it's certainly what causes your problem here. But it's not multi-instance specific, probably you'll have the same behaviour in the same conditions in multi-chan mode)

EDIT: I applied that in latest master

@riban-bw
Copy link
Author

riban-bw commented Feb 6, 2023

Although that stops note-off messages being sent I am still not seeing any note-on messages being sent in multi-instance mode.

[Edit] Actually - in multi-instance mode the pattern instance behaves as if there is not chord instance connected. I wonder if the IPC is working as expected on this platform:

Arpligner.so: ELF 32-bit LSB pie executable, ARM, EABI5 version 1 (GNU/Linux), dynamically linked, BuildID[sha1]=7f85e19443224c9c448b21e863a81d5907db2092, with debug_info, not stripped

@YPares
Copy link
Owner

YPares commented Feb 6, 2023

@riban-bw Then that's probably that. That's what's expected to happen if the two instances are isolated and both create their own "singleton" object each one on their side.

@riban-bw
Copy link
Author

riban-bw commented Feb 6, 2023

How would mult-instance be instantiated successfully?

@YPares
Copy link
Owner

YPares commented Feb 7, 2023

@riban-bw Multi-instance relies on SingletonHolder from JUCE: https://github.com/juce-framework/JUCE/blob/2b16c1b94c90d0db3072f6dc9da481a9484d0435/modules/juce_core/memory/juce_Singleton.h

But it's not clear to me yet what in their implementation makes the shared pointer unique...

@YPares
Copy link
Owner

YPares commented Feb 7, 2023

Okay so it probably just boils down to the fact that the singletonHolder attached to the class is made static:
static juce::SingletonHolder<Classname, juce::CriticalSection, doNotRecreateAfterDeletion> singletonHolder;

So yes I'd guess that, for it to work, the exact same process has to load (at least on Linux) the various plugin instances, so that static singletonHolder may be the same for each. Is the "scope" of static mutable members a well-defined property in C++ standards anyway? (I know this could qualify as "dabbling with black magic" here...)

@YPares YPares removed the bug Something isn't working label Feb 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants