Last active
January 30, 2019 15:39
-
-
Save TomasKostadinov/27c8ebf5c20fb6ccf0bfaa798d4cf493 to your computer and use it in GitHub Desktop.
Using a Rane 72 to Control Spotify
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on runme(message) | |
if (item 1 of message = 191) and (item 2 of message = 0) and (item 3 of message = 65) then | |
tell application "Spotify" | |
next track | |
end tell | |
end if | |
if (item 1 of message = 191) and (item 2 of message = 0) and (item 3 of message = 63) then | |
tell application "Spotify" | |
previous track | |
end tell | |
end if | |
if (item 1 of message = 190) and (item 2 of message = 45) then | |
tell application "Spotify" | |
set faderVol to item 3 of message | |
set sound volume to (faderVol / 128) * 100 | |
end tell | |
end if | |
if (item 1 of message = 158) and (item 2 of message = 17) and (item 3 of message > 0) then | |
tell application "Spotify" | |
if shuffling is false then | |
set shuffling to true | |
else | |
set shuffling to false | |
end if | |
end tell | |
end if | |
if (item 1 of message = 159) and (item 2 of message = 50) and (item 3 of message > 0) then | |
using terms from application "Spotify" | |
if player state of application "Spotify" is paused then | |
tell application "Spotify" to play | |
else | |
tell application "Spotify" to pause | |
end if | |
end using terms from | |
end if | |
end runme |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Why?
Because I use my Rane 72 on a daily basis not only with Serato but also with Spotify I wanted to be able to control my music with my mixer.
Prerequisites
Requirements: You will need a MacOS Computer and a Rane 72 Mixer for this script to work, but the script can be modified to work on any other midi controller.
I'm using the Rane 72 as my main audio output device so I can control the volume using the faders/knobs on the mixer. This step is not needed and optional. To configure the Rane 72 as your main audio output open the audio and midi setup application.
Press configure speaker and select which channel you want to output your pc's sound to:
You could use USB Aux which will output the sound as a sampler, the volume then can be controlled using the 'Sampler Level' knob, you can then also listen to the sound via the main cue mix. I prefer using Deck 1 because of the access to the 3 Band EQ and Effects.
How to use
You could expand this as you like and even map tracks and playlists to a special midi button or assign a special button to open Spotify. This script can also be modified to work on iTunes and other players.
Sources and further reading
This was inspired by Jake Hebbert's Video "Controlling PhotoShop with a Korg NanoKontrol via midiPipe and AppleScripts".
Feel free to ask any questions in the comments below!