My new Mac arrived and one of the first things I wanted to do was set up SuperCollider (SC). Installing SC on a Mac is really easy - it's just a regular .dmg installer. Once it's in your Applications folder you're good to go.

The TextMate logo
The TextMate logo

But editing in the SC window isn't much fun -- you really need a decent code editor / file manager / syntax highlighter. I took Gene's advice (I've been doing that a lot recently) and installed TextMate.

There are a few hoops you have to jump (or ought to jump?) when setting this up, so in this post I want to explain the process I went through -- how to get TextMate to talk to SC from the perspective of an ex-Windows user.

TextMate SuperCollider bundle
TextMate calls it's plugins 'Bundles'. To control SC 3.5 from TextMate, you'll need to install the SC TextMate bundle from Rob Watson, which gives you syntax highlighting and SC control from within TextMate.

(EDIT: I've now switched to Stephen Lumenta's TextMate bundle, similar, but more up-to-date.)

You'll notice from the readme (scroll down) that there are two ways to install - with git or without git. Being as I am a brand-new convert to a brand new Mac, I didn't yet have git (or much else) installed. However, since I will be using openFrameworks, and it's addons are almost exclusively delivered in git, it makes sense to tackle that upfront, and install git now.

HomeBrew
Again, taking Gene's advice, I first installed HomeBrew. HomeBrew is a console-based package manager which vastly simplifies and standardizes the setup process for developer / admin utilities and software (such as git). A quick glance at some of the Terminal commands it gives you will give you a sense of what it does for you (the Mac 'console' is called Terminal).

I'm already used to using a package manager called NuGet for Visual Studio, and so I'm well-versed in the benefits. A package manager helps you install things quickly and easily using a standard configuration (directory structure, file paths etc). This saves you following instructions to set up each individual package you want to use, and potentially making common configuration mistakes. The only downside is you have to get HomeBrew set up in the first place, but in the long run it'll save a lot of time.

The HomeBrew installation page provides a Terminal string which you can use to install HomeBrew. Once you've done that, you are ready to install git. But as HomeBrew itself will tell you once it's installed, you should run brew doctor from the Terminal before attempting any new package installation. This command will inform you of any problems or irregularities found in your existing setup. I had to clear up a couple of issues straight off the bat, but there wasn't anything that a quick google search couldn't handle.

When HomeBrew is happy with your configuration, it will tell you:

Your system is raring to brew.

Git
With HomeBrew ready to go, all you have to do is type into the Terminal:

brew install git

HomeBrew then downloads and installs git. Easy.

The last step is to personalise git and tell it to use your GitHub account when your logged on to your computer.

TextMate SC bundle
With git installed, you can now install the TextMate bundle mentioned earlier, by following the git install option.

Once that's done, it's easy to test whether the bundle is correctly integrated. Just launch SC and TextMate, and in TextMate open a new editor window. If you haven't already done so, go to the menu option:

Bundles > SuperCollider > Complete installation

It should give you a screen telling you the installation is complete. Then switch the language from 'Plain Text' to 'SuperCollider' at the bottom of your code editor window, and test with something simple like:

"hello".postln

If everything worked, you should see "hello" printed to the SC console. You are now ready to go with a decent editor talking directly to SC!