Hello !
This is my first csound csd ...
I want to test the delayr and delayw opcodes. I produce 4 bursts of white noise that should pass through a small naive reverb implemented with a delay.
And it does not work ! Is seems that the overall signal is cut by the enveloppe. Can you help me ?
Here is the code:
-W -f -R -o test.wav
sr = 44100
ksmps = 1
nchnls = 2
;------------------------------------------------------------------------------
;------------------------------------------------------------------------------
instr 1
aenv1 mxadsr 0.001, 0.5, 1.0, 0.001
asignal1 rand 20000
asignal = aenv1 * asignal1
adly1 delayr 0.02
afdbk1 = 0.7 * adly1 + 0.7 * asignal
delayw afdbk1
outs adly1, asignal
endin
;------------------------------------------------------------------------------
;------------------------------------------------------------------------------
i1 0 .1 0 8.01
i1 1 . 0 8.01
i1 2 . 0 8.01
i1 3 . 0 8.01
Thanks very much,
Olivier



Micro help from another beginner
ciao,
i can only tell you only a little bit ...
Your instrument work, but if it play for .1 sec (p3), only .1 sec it work, i.e. the delay line is stopped (hope i'm clear). And in score you use 5 parameters, but your instrument needs only 3 (p4 = 0 and p5 = 8.01 don't are used).
I'm not able enough to help you more, but maybe you can use a global audio variable and a second instrument only for delay. Here is my example:
-W -f -odac ;test.wav
sr = 44100
ksmps = 1
nchnls = 2
gaout init 0
instr 1
aenv1 mxadsr 0.001, 0.5, 1.0, 0.001
asignal1 rand 20000
gaout = aenv1 * asignal1
outs gaout, gaout
endin
instr 2
adly1 delayr 0.05
afdbk1 = 0.7 * adly1 + 0.7 * gaout
delayw afdbk1
outs adly1, adly1
endin
i1 0 .1
i1 1 .
i2 0 2
Hope useful,
ciao,
fran.
Confirm
What Francesco said is correct. A delay loop is only maintained as long as the instrument is active.
You can actually hear the delay working if you play with your code a little bit. Modify the ADSR to just be a short burst -- i.e. make the sustain level low, and maybe shorten the decay time too. Then play the instrument for longer, maybe a full second.
The best way to get a reverb on everything is, again as Francesco says, to use a separate instrument, started at time 0 and running until the end of the piece. You can feed that with a global audio variable that is filled by whatever other instruments are played (or if you prefer, use a 'za' variable -- see 'zawm' etc in the manual). That's how I do it in my 'Hammond' emulator, designed to be played live, and it works well.
Hello to all, here's my
Hello to all,
here's my version, but I do not know if Olivier wants this ...
bye!
sr = 44100
ksmps = 1
nchnls = 2
instr 1
kenv1 mxadsr 0.001, 0.5, 1, 0.001
asignal1 rand 32768
asignal = kenv1 * asignal1
adummyr delayr .1 ;max-value of delay-line
adel deltapi .02
delayw (asignal + adel ) * .9
outs adel, asignal
endin
f0 86400
i1 0 .1
i1 1 .
i1 2 .
i1 3 .
e
Thanks very much all of you,
Thanks very much all of you, you, you, you, you, ....
;-)
Olivier