View Single Post
Old 10-26-2018, 10:46 PM   #36
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,685
Default

BTW. (happily you got up to speed with EERL programming very fast ) :
Regarding reducing the count of voices I suggest using an array that holds the assignments of incoming channels to outgoing "slots", used in a "overwrite the least recently used entry" way with a configurable max count of active entries.

Same would hold the incoming channel (or maybe the outgoing slot if sorted the other way) (or -1 for unused), a mark that a sound is running (set with note-on, reset with note-off) and the note-on velocity (the same byte as the mark could be used: "not running" = 0, as note-on velocity 0 means note-off), and a "last used" timestamp .

If a message with a not managed channel arrives, the least recently used entry that is not "running" is re-used. No problem here.

If no not running entry is found, the least recently used entry needs to be re-used. Now you need to send a Note-off to the old target slot to kill the sound (as supposedly the keyboard did not detect legato here). Here I suggest to use the saved note-on velocity for note-of velocity to provide the best possible consistency.

It makes sense to save this fact (including the "old" channel) in the same or in an additional array, to be able to discard messages to such channel, preventing incoming messages to a dead voice from taking away a voice slot.

Using just note-on and note-off events for assigning slots to incoming channels can't be done, because MPS allows for meaningful messages to a channel before note-on (e.g. Pitch-bend for staring a detuned sound) and after note-off (modulating the release phase).

Afterthought:
All this is strictly about means to use "any" VSTi with an MPE enabled keyboard. There also are things that might be viable for dedicated sound engines. E.g. I use "The Trumpet" by sampleModeling, which is based on NI Kontakt. Here it would make sense to convert Note-Off velocity ("lift" Dimension) to triggering a "Fall", which is done by sending note-on events outside the range of the instrument). Kontakt can't manage Note-off velocity .

-Michael

Last edited by mschnell; 10-27-2018 at 06:35 AM.
mschnell is online now   Reply With Quote