How do i send two midi cc's with one button
-
- Newbie
- Posts: 12
- Joined: 19 Apr 2013 02:33
How do i send two midi cc's with one button
Probably a noob question but i can't figure out how to get a custom button to send twi midi cc's.
I want to have one cc sent when turned on and another cc when it is turned off. I figured out how to do this in bome's midi translator to send two key strokes but i'm sure it's something easy in Lemur.
I want to have one cc sent when turned on and another cc when it is turned off. I figured out how to do this in bome's midi translator to send two key strokes but i'm sure it's something easy in Lemur.
Re: How do i send two midi cc's with one button
You can easily do that by adding a script in your object with if statements and the ctlout function.
For example
Add script on expression x, any
The above script will send on target 0, cc21 the value 64 on midi channel 1 if the button is switched off and on target 0, cc22 the value 127 on midi channel 1 if the switch is on. If you want,as i suspect you will be needing, to include more tahn one actions in your if statement (the above script doesnt mkae any sense because after two consequent presses nothing is changed, cc21 and cc22 are not changed anymore) include the actions in {}.
For example
Will switch on off the cc21 and cc22 but the one opposite with the other
Keep in mind a second way would be to add two scripts one on expression x, rising from 0 (up arrow) and one on expression x,dropping to zero ( down arrow ) which is essentially a way to seperate the off-to-on state of a switch from the on-to- off state.
Edit: typo in scripts corrected
For example
Add script on expression x, any
Code: Select all
if (x==0) ctlout(0, 21, 64, 1);
else ctlout(0, 22, 127, 1);
For example
Code: Select all
if (x==0) {ctlout(0, 21, 0, 1); ctlout(0, 22, 127, 1); }
else {ctlout(0, 21, 127, 1); ctlout(0, 22, 0, 1);}
Keep in mind a second way would be to add two scripts one on expression x, rising from 0 (up arrow) and one on expression x,dropping to zero ( down arrow ) which is essentially a way to seperate the off-to-on state of a switch from the on-to- off state.
Edit: typo in scripts corrected
Last edited by Softcore on 22 Apr 2013 08:39, edited 1 time in total.
-
- Newbie
- Posts: 12
- Joined: 19 Apr 2013 02:33
Re: How do i send two midi cc's with one button
Damnso silly of me, sorry!!!!
I should have typed if not If - the damn auto capitalisation of iPad!!!!
And yes, you figured correctly - red means something is wrong in the script, even if its just only a typo!!!
I should have typed if not If - the damn auto capitalisation of iPad!!!!
And yes, you figured correctly - red means something is wrong in the script, even if its just only a typo!!!
Re: How do i send two midi cc's with one button
As for making a button control other buttons, if you search the manual or the last, like, 10 of me replies you'll see its a very common question!!!
Here is more on this subject
http://forum.liine.net/viewtopic.php?f=25&t=2891
Here is more on this subject
http://forum.liine.net/viewtopic.php?f=25&t=2891
-
- Newbie
- Posts: 12
- Joined: 19 Apr 2013 02:33
Re: How do i send two midi cc's with one button
thanks a lot for your knowledge but I'm just not getting it and i've been at it for the last couple of hours, i feel like a retard! Where you say CODE:SELECT ALL, is this just random what you call your script line or is it important, do you put this in when it asks,"create script"? but that comes up red when i type it all in caps like you have. Sorry but i've searched how to script but I need a Dummies version of how to script i think!
Re: How do i send two midi cc's with one button
Been in bed with flu for the last couple of days so my posts were made on the iPad and not actual testing....hold on a sec , im working on an example.....
But no, the name of the script is not important for its functionality - it is just given in the case you want to refer to it from another object....
Brb
But no, the name of the script is not important for its functionality - it is just given in the case you want to refer to it from another object....
Brb
Re: How do i send two midi cc's with one button
Ok just checked...after the edits the script is functional - probably you have missed a typo somewhere....
Here's an example with also a button that controls the dual CC button AAANNNNNDDDD lol, another button that inverts the way the second button controls the dual button.....
If you 've been using Bomes Im sure you ll get it right away - its just learning the script structure!
Here's an example with also a button that controls the dual CC button AAANNNNNDDDD lol, another button that inverts the way the second button controls the dual button.....
If you 've been using Bomes Im sure you ll get it right away - its just learning the script structure!
Re: How do i send two midi cc's with one button
Ok I see what caused the confusion, this right here.....
is a handy way of PHPBB forums to present codes for any purpose...It's mainly designed to give the forum members the way to post html, php or java codes without being executed so I have the habbit to include my Lemur scripts in it, even though its not necessary....I always thought it was common knolwedge and helps visually to distinguish code from text.
In other words, the "code: select all" is just there so that you can easily copy paste the code and has nothing to do with Lemur!
Code: Select all
some script or code here....
In other words, the "code: select all" is just there so that you can easily copy paste the code and has nothing to do with Lemur!
-
- Newbie
- Posts: 12
- Joined: 19 Apr 2013 02:33
Re: How do i send two midi cc's with one button
AHHHHHH your the man! I was using message on control change before, as soon as i change it to notes it works fine. I'm sort of getting it now, thanxs so much for getting out of bed, hope your flu gets better!