"filename.txt" -- numeric values contained in "filename.txt" (which indicates the complete pathname of the character file to be read), can be separated by spaces, tabs, newline characters or commas.
size -- number of points in the table. Must be a power of 2 , power of 2 + 1, or zero. If size = 0, table size is determined by the number of numeric values in filename.txt. (New in Csound version 3.57)
Note
All characters following ';', '#' (comment) or '<' (XML tag from version 6.04) are ignored until next line (numbers too).
Examples
Here is an example of the GEN23 generator. It uses the file gen23.csd and spectrum.txt.
<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 gen23.wav -W ;;; for file output any platform</CsOptions><CsInstruments>sr=44100ksmps=32nchnls=20dbfs=1;"spectrum.txt" is created by the spectrum plotter of Audacity (set at size 128), using "fox.wav".instr1;performs additive synthesis based on spectrum.txtindx=0;start reading at first valueloop:ifreqtab_iindx,2;take odd values of list (= frequency)iamptab_iindx+1,2;take even values of list (= amplitude)event_i"i",10,0,p3,iamp,ifreq;use "event_i" to trigger instr. 10 loop_ltindx,2,126,loop;use all 126 frequency and amplitude valuesendininstr10;generate soundiamp=p4ifreq=p5asigposcilampdb(iamp),ifreq,1asiglinenasig,.01,p3,p2outsasig,asigendin</CsInstruments><CsScore>f1016384101;sine wavef20128-23"spectrum.txt";"spectrum.txt" can be found in /manual/examplesi102e</CsScore></CsoundSynthesizer>
This is the diagram of the waveform of the GEN23 routine, as used in the example:
f 2 0 128 -23 "spectrum.txt" - not normalized
Credits
Author: Gabriel Maldonado
Italy
February, 1998
New in Csound version 3.47. Comments starting with '#' are
ignored from Csound version 5.12.