Re: [Csnd] Ring modulation one audiofile by another

Hi!

Thanks a lot for examples of the ring modulation! One more question — how to make the output file length same as the input file length automatically? (If I want to load audiofile, ring-modulate it and write to disc the result file with same duration?)

Best regards,
Vadim
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Use filelen to get the length of the audio file and use that value to set (change the instr duration (p3). So, inside the instr:

instr RingMod
Sfile = “carrier.wav” // ( file being modulated)
iLen = Sfile
p3 = iLen
aCarrier diskin Sfile… // rest of instr
endin

Using Sfile saves you from typing the filename out twice.

In this case the score or schedule/event duration (p3) gets overwritten and is essentially not important. You could make it say .1 seconds then the output will process quicker.

ex. i"RingMod"0 .1 or
schedule"RingMod", 0, .1

Though, if you want to listen to it in realtime as it is modulated, you could use the fout opcode to write the output file to disk instead of -o in CsOptions.

Best,
Scott

Oops, should have written:

iLen filelen Sfile

Sorry.

my example did that.

Prof. Victor Lazzarini
Maynooth University
Ireland