AMINST

amplitude modulation: a type of modulation where a carrier signal (of frequency fc and mean amplitude a) is varied by a modulator signal (of frequency fm and modulation index I) such that two sidebands are produced of frequency fc ± fm and amplitude of a-I/2. the result depends on the modulator frequency: a modulator of frequency less than 10Hz will result in a tremelo effect based on the amplitude of the modulator signal. if the modulator is between 10Hz and a frequency where the sidebands are still within critical band of the center frequency, the sound will have an amplitude proportional to the averave amplitude of the modulator. at higher frequencies, the sidebands will be perceptible. (adapted from Dodge and Jerse, 1985).

Syntax:


makegen(1, 24, 1000, t0, a0, t1, a1...) /* amplitude envelope of the carrier */
makegen(2, 24, 1000, t0, a0, t1, a1...) /* amplitude envelope of the modulator */
makegen(3, 10, 1000, p0, p1...) /* spectrum of the carrier */
makegen(4, 10, 1000, p0, p1...) /* spectrum of the modulator */

AMINST(outskip, duration, amp, fc, fm, spread)

in comment form:

/* aminst -- amplitude modulation synthesis
*
*  p0 = start
*  p1 = duration
*  p2 = amplitude
*  p3 = carrier frequency (hz)
*  p4 = modulator frequency (hz)
*  p5 = stereo spread <0-1> [optional]
*  assumes function table 1 is the amplitude envelope
*  assumes function table 2 is the modulation envelope
*  function table 3 is the carrier waveform
*  function table 4 is the modulator waveform
*
*/

An example score:

rtsetparams(44100, 2)
load("AMINST")

makegen(1, 24, 1000, 0,0, 0.1,1, 3.4,1, 3.5,0)
makegen(2, 24, 1000, 0,0, 1,1, 2,0)
makegen(3, 10, 1000, 1)
makegen(4, 10, 1000, 1)
AMINST(0, 3.5, 10000, 178, 315)

makegen(1, 24, 1000, 0,1, 1,0)
makegen(2, 24, 1000, 0,1, 1.0,0.2, 3.4,0)
AMINST(3.9, 3.4, 10000, cpspch(8.00), cpspch(8.02))