buzz — Output is a set of harmonically related sine partials.
ifn -- table number of a stored function containing a sine wave. A large table of at least 8192 points is recommended.
iphs (optional, default=0) -- initial phase of the fundamental frequency, expressed as a fraction of a cycle (0 to 1). A negative value will cause phase initialization to be skipped. The default value is zero
xamp -- amplitude
xcps -- frequency in cycles per second
The buzz units generate an additive set of harmonically related cosine partials of fundamental frequency xcps, and whose amplitudes are scaled so their summation peak equals xamp. The selection and strength of partials is determined by the following control parameters:
knh -- total number of harmonics requested. New in Csound version 3.57, knh defaults to one. If knh is negative, the absolute value is used.
buzz and gbuzz are useful as complex sound sources in subtractive synthesis. buzz is a special case of the more general gbuzz in which klh = kmul = 1; it thus produces a set of knh equal-strength harmonic partials, beginning with the fundamental. (This is a band-limited pulse train; if the partials extend to the Nyquist, i.e. knh = int (sr / 2 / fundamental freq.), the result is a real pulse train of amplitude xamp.)
Although knh may be varied during performance, its internal value is necessarily integer and may cause “pops” due to discontinuities in the output. buzz can be amplitude- and/or frequency-modulated by either control or audio signals.
N.B. This unit has its analog in GEN11, in which the same set of cosines can be stored in a function table for sampling by an oscillator. Although computationally more efficient, the stored pulse train has a fixed spectral content, not a time-varying one as above.
Here is an example of the buzz opcode. It uses the file buzz.csd.
Example 61. Example of the buzz opcode.
See the sections Real-time Audio and Command Line Flags for more information on using command line flags.
<CsoundSynthesizer> <CsOptions> ; Select audio/midi flags here according to platform ; Audio out Audio in No messages -odac -iadc -d ;;;RT audio I/O ; For Non-realtime ouput leave only the line below: ; -o buzz.wav -W ;;; for file output any platform </CsOptions> <CsInstruments> ; Initialize the global variables. sr = 44100 kr = 4410 ksmps = 10 nchnls = 1 ; Instrument #1. instr 1 kamp = 20000 kcps = 440 knh = 3 ifn = 1 a1 buzz kamp, kcps, knh, ifn out a1 endin </CsInstruments> <CsScore> ; Table #1, a sine wave. f 1 0 16384 10 1 ; Play Instrument #1 for one second. i 1 0 1 e </CsScore> </CsoundSynthesizer>