diff options
author | Eddy Pedroni <eddy@0xf7.com> | 2022-01-01 20:54:15 +0100 |
---|---|---|
committer | Eddy Pedroni <eddy@0xf7.com> | 2022-01-01 20:54:15 +0100 |
commit | 27ba3bc396a2da4ffcc39e3e36da5f37df8f628e (patch) | |
tree | f72849cd84d599ed8784b4174075d3baa7ec3401 /midi_controller_launchpad_mini.py | |
parent | f7480bb96323b8466ad8e097475db2a7135c88e0 (diff) |
Added playback rate functionality to launchpad
Diffstat (limited to 'midi_controller_launchpad_mini.py')
-rw-r--r-- | midi_controller_launchpad_mini.py | 11 |
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 + |