Setting up Siren

To test the Siren set-up and I/O, open the configuration/test panel,

[SirenSession openUtility] d

You can see the system configuration and test the MIDI, sound file, and sound IO here. If you use MIDI, use the left row of buttons to set it up and test it. The 2nd row of buttons is used to test sound IO via PortAudio. The SirenUtility is available as a menu item and a toolbar button in the Launcher's Tools menu (right-most button). There's a section below in this workbook about the Siren utility and transport panes.

The right-most buttons are important utilities. The "clean up" button stops the scheduler and shuts down MIDI and sound IO (for use in an emergency).

Special init

See the method SirenUtility class initialize, with which you can customize Siren so that it finds your devices, servers, and data files. See especially the lines,

DefaultMIDIIn := 4. "Tune these to your setup"
DefaultMIDIOut := 10.
DefaultOSCHost := #[127 0 0 1].
DefaultOSCPort := 54321.
Verbosity := 1. "0 = pretty silent, only error logging;
1 = medium-verbose IO interface logging;
2 = full scheduler and verbose interface logging"
[...]
"Set search paths"
self addDir: 'Databases' to: SoundDir. "STP-specific"
self addDir: '3-Credo/*' to: SoundDir. "You can add using wildcards"

Setting up the External Interfaces

Siren uses several external interfaces (based on the DLLCC framework or SWIG) for access to external data and I/O. The Smalltalk code for these interfaces is in the category MusicIO-External. The external libraries Siren uses are:

Sound file read/write -- libSndFile -- see http://www.mega-nerd.com/libsndfile
Streaming MIDI I/O -- PortMidi -- see http://www.cs.cmu.edu/~music/portmusic
Streaming sound I/O -- PortAudio -- see http://www.portaudio.com
Fast Fourier Transform -- FFTW -- see http://fftw.org

You need to have these libraries installed (normally in a directory such as /usr/local/lib), and compile and link the C-language interface libraries in the subdirectory DLLCC for sound or MIDI I/O to work with Siren. Binaries are available for Mac OSX. There are full sources and pre-compiled versions of the required libraries on the CSL web site; look at http://FASTLabInc.com/CSL.

To get Loris, http://sourceforge.net/projects/loris
To get CSL, http://FASTLabInc.com/CSL

To use the SWIG-based interfaces (Loris and CSL), see the pages below.

Testing MIDI I/O
This will open the MIDI driver and play a note; printing messages to the Transcript.
[MIDIPort testANote]
Test this using a MIDI dump utility (such as MIDIMonitor), or a soft-synth, or outboard MIDI hardware. There are many other tests in class MIDIPort.

Testing OpenSoundControl output
The following example will send out a few OSC messages; test it with a dumpOSC utility, or with the CSL OSC server example. There are many other tests in class OSCVoice.
[OSCVoice fm_example1]

Testing sound file I/O
This will print diagnostics and a few rows of sample values to the Transcript. There are more examples ion class SoundFile.
[LibSndFileInterface example1: 'a.snd']

Testing streaming sound I/O
This will report to the Transcript; lsee also the examples in class SoundPort.
[PortAudioInterface example1]

Testing the Siren scheduler
To test the built-in real-time scheduler, try the following block, which will display colored rectangles on the top window for 5 seconds, then refresh the screen.
[ActionEvent playExample]

MIDI/Sound Configuration

Siren's MIDI support depends on a platform-independent interface class that talks to VM-side primitives that talk to OS-level device drivers. There are clas ssettings in MIDIPort for the default I/O devices. The same applies to SoundPort.

Smalltalk Options

There are several configurable parts to Siren. Class SirenUtility is the general place to find utility messages related to Siren set-up and global variables. Look at its class variables and initialization method.

Several of the voice classes have "default" methods that return a default instance. Look at MIDIVoice default, and Voice default.

Siren looks in default directory for scores and sound files. By default this is called "Data" and is a sub-folder of the folder where the virtual image is executing. There are methods in class SirenUtility to change this.

Useful Utilities

There are several sound/MIDI utilities that Siren users generally need; these include:
a MIDI dump utility such as MIDIMonitor from Snoize;
an OSC dump utility such as dumpOSC from CNMAT;
an OSC send script such as sendOSC from CNMAT; and
an audio patching utility such as Jack or Audio Hijack.

Siren House-keeping

To clear out temp. event lists, use,
[SirenSession flushTempEventLists]
or to flush all,
[SirenSession flushAllEventLists]

To flush and close down the scheduler,
[Schedule interrupt; flush; release]

To send MIDI all notes off, flush ports, throw away open ports, clear out temp event lists, etc.
[MIDIPort cleanUp]

Check here to see if there are any left-over objecgts being held onto,
[DependentsFields inspect]