|
at least in csound4 you were able to use
-i for an input file
>
> -odac -b10 -iD:/soundfile.wav
>
>
instr 1
ilen filelen "-i"
ktime init 0
ktime times
if (ktime >= ilen) then
event "e", 0, 0 ; or turnoff
endif
asig in
out asig
endin
you might just be able to do an
event "e", ilen
but i havent tried any of this
-m
On Tue, 16 May 2006, Rory Walsh wrote:
>> 1) if there is a way to make csound run only for the duration dependent on
>> the length of an audio file.
>
> The code below is passed a soundfile in the CsOptions and then plays the
> soundfile for as long as the sound is. I set up the second instrument to play
> for the length of the sound file using event_i. It's not the prettiest but
> it's the only way I could think of doing it! You can then use the filenchnls
> opcode and an if statement for the number of channels. This is the way I
> built the sound file player that comes with my Lettuce frontend.
>
> Rory.
>
>
>
>
> -odac -b10 --strset1=D:/soundfile.wav
>
>
> sr = 44100
> kr = 4410
> ksmps = 10
> nchnls = 1
>
> instr 1
> Sname strget 1
> ilen filelen Sname
> event_i "i", 2, 0, ilen
> endin
>
> instr 2
>
> Sname strget 1
> ksearch chnget "skip"
> ktrig changed ksearch
> reset:
> iskip = i(ksearch);
> print iskip
> print iskip;
> if(ktrig==0) then
> goto contin
> else
> reinit reset
> endif
> contin:
> a1 soundin Sname, iskip
> out a1
> rireturn
> endin
>
>
>
>
> f1 0 4096 10 1
> i1 0 100
> e
>
>
>
>
>
>
> --
> Send bugs reports to this list.
> To unsubscribe, send email to csound-unsubscribe@lists.bath.ac.uk
> |