sr = 44100
kr = 4410
ksmps = 10
nchnls = 1
instr 101
a1 oscil 10000, 440, 1
out a1
endin
;oscil is a simple oscillator, and it takes three arguments, amplitude, Hertz ;and then the f-statement those two statements describe.
instr 102
a1 foscil 10000, 440, 1, 2, 3, 1
out a1
endin
;foscil performs Frequency-modulation synthesis to create complex waveforms. It ;takes six arguments, amplitude, Hertz, f-table call, carrier, modulator, and ;index. As best I understand, the carrier frequency is Hertz*carrier, and the ;modulating frequency is Hertz*modulator. These two frequencies interact ;according to the value of index in a way I do not understand. The reference ;says that index "determines the spread of acoustic energy over the partial ;positions given by n = 0,1,2,.., etc." In-depth understanding of FM synthesis ;is not addressed in "Introduction to Sound Design"
instr 103
a1 buzz 10000, 440, 10, 1
out a1
endin
;The buzz opcode takes a sine wave from an f-table and generates a specified ;number of equal-strength harmonic partials to it. The first argument is ;amplitude, the second is Hertz, the third is the total number of partials to be ;generated and the fourth is the f-statement which had better describe a sine ;wave or else. The output will be a sine with the fundamental oscillating at 440 ;Hertz, and also the first ten harmonics of the fundamental in equal strength.
instr 104
a1 pluck 10000, 440, 440, 2, 1 ;karplus-strong plucked string
out a1
endin
;the pluck opcode takes five arguments and submits them to a particular ;operation (called a Karplus-Strong algorithm) which simulates the sound of a ;plucked string. The first, third and fourth arguments are our familiar ;Amplitude, pitch and f-table references, and the second and fifth are ;Karplus-Strong specific voodoo. This will sound like a plucked string vibrating ;in and around 440 Hertz.