// The following is working by itself,
// but factory function assignment to global var
// returns nil
- /*
- try {
+ /*try {
// linux
push.pushOut = MIDIOut.newByName("Ableton Push", "Ableton Push MIDI 2");
}{
// mac os
push.pushOut = MIDIOut.newByName("Ableton Push", "User Port");
- };
- */
+ };*/
+
push.pushOut.latency_(0);
if (push.pushOut==nil, {"Cannot control push LEDs!"});
~se.makeSynthEvent
~se.makeSynthArgs
+~recording = false;
(
~push.recDown = { |zi|
- ~se.startRec();
+ if (~recording, {
+ ~se.stopRec();
+ ~recording = false;
+ }, {
+ ~se.startRec();
+ ~recording = true;
+ });
};
~push.recUp = { |zi|
- ~se.stopRec();
+ //~se.stopRec();
};
~push.playDown = { |zi|
~se.playSample();
var note, amp;
~push.padLight(row, col, 2, 1, false, 0);
note = Scale.major.degreeToFreq(col, 0.midicps, row+1);
- amp = vel.linlin(1, 127, 0.01, 0.4);
- Synth(~se.synthName, ~se.makeSynthArgs++[\freq, note]);
+ Synth(~se.synthName, ~se.makeSynthArgs++[\freq, note, \amp, vel]);
};
~push.padUp = { |zi, row, col, vel|
~push.padLight(row, col, 0, 0, false, 1);