## A TB303 emulator

The Tb303 suite emulates the classic Roland TB-303 "Bass Line" analog synth. (Just the synth, not the sequencer; VSS has a separate sequencer actor.) To use the Tb303 implementation, load tb303.so and create an actor of type Tb303Actor.

Note that it won't make any sound after you send the BeginSound command until you also send the Retrigger command. So the usual order of commands is

1. hSound = BeginSoundPaused SetFoo 42.0 SetBar 43.0 ... ;
2. Retrigger hSound;
3. SetPause hSound 0;

### Tb303Actor messages

In addition to the messages understood by all generator actors, the Tb303Actor understands the following messages. If the optional parameter `time` is specified in any of the following messages, then the corresponding parameter is linearly modulated from the old value to the specified value over the duration of `time` seconds after receipt of the command. In the case of the commands SetAll[Param] (which set the value for all handlers spawned by a particular actor), the default [Param] is always set immediately on receipt of the command, regardless of `time`.

SetFreq `hActor x`
SetAllFreq `hActor x time`
  Set the default frequency for new instances to `x`.
SetFilterCutoff `hActor x`
SetAllFilterCutoff `hActor x time`
  Set the default filter cutoff for new instances to `x`.
SetResonance `hActor x`
SetAllResonance `hActor x time`
  Set the default resonance for new instances to `x`.
SetEnvMod `hActor x`
SetAllEnvMod `hActor x time`
  Set the default envelope modulation for new instances to `x`.
SetEnvDecay `hActor x`
SetAllEnvDecay `hActor x time`
  Set the default envelope decay for new instances to `x`.

### Tb303 handler messages

In addition to the messages understood by all handlers, the handler for the tb303 algorithm understands the following messages:

Retrigger `hSound`
  Play the attack portion of a sound (the phreeeeoooooooo part before it settles down to the steady-state portion).
SetFreq `hSound x time`
  Set the frequency to `x` Hz (10 to 1000 works best; default 110).
SetFilterCutoff `hSound x time`
  Set the "vowel color" to `x` (0 to 1, default 0); from 0 to 1, the sound goes through oo, oh, ah, ee and gets louder at the same time.
SetResonance `hSound x time`
  Set the narrowness of the filter to `x` (0 to 1, default 0). At higher values you can hear individual harmonics during the attack of a sound.
SetEnvMod `hSound x time`
  Set the amount of "modulation" in the attack envelope to `x` (0 to 1, default 0). At higher values, the attack starts higher and finishes on a lower (less buzzy, more sinetone) steady-state sound.
SetEnvDecay `hSound x time`
  Set the duration of the attack portion to `x` (0 to 1, default 0). 0 corresponds to about 1/10 second, 1 to about 5 or 6 seconds.

(All these funky names are what the original Roland box used.)