Page 1 of 1

Multifader advice - Ableton

Posted: 04 Jan 2012 22:44
by djtex
Hi everyone, I'm pretty new to Lemur, but so far loving it. I am trying to create my own custom template for DJing and so far so good. Apart from one small part I was hoping someone maybe able to help with.

I want to map an EQ8 in Ableton to 8 sliders in a Multi Slider, this was the easy part and works nicely at the frequency bands I selected. However, I want a button next to the slider that returns all the faders back to the top of the slider. But I really don't know where to start. Can anyone try and help me in the right direction.

It's basically, just a quick way to kill any EQ settings without having to adjust all the faders individually. Any ideas out there?

Many thanks in advance :D

Re: Multifader advice - Ableton

Posted: 05 Jan 2012 02:51
by highmountain
So let's say your button is a Pad object (or a Custom Button set to Pad behavior). Create a script on your pad or button. Set the script's execution to "On Expression", and in the field to the right, put "x". This means that any time the button's "x" value changes, the script will execute.

In that script, put this:

Code: Select all

if (x) {
		MultiSlider.x = range(sizeof(MultiSlider.x), 1, 1);
}
That checks to make sure "x" is true. For Pads and Custom Buttons in Pad mode, this means that it will only perform the instructions inside the "if" when you first touch the pad. In that case, it sets all of the MultiSlider's "x" values to 1. In detail: "sizeof(MultiSlider.x)" basically means "the length of the MultiSlider's X", which will always be the same as the number of sliders you gave it. "range(n, low, high)" creates an array of size n, with values starting at low, and evenly spaced until the last one at high. So for example, "range(3, 1, 3)" will give you {1, 2, 3}. Putting those two together, it creates an array with a "1" for every slider in your MultiSlider, then assigns it to the MultiSlider's "x".

If you have named your MultiSlider something other than "MultiSlider", you'll need to change "MultiSlider" to whatever name you gave the object.

Re: Multifader advice - Ableton

Posted: 05 Jan 2012 19:50
by djtex
highmountain wrote:So let's say your button is a Pad object (or a Custom Button set to Pad behavior). Create a script on your pad or button. Set the script's execution to "On Expression", and in the field to the right, put "x". This means that any time the button's "x" value changes, the script will execute.

In that script, put this:

Code: Select all

if (x) {
		MultiSlider.x = range(sizeof(MultiSlider.x), 1, 1);
}
That checks to make sure "x" is true. For Pads and Custom Buttons in Pad mode, this means that it will only perform the instructions inside the "if" when you first touch the pad. In that case, it sets all of the MultiSlider's "x" values to 1. In detail: "sizeof(MultiSlider.x)" basically means "the length of the MultiSlider's X", which will always be the same as the number of sliders you gave it. "range(n, low, high)" creates an array of size n, with values starting at low, and evenly spaced until the last one at high. So for example, "range(3, 1, 3)" will give you {1, 2, 3}. Putting those two together, it creates an array with a "1" for every slider in your MultiSlider, then assigns it to the MultiSlider's "x".

If you have named your MultiSlider something other than "MultiSlider", you'll need to change "MultiSlider" to whatever name you gave the object.
You sir are a wonderfully splendid chap!!!! Works a treat, and has helped my understanding no end. Really appreciate your help and assistance.
:D :D :D :D :D :D :D

Re: Multifader advice - Ableton

Posted: 05 Jan 2012 23:11
by whatisvalis
very cool, thanks for the explanation.

Is it possible to list multiple objects (to reset) in that script?

Re: Multifader advice - Ableton

Posted: 06 Jan 2012 03:20
by highmountain
Yall are welcome. :D

You can set as many things as you like. Just put them all inside the braces using a similar format. For example, this will set x values for a Fader and a Range also:

Code: Select all

if (x) {
      MultiSlider.x = range(sizeof(MultiSlider.x), 1, 1);
      Fader.x = 0.5;
      Range.x = {0, 1};
}
Since the Fader always has one x value, no array is needed. A range object always has two values for x, so it can be set by hand with a two item array. You can also do things like setting the value of one object to the current value of another, or setting object variables other than x. Generally any variable that you can set using this syntax will be in all lowercase in the object's Properties or Behavior tab, though this is not entirely consistent (the main exception is "grid").