View Single Post
Old 09-11-2019, 08:37 AM   #1
lunker
Human being with feelings
 
lunker's Avatar
 
Join Date: Nov 2007
Location: Lucas, TX, USA (via Luleå, Sweden)
Posts: 2,009
Default How To Intercept/Manipulate MIDI Controller Data ?

I hope this isn't a crazy/stupid question.

I know how to write a JSFX to read MIDI input going to a track and have the JSFX manipulate the MIDI data in some way.

Is there a way to do something similar for MIDI data that is being sent to plugins via the MIDI learn function? I want to intercept it and alter it before it gets to the plugin.

Or maybe you can suggest a different solution to my problem:

I have a MIDI controller with endless rotary encoders, which I have assigned to knobs in a plugin using relative increment/decrement mode. The encoders send out roughly 100 increment (or decrement) commands for each 360° turn of the encoder.

The VST knob I want to control goes from 0.0 to 100.0 in 0.1 steps, so there are 1000 steps from the minimum value to the maximum value. Thus it takes roughly 10 full 360° turns of the rotary encoder to go from the minimum value to the maximum value. With my slow fingers, it takes me roughly 5-6 seconds to turn the encoder 10 full turns, which is WAY too slow to get decent control of the plugin parameters.

I would like to intercept the MIDI data from the controller, and measure the time between successive increment (or decrement) events. If the time between events is short, it means the encoder is being turned quickly. The shorter the time between events, the faster the encoder is being turned. When the encoder is being turned really fast, I would like to output extra increment (or decrement) events to create a pseudo acceleration factor for the encoder. At high acceleration, I could have it output maybe 9 extra events for every one it receives, which would result in 1000 increment (or decrement) events for a single very fast turn of the encoder. That would give me the kind of quick control I want for the plugin knobs.

I know how I would write this as a JSFX to intercept MIDI data going to a track. I just don't know how I would write something to intercept MIDI learn data before it gets to a plugin. Could I do it with a Lua script that is continuously running in the background? If so how? (I'm familiar with Lua scripts, but not with using them to intercept and manipulate MIDI controller data).
__________________
Best Regards, Ernie "lunker" Lundqvist
BDSM (Bad Dog Studio Musicians)
Windows 10 running on Z390 + i7-8700

Last edited by lunker; 09-11-2019 at 08:42 AM.
lunker is offline   Reply With Quote