diff --git a/release-packaging/Classes/FDCompose.sc b/release-packaging/Classes/FDCompose.sc index 3f3acd2..357d7fa 100644 --- a/release-packaging/Classes/FDCompose.sc +++ b/release-packaging/Classes/FDCompose.sc @@ -1,11 +1,14 @@ FDCompose{ - *process { arg server, src, offsetframes1 = 0, numframes1 = -1, offsetchans1 = 0, numchans1 = -1, src1gain = 1, src1dstoffset = 0, src1dstchanoffset = 0, src2, offsetframes2 = 0, numframes2 = -1, offsetchans2 = 0, numchans2 = -1, src2gain = 1, src2dstoffset = 0, src2dstchanoffset = 0, dstbuf; + *process { arg server, srcBufNumA, startAtA = 0, nFramesA = -1, startChanA = 0, nChansA = -1, srcGainA = 1, dstStartAtA = 0, dstStartChanA = 0, srcBufNumB, startAtB = 0, nFramesB = -1, startChanB = 0, nChansB = -1, srcGainB = 1, dstStartAtB = 0, dstStartChanB = 0, dstBufNum; + + if(srcBufNumA.isNil) {Error("Invalid Buffer").format(thisMethod.name, this.class.name).throw}; + if(srcBufNumB.isNil) {Error("Invalid Buffer").format(thisMethod.name, this.class.name).throw}; + if(dstBufNum.isNil) {Error("Invalid Buffer").format(thisMethod.name, this.class.name).throw}; server = server ? Server.default; - if(src.bufNum.isNil) {Error("Invalid Buffer").format(thisMethod.name, this.class.name).throw}; - server.sendMsg(\cmd, \BufCompose, src.buNum, offsetframes1, numframes1, offsetchans1, numchans1, src1gain, src1dstoffset, src1dstchanoffset, - if( src2.isNil, -1, {src2.bufNum}), offsetframes2, numframes2, offsetchans2, numchans2, src2gain, src2dstoffset, src2dstchanoffset, - if( dstbuf.isNil, -1, {dstbuf.bufNum})); + server.sendMsg(\cmd, \BufCompose, srcBufNumA, startAtA, nFramesA, startChanA, nChansA, srcGainA, dstStartAtA, dstStartChanA, + srcBufNumB, startAtB, nFramesB, startChanB, nChansB, srcGainB, dstStartAtB, dstStartChanB, + dstBufNum); } -} +} \ No newline at end of file diff --git a/src/fdCompose/tests.scd b/src/fdCompose/tests.scd new file mode 100644 index 0000000..4b5d627 --- /dev/null +++ b/src/fdCompose/tests.scd @@ -0,0 +1,23 @@ +s.reboot +//////////////////////////// +// test for efficiency + +( +b = Buffer.read(s,"/Users/pa/Documents/documents@hudd/research/projects/fluid corpus navigation/research/archives-2017-18/denoise_stn/sources/01-mix.wav"); +c = Buffer.read(s,"/Users/pa/Documents/documents@hudd/research/projects/fluid corpus navigation/research/archives-2017-18/denoise_stn/sources/02-guit.wav"); +d = Buffer.new(s); +) + +( +// without basic params +Routine{ + t = Main.elapsedTime; + FDCompose.process(s, srcBufNumA: b.bufnum, srcBufNumB: c.bufnum, dstBufNum: d.bufnum); + s.sync; + (Main.elapsedTime - t).postln; +}.play +); + +d.query; +d.play; +d.plot \ No newline at end of file