Siren Design Notes

There are several elements to Siren:
   the Smoke music representation language
      (music magnitudes, events, event lists, generators, functions, and sounds);
   voices, schedulers and I/O drivers
      (real-time and file-based voices, sound and MIDI I/O);
   user interface components for musical applications
      (extended graphics framework, layout managers, UI tools and widgets); and
   several built-in applications
      (editors and browsers for Siren objects).

Siren Design Patterns

To understand Siren's design, you should be familiar with the terminology of object-oriented design patterns, as laid out in the books "Design Patterns: Elements of Reusable Object-Oriented Software" (Gamma, Helm, Johnson, and Vlissides, Addison-Wesley 1995), and "The Design Patterns Smalltalk Companion" (Alpert, Brown, and Woolf, Addison-Wesley 1998).

The following list introduces the design patterns found in Siren, and gives the parts of the system where they are used and a brief definition of each.

Composite -- events/event lists, display items/display lists -- class structure for building hierarchies of objects

Adaptor -- voices, ports, graphics -- interface objects translate between message protocol "languages"

Singleton -- ports, scheduler, external interfaces -- a class is limited to having a single well-known instance.

Decorator -- event modifiers, voices, layout -- one object "wraps" another and forwards messages sent to it.

Observer -- MVC, MIDI -- an object registers istelf as an "observer" of some aspect of another object, wanting to get update messages when the observed object changes.

Strategy -- layout managers, event generators, voices -- a set of classes provide a family of algorithms that encapsulate their client objects.

Proxy -- voices, ports, Smoke -- one object serves as a representative of another in some context.

Chain of Responsibility -- MVC, voices, input -- object-oriented recursion iterates through tree structures using composed command objects.

Visitor -- Smoke, voices, graphics -- active objects traverse data structures operating on them.

Double-dispatching -- Smoke -- polymorphic operators support mixed-mode operations among families of classes.

Multi-threading -- scheduler

The Siren Class Categories

The list below is the class categories (akin to subpackages) in the Siren namespace. The same list is a class message (categoryList) in class SirenUtility.

Music-Models-Representation -- abstract music magnitude models
Music-Models-Implementation -- music magnitude implementation classes
Music-Events -- central event classes, EventLists
Music-EventGenerators -- EventGenerators: chords, clouds, etc.
Music-EventModifiers -- EventModifiers: rubato, swell
Music-Functions -- functions of time
Music-Sound -- abstract and concrete sound classes
Music-Support -- Scheduler, Utility, Session classes, abstract device, port and editor models
Music-PitchClasses -- Pitch classes (octave-independent pitch notation), chords and key signatures
Music-PitchScales -- Scales and harmony

MusicIO-External -- External interfaces to PortAudio, PortMIDI, LibSndFile, etc.
MusicIO-MIDI -- MIDI voices and devices
MusicIO-OSC -- OSC streams
MusicIO-Sound -- Sound ports
MusicIO-Voices -- Voice hierarchy

MusicUI-DisplayLists -- Core display items and list
MusicUI-DisplayListViews -- Basic DL views
MusicUI-Editors -- Music editors and support
MusicUI-Functions -- Function editors
MusicUI-Layout -- Layout managers for various notations
MusicUI-Sound -- Sound and spectrum views

MusicApps-CSL -- Support for the CREATE Signal Library (CSL)
MusicApps-Loris -- Support for the Loris analysis/resynthesis package
MusicApps-LPC -- Rudiomentary support for linear predictive coding
MusicApps-SHARC -- Readers for the Sandell Harmonic Archive timbre database

There are separate sub-namespaces for the SWIG-generated CSL and Loris classes.

The primary class hierarchies of Siren are given below grouped into categories. The text indentation signifies sub/super-class relationships, and instances variable names are shown.

Music Magnitude Models

   Magnitude
      MusicMagnitude -- value
         MusicModel -- class generality table
            Chroma
               ModeMember
               Pitch
            Chronos
               Duration
               Meter
            Ergon
               Amplitude
            Positus
               Directionality
               Position
               Spatialization

Music Magnitude Implementations

   Magnitude
      MusicMagnitude -- value
         ConditionalDuration
         NominalMagnitude
            SymbolicLoudness
            SymbolicPitch
         NumericalMagnitude
            HertzPitch
            IntervalMagnitude
               MIDIPitch
               MIDIVelocity
            MSecondDuration
               SecondDuration
            RatioMagnitude -- relative
               RatioDuration
               RatioLoudness
                  DBLoudness
               RatioPitch
         OrdinalMagnitude -- table
            Length
            Sharpness
         PField -- name field

Events

   AbstractEvent -- properties
      DurationEvent -- duration
         ActionEvent -- action
         MusicEvent -- pitch loudness voice
            EventList -- events index startedAt

EventLists

   AbstractEvent -- properties
      DurationEvent -- duration
         MusicEvent -- pitch loudness voice
            EventList -- events index startedAt
               EventGenerator
                  Cloud -- density
                     DynamicCloud
                     SelectionCloud
                        DynamicSelectionCloud
                  Cluster
                     Chord -- root inversion
                        Arpeggio -- delay
                     Roll -- number delta noteDuration
                        Trill
                  Ostinato -- list playing process

Functions

   AbstractEvent -- properties
      DurationEvent -- duration
         Function -- data range domain
            FourierSummation -- myForm myArray
            LinearFunction
               ExponentialFunction
               SplineFunction -- linSeg
            Sound
               GranularSound -- grains
               StoredSound -- samplesInMemory firstIndex changed
                  FloatSound
                  VirtualSound -- source
                     CompositeSound -- components
                     GapSound -- cutList
                  WordSound

Voices
   Model -- dependents
      Voice -- name instrument stream
         MIDIFileVoice -- fileType tracks ppq tempo
         MIDIVoice -- currentTime
         NotelistVoice -- parameterMap
            CmixVoice
            CmusicVoice
            CsoundVoice
         SoundVoice