Code: Select all
//Switch ch_on (On Expression, x, any)
sys_msg=fill(1,{0x00},5);
decl i, diff = nonnull(ch_on.x - last_press);
if(ch_on.x[diff]==1) sys_msg[4]={0x01};
send_sysex({sys_channel_toggle,0x00,page_channels[active_page*8+diff],sys_msg});
last_press = ch_on.x;
for(i=0; i<8; i++){
if(last_press[i]==1) toggle_labels[i]='On';
else toggle_labels[i]='Off';
}
setattribute(ch_on,'labels',{toggle_labels});
CS