[sdiy] My latest project
Antti Huovilainen
ajhuovil at cc.hut.fi
Thu Feb 18 20:44:19 CET 2010
On Wed, 17 Feb 2010, Tom Wiltshire wrote:
> LFO waveshape - which lookup table? (Sine, triangle, ramp, etc)
Pointer to interpolated LUT or pointer to function.
The function pointer is good if you use y = (x - 1/3*x^3)*3/2 to produce
sine from triangle. It's almost perfect approximation for LFO purposes,
but not quite good enough for audio as there are some harmonics starting
at -40dB.
Rewriting the equation as y = (x - 1/2*x^3 + x/2) makes it more suitable
for fixed point implementation:
; LFO sine approx
; y = (x - 1/2*x^3 + x/2)
mul.ss w2, w2, w0 ; w1 = x^2 / 2
sl w1, w1 ; w1 = x^2
mul.ss w2, w1, w0 ; w1 = x^3 / 2
sub w2, w1, w0 ; w0 = x - 1/2*x^3
asr w2, w1 ; w1 = x/2
add w0, w1 ; w0 = x - 1/2*x^3 + x/2
> Envelope - Which curve? (expo attack, expo decay, linear, cosine, etc)
Function pointer.
> Envelope - release instantly on gate low, or go through all remaining stages
> Envelope - start from zero level on gate on, or start from current level
> Envelope - if loop mode is on, loop back to stage X.
These are easily handled by calling a function pointer when envelope
finishes current stage or note on/off happens.
Antti
"No boom today. Boom tomorrow. There's always a boom tomorrow"
-- Lt. Cmdr. Ivanova
More information about the Synth-diy
mailing list