* set your SCPattern class to respond to the controllers that you
* care about.
*/
-
+import processing.event.*;
interface MidiEngineListener {
public void onFocusedDeck(int deckIndex);
}
} else {
mapKeys();
}
- //registerKeyEvent(this);
+ registerMethod("keyEvent",this);
}
private void mapAPC() {
if (!enabled) {
return;
}
- /* char c = 0;//0Character.toLowerCase(e.getKeyChar());
+ char c = 0;//0Character.toLowerCase(e.getKeyChar());
NoteMeta nm = keyToNote.get(c);
if (nm != null) {
- switch (e.getID()) {
- case KeyEvent.KEY_PRESSED:
+ switch (e.getKeyCode()) {
+ case KeyEvent.PRESS:
noteOnReceived(new Note(Note.NOTE_ON, nm.channel, nm.number + octaveShift*12, 127));
break;
- case KeyEvent.KEY_RELEASED:
+ case KeyEvent.RELEASE:
noteOffReceived(new Note(Note.NOTE_OFF, nm.channel, nm.number + octaveShift*12, 0));
break;
}
}
- if ((mode == KEYS) && (e.getID() == KeyEvent.KEY_PRESSED)) {
+ if ((mode == KEYS) && (e.getKeyCode() == KeyEvent.PRESS)) {
switch (c) {
case 'z':
octaveShift = constrain(octaveShift-1, -4, 4);
octaveShift = constrain(octaveShift+1, -4, 4);
break;
}
- }*/
+ }
}
}