Controlling Velocity with a MIDI Controller

florian

2006-03-03 19:19:21

a user asked this:
The single most useful tool, (and the rarest) is to take a proportional control input and a stream of notes, on the same channel, to read the last received CC number's value whenever a note is received, and to replace the velocity value for this note with the value read from the last control change event. I won't try to convince you how useful this is, I think you'll work out the implications for yourself. :)
Now this can be done with Midi Translator! Just use global variables. Globals are just like normal variables, but they are 2-letter codes starting with g for global: go, gp, gq, gr,... Unlike normal variables (oo,pp,qq,rr,...) which are local for a single Translator (i.e. they forget their value after processing of a Translator), global variables remember their value indefinitely.

So to set up velocity control through a MIDI controller, define these translators:

1) catch Note Off
This is necessary to pass through Note Off events with 0 velocity unaltered.

General: Stop Processing: yes (important!)
Incoming: MIDI 90 pp 00
Outgoing: MIDI 90 pp 00

2) Filter the note on events
This is the part where we replace the velocity value of any incoming MIDI note event with the value of the global variable gp:

Incoming: MIDI 90 pp qq
"Output both translated action and incoming message": NO (important!)
Outgoing: MIDI 90 pp gp

3) Parse controller messages
This Translator is responsible for interpreting the controller's value and putting it into the global variable gp.

Incoming MIDI B0 pp gp
Outgoing: MIDI B0 pp qq

Note: this will cause all controllers to be interpreted (good to test, useless for actual use). In order to restrict it to one controller, set the second number of the incoming message to the controller number (use the Capture mode). I.e. to use modulation wheel for velocity control, use this:

Incoming: MIDI B0 01 gp
Outgoing: MIDI B0 01 gp

If you don't want to pass through the controller, use "No Output" as Outgoing Action.

Questions? :roll:

Florian

stoecklem

2006-11-06 12:11:21

that is a great idea. I can't wait to try that. and thanks for posting that.