MKtl class that simplifies interfacing the Ableton Push 1 controller. Otherwise behaves as its parent MKtl.
Currently only implements an interface to set color LEDs.
name |
a name |
multiIndex |
should be 1, unless you have several, then it is 3, 5, etc. |
returns a 7bit CC-number representing the color specified by given arguments.
color |
A Symbol representing the color. |
intensity |
can be either |
blink |
can be either |
row |
either // print available colors MPush.lights.topRowColor.keys; // 1st row MPush.lights.padColor.keys; // 2nd row |
returns a 7bit velocity representing the color specified by the given arguments.
color |
A Symbol representing the color. |
intensity |
can be either |
blink |
can be either xxxxxxxxxx // print available colors MPush.lights.padColor.keys; |
dictionary with light definitions.
xxxxxxxxxx
(
2.do{|i|
MKtl('bltn1').elementAt(\colorBut, i).flat.do{|el| el.rawValue_(MPush.buttonLight(intensity: \full, color: \red, row: i)).prMaybeSend;};
};
8.do{|i|
MKtl('bltn1').elementAt(\pad, \on, i).flat.do{|el| el.rawValue_(MPush.padLight(intensity: \full, color: 60)).prMaybeSend;};
}
)
turn off all lights.
elem |
element to be set. should be of type specified by method |
color |
A Symbol representing the color. |
intensity |
can be either |
blink |
can be either set light of a specific element |
// create Mktl for the Push controller, it has two ports, the 2nd one is the "default"
// make sure, ableton is not running (it grabs the device)
k = MPush('push');
k.trace(true);
// wiggle some pots / buttons
k.trace(false);
k.elAt(\pad, \8, \1); // symbols represent button names (typically starting at 1), integers are indices (starting at 0)
// set an action to post aftertouch values
k.elAt(\pad, \8, \1).action = {|el|
el.value.postln;
}
// remove action
k.elAt(\pad, \8, \1).action= nil;
// on-action:
k.elAt(\pad, \8, \1, \on).action = {|el|
"on:\t%".format(el.value).postln
}
// off-action:
k.elAt(\pad, \8, \1, \off).action = {|el|
"off:\t%".format(el.value).postln
}
// set lights
k.setPadLight(k.elAt(\pad, \8, \1, \on), \green);
k.setBtLight(k.elementAt(\bt, 0, 0), \green);
k.setBtLight(k.elementAt(\bt, 1, 0), \blue);
k.setCtlLight(k.elementAt(\btCtl), blink: \slow);
k.setCtlLight(k.elementAt(\btCtl), blink: \steady);
// turn off all lights
k.lightsOff