I’d like to implement MIDI note repeat, ala MPC note repeat, for any MIDI input devices (virtual or physical).
The logic is as follow:
User enables note repeat and sets a specific resolution (1/4th bar, 1/8th bar, etc.)
As long as any MIDI note is held, the same note repeats at the specified interval
It can be used to repeat notes even if the transport isn’t playing and can also be used to record repeated notes.
I was able to implement something similar with a custom MIDI plugin inserted on a track that would feed into another track MIDI input, but this double the amount tracks I need for that purpose.
After a bit of research I was thinking of adding the logic to MidiInputDeviceInstanceBase and, if, needed, MidiInputDeviceNode.
Yeah, ideally if the user starts recording, the repeated notes should be recorded as they were played.
Some MIDI controllers have this feature built-in (like the Akai MPD32), which is cool to record hi-hats etc. but ideally I’d like to have this available for any MIDI controller (and also virtual MIDI devices, which I use in my UI to send events to tracks).
That’s why I ended up looking directly into the MIDI device code and the graph node.
We did think about adding MIDI effects to inputs but it was overly complicated so we put it on hold for other higher priority things. Probably the best way to do it is as a plugin whilst recording and then when the recording is stopped, render the MIDI from the clip through the plugin and remove the plugin. That should happen quick enough to be transparent to the user.
Ah I see. The thing is the repeater should work even if playback is stopped or not even recording. I could maybe optimize my original code so the extra track is created on-demand when note repeat is enabled.