From 406e06ecfa0391cc3138a33bee0e5e45cb06f6c5 Mon Sep 17 00:00:00 2001 From: Eddy Pedroni Date: Sat, 1 Jan 2022 21:02:19 +0100 Subject: Added playback volume functionality to launchpad --- midi_controller_launchpad_mini.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'midi_controller_launchpad_mini.py') diff --git a/midi_controller_launchpad_mini.py b/midi_controller_launchpad_mini.py index 960dd7d..bc2ed8a 100644 --- a/midi_controller_launchpad_mini.py +++ b/midi_controller_launchpad_mini.py @@ -20,6 +20,10 @@ class MidiController: 119 : self._soloTool.nextSong } + for i in range(0, 8): + volume = round(0.125 + i * 0.125, 3) + self._handlers[i] = self._createSetPlaybackVolumeCallback(volume) + for i in range(16, 24): rate = round(0.5 + (i - 16) * 0.1, 1) self._handlers[i] = self._createSetPlaybackRateCallback(rate) @@ -46,3 +50,7 @@ class MidiController: self._soloTool.setPlaybackRate(rate) return f + def _createSetPlaybackVolumeCallback(self, volume): + def f(): + self._soloTool.setPlaybackVolume(volume) + return f -- cgit v1.2.3