| Strictly speaking a simple waveguide implemented with delayw/r will require
ksmps < sr/fr; the example below demonstrates this. It does not work for
ksmps=64, but lower ksmps will do. However, it we are implementing
a waveguide with some sort of dampening, then filters are involved in the
feedbac loop and we will need ksmps=1 to make a proper mathematically
sound implementation.
As a rule of thumb, whenever we need feedback, setting ksmps=1 is a good
measure, as this avoids any possible implementation problems.
sr= 44100
ksmps = 64
nchnls = 1
0dbfs=1
instr 1
ifr = cpspch(p4)
kamp linseg 1, 1/ifr,0.001
asig rand kamp
adp delayr 1
atap deltapi 1/ifr
delayw asig+atap*0.999
out atap*0.5
endin
f1 0 16384 10 1
i1 0 3 9.05
----- Original Message -----
From: "Graham Breed"
To:
Sent: Sunday, March 29, 2009 11:59 AM
Subject: [Csnd] Re: Re: Re: Re: Physical modeling synthesis
> Victor.Lazzarini@nuim.ie wrote:
>> No, for 1-sample delays and waveguide stuff you
>> do need ksmps=1. It will not work otherwise.
>
> I don't know about 1-sample delays and I didn't see that up-thread. If
> they require ksmps=1 it should be documented here:
>
> http://www.csounds.com/manual/html/delay1.html
>
> Waveguides must work because I have them working. I am having trouble
> with clicks, and if that's because of the control rate you'll have to
> explain why. The code's below.
>
> ; based on the example in The Csound Book Chapter 19
> opcode ClarinetTimbre, a, aiaa
> ; aamp: amplitude
> ; ifqc: frequency
> ; apressm: breath pressure
> ; aemboff: SUPPOSEDLY HAS SOMETHING TO DO WITH REED STIFFNESS?
> aamp, ifqc, apressm, aemboff xin
>
> setksmps sr/2100
> ; valid for sr=44100 and kr=210
>
> ifco = 1000
> ; calibration for 44.1 kHz sample rate and 2.1 kHz local control rate
> ; not perfect tuning and no indication it'll work for other sample rates
> ibore = 0.5/ifqc-5.6/sr
> areedbell delayr ibore + 1/sr
> areedbell deltapi ibore ; sub-sample accuracy
>
> ; REFLECTION FILTER FROM THE BELL IS LOWPASS
> arefilt tone areedbell, ifco
>
> ; REFLECTION FILTER FROM THE BELL IS LOWPASS
> arefilt tone areedbell, ifco
>
> ; BACK PRESSURE AND REED TABLE LOOK UP
> aout = - apressm -.95*arefilt - aemboff
> areedtab table aout/4+.34, gi_reed_table, 1, .5
> amult = aout * areedtab
>
> ; FORWARD PRESSURE
> aout = apressm + amult
>
> delayw aout
> xout aout*aamp
> endop
>
>
>
>
> Send bugs reports to this list.
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
> csound"
|