Troubleshooting

Why does this conditional operation not work?

Started by FriFlo on .

Sign in or create an account to join the conversation.

4 posts

Topic starter
I have a Fader object and its midi input and output are disabled. Then I create a script "On Expression, Fade.x" to get feedback to the fader from a hardware midi controller sending pitchbend:
midiout(1,{224,1,Fader.x*127});
This works! Then I create a script"On Midi, Pitchbend, Channel 1" to output midi pitchbend:
setexpression(Fader,'x',MIDI_ARGS[0]/16000);
Ok, now I get midi output from the Fader in Lemur. However, I also get doubled midi output from feedback sent to the fader, which is not how I want it. Well, this is why I created the condition in the first script:
if(Fader.z>0) midiout(1,{224,1,Fader.x*127});
This should theoretically only send the mid out, as long as I touch the fader. But instead, the midi gets sent out anyway ... I don't understand why?!
Thanks for trying! Actually, that line is not necessary with any other conditional expressions.
But I tried it anyway. It didn't help ... I can't figure out why ... it seems so obvious it must work!
I think I figured it out: With every Midicommand triggering the Fader.x value via script, the fader automatically sends a Fader.z=1 value. SO, it seems, there is no way to trigger a fader or knob without triggering touch with it, although you actually did not touch the fader ...
Bad news ...