Repeating incoming MIDI notes

Hey !

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.

Does it seem to be the right approach ?

Thanks,

E.

Are you sure you need to be able to record the repeated events? Usually this kind of thing is just implemented as a plugin.

1 Like

Hey @dave96,

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.

Cheers!
E.

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.

1 Like

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.

Thanks for your help,

Cheers,
E.

@dave96 Giving more thought to it, this is how I’m able to “emulate” input MIDI effects.

So I simply create a “sister” AudioTrack (hidden and disabled by default) which output is connected to my “receiver” track input. When MIDI effects are added and/or enabled, I simply move the “receiver” track MIDI inputs to the MIDI FX track inputs (the UI virtual MIDI device and any hardware MIDI inputs).

This is pretty cool because it allows creating more complex MIDI input effect chains (and use external MIDI plugins), which can be recorded freely to the clips, or played live, without flattening the effects to Clips.

@dave96 Follow up question : when a track output is connected to a track input, does latency adds up ? I would believe so but interested to get your feedback.

I don’t think so anymore, as long as there isn’t a cycle in the audio graph.

1 Like

Oh nice, so I don’t have to switch the MIDI inputs from the receiver track or sister track.
Thanks!