From 32d3f463af714f1de8f7ffa6e97bc19e599a48e7 Mon Sep 17 00:00:00 2001 From: Pierre Alexandre Tremblay Date: Thu, 12 Mar 2020 17:05:28 +0000 Subject: [PATCH] buf noveltyslice: corrected the helpfiles for new latency formula, and updated the minSliceLenght to be the same as other CCEs --- release-packaging/Classes/FluidBufNoveltySlice.sc | 8 ++++---- release-packaging/Classes/FluidNoveltySlice.sc | 2 +- .../HelpSource/Classes/FluidNoveltySlice.schelp | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/release-packaging/Classes/FluidBufNoveltySlice.sc b/release-packaging/Classes/FluidBufNoveltySlice.sc index 678726f..7467349 100644 --- a/release-packaging/Classes/FluidBufNoveltySlice.sc +++ b/release-packaging/Classes/FluidBufNoveltySlice.sc @@ -1,5 +1,5 @@ FluidBufNoveltySlice : UGen { - *new1 { |rate, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, indices, feature = 0, kernelSize = 3, threshold = 0.5, filterSize = 1, minSliceLength = 1, windowSize = 1024, hopSize = -1, fftSize = -1, doneAction = 0, blocking = 0 | + *new1 { |rate, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, indices, feature = 0, kernelSize = 3, threshold = 0.5, filterSize = 1, minSliceLength = 2, windowSize = 1024, hopSize = -1, fftSize = -1, doneAction = 0, blocking = 0 | var maxFFTSize = if (fftSize == -1) {windowSize.nextPowerOfTwo} {fftSize}; @@ -13,13 +13,13 @@ FluidBufNoveltySlice : UGen { } - *kr { |source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, indices, feature = 0, kernelSize = 3, threshold = 0.5, filterSize = 1, minSliceLength = 1, windowSize = 1024, hopSize = -1, fftSize = -1, doneAction = 0 | + *kr { |source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, indices, feature = 0, kernelSize = 3, threshold = 0.5, filterSize = 1, minSliceLength = 2, windowSize = 1024, hopSize = -1, fftSize = -1, doneAction = 0 | ^this.multiNew(\control, source, startFrame, numFrames, startChan, numChans, indices, feature, kernelSize, threshold, filterSize, minSliceLength, windowSize, hopSize, fftSize, doneAction); } - *process { |server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, indices, feature = 0, kernelSize = 3, threshold = 0.5, filterSize = 1, minSliceLength = 1, windowSize = 1024, hopSize = -1, fftSize = -1, action | + *process { |server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, indices, feature = 0, kernelSize = 3, threshold = 0.5, filterSize = 1, minSliceLength = 2, windowSize = 1024, hopSize = -1, fftSize = -1, action | ^FluidNRTProcess.new( server, this, action, [indices] ).process( @@ -27,7 +27,7 @@ FluidBufNoveltySlice : UGen { ); } - *processBlocking { |server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, indices, feature = 0, kernelSize = 3, threshold = 0.5, filterSize = 1, minSliceLength = 1, windowSize = 1024, hopSize = -1, fftSize = -1, action | + *processBlocking { |server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, indices, feature = 0, kernelSize = 3, threshold = 0.5, filterSize = 1, minSliceLength = 2, windowSize = 1024, hopSize = -1, fftSize = -1, action | ^FluidNRTProcess.new( server, this, action, [indices], blocking:1 ).process( diff --git a/release-packaging/Classes/FluidNoveltySlice.sc b/release-packaging/Classes/FluidNoveltySlice.sc index 594088e..a0ecbe1 100644 --- a/release-packaging/Classes/FluidNoveltySlice.sc +++ b/release-packaging/Classes/FluidNoveltySlice.sc @@ -1,5 +1,5 @@ FluidNoveltySlice : UGen { - *ar { arg in = 0, feature = 0, kernelSize = 3, threshold = 0.8, filterSize = 1, minSliceLength = 1, windowSize = 1024, hopSize = -1, fftSize = -1, maxFFTSize = 16384, maxKernelSize = 101, maxFilterSize = 100; + *ar { arg in = 0, feature = 0, kernelSize = 3, threshold = 0.8, filterSize = 1, minSliceLength = 2, windowSize = 1024, hopSize = -1, fftSize = -1, maxFFTSize = 16384, maxKernelSize = 101, maxFilterSize = 100; ^this.multiNew('audio', in.asAudioRateInput(this), feature, kernelSize, threshold, filterSize, minSliceLength, windowSize, hopSize, fftSize, maxFFTSize, maxKernelSize, maxFilterSize) } checkInputs { diff --git a/release-packaging/HelpSource/Classes/FluidNoveltySlice.schelp b/release-packaging/HelpSource/Classes/FluidNoveltySlice.schelp index 115c0ec..c7d9167 100644 --- a/release-packaging/HelpSource/Classes/FluidNoveltySlice.schelp +++ b/release-packaging/HelpSource/Classes/FluidNoveltySlice.schelp @@ -56,7 +56,7 @@ ARGUMENT:: maxFilterSize This cannot be modulated. RETURNS:: - An audio stream with impulses at detected transients. The latency between the input and the output is STRONG::hopSize * (((kernelSize+1)/2) + filterSize):: at minimum. + An audio stream with impulses at detected transients. The latency between the input and the output is STRONG::windowSize + (hopSize * (((kernelSize+1)/2) + (filterSize / 2))):: samples at minimum. EXAMPLES:: @@ -65,10 +65,10 @@ code:: b = Buffer.read(s,File.realpath(FluidNoveltySlice.class.filenameSymbol).dirname.withTrailingSlash ++ "../AudioFiles/Nicol-LoopE-M.wav"); // basic param (the process add a latency of windowSize samples -{var sig = PlayBuf.ar(1,b,loop:1); [FluidNoveltySlice.ar(sig,0,11,0.33) * 0.5, DelayN.ar(sig, 1, 512 * (((11+1)/2) + 1)/ s.sampleRate, 0.2)]}.play +{var sig = PlayBuf.ar(1,b,loop:1); [FluidNoveltySlice.ar(sig,0,11,0.33) * 0.5, DelayN.ar(sig, 1, (1024 + (512 * (((11+1)/2) + (1 / 2))))/ s.sampleRate, 0.2)]}.play // other parameters -{var sig = PlayBuf.ar(1,b,loop:1); [FluidNoveltySlice.ar(sig, 1, 31, 0.0035, 4, 100, 128, 32) * 0.5, DelayN.ar(sig, 1, 32 * (((31+1)/2) + 4)/ s.sampleRate,0.2)]}.play +{var sig = PlayBuf.ar(1,b,loop:1); [FluidNoveltySlice.ar(sig, 1, 31, 0.0035, 4, 100, 128, 32) * 0.5, DelayN.ar(sig, 1, (128 + (32 * (((31+1)/2) + (4 / 2))))/ s.sampleRate,0.2)]}.play // more musical trans-trigged autopan ( @@ -76,7 +76,7 @@ b = Buffer.read(s,File.realpath(FluidNoveltySlice.class.filenameSymbol).dirname. var sig, trig, syncd, pan; sig = PlayBuf.ar(1,b,loop:1); trig = FluidNoveltySlice.ar(sig, 0, 11, 0.25, 5, 1, 128, 32); - syncd = DelayN.ar(sig, 1, 64 * (((11+1)/2) + 5) / s.sampleRate); + syncd = DelayN.ar(sig, 1, (128 + (32 * (((11+1)/2) + (5 / 2))))/ s.sampleRate); pan = TRand.ar(-1,1,trig); Pan2.ar(syncd,pan); }.play