TONE
From STX Wiki
Jump to navigationJump to search
Contents
TONE - sine/tone generator
Usage:
TONE a f p n sr
Inputs:
a | amplitude component |
f | frequency component |
p | phase component |
n | number of components |
sr | sampling rate |
Outputs:
y | synthesized signal sample (number) |
Function:
The TONE
atom uses additive synthesis of sine waves to synthesize signal samples. Because the signal is synthesized sample by sample and all inputs are updated before each evaluation cycle, all parameters are variable (modulation!). The following input connections are possible:
harmonic tone with equal magnitudes:
with
Anumber | magnitude for all components |
Fnumber | fundamental frequency of harmonic tone |
Pnumber | starting phase for all components (default: P=0) |
Nnumber | number of harmonics (default: N=1) |
harmonic tone with different magnitudes:
with
Avector | component magnitudes |
Fnumber | fundamental frequency of harmonic tone |
Pnumber | starting phase for all components (default: P=0) |
n | number of harmonics = length of vector A |
with
Avector | component magnitudes |
Fvector | fundamental frequency of harmonic tone |
Pnumber/vector | starting phase of components (default: P=0) |
n | number of harmonics = length of input vectors |
Examples:
The following code defines an spu which uses the TONE spatom and creates an instance thereof.
[SPU tonegen a f p n sr out y] t = tone t $a $f $p $n $sr y = t.y [Macro spu_test] #x := new SPU * tonegen 1 1000 0 1 44100 exit 1