Page 1 of 1
Send ctlout Pitchbend to variable target
Posted: 09 May 2014 23:56
by AkaMed
Hi,
I am trying to apply 'E0' (pitchbend) by sending a 'ctlout' to a target that is a variable, but I can´t find the way to achieve this.
Seems that the only way to get it is by using the Midi Mapping of the desired object, but there I have to select the target, and my target must be a variable! so I can´t do this...
Any help?
thanks!
P.d.
I have tried also by sending the Pitchbend in another way that i found in internet:
ctlout(target,100,0,channel);
ctlout(target,101,0,channel);
ctlout(target,'E0',x,channel);
ctlout(target,101,0,channel);
But doesn´t work either...
Re: Send ctlout Pitchbend to variable target
Posted: 12 May 2014 20:34
by Softcore
ctlout is for CC messages out.....Pitchbend is not CC...
try this one, not sure but it should work
(target is a variable you can change with buttons or other objects,
midich is a variable you can change with other objects too,
Pitchbend messages are 14 bit with MSB/LSB, my example works by using 7 bit, LSB=0, MSB=Fader.x*127)
Re: Send ctlout Pitchbend to variable target
Posted: 13 May 2014 07:46
by AkaMed
Works Softcore!
I found midiout was the function, but I wasn´t able to make it work...I think I was setting it with a wrong the LSB/MSB.
Thanks so much Softcore!
(BTW: I was getting crazy to get information about this function, the user manual wasn´t any help...)
Re: Send ctlout Pitchbend to variable target
Posted: 13 May 2014 09:22
by Softcore
In all fairness, Lemur manual cannot cover all the cases and specs of MIDI...
"SO how was your script derived then?"
First, I visited the official MIDI specs
http://www.midi.org/techspecs/midimessages.php
Notice that Pitchbend messages are spec'd as:
from 11100000= E0= 224 to 11101111= EF= 239 - Chan 1 to 16 Pitch Bend Change - Pitch Bender LSB (0-127) - Pitch Bender MSB (0-127)
Perhaps now its clearer why I use 223+midich in my script
Re: Send ctlout Pitchbend to variable target
Posted: 13 May 2014 23:15
by Traxus
Pitch bend took me awhile to comprehend:
https://forum.liine.net/viewtopic.php?f ... 852#p15852
basically, it has not double, not triple, not even quadruple but 128 times the resolution of a normal control change message.
remember a normal CC sends from 0 - 127, for a resolution of 128 different steps;
pitch bend and other protocols actually send TWO values between 0 - 127, resulting in a resolution of 16383 steps (!!!)
you might be inclined to think, 128 * 2 only equates to around 256. when in fact you are multiplying 128 * 128
this is referred to as MSB/LSB or most significant byte & least significant bite
each MSB, from 0-127 is a big step; each LSB from 0-127 is a baby step between big steps
So, if your MSB is 56, and your LSB is 0, thats like saying 'go exactly to big step 56'
MSB 56, LSB 63 is saying 'go to big step 56 but then keep going until your half way to 57'
An easy way to think of it in comparision to a normal Control Change is, MSB is your whole number, and LSB is the decimal
So, instead of having to choose between sending a value of, say 77 or 78, you can now do 77.4, 77.5, 77.6 etc
Re: Send ctlout Pitchbend to variable target
Posted: 06 Jun 2014 21:32
by AkaMed
Traxus,
I've been reading in the link you post, there's a lot to learn!
Thanks!
Ruben