General
Switch needs to cycle again to turn off - fix?
Started by biologik on .
Sign in or create an account to join the conversation.
Hi Everyone,
I'm creating a template for my elektron octatrack.
Right now I've created a switch so that it launches the track (this is akin to launching a clip in ableton). It works fine except that when I want to turn OFF the track I have to cycle the switch (ie. make it light up again and then turn it off). Any ideas on how I can fix that?
I'm creating a template for my elektron octatrack.
Right now I've created a switch so that it launches the track (this is akin to launching a clip in ableton). It works fine except that when I want to turn OFF the track I have to cycle the switch (ie. make it light up again and then turn it off). Any ideas on how I can fix that?
The functionality you need is performed by a pad not a switch - the obvious disadvantage of course, being, you wont have visual feedback of whether the track has been fired or not. Perhaps you can bypass this disadvantage with scripting to control the pad's light (in order to mimic a on-off state) or use LED objects to display the track's status.
You could use a Custom Button, with Mode=Pad, then change the Custom Button's 'color' attribute in a script to display the track status. The color attribute is a 2-element array.
// set Custom Button color: OFF=blue, ON=red
decl blue = RGB(0,0,1);
decl red = RGB(1,0,0);
setattribute( myCustomButton, 'color', {blue, red} );
Similar thing is possible using a Pads object using the 'colors' attribute. This 'colors' attribute is an array, containing the integer values that specify the 'OFF' color of the individual pads. // set Pads colors
decl blue = RGB(0,0,1);
decl red = RGB(1,0,0);
decl c = fill(1, blue, sizeof(myPadsObject.x) ); // set the default pad OFF color
c[0] = red; // replace this line of code with your code that configures your pad colors as desired
setattribute( myPadsObject, 'colors', c);Thanks guys! I'll give this a shot tonight
I appreciate your help!
Hi Dsorlien,
I'm trying to get your pad script to work. Right now I can get the buttons to respond no problem. Only one touch turns it on and off - exactly what I needed. But the color doesn't stay on.
Maybe it's the script placement.. where should I be dropping it? I'm not going to lie here, i'm a COMPLETE n00b when it comes to scripting. I've only ever been using Lemur in automap or hardware CC format. The only "script" i've used is to progressively change the colors from light to dark. So, where should I be plopping this?
edit: here's the code I'm plopping in: dec1blue=RGB(0, 0, 1);dec1red=RGB(1, 0, 0);dec1c=fill(1, blue, sizeof(Pads.x));c[0]=red;setattribute(Pads, 'colors', c);
Thanks again!
I'm trying to get your pad script to work. Right now I can get the buttons to respond no problem. Only one touch turns it on and off - exactly what I needed. But the color doesn't stay on.
Maybe it's the script placement.. where should I be dropping it? I'm not going to lie here, i'm a COMPLETE n00b when it comes to scripting. I've only ever been using Lemur in automap or hardware CC format. The only "script" i've used is to progressively change the colors from light to dark. So, where should I be plopping this?
edit: here's the code I'm plopping in: dec1blue=RGB(0, 0, 1);dec1red=RGB(1, 0, 0);dec1c=fill(1, blue, sizeof(Pads.x));c[0]=red;setattribute(Pads, 'colors', c);
Thanks again!
You got typos in your script....
its not dec1 its decl (short for declare)... You are declaring a new variable named, for example blue and then you proceed instructing Lemur what that variable equals to
its not dec1 its decl (short for declare)... You are declaring a new variable named, for example blue and then you proceed instructing Lemur what that variable equals to
If you are unfamiliar with scripting, start off by using multiple Custom Button objects rather than a Pads object.
I assume the OctaTrack only has 8 tracks, so you only need 8 Custom Buttons to launch the tracks. Create your template with the 8 Custom Buttons, set to 'Pad' mode. Use the Mapping window to map MIDI or OSC messages to each Custom Button as needed to launch the OctaTrack tracks. Get that working and test it with the hardware.
In each custom button, add a script. Set the script execution to: 'On Expression', x, 'rising edge'
The script will trigger when the Custom Button is tapped
Copy and paste this code to avoid typos
I assume the OctaTrack only has 8 tracks, so you only need 8 Custom Buttons to launch the tracks. Create your template with the 8 Custom Buttons, set to 'Pad' mode. Use the Mapping window to map MIDI or OSC messages to each Custom Button as needed to launch the OctaTrack tracks. Get that working and test it with the hardware.
In each custom button, add a script. Set the script execution to: 'On Expression', x, 'rising edge'
The script will trigger when the Custom Button is tapped
Copy and paste this code to avoid typos
// swap Custom Button color each time it is tapped
decl blue = RGB(0,0,1);
decl red = RGB(1,0,0);
decl c = getattribute(getobject(), 'color');
if(c[0] != blue)
setattribute( getobject(), 'color', {blue, red} );
else
setattribute( getobject(), 'color', {red, blue} );On same subject I'm using a custom button in pad mode. Can't use switch. I need button to stay light when pressed like with mackie button softcore made. But with same idea that it lights up instead of using color.
It works!! Thank for the script Dsorlien! I appreciate it. Thanks to everyone else too 
Wurlt01, the pad script that Dsorlien posted works exactly as you need. You can change the colors are you need. I used: http://web.njit.edu/~kevin/rgb.txt.html to pick colors, although they don't all match up well for some reason.
Wurlt01, the pad script that Dsorlien posted works exactly as you need. You can change the colors are you need. I used: http://web.njit.edu/~kevin/rgb.txt.html to pick colors, although they don't all match up well for some reason.
To match the colors to existing objects in your template, you can add a Monitor object to display the 'color' or 'colors' attribute of an object.
For example, suppose you have a Custom Button named "myCustomButton". To get the colors of this object, add a Monitor object with value:
getattribute(myCustomButton, 'color')
For example, suppose you have a Custom Button named "myCustomButton". To get the colors of this object, add a Monitor object with value:
getattribute(myCustomButton, 'color')
Wonderful! Thanks!
Where's a good place to learn this stuff? I've gone over to the original lemur site and looked at somethings but much of that is WAY over my head. Any tips?
Where's a good place to learn this stuff? I've gone over to the original lemur site and looked at somethings but much of that is WAY over my head. Any tips?
This is nice Not sure what Im doing wrong tried 1 st and 3 script and color changes when pressed but goes back to main color it doesn't toggle. Can you make a module of your script and add to modules.
@wurlt01
Make sure you have set the scripts to execute on the expression rising from zero and not "any" (select the arrow pointing up symbol instead of "any")
Make sure you have set the scripts to execute on the expression rising from zero and not "any" (select the arrow pointing up symbol instead of "any")
ok thanks weird I tried that must have made small error cause now it works.
Thank you a million times dsorlien...finally I have found a way to do this

So many times I need a hybrid switch/pad behaviour and now I have it!
Wonder if it's possible to get the text to do the same thing i.e latch
So many times I need a hybrid switch/pad behaviour and now I have it!
Wonder if it's possible to get the text to do the same thing i.e latch
hello friend were you able to create successful switch? I am looking to built similar one so can you provide me some useful information,,biologik wrote:[color=#000000]Hi Everyone, I'm creating a template for my elektron octatrack. Right now I've created a switch so that it launches the track (this is akin to launching a clip in ableton). It works fine except that when I want to turn OFF the track I have to cycle the switch (ie. make it[/color] [color=#000000]led light[/color][color=#000000] up again and then turn it off). Any ideas on how I can fix that?[/color]