FTables
Introduction
ftables
, or Function Tables, is a term borrowed from MUSIC N
and the Csound, used to describe fixed-lenth floating point
tables, often used by things like table lookup oscillators.
Presumably, the "function" aspect may come from the fact that
these tables were often allocated then put through a
function to do things like generate sine waves.
Ftables are a data structure defined in Soundpipe, and are
often abbreviated as ftbl
in code, and in C have the struct
name sp_ftbl
.
GEN Routines
GEN routines are another throwback term found in MUSIC N and Csound. These are things that take in csound
Making Ftables
A new ftable can be created using the runt word ftnew
,
available also as a scheme function via ugens.org. Typicially these are stored in registers via regset
.
(regset (ftnew 8192) 0)
This will create an ftable local to the patch that gets freed when the patch is recompiled.
Persistant tables can be created and managed by monolith via the monolith dictionary.
An ftable can be created by monolith using the command
monolith:ftbl-create
:
(monolith:ftbl-create "foo" 8192)
To access the ftable, use monft
, available as a runt word
or scheme command:
(gen_sine (monft "foo"))
TODO Gen routines
gen_sine
loadwav
, etc.
TODO UGens that take ftables
oscf
, osci
, fosc
, fmpair
, tabread
, trd
, etc.
Getting ftable size/duration
The runt words tblsize
and tbldur
get
size and duration, respectively.
tblsize
returns the length of the ftable in
samples, while tbldur
returns the length
of the ftable in seconds.
Retrieving table values
tget
sets an ftable.