| Hi Forrest,
The problem is that you're clearing out the channel in instr 999. I
modified instr 101 to use zaw when writing to zak 1, and commented out
the clear in instr 999:
instr 101
; echo reads from zak channel 0
; writes mixed source and echo to zak channel 1
aChan0 zar 0
zawm aChan0, 1
aChan1 zar 1
aEcho delay aChan1, 1
zaw aEcho * 0.9, 1
zacl 0, 0
endin
instr 999
; writes zak channel 1 to output
aChan1 zar 1
out aChan1
;zacl 1, 1
endin
Using zaw ensures you're not going to get an accumulated signal. On
the other hand, if you're planning to mix other things into zak 1, you
can do all of the delay processing within instr 101, rather than using
the zak channel to store the delayed signal, and reinstate zacl in
instr 999:
instr 101
; echo reads from zak channel 0
; writes mixed source and echo to zak channel 1
aChan0 zar 0
adelay init 0
aEcho delay aChan0 + adelay, 1
adelay = aEcho * 0.9
zawm adelay, 1
zacl 0, 0
endin
instr 999
; writes zak channel 1 to output
aChan1 zar 1
out aChan1
zacl 1, 1
endin
So either of those should work for you.
Hope that helps!
steven
On Sat, Mar 10, 2012 at 4:54 AM, Forrest Cahoon
wrote:
> Hey Csounders! I'm being an idiot again, I can't figure out what's
> wrong with my csd.
>
> I'm using zak audio channels to implement an echo, and I can't figure
> out why it's only echoing once.
>
> instr 101 is the echo. It reads the source input from zak audio
> channel 0, then writes it right out to zak audio channel 1, with
> mixing. Then the delay also writes to zak audio channel 1 with
> mixing. Then instr 999 writes channel 1 to audio out.
>
> I'm only getting one echo, but if I'm writing my echoes back, with
> mixing, to the same channel, shouldn't I also get an echo of the echo
> (and an echo of the echo of the echo and ... ) ?
>
> As usual, any help would be greatly appreciated.
>
> -- Forrest
>
>
>
>
> sr=44100
> ksmps=1
> nchnls=1
>
> zakinit 1, 1
>
> instr 1
> ; sound source, writes to zak channel 0
> iDur = p3
> iAmp = ampdbfs(p4)
> iFreq = p5
>
> aOut pluck iAmp, iFreq, iFreq, 0, 1
> zawm aOut, 0
> endin
>
> instr 101
> ; echo reads from zak channel 0
> ; writes mixed source and echo to zak channel 1
> aChan0 zar 0
> zawm aChan0, 1
> aChan1 zar 1
> aEcho delay aChan1, 1
> zawm aEcho * 0.9, 1
> zacl 0, 0
> endin
>
> instr 999
> ; writes zak channel 1 to output
> aChan1 zar 1
> out aChan1
> zacl 1, 1
> endin
>
>
>
>
> i101 0 -1
> i999 0 -1
>
> i1 0 .5 -1 256
>
> e 10 ; time for echoes
>
>
>
>
>
> Send bugs reports to the Sourceforge bug tracker
> https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>
|