Page 1 of 1

Radiobutton Question [SOLVED]

Posted: 04 Oct 2012 23:59
by jbgeluid
hello,

Ive been trying for a few days now to get the folowing script working, no succes yet:
I have a radiobutton with 8 switches, I use it for container-switching and to send different notes per switch. This all works fine.

I am looking for a script for a "sustaining" note 50, value 0 when my radio-button is at the first switch (0), and a "sustaining" note 50 value 127 for all other switches. (so Always note 50,value 127 when on buton 1,2,3,4,5,6,7 , not "switching" but on hold all the time) Whatever I try, I end up with a random toggeling note 50.


Anybody?

Radiobutton Question solved

Posted: 05 Oct 2012 20:32
by jbgeluid
found it...

scripts for a radiobutton called "Switches", make it send different notes per switch AND send an extra note, but only a 0 value at the first switch
the solution was;

radiobutton, 8 switches.
objectarget midi 0
target: none

action:
flip:
midi 0
midi 0
note on, 50 - 50
scale 0-127
chan 1
scrip1;def
on expression:x, _/- (message send when value goes from 0 to positive)

Code: Select all

decl ind=firstof(Switches.x);
if (Switches.x[0]==1) noteout (0, 42, 127, 1);
if (Switches.x[1]==1) noteout (0, 42, 127, 1);
if (Switches.x[2]==1) noteout (0, 44, 127, 1);
if (Switches.x[3]==1) noteout (0, 45, 127, 1);
if (Switches.x[4]==1) noteout (0, 43, 127, 1);
if (Switches.x[5]==1) noteout (0, 76, 127, 1);
if (Switches.x[6]==1) noteout (0, 80, 127, 1);
if (Switches.x[7]==1) noteout (0, 81, 127, 1);
script2,name def2
on expression x, X (message...when value reaches or leaves 0)

Code: Select all

if (Switches.x[0]<=1) flip = noteout (0, 50, 0, 1); 
if (Switches.x[0]>=1) flip = noteout (0, 50, 127, 1);
if (Switches.x[2]<=1) flip = noteout (0, 50, 127, 1);
if (Switches.x[4]<=1) flip = noteout (0, 50, 127, 1);
if (Switches.x[5]<=1) flip = noteout (0, 50, 127, 1);
if (Switches.x[6]<=1) flip = noteout (0, 50, 127, 1);
if (Switches.x[7]<=1) flip = noteout (0, 50, 127, 1);

Re: Radiobutton Question [SOLVED]

Posted: 05 Oct 2012 23:00
by Phil999
congratulations :)