A CHANT synthesis implementation

Note: this code is licensed from the author, IRCAM, only for use internal to NCSA.

The Chant Synthesis suite (chantActor, chantHand, chantAlg) synthesizes voiced "formants", such as result by exciting a resonant cavity with a periodic pulse train. This algorithm has been used extensively for synthesizing the sound of the human singing voice.

A sound created by this actor is composed of up to five (5) formants per sound. Within each formant, three main parameters may be independently controlled: the center frequency, bandwith, and the amplitude relative to that of the other formants. Other (less interesting) parameters may also be independently controlled, but to effectively use them a good understanding of the underlying synthesis technique is required.

To use the Chant Synthesis implementation, load chant.so and create an actor of type ChantActor.

ChantActor messages

The ChantActor understands the usual generator actor messages, but no other messages particular to itself.

Chant Handler messages

In addition to the messages understood by all handlers, the handler for the CHANT synthesis algorithm 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.

AddFormant hSound amp cf bw
Add a new formant to an existing Chant sound, specifying relative amplitude, center frequency in Hz, and bandwidth in Hz. Up to 5 formants may be added per sound.
SetFreq hSound freq time
Set the fundamental frequency of excitation for the formant, in Hz, to freq.
The remaining commands are for adjusting single formants. In each command, the parameter formant determines which formant is being changed; this is an integer from 1 up to the number of AddFormant commands given for this sound.
SetFormantAmp hSound formant amp time
Set the amplitude of this formant, relative to that of the other formants in the current sound, to amp.
SetFormantCF hSound formant cf time
Set the center frequency of this formant to cf Hz.
SetFormantBW hSound formant bw time
Set the bandwidth of this formant to bw Hz.
SetFormantTex hSound formant tex time
Set the time of excitation of this formant to tex seconds.
SetFormantDeb hSound formant deb time
Set the time till onset ("debut") of attenuation of this formant to deb seconds.
SetFormantAtt hSound formant att time
Set the attenuation time of this formant to att seconds.
SetFormantPhase hSound formant phase time
Set the phase of this formant waveform to phase radians.
We recommend that you use the last four commands (SetFormantTex, SetFormantDeb, SetFormantAtt, and SetFormantPhase) only after you've got a feel for what the other more basic commands do.

It appears that the three values tex, deb, att are successive durations: first the formant is excited for a duration of tex seconds, then time passes for deb seconds, then attenuation occurs over a duration of att seconds. (I confess that IRCAM's code is un peu mysterieuse.)

Examples

LoadDSO chant.so;
a = Create ChantActor;
Play a note, then change it a little:

s = BeginSound a;
sleep 1;
AddFormant s 0.5 400 100;
sleep 1;
AddFormant s 0.5 200 100;
sleep 2;

SetFormantCF s 2 2000 4;
SetFormantBW s 2 300;
SetAmp s .5 1;
sleep 2;
SetAmp s 1.0 1;
sleep 2;