aboutsummaryrefslogtreecommitdiffstats
path: root/midi_controller_launchpad_mini.py
diff options
context:
space:
mode:
Diffstat (limited to 'midi_controller_launchpad_mini.py')
-rw-r--r--midi_controller_launchpad_mini.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/midi_controller_launchpad_mini.py b/midi_controller_launchpad_mini.py
index adf18d5..960dd7d 100644
--- a/midi_controller_launchpad_mini.py
+++ b/midi_controller_launchpad_mini.py
@@ -11,14 +11,18 @@ class MidiController:
self._midiWrapper = MidiWrapper()
self._handlers = {
+ 96 : self._soloTool.stop,
112 : self._playPause,
- 96 : self._soloTool.stop,
101 : self._soloTool.jumpToA,
102 : self._soloTool.previousStoredAbLimits,
103 : self._soloTool.nextStoredAbLimits,
118 : self._soloTool.previousSong,
119 : self._soloTool.nextSong
}
+
+ for i in range(16, 24):
+ rate = round(0.5 + (i - 16) * 0.1, 1)
+ self._handlers[i] = self._createSetPlaybackRateCallback(rate)
def connect(self):
self._midiWrapper.connect(MidiController.DEVICE_NAME)
@@ -37,3 +41,8 @@ class MidiController:
else:
self._soloTool.play()
+ def _createSetPlaybackRateCallback(self, rate):
+ def f():
+ self._soloTool.setPlaybackRate(rate)
+ return f
+