Page 1 of 1

ctlout syntax for pad array?

Posted: 09 Dec 2012 18:54
by whatisvalis
I can't get this working. I'm try to set the CC values for a pad array using ctlout

i've tried this, but no luck.

ctlout(1,{16, 17, 18, 19, 20, 21, 22, 23, 24, 25},127,1);

Basically on certain conditions i want the array to send out different values, unfortunately it's stuck sending out the first value.

I could use a custom midi script, but i do not know how to switch between different custom scipts

Re: ctlout syntax for pad array?

Posted: 09 Dec 2012 21:59
by whatisvalis
Is there a more efficient way than this?

if(x[0])
ctlout(1,16,127,1);
if(x[1])
ctlout(1,17,127,1);
if(x[2])
ctlout(1,18,127,1);
if(x[3])
ctlout(1,19,127,1);
if(x[4])
ctlout(1,20,127,1);
if(x[5])
ctlout(1,21,127,1);
if(x[6])
ctlout(1,22,127,1);
if(x[7])
ctlout(1,23,127,1);
if(x[8])
ctlout(1,24,127,1);
if(x[9])
ctlout(1,25,127,1);

Re: ctlout syntax for pad array?

Posted: 10 Dec 2012 00:14
by Phil999
as soon you have a mathematical 'row' (don't know the exact term in English, numbers that follow a simple rule like +1), you can use ++ (increment) and -- (decrement). Should be something like this:

Code: Select all

decl i;
for (i=0; i<9; i++);

if(x[i])
ctlout(1,i+16,127,1);
I haven't tested it, tell me if it works.

Re: ctlout syntax for pad array?

Posted: 10 Dec 2012 00:33
by whatisvalis
Thanks for the reply Phil.

I gave that solution a try, unfortunately it only outputs on ch 25 across all the switches

Re: ctlout syntax for pad array?

Posted: 10 Dec 2012 00:42
by Phil999
there was an error, it should be

Code: Select all

decl i;
for (i=0; i<=9; i++);

if(x[i])
ctlout(1,i+16,127,1);
but maybe you'll need two variables.

I got this from a user library template, I actually never used incremental arithmetic operators myself. Unfortunately I only noted that syntax, not the name of the template. But I think it's close to the solution.

Edit: hmm, thinking about it, there must be a firstof() function in the script, like in the Ambivalent Beats template. The Lemurised L3 template from the AB Bundle could also give a hint, but my editor crashes everytime I try to load it.

Re: ctlout syntax for pad array?

Posted: 10 Dec 2012 01:52
by whatisvalis
That ended-up out putting on 26 only.

I've experimented with firstof, but really guess work to be honest. Maybe the ctlout function is limited in that respect?

I thought Ambient Beats was mostly Max 4 Live back-end stuff? I'll have a look anyway, I've been trawling the library for ctlout examples

cheers Phil.

JD