Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
TidalCycles Installer Script for Mac OS https://tidalcycles.org/index.php/MacOS_installation
#!/bin/bash
# Author: James Campbell
# Date: September 2019
# Last Updated: September 2019
# Contact: james@jamescampbell.us
# What: tidalcycles installer script for OSX
#### COLORS
COLOR_PURPLE='\033[0;35m'
normal='\033[0m'
#### CHECK FOR MAC OS
if [[ "$OSTYPE" == "darwin"* ]]; then
printf "$COLOR_PURPLE[0]$normal Mac OS detected, moving forward with installation...\n"
else
echo "Mac OS not detected, this script is for Mac OS or OSX only." && exit 1
fi
#### CHECK FOR HOMEBREW
if command -v brew 2>/dev/null; then
printf "$COLOR_PURPLE[1]$normal Homebrew found, installing Super Collider..."
brew cask install supercollider
else
echo "Install homebrew first at https://brew.sh"
exit 1
fi
#### CHECK FOR HASKELL
if command -v cabal 2>/dev/null; then
printf "$COLOR_PURPLE[2]$normal Haskell found, skipping...\n"
else
printf "$COLOR_PURPLE[2]$normal Installing Haskell via ghcup...\n"
curl https://get-ghcup.haskell.org -sSf | sh
fi
#### CHECK FOR GIT
if command -v git 2>/dev/null; then
printf "$COLOR_PURPLE[3]$normal git found, skipping...\n"
else
printf "$COLOR_URPLE[3]$normal installing git...\n"
brew install git
fi
#### INSTALL TIDALCYCLES
printf "$COLOR_PURPLE[4]$normal Congratulations, you have all the pre-reqs...\n"
echo "Installing tidalcycles via cabal..."
echo ""
. "$HOME/.ghcup/env"
echo '. $HOME/.ghcup/env' >> "$HOME/.bashrc"
cabal update
cabal install tidal --lib
#### OPEN SUPERCOLLIDER TO CREATE DIRS
printf "Opening SuperCollider and closing in background to initialize Extensions directory..."
sudo spctl --master-disable
open -j -g -a SuperCollider
sudo spctl --master-enable
sleep 5
killall SuperCollider
#### INSTALL PLUGINS
printf "$COLOR_PURPLE[5]$normal Installing SuperCollider Plugins...\n"
wget https://github.com/supercollider/sc3-plugins/releases/download/Version-3.10.0/sc3-plugins-3.10.0-macOS.zip -O /tmp/sc3.zip
unzip -q /tmp/sc3.zip -d ~/Library/Application\ Support/SuperCollider/Extensions/
#### INSTALL SUPERDIRT
echo "Follow the instructions on the screen in SuperCollider to finish the install, enjoy!"
echo "Help and further info at: https://tidalcycles.org/index.php/MacOS_installation"
printf '// Place your cursor on the line below and press Shift-Enter\ninclude("SuperDirt")\n restart SuperCollider and GTG\n' > /tmp/superdirt.scd
open /tmp/superdirt.scd
exit 0
@jamesacampbell

This comment has been minimized.

Copy link
Owner Author

jamesacampbell commented Sep 4, 2019

This is untested, but would love feedback. Please try it out and let me know. To run in OSX:

chmod +x tidalup.sh
./tidalup.sh

I am trying to make it idempotent so it shouldn't break anything if you run it more than once but YMMV.

@wensontsai

This comment has been minimized.

Copy link

wensontsai commented Oct 11, 2019

this worked great! 👍

@jamesacampbell

This comment has been minimized.

Copy link
Owner Author

jamesacampbell commented Oct 11, 2019

@wensontsai great, thanks for testing it out. Glad it worked :)

@jamesacampbell

This comment has been minimized.

Copy link
Owner Author

jamesacampbell commented Oct 11, 2019

Now I can safely say this script is confirmed working.

@wensontsai

This comment has been minimized.

Copy link

wensontsai commented Oct 11, 2019

It's a godsend. I was having issues with installing each piece before and ghc path fussinesses. Very happy!

@jamesacampbell

This comment has been minimized.

Copy link
Owner Author

jamesacampbell commented Oct 11, 2019

🥰😍😎 super glad someone else found it useful. I had painful time as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.