Hi everyone,
Another (shorter) addenda to the "possible corrigenda" list --
found this first one this weekend, while I was tracking down why
running the buzz opcode as a real-time instrument with "rolloff" hooked
to a modulation wheel blew out my speaker ...
I'll probably be putting all of these "possible corrigenda"
postings on a webpage soon, to have a cumulative record of them ...
--jl
-------------------------------------------------------------------------
John Lazzaro -- Research Specialist -- CS Division -- EECS -- UC Berkeley
lazzaro [at] cs [dot] berkeley [dot] edu www.cs.berkeley.edu/~lazzaro
-------------------------------------------------------------------------
5.9.7.8
Summary: Buzz opcode/wavetable scaling looks wrong ...
Easiest to show with math. If we use the "if rolloff = 1, scale = 1" as
well as the scaling equation in 5.9.7.8, and calculate the amplitude
of the cosine peak at theta = 0 for rolloff = 0.99, 1, and 1.01, this
is what we get:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If rolloff = 0.99:
(1 - 0.99)
scale = -------------- = 0.104583
(1 - (0.99)^10)
value of cosine peak at theta = 0:
1 + 0.99 + 0.99*99 + ... = 10.4662
buzz opcode output = 10.4662 * 0.104583 = 1.0945
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If rolloff = 1:
scale = 1
value of cosine peak at theta = 0:
1 + 1 + 1 + ... = 11
buzz opcode output = 11
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If rolloff = 1.01:
(1 - 1.01)
scale = -------------- = 0.0955821
(1 - (1.01)^10)
value of cosine peak at theta = 0:
1 + 1.01 + 1.01*1.01 + ... = 11.5668
buzz opcode output = 11.5668 * 0.0955821 = 1.10558
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From looking at this math, it seems like
[1] If |rolloff = 1|, scale = (1/(nharm+1))
[2] The formula for scale is slightly off and should be
1 - |rolloff|
scale = -------------
1 - |rolloff|^(nharm + 1)
which would make the cosine peak at 0.99 and 1.01 both be 1.0.
-------
5.9.10.{1,2}
Summary: fft() and ifft() use irregular escape values
All over SAOL and SASL -1 is used as the integral "special condition"
code, namely:
*** For the size parameter in wavetable generators, to indicate
that the generator should compute the size of the table.
*** For the duration parameter in SAOL and SASL instr statements,
to indicate indefinite duration.
*** The loops parameter in the oscil and koscil core opcodes.
*** The nharm parameter in the buzz core opcode and core wavetable
wavetable generator.
To help make more readable SAOL coding happen, I added a NONE symbol,
defined to -1, as part of the SFlib of SAOL and SASL pre-processor defines
that will ship with sfront 0.61. The fft() and ifft() are exceptional in that
0 is the special value for len, shift, and size, not -1, and in fact
-1 is specifically declared to be illegal syntax. Any chance of changing
this to "less than or equal to zero" codes the special condition, to
make the NONE define slightly more useful?
-------
This archive was generated by hypermail 2b29 : Mon Jan 28 2002 - 12:03:55 EST