size -- number of points in the table. Must be a power-of-2 (see f statement).
fna, fnb, etc. -- pre-existing table number to be written into the table.
ampa, ampb, etc. -- strength of wavefoms. These are relative strengths, since the composite waveform may be rescaled later. Negative values are permitted and imply a 180 degree phase shift.
starta, startb, etc. -- where to start writing the fn into the table.
finisha, finishb, etc. -- where to stop writing the fn into the table. The last available location is the power of two - 1.
Examples
f104096101f20102418110511115121023
f2 consists of two copies of f1 written in to locations 0-511 and 512-1023.
Here is an example of the GEN18 routine. It uses the files gen18.csd.
<CsoundSynthesizer><CsOptions>; Select audio/midi flags here according to platform-odac ;;;realtime audio out;-iadc ;;;uncomment -iadc if realtime audio input is needed too; For Non-realtime ouput leave only the line below:; -o gen18.wav -W ;;; for file output any platform</CsOptions><CsInstruments>sr=44100ksmps=32nchnls=20dbfs=1instr1ifn=p4ilen=ftlen(ifn)aphasephasor220asigtableiaphase*ilen,ifnoutsasig,asigendin</CsInstruments><CsScore>f104096101;sinef2040961010.50.30.250.20.1670.140.125.111;sawtoothf304096111052;cosine partialsf11081921811040952140968191;sine+sawtoothf12081921811040953140968191;sine+cosine partialsf13010241810.7076730.75121023;sine+cosine partials overlapped, shorter tablei1022;play sawtooth i1+23;then cosine partialsi15211;now sine+sawtoothi1+212;and sine+cosine partialsi1+213;and sine+cosine partials overlapped, shorter tablee</CsScore></CsoundSynthesizer>
These are the diagrams of the waveforms generated by GEN18, as used in the example:
f 11 0 8193 18 1 1 0 4096 2 1 4097 8192 - composite waveform made up of a sine wave and a sawtoothf 12 0 8192 18 1 1 0 4096 3 1 4097 8192 - composite waveform made up of a sine wave and a wave of cosine partialsf 13 0 1024 18 1 0.7 0 767 3 0.7 512 1023 - sine+cosine partials overlapped, also shorter table than f12
Deprecated Names
GEN18 was called GEN22 in version 4.18. The name was changed due to a conflict with DirectCsound.
Credits
Author: William “Pete” Moss
University of Texas at Austin
Austin, Texas USA
January 2002