| I would suggest this:
1)don't use -i
2) Use the following CSD:
-d -m0 -M0 -odac
sr=44100
ksmps=64
nchnls=2
0dbfs=1
giSine ftgen 0, 0, 8192, 10, 1
ga1 init 0
ga2 init 0
instr 1
SFile = "rawfile.wav"
idur filelen SFile
p3 = idur
a1, a2 diskin2 SFile, 1
event_i "i", 100, 0, p3,0.5, 0.9
ga1 = a1 + ga1
ga2 = a2 + ga2
endin
instr 100
itime = p4 * 2
itimeR = itime * 1.5
iLfdbk = p5 * 0.025
iRfdbk = iLfdbk ; * 0.8
aL = ga1
aR = ga2
klfo oscil 0.002, 0.4, giSine
kfiltLFO oscil 400, 0.13, giSine
adelL delayr itime
aLtap deltapi (itime*0.5) + klfo
aLfilt resonr aLtap, 700+kfiltLFO, 300
delayw aL + aLfilt*iLfdbk
adelR delayr itimeR
aRtap deltapi (itimeR*0.5) - klfo
aRfilt resonr aRtap, 700-kfiltLFO, 300
delayw aR+aRfilt*iRfdbk
aoutL = aL*0.7 + adelL*0.7
aoutR = aR*0.7 + adelR*0.7
outs aoutL, aoutR
ga1 = 0
ga2 = 0
endin
i1 0 1
Victor
On 24 Dec 2012, at 00:10, pj@pjb.com.au wrote:
> I wrote:
>> csound -i rawfile.wav -o processedfile.wav delayprocessor.csd
>> produces an hour-long long output file because of the line:
>> e 3600
>> How could the .csd detect when the rawfile.wav is finished,
>> and then tidy up its alwayson instrument and exit ?
>
> joachim wrote:
>> you can terminate csound with the opcode exitnow.
>> what do you want to do exactly?
>
> I want to detect, within the .csd, when the rawfile.wav is
> finished, so that it can tidy up its alwayson instrument,
> (like waiting for any pending delays to work their way through)
> and then exit. How do I detect when rawfile.wav is finished ?
>
>> can you post a csd?
>
> Anything with ins and outs would do, but my .csd was:
>
> --------------------------------------------
>
> ; see Csound Power p268
>
> -d -m0 -M0
>
>
> sr=44100
> ksmps=64
> nchnls=2
> 0dbfs=1
>
> giSine ftgen 0, 0, 8192, 10, 1
> alwayson "DelayProcessor", 0.5, 0.9
>
> instr DelayProcessor
> itime = p4 * 2
> itimeR = itime * 1.5
> iLfdbk = p5 * 0.025
> iRfdbk = iLfdbk ; * 0.8
> aL, aR ins
> klfo oscil 0.002, 0.4, giSine
> kfiltLFO oscil 400, 0.13, giSine
> adelL delayr itime
> aLtap deltapi (itime*0.5) + klfo
> aLfilt resonr aLtap, 700+kfiltLFO, 300
> delayw aL + aLfilt*iLfdbk
> adelR delayr itimeR
> aRtap deltapi (itimeR*0.5) - klfo
> aRfilt resonr aRtap, 700-kfiltLFO, 300
> delayw aR+aRfilt*iRfdbk
> aoutL aL*0.7 + adelL*0.7, 9
> aoutR aR*0.7 + adelR*0.7, 9
> outs aoutL, aoutR
> endin
>
>
>
> e 3600
>
>
> --------------------------------------------
>
> Regards, Peter Billam
>
> http://www.pjb.com.au pj@pjb.com.au (03) 6278 9410
> "Follow the charge, not the particle." -- Richard Feynman
> from The Theory of Positrons, Physical Review, 1949
>
>
>
> 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"
>
Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie
|