René Nyffenegger's collection of things on the web
René Nyffenegger on Oracle - Most wanted - Feedback -
 

buzz (Csound opcode)

ar   buzz xamp, xcps, knh, ifn [, iphs]
xamp: peak amplitude
xcps: frequency of fundamental
knh: number of partials generated
ifn: function table number (should be sine)
The following example generates the same signal on the left and the right channal, one with buzz the other traditionally.
buzz.orc
sr     = 44100
kr     = 4410
ksmps  = 10
nchnls = 2

instr 1
  kamp = 20000
  kcps = 440

  aleft buzz kamp, kcps, 3, 1

  aright_1 oscili kamp/3, 1*kcps, 1, 0.25
  aright_2 oscili kamp/3, 2*kcps, 1, 0.25
  aright_3 oscili kamp/3, 3*kcps, 1, 0.25

  aright = aright_1 + aright_2 + aright_3
  outs aleft, aright
endin
buzz.sco
f 1 0 16384 10 1

i 1 0 1

Maximum number of harmonics

The following 'trick' shows how to have the maximum of harmonics without exceeding the nyquist frequency:
asig buzz xamp, xcps, sr/2/xcps, ifn

Related links

This opcode is used for the following instruments: