Page 1 of 1

Invert Midi value problem

Posted: Fri Jan 20, 2012 3:34 pm
by Michelle242
Hallo, I have the following problem. I'd like to change all incoming midi values from for example 90 10 pp to the invert value with the modifier pp=pp*-1 If I try to do this no more midi comes out of the output. But when I type in pp=pp*-2 I get midi output again. But I need pp=pp*-1 . What's going wrong here? Please help!

Re: Invert Midi value problem

Posted: Thu Jan 26, 2012 6:13 am
by DvlsAdvct
Just to be sure, you want a knob to start at the left at 127 and go down to 0 as you turn it right, correct?

Re: Invert Midi value problem

Posted: Thu Jan 26, 2012 10:38 am
by Michelle242
Well it's not really a knob and it does not turn from left to right but yes, I want a fader to spit out the value of 127 if it's down continueing until 0 when it's up. Simple as that.

Re: Invert Midi value problem

Posted: Fri Jan 27, 2012 2:08 am
by DvlsAdvct
pp=pp/2
pp=pp+64
pp=pp-127
pp=pp*-1
g0=pp

I THINK those rules should do it. It worked on an older code I used for a knob, but it might be wrong. let me know. Make sure the outgoing message has g0 (or any available variable) for the outgoing velocity and pp as the incoming velocity. If you change the outgoing variable please be sure to change the variable in the rules.

Re: Invert Midi value problem

Posted: Fri Jan 27, 2012 5:14 pm
by DvlsAdvct
I was actually putting some thought into this and I think it would work better if your rules were simply

pp=pp*-1
pp=pp+127

That should equal out to inverting the signal.

Re: Invert Midi value problem

Posted: Fri Jan 27, 2012 8:26 pm
by Michelle242
Well thank you so much for your help. I will soon try out your suggestions. But I don't know if you really read my post exactly. Because if you did you would know that the rule pp=pp*-1 does not seem to work for me for some strange reason.

Re: Invert Midi value problem

Posted: Fri Jan 27, 2012 8:41 pm
by DvlsAdvct
I did read your post, though I might be confused as to all of the steps you've used.

After you do pp=pp*-1 you have to add pp=pp+127

Then you should get MIDI. Or did you try that and then it still didn't work?

Re: Invert Midi value problem

Posted: Thu Feb 02, 2012 7:54 pm
by Michelle242
Thaaaaaank you so much, DvlsAdvct. It seems I simply forgot to add "pp=pp+127" . Now it works! I thought too simple just thinking "Ok, invert must be *-1. But adding 127 is a logical step in this quotation! Thank you again! Now I can complete my program!

Re: Invert Midi value problem

Posted: Thu Feb 02, 2012 8:42 pm
by DvlsAdvct
Yeah, it's something that stumped me when I first started doing this stuff. :)

Enjoy!