Sent: Thursday, September 11, 2008 8:25
PM
Subject: [Csnd] Csound for mixing files
of unknown length
Hi!
I use the following csd for mixing wav files.
The
third parameter to the instrument (P3) represents the length of the the
current file.
What if I don't know the length of the files?
In this
case I work with files of same length, and I just want to mix them
together...
Regards / Jonas
- - -
<CsoundSynthesizer>;
<CsOptions>
csound -W -o test.wav
</CsOptions>
<CsInstruments>
sr = 44100
kr =
44100
ksmps = 1
nchnls =
2
;
***************************************************
;
Instrument 1
;
***************************************************
; p2
= start position
; p3 = duration
;
p4 = volume
; p5 = pan
; p6 =
filename
;
instr
1
ivol = p4
ipan = p5 * 1.570796327
aleft,
aright diskin p6, 1
aleft = aleft * ivol *
cos(ipan)
aright = aright * ivol *
sin(ipan)
outs aleft,
aright
endin
</CsInstruments>
<CsScore>
; PARAMETERS:
; instrument, start position, length, volume,
pan, file name
i1 0 10 1 0 "beats.wav"
i1 0 10 1 1 "mary.wav"
</CsScore>
</CsoundSynthesizer>