Seeking help - Refactoring midi controller device drivers for Vangelis

Hi @LFO!

What “launcher” device is your target?

Don’t use this. You should never try to “send notes from the driver to the chains” using function calls:

  • First, notes are not going to be routed adequately and you would need to do bizarre things to receive these notes in your chains
  • Second, you would have high latency and jitter, as “normal” driver code is not real time code.

Ideally, the events reaching the chains should never leave the jack’s Real Time stream. You have 2 different ways to manage this:

  • The simple way is using the “unroute_from_chains” class var:

unroute_from_chains = 0b0000001000000000 # Unroute MIDI channel 10
or
unroute_from_chains = 0b0000000000001111" # Unroute MIDI channels 0 to 3.

This allow to set the MIDI channels you want to unroute from the chains when your driver is loaded, so the events on these MIDI channels only reach your driver. By default, ALL MIDI channels will be unrouted, so no events reach your chains.
You will find several examples in the current drivers. For instance, worlde_mini_moder.

  • The powerful (but more complex) way is using midiproc. Basically, the “midiproc_task” is a real-time process that is called by the Jack Audio daemon in real time It’s better explained in this thread;

and you will find some interesting examples in the drivers folder (base_moder) or inside the “examples” subfolder.

Cheers!

2 Likes