sfront NMP Howto
This brief howto will allow you to set up a NMP session using sfront under GNU/Linux and a basic set of instruments.
- Download the latest copy of sfront here.
- Extract the file: tar zxf sfront.tar.gz. Note that the paths used in remainder of this Howto assumes this tarball was extracted to ~/.
- In the copy i'm using [0.88] the MIDI device it looks for is /dev/midi00, but on the machine i'm using the device talks on /dev/midi01. Either way, the primary MIDI device should be linked to /dev/midi so that's the way to go in my opinion. Search the file ~/sfront/src/csyslib.c for the string /dev/midi, and update any /dev/midi00 you see with /dev/midi [or a specific /dev/midiXX if needed].
- Time to compile! A simple make in ~/sfront/src/ is all it takes. Up to this point, each step should only be needed when installing a new version of sfront.
- You'll need ~/sfront/bin/ in your shell's PATH. In csh [the default shell at CCRMA] simply run set path=($path ~/sfront/bin). In bash [my personal preference] the command is PATH=$PATH:~/sfront/bin. If you want to avoid running this command every time you open a new terminal, add it to your .*rc file [.cshrc, .bashrc, etc]. Alternatively, you can leave your PATH as is and change the Makefile discussed later to specify the path for sfront. See number 8.
- Hop over to ~/sfront/examples/rtime/nmp_audio/. You can use the stock SAOL file, grab one that i use [very similar to the 3 stock instruments with an additional buzz instrument], or write your own if you're feeling adventurous.
- Open up the Makefile. Make sure CIN is set to -cin linmidi. Also, edit NETWORK to a session and passphrase of your liking. The passphrase must be at least 20 characters. Each session is created based on the session/passphrase pair, not on session only. For example, if one client uses -session "my_session" -passphrase "abcdefghijklmnopqrstuvwxyz" and another client uses -session "my_session" -passphrase "zyxwvutsrqponmlkjihgfedcba" the second user will not receive an error that the passphrase used is incorrect; instead, a new session with the second session/passphrase pair will be created.
- If you decided not to set your shell's PATH, you'll need to adjust your Makefile accordingly. Set SFRONT to ~/sfront/bin/sfront.
- Running make from the current directory will compile and run your sfront NMP client. This will need to be done whenever you change anything in your Makefile [like NETWORK, CIN, or FILENAME] and if you update your SAOL file. Otherwise, simply run ./sa to avoid needless recompilation.
I hope this brief guide was helpful in getting a sfront NMP session up and running. Please send me an email if you have any questions. Good day!
bburkett [at] ccrma [dot] stanford [dot] edu
sfront
NMP