Some of the keyboard combinations I was using in my TextMate / SC bundle weren't working, so on the advice of users in the forum I decided to switch to a new fork.
Stephen Lumenta's fork is much more up-to-date, appears to be being actively supported, and has a number of improvements to the master.
It worked in the end, but I thought I'd post a few pointers to anyone else trying set this up or use it:
Setup issues: select the right branch
If you are using SC >= 3.5, make sure you use the qt_35 branch. That means switching the top-left corner and then clicking the zip download link. As of this writing all the git clone
commands point to the < 3.5 version.
When you have downloaded the file and unzipped it, you can rename it to scmate.tmbundle
and place it in the TextMate bundles directory so that it matches how it would have looked if you'd cloned it:
~/Library/Application Support/TextMate/Bundles/scmate.tmbundle
(Where the tilde ~ represents your User's home directory)
Setup issues: Use the default SC directory
Make sure SuperCollider is installed in the default app location. I had SC installed inside a subdirectory, and although (as the readme suggests) you can fiddle with paths it's just easier to use the default location:
~/Applications/SuperCollider.app
Complete the installation
Remember to complete the installation by launching TextMate and selecting this menu option:
Bundles > SuperCollider > SCLang > Complete Installation
This command copies some .sc
linkage files into a SuperCollider startup precompilation directory. When you next start SC, it should find and parse these files, and include the results in the SC runtime.
Usage
To actually use the bundle:
- If you haven't already done so, launch SC and complete the installation
- Create a new TextMate window and select SuperCollider from the drop-down at the bottom
- Select the following menu item, or use
Cmd-F1
(you may have to actually pressCmd-Fn-F1
):
Bundles > SuperCollider > Launch SCLang
You should see a Terminal window pop up and show you the usual SC startup script. You should also notice sclang
starting up as a program in your app menu, called from the Terminal.
With this bundle, all your communication will be with the Terminal rather than the SC post window. If (like me) you like the internal / localhost GUIs, you can launch those via code:
Server.local.makeGui;
Server.internal.makeGui;
They will respond in the usual way.
- Type and execute a few commands in TextMate to make sure everything is working (keyboard commands at the bottom of this post):
s.boot;
"test".postln;
{SinOsc.ar}.play;
At this point, you are good to go.
A clean exit
To cleanly exit sclang
, use Ctrl-C
in the Terminal window. This will kill the sclang
process and you should notice the sclang
app icon disappear from your app menu.
If you forget to kill sclang
in this way, the next time you try to launch SC from TextMate it will tell you there is already an sclang
process. To kill that process, just quit sclang
from the app menu, and then remove the temp files via the Terminal:
rm /tmp/sclang*
You should then be able to boot sclang
from the Bundles
menu as usual.
Terminal choice
If you want to use a Terminal other than the default one, you will need to make an edit to this file:
~/Library/Application Support/TextMate/Bundles
/scmate.tmbundle/Commands/Launch SCLang.tmCommand
You can change the referenced .app
package to be your favourite terminal app.
Common shortcuts
The bundle shortcut keys can be accessed via the TextMate Bundles
menu, but here are a few basic ones to get you going - mixed with some useful TextMate shortcuts for use with SC:
Shift-Cmd-B | Select everything within the enclosing brackets / braces |
Shift-Enter | Evaluate |
Ctrl-. | Stop all playback |
Cmd-D | Open help for item at text cursor (no need to fully highlight) |
Cmd-J | Open source code for item at text cursor |
Ctrl-Shift-D | Duplicate |
Cmd-[ and Cmd-] | Indent left / right (select code block first) |