Page 1 of 1

Multiball Z Out toggle CC / Note

Posted: 04 Sep 2012 23:45
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!

Re: Multiball Z Out toggle CC / Note

Posted: 05 Sep 2012 14:14
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 . . .

Re: Multiball Z Out toggle CC / Note

Posted: 05 Sep 2012 18:37
by whatisvalis
That's the sort of direction I needed, I will experiment.

Thanks!

Re: Multiball Z Out toggle CC / Note

Posted: 07 Sep 2012 01:42
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?

Re: Multiball Z Out toggle CC / Note

Posted: 07 Sep 2012 10:56
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

Re: Multiball Z Out toggle CC / Note

Posted: 07 Sep 2012 14:29
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.