Momentary Triggers for Longer Actions From External Midi CC

Im trying to write a plugin creating a “Drum Roll” - the idea being a momentary CC message will trigger the roll to start and it will end depending on the number of repetitions being desired (elsewhere set in the plugin).

In the internals of the plugin, the run method listens to a port for a 1 (cc>64) or 0 (cc<64) value. If its a 1 after having been zero, the roll is started. But my question being how can that port value go back to 0 in order that it can listen to a further 0->1 change in the future.

Is it the responsibility of the midi controller to send both a cc>64 message and shortly after another cc<64 message (so that the value of the port is reset)?

Or can one use the mod:preferMomentaryOnByDefault (or related properties) to achieve this. (is there a way where the mod itself resets the value of the port after a change - or does this only work for the built in footswitches)

1 Like