Csound Csound-dev Csound-tekno Search About

Advice sought for physical models

Date1999-03-09 18:19
Fromjpff@maths.bath.ac.uk
SubjectAdvice sought for physical models
Message written at 9 Mar 1999 17:00:21 +0000

There have been some comments recently about the physical models and i
thought i would try to explain the problem, and offer three
alternative approaches

The proble arises in all the waveguide opcodes where there is a krate
frequency argument, and an optional irate lowest frequency.  If the
optional argument is not given, then the krate argument is consulted.
If this is a constant then it is used.  So

a1  wgflute  31129.60, 440, 0.32, 0.1, 0.1, 0.15, 5.925, 0.05, 1
a1  wgflute  31129.60, kfq, 0.32, 0.1, 0.1, 0.15, 5.925, 0.05, 1, 400

are both OK.  However if one tries

a1  wgflute  31129.60, kfq, 0.32, 0.1, 0.1, 0.15, 5.925, 0.05, 1

at init time the value of kfq is not available -- it really is not
there until the first cycle -- so a perf error is given saying no
lowest frequency.

What to do about it?  I can think of 3 possible things.
1) Accept the status quo as it is what is really happening
2) Delay the creation of the structures to the first cycle, and accept
the performance hit of checking every cycle
3) Assume that no one uses frequencies before 50Hz without thinking,
so default to 50Hz if there is no other way to determine at init time.

Any preferences?  1 and 3 are easy to code.  2 will take a little
longer.

==John ffitch

PS the mandol opcode seems to have stopped functioning.  No idea what