Add full DPat compatibility to presets
[SugarCubes.git] / _MIDI.pde
index 9a3ce5cb29f21266e69247ab6d9a2e087084f6af..535194f8264d63d40c7cf403464fde4cc841b666 100644 (file)
--- a/_MIDI.pde
+++ b/_MIDI.pde
@@ -703,9 +703,16 @@ class APC40MidiOutput implements LXParameter.Listener, GridOutput {
     while (i < 12) {
       sendKnob(i++, 0);
     }
-    for (int row = 0; row < 7; ++row) {
-      for (int col = 0; col < 8; ++col) {
-        setGridState(row, col, 0);
+    if (focusedPattern instanceof DPat) {
+      ((DPat)focusedPattern).updateLights();
+    } else {
+      for (int j = 0; j < 8; ++j) {
+        output.sendNoteOn(j, 48, 0);
+      }
+      for (int row = 0; row < 7; ++row) {
+        for (int col = 0; col < 8; ++col) {
+          setGridState(row, col, 0);
+        }
       }
     }
   }