Multiball Z Out toggle CC / Note

Discuss Lemur and share techniques.
Post Reply
whatisvalis
Regular
Posts: 153
Joined: 31 Dec 2011 17:12

Multiball Z Out toggle CC / Note

Post by whatisvalis »

Hi

I want to create an option in a settings page that allows the user to Toggle between CC and note messages for the Z variable of the multiball.

Not entirely sure how to approach this. Could i use a radio switch and a script incorporating firstoff? How would i get it to target the custom midi I am using to define CC and Note outputs?

Thanks for any help!
Macciza
Regular
Posts: 1315
Joined: 07 Dec 2011 04:57
Location: Sydney, Australia.

Re: Multiball Z Out toggle CC / Note

Post by Macciza »

Maybe a Custom Switch - 0 =CCs, 1 =Notes
Then in your Multiball script you can check it's value and respond differently
-psuedo-code -
if (customswitch == 0)
{
do stuff
}
else if (customswitch ==1)
{
do otherstuff
}
Hope that helps . . .
iMac 2.8G i7 12G 10.6.8/10.7.2, Legacy Dexter/Lemur, Liine Lemur/iPad2, KMI SoftStep, 12Step & QuNeo , B-Controls, Mackie C4 etc
MaxMSP, Live Suite, Native Instrument stuff, etc Modified Virtual Guitar System etc All Projects/Modules © CC-BY-NC-SA[*][/b]
whatisvalis
Regular
Posts: 153
Joined: 31 Dec 2011 17:12

Re: Multiball Z Out toggle CC / Note

Post by whatisvalis »

That's the sort of direction I needed, I will experiment.

Thanks!
whatisvalis
Regular
Posts: 153
Joined: 31 Dec 2011 17:12

Re: Multiball Z Out toggle CC / Note

Post by whatisvalis »

This is probably dead easy, but I'm learning as i go.

if I'm using

ctlout(0,ccNum,127,1);

How do i get the value to scale from 1-127?
Macciza
Regular
Posts: 1315
Joined: 07 Dec 2011 04:57
Location: Sydney, Australia.

Re: Multiball Z Out toggle CC / Note

Post by Macciza »

Hi
Usually it would be 0 -127 . . .
Can either predeclare it as
decl val = floor(x*127); and use val in your ctlout(0,ccNum,val,1)
or just ctlout(0,ccnum,floor(x*127),1);

This assume your script is within the MultiBall and that you are wanting to use the x value . .
The 'floor' function rounds the numbers down to whole numbers . . .

Cheers
MM
iMac 2.8G i7 12G 10.6.8/10.7.2, Legacy Dexter/Lemur, Liine Lemur/iPad2, KMI SoftStep, 12Step & QuNeo , B-Controls, Mackie C4 etc
MaxMSP, Live Suite, Native Instrument stuff, etc Modified Virtual Guitar System etc All Projects/Modules © CC-BY-NC-SA[*][/b]
whatisvalis
Regular
Posts: 153
Joined: 31 Dec 2011 17:12

Re: Multiball Z Out toggle CC / Note

Post by whatisvalis »

Thanks.

I tried 0 -127 before, but using that stops any midi output for some reason. Anyway it's nice to use the decl function for the first time, so things are starting to work.

decl val = floor(x*127);
if(go.x==1)
ctlout(0,ccNum,val,1);

Oddly enough the range was inverted right (0) to left(127) in Cubase using the X axis ball, and Cubase reported -60 to 67 when the Ball was moved, although actual recorded controller points were 127 to 0. I played around with -1, trying to invert that value, but this screwed up the range. However, now it's working fine with the original code, 0-127 left to right. Very strange.
Post Reply