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

Combination lag using MIDI signals #10

Open
davy7125 opened this issue Jul 16, 2022 · 5 comments
Open

Combination lag using MIDI signals #10

davy7125 opened this issue Jul 16, 2022 · 5 comments

Comments

@davy7125
Copy link
Contributor

I discovered on a Raspberry Pi a weird behavior.
To describe the issue I made a minimal disposition comprising:

  • around 60 stops
  • a combination "tutti", enabling all stops
  • a combination "global cancel", disabling all stops

bug gc-tutti lag.zip

If I click on the combination "tutti" with the mouse, all stops are enabled instantly.
But when I link this combination to a MIDI signal that activates it, we are able to see that the stops are not enabled instantly. This is still fast, but with a heavier disposition this can impair the sound (stops are progressively enabled and the effect is not very nice when playing).

I tried to synchronize an activator to the combination, the activator being linked to a MIDI signal, but same problem.
This is like the signals or not processed the same way if we click or if we use a external MIDI signal.

@svenmeier
Copy link
Owner

Mouse operation or activation by MIDI signal should not make any difference. Internally it's handled identically.

I don't have a Raspberry at hand for the next two weeks - is this platform dependent or can this problem be replicated on a Linux PC?

@davy7125
Copy link
Contributor Author

I confirm the behavior is the same using my Fedora, though less problematic since the hardware allow faster operations. You should be able to see the difference between a mouse click and a MIDI signal without a Raspberry.

@svenmeier
Copy link
Owner

There's a small difference depending on how you initiate a combination:

When initiated via mouse, all stops are activated on the GUI-thread. This forces the repainting of the GUI to be is deferred until all stops have changed.

When initiated via a MIDI signal (i.e. on the MIDI thread), the GUI can repaint all stops synchronously.
This might lead to several smaller GUI updates, depending on the position of the stops some areas might even be drawn several times - this happens when the GUI system decides to combine drawing areas into larger areas :(.

But as far as I can see, this is a graphical problem only: the time to activate the stops should be the same. Either way, the graphic updates do not hinder the MIDI processing.

@davy7125
Copy link
Contributor Author

davy7125 commented Aug 1, 2022

I made further tests and you are right: the lag impairs only the GUI and not the sound. I close this issue, sorry for that.

@davy7125 davy7125 closed this as completed Aug 1, 2022
@davy7125
Copy link
Contributor Author

I'm reopening this bug after further investigations. I am using a disposition comprising more mechanics such as a stop counter and the difference between a mouse action and an external MIDI action is more pronounced. Using a MIDI signal, the stops are not called / removed at the same time:

  • graphically we can see that the stops are called / removed progressively,
  • we can hear it (see below),
  • the LEDs on the MIDI console are also progressively on / off.

What is quite bad is the impact on the sound and in this archive you will find two MP3:

  • a first one calling all stops and canceling everything using the mouse (OK),
  • a second one using an external MIDI signal instead (KO).

Context: disposition with 64 stops on a Raspberry Pi.

@davy7125 davy7125 reopened this Aug 15, 2022
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