From be46f346f37e98953d4f67da6ed03522d047f330 Mon Sep 17 00:00:00 2001 From: Pierre Alexandre Tremblay Date: Tue, 4 Jun 2019 18:10:45 -0300 Subject: [PATCH] new interface on (buf)RTNoveltySlice in progress (for alpha08) --- release-packaging/Classes/FluidBufRTNoveltySlice.sc | 6 +++--- release-packaging/Classes/FluidRTNoveltySlice.sc | 4 ++-- .../HelpSource/Classes/FluidBufRTNoveltySlice.schelp | 2 +- .../HelpSource/Classes/FluidRTNoveltySlice.schelp | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/release-packaging/Classes/FluidBufRTNoveltySlice.sc b/release-packaging/Classes/FluidBufRTNoveltySlice.sc index 104f034..5741f15 100644 --- a/release-packaging/Classes/FluidBufRTNoveltySlice.sc +++ b/release-packaging/Classes/FluidBufRTNoveltySlice.sc @@ -1,7 +1,7 @@ FluidBufRTNoveltySlice{ - *process { arg server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, indices, feature = 0, kernelSize = 3, threshold = 0.8, filterSize = 1, winSize = 1024, hopSize = -1, fftSize = -1, action; + *process { arg server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, indices, feature = 0, kernelSize = 3, threshold = 0.8, filterSize = 1, windowSize = 1024, hopSize = -1, fftSize = -1, action; - var maxFFTSize = if (fftSize == -1) {winSize.nextPowerOfTwo} {fftSize}; + var maxFFTSize = if (fftSize == -1) {windowSize.nextPowerOfTwo} {fftSize}; source = source.asUGenInput; indices = indices.asUGenInput; @@ -12,7 +12,7 @@ FluidBufRTNoveltySlice{ server = server ? Server.default; forkIfNeeded{ - server.sendMsg(\cmd, \BufRTNoveltySlice, source, startFrame, numFrames, startChan, numChans, indices, feature, kernelSize, threshold, filterSize, winSize, hopSize, fftSize, maxFFTSize, kernelSize, filterSize); + server.sendMsg(\cmd, \BufRTNoveltySlice, source, startFrame, numFrames, startChan, numChans, indices, feature, kernelSize, threshold, filterSize, windowSize, hopSize, fftSize, maxFFTSize, kernelSize, filterSize); server.sync; indices = server.cachedBufferAt(indices); indices.updateInfo; server.sync; action.value(indices); diff --git a/release-packaging/Classes/FluidRTNoveltySlice.sc b/release-packaging/Classes/FluidRTNoveltySlice.sc index b908004..813d15a 100644 --- a/release-packaging/Classes/FluidRTNoveltySlice.sc +++ b/release-packaging/Classes/FluidRTNoveltySlice.sc @@ -1,6 +1,6 @@ FluidRTNoveltySlice : UGen { - *ar { arg in = 0, feature = 0, kernelSize = 3, threshold = 0.8, filterSize = 1, winSize = 1024, hopSize = -1, fftSize = -1, maxFFTSize = 16384, maxKernelSize = 101, maxFilterSize = 100; - ^this.multiNew('audio', in.asAudioRateInput(this), feature, kernelSize, threshold, filterSize, winSize, hopSize, fftSize, maxFFTSize, maxKernelSize, maxFilterSize) + *ar { arg in = 0, feature = 0, kernelSize = 3, threshold = 0.8, filterSize = 1, windowSize = 1024, hopSize = -1, fftSize = -1, maxFFTSize = 16384, maxKernelSize = 101, maxFilterSize = 100; + ^this.multiNew('audio', in.asAudioRateInput(this), feature, kernelSize, threshold, filterSize, windowSize, hopSize, fftSize, maxFFTSize, maxKernelSize, maxFilterSize) } checkInputs { if(inputs.at(8).rate != 'scalar') { diff --git a/release-packaging/HelpSource/Classes/FluidBufRTNoveltySlice.schelp b/release-packaging/HelpSource/Classes/FluidBufRTNoveltySlice.schelp index 586e586..e90651f 100644 --- a/release-packaging/HelpSource/Classes/FluidBufRTNoveltySlice.schelp +++ b/release-packaging/HelpSource/Classes/FluidBufRTNoveltySlice.schelp @@ -53,7 +53,7 @@ ARGUMENT:: threshold ARGUMENT:: filterSize The size of a smoothing filter that is applied on the novelty curve. A larger filter filter size allows for cleaner cuts on very sharp changes. -ARGUMENT:: winSize +ARGUMENT:: windowSize The window size. As novelty estimation relies on spectral frames, we need to decide what precision we give it spectrally and temporally, in line with Gabor Uncertainty principles. http://www.subsurfwiki.org/wiki/Gabor_uncertainty ARGUMENT:: hopSize diff --git a/release-packaging/HelpSource/Classes/FluidRTNoveltySlice.schelp b/release-packaging/HelpSource/Classes/FluidRTNoveltySlice.schelp index 58304bc..166cf76 100644 --- a/release-packaging/HelpSource/Classes/FluidRTNoveltySlice.schelp +++ b/release-packaging/HelpSource/Classes/FluidRTNoveltySlice.schelp @@ -34,11 +34,11 @@ ARGUMENT:: threshold ARGUMENT:: filterSize The size of a smoothing filter that is applied on the novelty curve. A larger filter filter size allows for cleaner cuts on very sharp changes. -ARGUMENT:: winSize +ARGUMENT:: windowSize The window size. As sinusoidal estimation relies on spectral frames, we need to decide what precision we give it spectrally and temporally, in line with Gabor Uncertainty principles. http://www.subsurfwiki.org/wiki/Gabor_uncertainty ARGUMENT:: hopSize - The window hop size. As sinusoidal estimation relies on spectral frames, we need to move the window forward. It can be any size but low overlap will create audible artefacts. The -1 default value will default to half of winSize (overlap of 2). + The window hop size. As sinusoidal estimation relies on spectral frames, we need to move the window forward. It can be any size but low overlap will create audible artefacts. The -1 default value will default to half of windowSize (overlap of 2). ARGUMENT:: fftSize The inner FFT/IFFT size. It should be at least 4 samples long, at least the size of the window, and a power of 2. Making it larger allows an oversampling of the spectral precision. The -1 default value will default to windowSize. @@ -53,7 +53,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 winSize at maximum. + An audio stream with impulses at detected transients. The latency between the input and the output is windowSize at maximum. EXAMPLES:: @@ -61,7 +61,7 @@ code:: //load some sounds b = Buffer.read(s,File.realpath(FluidRTNoveltySlice.class.filenameSymbol).dirname.withTrailingSlash ++ "../AudioFiles/Nicol-LoopE-M.wav"); -// basic param (the process add a latency of winSize samples +// basic param (the process add a latency of windowSize samples {var sig = PlayBuf.ar(1,b,loop:1); [FluidRTNoveltySlice.ar(sig,0,3,0.2) * 0.5, DelayN.ar(sig, 1, 1024/ s.sampleRate)]}.play // other parameters