Possible to make Knobs with custom Midi work bidirectional?

Discuss problems and solutions.
Post Reply
electrofux
Regular
Posts: 294
Joined: 24 Jan 2012 18:22

Possible to make Knobs with custom Midi work bidirectional?

Post by electrofux »

Hello,

i have a Knob with a custom Midi sending cc#1 on Channel5. It is connected to a Filter-Knob in Reason. I know that Custom Midi does not work bidirectionally from the manual. I was hoping to construct a workaround with a script On Midi that listens to cc#1 on Channel 5. I want to use the Custom Midi in order to refactor my template which has non Custom Midi Controls for too many Lemur items and i am hoping to spare a couple by having control over the cc# and channel of each item and reuse them.

The custom Midi in the knob is set to:
target: Midi0
controller:1 trigger:-
value:x/0.00787402 trigger:any
Channel: 5 trigger:-
Trigger:x trigger:-

I made the folowing script:

decl controller, controllerval,i;
controller=MIDI_ARGS[0];
controllerval=MIDI_ARGS[1];

if (controller==1)
{
x=controllerval*0.00787402;
}

Now, when i turn the Filter-Knob in Reason the Knob in Lemur moves smoothly. But when i slide the knob in Lemur it doesn't follow my movement. It just moves when i touch the knob somewhere for the first time. I can't then slide on and change values. The knob doesn't follow anymore.
Softcore
Regular
Posts: 1613
Joined: 04 Nov 2012 08:34

Re: Possible to make Knobs with custom Midi work bidirection

Post by Softcore »

This should do the trick - it makes sure, that feedback is not calculated when you touch the knob in Lemur

Code: Select all

if (z) return;

decl controller, controllerval,i;
controller=MIDI_ARGS[0];
controllerval=MIDI_ARGS[1];

if (controller==1)
{
x=controllerval*0.00787402;
}

electrofux
Regular
Posts: 294
Joined: 24 Jan 2012 18:22

Re: Possible to make Knobs with custom Midi work bidirection

Post by electrofux »

Thx for the info. Didnt know that Knobs have a touch-z variable. Very good.
electrofux
Regular
Posts: 294
Joined: 24 Jan 2012 18:22

Re: Possible to make Knobs with custom Midi work bidirection

Post by electrofux »

It works nicely. Thx very much. Now comes the hard work ;-)
Post Reply