CLAR


CLAR is a physical modelling algorithm for a clarinet. physical modelling is a synthesis paradigm (developed by Perry Cook) whereby the computer synthesizes sound not according to the spectrum of the desired output, but rather based on a description of the physical process which makes the sound (to whit: a violin's physical model would include a system describing the physics of a vibrating string, coupled with a quantified description of the effects of bow pressure, string vibrato, etc.). physical modelling instruments, therefore, are simulated and controlled by expert systems describing cause-and-effect relationships of specific performance actions on corresponding acoustic results. (adapted from Cook, 1992, 1995).

See also the MBLOWHOLE and MCLAR synthesis instruments.

Syntax:


makegen(1, 24, 1000, t0, a0, t1, a1...) /* amplitude of the noise (breath pressure) injected into the wind model in time/amplitude pairs */
makegen(2, 24, 1000, t0, a0, t1, a1...) /* amplitude of the overall output note */

CLAR(outskip, duration, noiseamp, length1, length2, amp, d2gain, spread)

in comment form:

/* CLAR -- Perry Cook's clarinet physical model
*
*  p0 = start
*  p1 = dur
*  p2 = noise amp
*  p3 = length1
*  p4 = length2
*  p5 = output amp
*  p6 = d2 gain
*  p7 = stereo spread (0-1) 
*  function slot 1 is the noise amp envelope
*  function slot 2 is the output amp envelope
*
*/

An example score:

rtsetparams(44100, 2)
load("CLAR")
makegen(1, 24, 1000, 0, 1, 1, 1)
makegen(2, 24, 1000, 0, 1, 1, 1)
CLAR(0, 1, 0.02, 78, 31, 7000, 0)
CLAR(1, 1, 0.02, 35, 4, 7000, 0)
CLAR(2, 1, 0.02, 35, 9, 7000, 0)
CLAR(3, 1, 0.02, 51, 20, 7000, 0.5)

Another score, featuring a looping structure:

rtsetparams(44100, 2)
load("CLAR")
makegen(1, 24, 1000, 0, 1, 1, 1)
makegen(2, 24, 1000, 0, 1, 1, 1)

d2 = 0
for (start = 0; start < 10; start = start + 0.5) {
	CLAR(start, 0.5, 0.02, 69, 34, 7000, d2)
	d2 = d2 + 0.05
	}