From e18e8221ed9470432fb49388fbe2584b48ad178a Mon Sep 17 00:00:00 2001 From: Pierre Alexandre Tremblay Date: Wed, 7 Apr 2021 13:51:53 +0100 Subject: [PATCH] descriptors: new interface with padding, and explanation --- release-packaging/Classes/FluidBufMFCC.sc | 24 ++++++++-------- release-packaging/Classes/FluidBufMelBands.sc | 12 ++++---- release-packaging/Classes/FluidBufPitch.sc | 28 +++++++++---------- release-packaging/Classes/FluidBufSTFT.sc | 12 ++++---- .../Classes/FluidBufSpectralShape.sc | 12 ++++---- .../HelpSource/Classes/FluidBufMFCC.schelp | 5 +++- .../Classes/FluidBufMelBands.schelp | 3 ++ .../HelpSource/Classes/FluidBufPitch.schelp | 9 ++++-- .../HelpSource/Classes/FluidBufSTFT.schelp | 6 ++-- .../Classes/FluidBufSpectralShape.schelp | 5 +++- 10 files changed, 64 insertions(+), 52 deletions(-) diff --git a/release-packaging/Classes/FluidBufMFCC.sc b/release-packaging/Classes/FluidBufMFCC.sc index 0d6360e..8e371e9 100644 --- a/release-packaging/Classes/FluidBufMFCC.sc +++ b/release-packaging/Classes/FluidBufMFCC.sc @@ -1,45 +1,45 @@ FluidBufMFCC : FluidBufProcessor{ - *kr { |source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, features, numCoeffs = 13, numBands = 40, minFreq = 20, maxFreq = 20000, windowSize = 1024, hopSize = -1, fftSize = -1, trig = 1, blocking = 0| - + *kr { |source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, features, numCoeffs = 13, numBands = 40, minFreq = 20, maxFreq = 20000, windowSize = 1024, hopSize = -1, fftSize = -1, padding = 1, trig = 1, blocking = 0| + var maxFFTSize = if (fftSize == -1) {windowSize.nextPowerOfTwo} {fftSize}; source = source.asUGenInput; features = features.asUGenInput; source.isNil.if {"FluidBufMFCC: Invalid source buffer".throw}; features.isNil.if {"FluidBufMFCC: Invalid features buffer".throw}; - - ^FluidProxyUgen.kr(\FluidBufMFCCTrigger, -1, source, startFrame, numFrames, startChan, numChans, features, numCoeffs, numBands, minFreq, maxFreq,numCoeffs, windowSize, hopSize, fftSize, maxFFTSize,trig, blocking); + + ^FluidProxyUgen.kr(\FluidBufMFCCTrigger, -1, source, startFrame, numFrames, startChan, numChans, features, padding, numCoeffs, numBands, minFreq, maxFreq,numCoeffs, windowSize, hopSize, fftSize, maxFFTSize,trig, blocking); } - *process { |server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, features, numCoeffs = 13, numBands = 40, minFreq = 20, maxFreq = 20000, windowSize = 1024, hopSize = -1, fftSize = -1,freeWhenDone=true, action | - + *process { |server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, features, numCoeffs = 13, numBands = 40, minFreq = 20, maxFreq = 20000, windowSize = 1024, hopSize = -1, fftSize = -1, padding = 1, freeWhenDone=true, action | + var maxFFTSize = if (fftSize == -1) {windowSize.nextPowerOfTwo} {fftSize}; source = source.asUGenInput; features = features.asUGenInput; source.isNil.if {"FluidBufMFCC: Invalid source buffer".throw}; features.isNil.if {"FluidBufMFCC: Invalid features buffer".throw}; - + ^this.new( server, nil,[features] ).processList( - [source, startFrame, numFrames, startChan, numChans, features, numCoeffs, numBands, minFreq, maxFreq, numCoeffs,windowSize, hopSize, fftSize,maxFFTSize,0],freeWhenDone,action + [source, startFrame, numFrames, startChan, numChans, features, padding, numCoeffs, numBands, minFreq, maxFreq, numCoeffs,windowSize, hopSize, fftSize, maxFFTSize,0],freeWhenDone,action ); } - *processBlocking { |server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, features, numCoeffs = 13, numBands = 40, minFreq = 20, maxFreq = 20000, windowSize = 1024, hopSize = -1, fftSize = -1,freeWhenDone=true, action | - + *processBlocking { |server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, features, numCoeffs = 13, numBands = 40, minFreq = 20, maxFreq = 20000, windowSize = 1024, hopSize = -1, fftSize = -1, padding = 1, freeWhenDone=true, action | + var maxFFTSize = if (fftSize == -1) {windowSize.nextPowerOfTwo} {fftSize}; source = source.asUGenInput; features = features.asUGenInput; source.isNil.if {"FluidBufMFCC: Invalid source buffer".throw}; features.isNil.if {"FluidBufMFCC: Invalid features buffer".throw}; - + ^this.new( server, nil,[features] ).processList( - [source, startFrame, numFrames, startChan, numChans, features, numCoeffs, numBands, minFreq, maxFreq,numCoeffs, windowSize, hopSize, fftSize,maxFFTSize,1],freeWhenDone,action + [source, startFrame, numFrames, startChan, numChans, features, padding, numCoeffs, numBands, minFreq, maxFreq,numCoeffs, windowSize, hopSize, fftSize, maxFFTSize,1],freeWhenDone,action ); } } diff --git a/release-packaging/Classes/FluidBufMelBands.sc b/release-packaging/Classes/FluidBufMelBands.sc index cb5eb12..b11ffb7 100644 --- a/release-packaging/Classes/FluidBufMelBands.sc +++ b/release-packaging/Classes/FluidBufMelBands.sc @@ -1,6 +1,6 @@ FluidBufMelBands : FluidBufProcessor { - *kr { |source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, features, numBands = 40, minFreq = 20, maxFreq = 20000, normalize = 1, windowSize = 1024, hopSize = -1, fftSize = -1, trig = 1, blocking = 0| + *kr { |source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, features, numBands = 40, minFreq = 20, maxFreq = 20000, normalize = 1, windowSize = 1024, hopSize = -1, fftSize = -1, padding = 1, trig = 1, blocking = 0| var maxFFTSize = if (fftSize == -1) {windowSize.nextPowerOfTwo} {fftSize}; @@ -11,10 +11,10 @@ FluidBufMelBands : FluidBufProcessor { features.isNil.if {"FluidBufMelBands: Invalid features buffer".throw}; - ^FluidProxyUgen.kr(\FluidBufMelBandsTrigger,-1, source, startFrame, numFrames, startChan, numChans, features, numBands, minFreq, maxFreq, numBands, normalize, windowSize, hopSize, fftSize,maxFFTSize, trig, blocking); + ^FluidProxyUgen.kr(\FluidBufMelBandsTrigger,-1, source, startFrame, numFrames, startChan, numChans, features, padding, numBands, minFreq, maxFreq, numBands, normalize, windowSize, hopSize, fftSize, maxFFTSize, trig, blocking); } - *process { |server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, features, numBands = 40, minFreq = 20, maxFreq = 20000, normalize = 1, windowSize = 1024, hopSize = -1, fftSize = -1, freeWhenDone = true, action| + *process { |server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, features, numBands = 40, minFreq = 20, maxFreq = 20000, normalize = 1, windowSize = 1024, hopSize = -1, fftSize = -1, padding = 1, freeWhenDone = true, action| var maxFFTSize = if (fftSize == -1) {windowSize.nextPowerOfTwo} {fftSize}; @@ -27,11 +27,11 @@ FluidBufMelBands : FluidBufProcessor { ^this.new( server, nil, [features] ).processList( - [source, startFrame, numFrames, startChan, numChans, features, numBands, minFreq, maxFreq, numBands, normalize, windowSize, hopSize, fftSize,maxFFTSize,0],freeWhenDone,action + [source, startFrame, numFrames, startChan, numChans, features, padding, numBands, minFreq, maxFreq, numBands, normalize, windowSize, hopSize, fftSize, maxFFTSize, 0],freeWhenDone,action ); } - *processBlocking { |server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, features, numBands = 40, minFreq = 20, maxFreq = 20000, normalize = 1, windowSize = 1024, hopSize = -1, fftSize = -1, freeWhenDone = true, action| + *processBlocking { |server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, features, numBands = 40, minFreq = 20, maxFreq = 20000, normalize = 1, windowSize = 1024, hopSize = -1, fftSize = -1, padding = 1, freeWhenDone = true, action| var maxFFTSize = if (fftSize == -1) {windowSize.nextPowerOfTwo} {fftSize}; @@ -44,7 +44,7 @@ FluidBufMelBands : FluidBufProcessor { ^this.new( server, nil, [features] ).processList( - [source, startFrame, numFrames, startChan, numChans, features, numBands, minFreq, maxFreq, numBands, normalize, windowSize, hopSize, fftSize,maxFFTSize,1],freeWhenDone,action + [source, startFrame, numFrames, startChan, numChans, features, padding, numBands, minFreq, maxFreq, numBands, normalize, windowSize, hopSize, fftSize, maxFFTSize, 1],freeWhenDone,action ); } } diff --git a/release-packaging/Classes/FluidBufPitch.sc b/release-packaging/Classes/FluidBufPitch.sc index 608a404..d62190b 100644 --- a/release-packaging/Classes/FluidBufPitch.sc +++ b/release-packaging/Classes/FluidBufPitch.sc @@ -1,21 +1,21 @@ FluidBufPitch : FluidBufProcessor{ - - *kr { |source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, features, algorithm = 2, minFreq = 20, maxFreq = 10000, unit = 0, windowSize = 1024, hopSize = -1, fftSize = -1, trig = 1, blocking = 0| - + + *kr { |source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, features, algorithm = 2, minFreq = 20, maxFreq = 10000, unit = 0, windowSize = 1024, hopSize = -1, fftSize = -1, padding = 1, trig = 1, blocking = 0| + var maxFFTSize = if (fftSize == -1) {windowSize.nextPowerOfTwo} {fftSize}; source = source.asUGenInput; features = features.asUGenInput; source.isNil.if {"FluidBufPitch: Invalid source buffer".throw}; - features.isNil.if {"FluidBufPitch: Invalid features buffer".throw}; - - ^FluidProxyUgen.kr(\FluidBufPitchTrigger, -1, source, startFrame, numFrames, startChan, numChans, features, algorithm, minFreq, maxFreq, unit, windowSize, hopSize, fftSize, maxFFTSize, trig, blocking); + features.isNil.if {"FluidBufPitch: Invalid features buffer".throw}; + + ^FluidProxyUgen.kr(\FluidBufPitchTrigger, -1, source, startFrame, numFrames, startChan, numChans, features, padding, algorithm, minFreq, maxFreq, unit, windowSize, hopSize, fftSize, maxFFTSize, trig, blocking); } - *process { |server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, features, algorithm = 2, minFreq = 20, maxFreq = 10000, unit = 0, windowSize = 1024, hopSize = -1, fftSize = -1, freeWhenDone = true, action| - + *process { |server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, features, algorithm = 2, minFreq = 20, maxFreq = 10000, unit = 0, windowSize = 1024, hopSize = -1, fftSize = -1, padding = 1, freeWhenDone = true, action| + var maxFFTSize = if (fftSize == -1) {windowSize.nextPowerOfTwo} {fftSize}; source = source.asUGenInput; @@ -23,16 +23,16 @@ FluidBufPitch : FluidBufProcessor{ source.isNil.if {"FluidBufPitch: Invalid source buffer".throw}; features.isNil.if {"FluidBufPitch: Invalid features buffer".throw}; - + ^this.new( server, nil, [features] ).processList( - [source, startFrame, numFrames, startChan, numChans, features, algorithm, minFreq, maxFreq, unit, windowSize, hopSize, fftSize, maxFFTSize, 0], freeWhenDone, action + [source, startFrame, numFrames, startChan, numChans, features, padding, algorithm, minFreq, maxFreq, unit, windowSize, hopSize, fftSize, maxFFTSize, 0], freeWhenDone, action ); } - *processBlocking { |server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, features, algorithm = 2, minFreq = 20, maxFreq = 10000, unit = 0, windowSize = 1024, hopSize = -1, fftSize = -1, freeWhenDone = true, action| - + *processBlocking { |server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, features, algorithm = 2, minFreq = 20, maxFreq = 10000, unit = 0, windowSize = 1024, hopSize = -1, fftSize = -1, padding = 1, freeWhenDone = true, action| + var maxFFTSize = if (fftSize == -1) {windowSize.nextPowerOfTwo} {fftSize}; source = source.asUGenInput; @@ -40,11 +40,11 @@ FluidBufPitch : FluidBufProcessor{ source.isNil.if {"FluidBufPitch: Invalid source buffer".throw}; features.isNil.if {"FluidBufPitch: Invalid features buffer".throw}; - + ^this.new( server, nil, [features] ).processList( - [source, startFrame, numFrames, startChan, numChans, features, algorithm, minFreq, maxFreq, unit, windowSize, hopSize, fftSize, maxFFTSize, 1], freeWhenDone, action + [source, startFrame, numFrames, startChan, numChans, features, padding, algorithm, minFreq, maxFreq, unit, windowSize, hopSize, fftSize, maxFFTSize, 1], freeWhenDone, action ); } } diff --git a/release-packaging/Classes/FluidBufSTFT.sc b/release-packaging/Classes/FluidBufSTFT.sc index bd0eb2d..e93d206 100644 --- a/release-packaging/Classes/FluidBufSTFT.sc +++ b/release-packaging/Classes/FluidBufSTFT.sc @@ -1,6 +1,6 @@ FluidBufSTFT : FluidBufProcessor { - *kr { |source, startFrame = 0, numFrames = -1, startChan = 0, magnitude, phase, resynthesis, inverse = 0,windowSize = 1024, hopSize = -1, fftSize = -1, trig = 1, blocking = 1| + *kr { |source, startFrame = 0, numFrames = -1, startChan = 0, magnitude, phase, resynthesis, inverse = 0,windowSize = 1024, hopSize = -1, fftSize = -1, padding = 1, trig = 1, blocking = 1| // source = source.asUGenInput; @@ -10,10 +10,10 @@ FluidBufSTFT : FluidBufProcessor { phase = phase ? -1; resynthesis = resynthesis ? - 1; - ^FluidProxyUgen.kr(\FluidBufSTFTTrigger, -1, source, startFrame, numFrames, startChan, magnitude, phase, resynthesis, inverse, windowSize, hopSize, fftSize,trig, blocking); + ^FluidProxyUgen.kr(\FluidBufSTFTTrigger, -1, source, startFrame, numFrames, startChan, magnitude, phase, resynthesis, inverse, padding, windowSize, hopSize, fftSize, trig, blocking); } - *process { |server, source, startFrame = 0, numFrames = -1, startChan = 0, magnitude, phase, resynthesis, inverse = 0, windowSize = 1024, hopSize = -1, fftSize = -1,freeWhenDone = true, action| + *process { |server, source, startFrame = 0, numFrames = -1, startChan = 0, magnitude, phase, resynthesis, inverse = 0, windowSize = 1024, hopSize = -1, fftSize = -1, padding = 1, freeWhenDone = true, action| // source = source.asUGenInput; @@ -26,11 +26,11 @@ FluidBufSTFT : FluidBufProcessor { ^this.new( server, nil, [magnitude,phase,resynthesis].select{|b| b != -1} ).processList( - [source, startFrame, numFrames, startChan, magnitude, phase, resynthesis, inverse, windowSize, hopSize, fftSize, 0], freeWhenDone, action + [source, startFrame, numFrames, startChan, magnitude, phase, resynthesis, inverse, padding, windowSize, hopSize, fftSize, 0], freeWhenDone, action ); } - *processBlocking { |server, source, startFrame = 0, numFrames = -1, startChan = 0, magnitude, phase, resynthesis, inverse = 0, windowSize = 1024, hopSize = -1, fftSize = -1,freeWhenDone = true, action| + *processBlocking { |server, source, startFrame = 0, numFrames = -1, startChan = 0, magnitude, phase, resynthesis, inverse = 0, windowSize = 1024, hopSize = -1, fftSize = -1, padding = 1,freeWhenDone = true, action| // source = source.asUGenInput; source = source ? -1; @@ -41,7 +41,7 @@ FluidBufSTFT : FluidBufProcessor { ^this.new( server, nil, [magnitude,phase,resynthesis].select{|b| b != -1} ).processList( - [source, startFrame, numFrames, startChan, magnitude, phase, resynthesis, inverse, windowSize, hopSize, fftSize,1], freeWhenDone, action + [source, startFrame, numFrames, startChan, magnitude, phase, resynthesis, inverse, padding, windowSize, hopSize, fftSize, 1], freeWhenDone, action ); } } diff --git a/release-packaging/Classes/FluidBufSpectralShape.sc b/release-packaging/Classes/FluidBufSpectralShape.sc index 4a28417..b4bb4ab 100644 --- a/release-packaging/Classes/FluidBufSpectralShape.sc +++ b/release-packaging/Classes/FluidBufSpectralShape.sc @@ -4,7 +4,7 @@ FluidBufSpectralShape : FluidBufProcessor { ^\FluidBufSpecShp } - *kr { |source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, features, windowSize = 1024, hopSize = -1, fftSize = -1, trig = 1, blocking = 0| + *kr { |source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, features, windowSize = 1024, hopSize = -1, fftSize = -1, padding = 1, trig = 1, blocking = 0| var maxFFTSize = if (fftSize == -1) {windowSize.nextPowerOfTwo} {fftSize}; @@ -14,11 +14,11 @@ FluidBufSpectralShape : FluidBufProcessor { source.isNil.if {"FluidBufSpectralShape: Invalid source buffer".throw}; features.isNil.if {"FluidBufSpectralShape: Invalid features buffer".throw}; - ^FluidProxyUgen.kr(this.objectClassName++\Trigger, -1, source, startFrame, numFrames, startChan, numChans, features, windowSize, hopSize, fftSize, maxFFTSize, trig, blocking); + ^FluidProxyUgen.kr(this.objectClassName++\Trigger, -1, source, startFrame, numFrames, startChan, numChans, features, padding, windowSize, hopSize, fftSize, maxFFTSize, trig, blocking); } - *process { |server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, features, windowSize = 1024, hopSize = -1, fftSize = -1, freeWhenDone = true, action| + *process { |server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, features, windowSize = 1024, hopSize = -1, fftSize = -1, padding = 1, freeWhenDone = true, action| var maxFFTSize = if (fftSize == -1) {windowSize.nextPowerOfTwo} {fftSize}; @@ -31,11 +31,11 @@ FluidBufSpectralShape : FluidBufProcessor { ^this.new( server, nil, [features] ).processList( - [source, startFrame, numFrames, startChan, numChans, features, windowSize, hopSize, fftSize, maxFFTSize, 0], freeWhenDone, action + [source, startFrame, numFrames, startChan, numChans, features, padding, windowSize, hopSize, fftSize, maxFFTSize, 0], freeWhenDone, action ); } - *processBlocking { |server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, features, windowSize = 1024, hopSize = -1, fftSize = -1, freeWhenDone = true, action| + *processBlocking { |server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, features, windowSize = 1024, hopSize = -1, fftSize = -1, padding = 1, freeWhenDone = true, action| var maxFFTSize = if (fftSize == -1) {windowSize.nextPowerOfTwo} {fftSize}; @@ -48,7 +48,7 @@ FluidBufSpectralShape : FluidBufProcessor { ^this.new( server, nil, [features] ).processList( - [source, startFrame, numFrames, startChan, numChans, features, windowSize, hopSize, fftSize, maxFFTSize, 1], freeWhenDone, action + [source, startFrame, numFrames, startChan, numChans, features, padding, windowSize, hopSize, fftSize, maxFFTSize, 1], freeWhenDone, action ); } } diff --git a/release-packaging/HelpSource/Classes/FluidBufMFCC.schelp b/release-packaging/HelpSource/Classes/FluidBufMFCC.schelp index 8ad8c8a..bfc4358 100644 --- a/release-packaging/HelpSource/Classes/FluidBufMFCC.schelp +++ b/release-packaging/HelpSource/Classes/FluidBufMFCC.schelp @@ -59,8 +59,11 @@ ARGUMENT:: hopSize 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 use the next power of 2 equal or above the windowSize. +ARGUMENT:: padding + The padding applied to both sides of the input buffer. By default (1) it is half the windowSize to ensure that the beginning of the audio is centered on the window and that no audio is left untouched at the end. (2) will apply (windowSize - hopSize) to cover each sides by the same number of overlaps. (0) will disable and start from the beginning, with the windowing effectively scaling down the first samples. + ARGUMENT:: freeWhenDone -Free the server instance when processing complete. Default true + Free the server instance when processing complete. Default true ARGUMENT:: action A Function to be evaluated once the offline process has finished and all Buffer's instance variables have been updated on the client side. The function will be passed [features] as an argument. diff --git a/release-packaging/HelpSource/Classes/FluidBufMelBands.schelp b/release-packaging/HelpSource/Classes/FluidBufMelBands.schelp index 8b76900..e71a189 100644 --- a/release-packaging/HelpSource/Classes/FluidBufMelBands.schelp +++ b/release-packaging/HelpSource/Classes/FluidBufMelBands.schelp @@ -60,6 +60,9 @@ ARGUMENT:: hopSize 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 use the next power of 2 equal or above the windowSize. +ARGUMENT:: padding + The padding applied to both sides of the input buffer. By default (1) it is half the windowSize to ensure that the beginning of the audio is centered on the window and that no audio is left untouched at the end. (2) will apply (windowSize - hopSize) to cover each sides by the same number of overlaps. (0) will disable and start from the beginning, with the windowing effectively scaling down the first samples. + ARGUMENT:: freeWhenDone Free the server instance when processing complete. Default true diff --git a/release-packaging/HelpSource/Classes/FluidBufPitch.schelp b/release-packaging/HelpSource/Classes/FluidBufPitch.schelp index 99cb9d8..7eed7a7 100644 --- a/release-packaging/HelpSource/Classes/FluidBufPitch.schelp +++ b/release-packaging/HelpSource/Classes/FluidBufPitch.schelp @@ -65,8 +65,11 @@ ARGUMENT:: hopSize 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 use the next power of 2 equal or above the windowSize. +ARGUMENT:: padding + The padding applied to both sides of the input buffer. By default (1) it is half the windowSize to ensure that the beginning of the audio is centered on the window and that no audio is left untouched at the end. (2) will apply (windowSize - hopSize) to cover each sides by the same number of overlaps. (0) will disable and start from the beginning, with the windowing effectively scaling down the first samples. + ARGUMENT:: freeWhenDone -Free the server instance when processing complete. Default true + Free the server instance when processing complete. Default true ARGUMENT:: action A Function to be evaluated once the offline process has finished and all Buffer's instance variables have been updated on the client side. The function will be passed [features] as an argument. @@ -164,8 +167,8 @@ d.do({ e.postln; //granulate only the frames that are in our buffer -// We need to convert our indices to frame start. Their position was (index * hopSize) - (windowSize) in FluidBufPitch -f = e.collect({arg i; (i * 512) - 1024}); +// We need to convert our indices to frame start. Their position was (index * hopSize) - (hopSize) in FluidBufPitch +f = e.collect({arg i; (i * 512) - 512}); // define a basic grain synth ( diff --git a/release-packaging/HelpSource/Classes/FluidBufSTFT.schelp b/release-packaging/HelpSource/Classes/FluidBufSTFT.schelp index f86fcff..b2e1a79 100644 --- a/release-packaging/HelpSource/Classes/FluidBufSTFT.schelp +++ b/release-packaging/HelpSource/Classes/FluidBufSTFT.schelp @@ -53,6 +53,9 @@ How many samples there are in-between analysis windows. The -1 default value wil ARGUMENT:: fftSize The 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 use the next power of 2 equal or above the windowSize. For this object it is effectively capped at 65536. +ARGUMENT:: padding +The padding applied to both sides of the input buffer. By default (1) it is half the windowSize to ensure that the beginning of the audio is centered on the window and that no audio is left untouched at the end. (2) will apply (windowSize - hopSize) to cover each sides by the same number of overlaps. (0) will disable and start from the beginning, with the windowing effectively scaling down the first samples. + ARGUMENT:: freeWhenDone Free the server instance when processing complete. Default true @@ -81,9 +84,6 @@ fork{ } ) -FluidBufSTFT.process(s,source:b,magnitude:m,phase:p) -m.getn(4444,10,{|x|x.postln;}) - { PlayBuf.ar(1,r); }.play //nullsum diff --git a/release-packaging/HelpSource/Classes/FluidBufSpectralShape.schelp b/release-packaging/HelpSource/Classes/FluidBufSpectralShape.schelp index 4f49ccd..f2e3874 100644 --- a/release-packaging/HelpSource/Classes/FluidBufSpectralShape.schelp +++ b/release-packaging/HelpSource/Classes/FluidBufSpectralShape.schelp @@ -64,8 +64,11 @@ ARGUMENT:: hopSize 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 use the next power of 2 equal or above the windowSize. +ARGUMENT:: padding + The padding applied to both sides of the input buffer. By default (1) it is half the windowSize to ensure that the beginning of the audio is centered on the window and that no audio is left untouched at the end. (2) will apply (windowSize - hopSize) to cover each sides by the same number of overlaps. (0) will disable and start from the beginning, with the windowing effectively scaling down the first samples. + ARGUMENT:: freeWhenDone -Free the server instance when processing complete. Default true + Free the server instance when processing complete. Default true ARGUMENT:: action A Function to be evaluated once the offline process has finished and all Buffer's instance variables have been updated on the client side. The function will be passed [features] as an argument.