I use the CSV output from command line to make files which LUA reads in ReaCoMa.
I ran into a problem with Ampgate today where there are two slices which have the same number in the CSV output (1.30933e+06). In SuperCollider though, with the same settings these two numbers are different. When I use these numbers to slice I get a crash because it tries to slice on the left boundary of a new segment which is a hard no from REAPER’s point of view.
I would prefer if the CSV output just had massive numbers rather than scientific notation. Is this a limitation of the output or a design choice? Perhaps I’m completely wrong here in my thinking. Attached is the data from CSV output and the SuperCollider code that I am testing with.
CSV
9664,42438,77609,106793,144826,191958,286947,322573,357046,379575,450034,491711,544577,593768,653132,675475,725943,767358,817698,840725,868551,890606,912667,934780,959290,981840,1.01967e+06,1.04174e+06,1.07054e+06,1.13702e+06,1.16368e+06,1.18746e+06,1.20954e+06,1.24283e+06,1.26492e+06,1.30933e+06
42435,77600,104297,144820,191956,286945,322570,357033,379345,449858,491706,544487,593735,653042,675473,725933,767349,817689,840723,868544,890601,912656,934771,958649,981825,1.01964e+06,1.04172e+06,1.07053e+06,1.13702e+06,1.16354e+06,1.18573e+06,1.20951e+06,1.2428e+06,1.2649e+06,1.30933e+06,1.323e+06
SC Code
(
~source = Buffer.read(
s,
File.realpath(
FluidBufStats.class.filenameSymbol
).dirname.withTrailingSlash ++ "../AudioFiles/Tremblay-ASWINE-ScratchySynth-M.wav");
~idx = Buffer.new(s);
)
(
var thresh = -51;
Routine.run({
FluidBufAmpGate.process(
s,
source: ~source,
indices: ~idx,
rampUp: 1,
rampDown: 100,
onThreshold: thresh,
offThreshold: thresh,
minSliceLength: 22050,
minSilenceLength: 2,
minLengthAbove: 0,
minLengthBelow: 0,
lookBack: 0,
lookAhead: 0,
highPassFreq: 0,
);
~idx.loadToFloatArray(
action:{arg x;
~onsets = x.unlace(2)[0];
~offsets = x.unlace(2)[1];
}
);
"----Raw Data----".postln;
~idx.getn(0, ~idx.numFrames, {|x|x.postln;});
s.sync;
"----Onsets----".postln;
~onsets.postln;
"----Offsets----".postln;
~offsets.postln;
"----Pairs----".postln;
~onsets.size.do{
arg x;
~onsets[x].asInteger.post;
"->".post;
~offsets[x].asInteger.postln;
};
};)
)