/*Getting started.. Function-Tables
It is also possible to create and fill an f-table from within the orchestra. In this case, the 'ftgen' opcode is used.
Filling an f-table directly from within the orchestra looks like this:
giMyNumbers ftgen 12, 0, -7, -2, 1, 2, 3, 4, 5, 6, 7
Here the f-table No. 12 has the size 7 and is filled with this list of numbers: [1, 2, 3, 4, 5, 6, 7]
gir ftgen ifn, itime, isize, igen, iarga [, iargb ] [...]
gir - the number of the table created. Global variables can be read independent from the current instrument, useful here
ifn - is the number of the F-Table, and will be your later keycode to read it out
If ifn is zero, the number is assigned automatically and the value placed in gir.
itime - says when this becomes calculated
isize - sets the size of the table
igen - the number of the GEN ROUTINE
iaga..b - arguments used by the GEN ROUTINES to calculate the numbers
*/
sr = 44100
ksmps = 128
nchnls = 2
0dbfs = 1
giSine ftgen 1, 0, 4096, 10, 1 ;a sinewave will be generated and stored into Table No. 1
giAdd7Sine ftgen 2, 0, 4096, 10, 1, 1, 1, 1, 1, 1, 1, 1 ;a sinewave and 6 harmonics
giNoise ftgen 3, 0, 4096, 21, 1 ; White Noise
giMyNumbers ftgen 0, 0, -3, -2, 1, 2, 3 ; [1, 2, 3] - becomes automatically table number 4
instr 1
iLength = ftlen(giMyNumbers)
iMyNumber tab_i (p2%(iLength)), giMyNumbers
aEnv madsr 0.1, 0.1, 1, 0.3
aWavetablePlayer oscili p4, cpspch(p5), (iMyNumber)
outs aWavetablePlayer*aEnv, aWavetablePlayer*aEnv
endin
;ins strt dur amp freq table-number
t 0 220
i 1 1 0.5 0.3 10.0
i 1 + 0.5 0.3 10.0
i 1 + 0.5 0.3 10.0
i 1 + 0.5 0.3 10.0
i 1 + 0.5 0.3 10.0
i 1 + 0.5 0.3 10.0
i 1 + 0.5 0.3 10.0
i 1 + 0.5 0.3 10.0
i 1 + 0.5 0.3 10.0
i 1 + 0.5 0.3 10.0
i 1 + 0.5 0.3 10.0
i 1 + 0.5 0.3 10.0
i 1 + 0.5 0.3 10.0
i 1 + 0.5 0.3 10.0
i 1 + 0.5 0.3 10.0
i 1 + 0.5 0.3 10.0
i 1 + 0.5 0.3 10.0
i 1 + 0.5 0.3 10.0
i 1 + 0.5 0.3 10.0
i 1 + 0.5 0.3 10.0
e
; written by Alex Hofmann (Mar. 2010) - Incontri HMT-Hannover
1013279563397true255255255761395120{f9ccbabd-c362-420e-b6da-27cecbe668f5}true0-301.000000001.000000001.000000001.00000000autoautotrue6223400158{ed41ad63-73be-4960-b6fe-183b565ce956}true0-3-255.00000000scope2.000000001.000000001.000000001.000000000.000000006539658{912fe89d-708b-44c9-b6f5-537c335d210f}true0-3left
Lucida Grande
143000255255255noborder11719339831{28be8cb0-7e8b-49fd-b163-95402e5aef94}true0-3left
Lucida Grande
143000255255255noborder11