From 28177c457ea5f2f3eb904665b2bf8172c4c7e269 Mon Sep 17 00:00:00 2001 From: Abigail de Joode Date: Sun, 25 Dec 2022 21:57:47 +0000 Subject: [PATCH] Add transport controls --- README.md | 11 ++++++++++- device_arturia_keystep_37.py | 19 ++++++++++++++++++- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7fadf3a..717951f 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,18 @@ # Arturia Keystep 37 Controller Script for FL Studio +![Arturia_Keystep_37_Black](https://user-images.githubusercontent.com/16174954/209695523-1e63591b-a9ed-46e1-9b62-78b5f5c0a085.png) +![Arturia_Keystep_37](https://user-images.githubusercontent.com/16174954/209695384-f355a731-3998-4836-a49b-2ded002cf8ab.png) + ## Installation 1. Download the latest [release](../../releases). Make sure to download the ZIP file and not the source code. 2. Extract the ZIP file in your `%USERPROFILE%/Documents/Image-Line/FL Studio/Settings/Hardware` directory. -3. In FL studio go to Options > MIDI Settings > Input > MPK mini Plus and select Arturia Keystep 37 (User) from the Controller Type dropdown menu. +3. In FL studio go to Options > MIDI Settings > Input > Arturia Keystep 37 and select Arturia Keystep 37 (User) from the Controller Type dropdown menu. ## Mapping + +| Button | Function | +|:-------:|---------------------| +| ⏺ | Toggle Recording | +| ⏹ | Stop Playback | +| ⏯ | Play/Pause Playback | diff --git a/device_arturia_keystep_37.py b/device_arturia_keystep_37.py index 08d34d5..09019ab 100644 --- a/device_arturia_keystep_37.py +++ b/device_arturia_keystep_37.py @@ -1,6 +1,23 @@ # name=Arturia Keystep 37 -# url=https://forum.image-line.com/viewtopic.php?f=1994 +# url=https://forum.image-line.com/viewtopic.php?f=1994&t=295188 # supportedDevices=Arturia Keystep 37 # version=1.0.0 import transport, general, mixer, midi + +BUTTON_RECORD = 0x32 +BUTTON_STOP = 0x33 +BUTTON_PLAY = 0x36 + +def OnControlChange(event): + event.handled = False + if event.data1 == BUTTON_RECORD: + print(f'{"Disabled" if transport.isRecording() else "Enabled"} recording') + transport.record() + elif event.data1 == BUTTON_STOP and event.data2 > 0: + print('Stopped playback') + transport.stop() + elif event.data1 == BUTTON_PLAY and event.data2 > 0: + print(f'{"Paused" if transport.isPlaying() else "Started"} playback') + transport.start() + event.handled = True \ No newline at end of file