change the order of the fixed parameters for the few classes which were different to the rest

nix
Pierre Alexandre Tremblay 5 years ago
parent 2a6e5330b7
commit 54204e4b9f

@ -1,5 +1,5 @@
FluidBufChroma : FluidBufProcessor {
*kr { |source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, features, numChroma = 12, ref = 440, normalize = 0, minFreq = 0, maxFreq = -1, windowSize = 1024, hopSize = -1, fftSize = -1, padding = 1, trig = 1, blocking = 0|
*kr { |source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, features, numChroma = 12, ref = 440, minFreq = 0, maxFreq = -1, normalize = 0, windowSize = 1024, hopSize = -1, fftSize = -1, padding = 1, trig = 1, blocking = 0|
var maxFFTSize = if (fftSize == -1) {windowSize.nextPowerOfTwo} {fftSize};
@ -12,7 +12,7 @@ FluidBufChroma : FluidBufProcessor {
^FluidProxyUgen.kr(\FluidBufChromaTrigger,-1, source, startFrame, numFrames, startChan, numChans, features, padding, numChroma, ref, normalize, minFreq, maxFreq, numChroma, windowSize, hopSize, fftSize, maxFFTSize, trig, blocking);
}
*process { |server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, features, numChroma = 12, ref = 440, normalize = 0, minFreq = 0, maxFreq = -1, windowSize = 1024, hopSize = -1, fftSize = -1, padding = 1, freeWhenDone = true, action|
*process { |server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, features, numChroma = 12, ref = 440, minFreq = 0, maxFreq = -1, normalize = 0, windowSize = 1024, hopSize = -1, fftSize = -1, padding = 1, freeWhenDone = true, action|
var maxFFTSize = if (fftSize == -1) {windowSize.nextPowerOfTwo} {fftSize};
@ -29,7 +29,7 @@ FluidBufChroma : FluidBufProcessor {
);
}
*processBlocking { |server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, features, numChroma = 12, ref = 440, normalize = 0, minFreq = 0, maxFreq = -1, windowSize = 1024, hopSize = -1, fftSize = -1, padding = 1, freeWhenDone = true, action|
*processBlocking { |server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, features, numChroma = 12, ref = 440, minFreq = 0, maxFreq = -1, normalize = 0, windowSize = 1024, hopSize = -1, fftSize = -1, padding = 1, freeWhenDone = true, action|
var maxFFTSize = if (fftSize == -1) {windowSize.nextPowerOfTwo} {fftSize};

@ -1,19 +1,20 @@
FluidChroma : FluidRTMultiOutUGen {
*kr { arg in = 0, numChroma = 12, ref = 440, normalize = 0, minFreq = 0, maxFreq = -1, maxNumChroma = 120, windowSize = 1024, hopSize = -1, fftSize = -1, maxFFTSize = 16384;
*kr { arg in = 0, numChroma = 12, ref = 440, minFreq = 0, maxFreq = -1, normalize = 0, windowSize = 1024, hopSize = -1, fftSize = -1, maxFFTSize = 16384, maxNumChroma = 120;
^this.multiNew('control', in.asAudioRateInput(this), numChroma, ref, normalize, minFreq, maxFreq, maxNumChroma, windowSize, hopSize, fftSize, maxFFTSize);
}
init {arg ...theInputs;
inputs = theInputs;
^this.initOutputs(inputs.at(6),rate);
^this.initOutputs(inputs.at(6),rate); //this instantiate the number of output from the maxNumCoeffs in the multiNew order
}
checkInputs {
if(inputs.at(6).rate != 'scalar') {
// the checks of rates here are in the order of the kr method definition
if(inputs.at(10).rate != 'scalar') {
^(": maxNumChroma cannot be modulated.");
};
if(inputs.at(10).rate != 'scalar') {
if(inputs.at(9).rate != 'scalar') {
^(": maxFFTSize cannot be modulated.");
};^this.checkValidInputs;
}

@ -1,20 +1,23 @@
FluidMFCC : FluidRTMultiOutUGen {
*kr { arg in = 0, numCoeffs = 13, numBands = 40, minFreq = 20, maxFreq = 20000, maxNumCoeffs = 40, windowSize = 1024, hopSize = -1, fftSize = -1, maxFFTSize = 16384;
*kr { arg in = 0, numCoeffs = 13, numBands = 40, minFreq = 20, maxFreq = 20000, windowSize = 1024, hopSize = -1, fftSize = -1, maxFFTSize = 16384, maxNumCoeffs = 40;
^this.multiNew('control', in.asAudioRateInput(this), numCoeffs, numBands, minFreq, maxFreq, maxNumCoeffs, windowSize, hopSize, fftSize, maxFFTSize);
}
init {arg ...theInputs;
inputs = theInputs;
^this.initOutputs(inputs.at(5),rate);
// inputs.at(5).rate.postln;
^this.initOutputs(inputs.at(5),rate);//this instantiate the number of output from the maxNumCoeffs in the multiNew order
}
checkInputs {
if(inputs.at(5).rate != 'scalar') {
// inputs.at(9).rate.postln;
// the checks of rates here are in the order of the kr method definition
if(inputs.at(9).rate != 'scalar') {
^(": maxNumCoeffs cannot be modulated.");
};
if(inputs.at(9).rate != 'scalar') {
if(inputs.at(8).rate != 'scalar') {
^(": maxFFTSize cannot be modulated.");
};^this.checkValidInputs;
}

@ -1,19 +1,20 @@
FluidMelBands : FluidRTMultiOutUGen {
*kr { arg in = 0, numBands = 40, minFreq = 20, maxFreq = 20000, maxNumBands = 120, normalize = 1, scale = 0, windowSize = 1024, hopSize = -1, fftSize = -1, maxFFTSize = 16384;
*kr { arg in = 0, numBands = 40, minFreq = 20, maxFreq = 20000, normalize = 1, scale = 0, windowSize = 1024, hopSize = -1, fftSize = -1, maxFFTSize = 16384, maxNumBands = 120;
^this.multiNew('control', in.asAudioRateInput(this), numBands, minFreq, maxFreq, maxNumBands, normalize, scale, windowSize, hopSize, fftSize, maxFFTSize);
}
init {arg ...theInputs;
inputs = theInputs;
^this.initOutputs(inputs.at(4),rate);
^this.initOutputs(inputs.at(4),rate); //this instantiate the number of output from the maxNumCoeffs in the multiNew order
}
checkInputs {
if(inputs.at(4).rate != 'scalar') {
// the checks of rates here are in the order of the kr method definition
if(inputs.at(10).rate != 'scalar') {
^(": maxNumBands cannot be modulated.");
};
if(inputs.at(10).rate != 'scalar') {
if(inputs.at(9).rate != 'scalar') {
^(": maxFFTSize cannot be modulated.");
};^this.checkValidInputs;
}

@ -44,15 +44,15 @@ ARGUMENT:: numChroma
ARGUMENT:: ref
The frequency of reference in Hz for the tuning of the middle A (default: 440 Hz)
ARGUMENT:: normalize
This flag enables the scaling of the output. It is off (0) by default. (1) will normalise each frame to sum to 1. (2) normalises each frame relative to the loudest chroma bin being 1.
ARGUMENT:: minFreq
The lower frequency included in the analysis, in Hz.
ARGUMENT:: maxFreq
The highest frequency included in the analysis, in Hz.
ARGUMENT:: normalize
This flag enables the scaling of the output. It is off (0) by default. (1) will normalise each frame to sum to 1. (2) normalises each frame relative to the loudest chroma bin being 1.
ARGUMENT:: windowSize
The window size. As chroma computation 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

@ -24,17 +24,14 @@ ARGUMENT:: numChroma
ARGUMENT:: ref
The reference frequency in Hz for the tuning to middle A (default: 440 Hz)
ARGUMENT:: normalize
This flag enables the scaling of the output. It is off (0) by default. (1) will normalise each frame to sum to 1. (2) normalises each frame relative to the loudest chroma bin being 1.
ARGUMENT:: minFreq
The lower frequency included in the analysis, in Hz.
ARGUMENT:: maxFreq
The highest frequency included in the analysis, in Hz.
ARGUMENT:: maxNumChroma
The maximum number of chroma bins. This sets the number of channels of the output stream, and therefore cannot be modulated.
ARGUMENT:: normalize
This flag enables the scaling of the output. It is off (0) by default. (1) will normalise each frame to sum to 1. (2) normalises each frame relative to the loudest chroma bin being 1.
ARGUMENT:: windowSize
The window size. As chroma computation 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
@ -48,6 +45,9 @@ ARGUMENT:: fftSize
ARGUMENT:: maxFFTSize
How large can the FFT be, by allocating memory at instantiation time. This cannot be modulated.
ARGUMENT:: maxNumChroma
The maximum number of chroma bins. This sets the number of channels of the output stream, and therefore cannot be modulated.
RETURNS::
A KR signal of STRONG::maxNumChroma:: channels, giving the measure amplitudes for each chroma bin. The latency is windowSize.

@ -28,9 +28,6 @@ ARGUMENT:: minFreq
ARGUMENT:: maxFreq
The highest boundary of the highest band of the model, in Hz.
ARGUMENT:: maxNumCoeffs
The maximum number of cepstral coefficients that can be computed. This sets the number of channels of the output, and therefore cannot be modulated.
ARGUMENT:: windowSize
The window size. As MFCC computation 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
@ -43,6 +40,9 @@ ARGUMENT:: fftSize
ARGUMENT:: maxFFTSize
How large can the FFT be, by allocating memory at instantiation time. This cannot be modulated.
ARGUMENT:: maxNumCoeffs
The maximum number of cepstral coefficients that can be computed. This sets the number of channels of the output, and therefore cannot be modulated.
RETURNS::
A KR signal of STRONG::maxNumCoeffs:: channels. The latency is windowSize.
@ -102,7 +102,7 @@ c = Buffer.read(s,File.realpath(FluidMFCC.class.filenameSymbol).dirname.withTrai
(
x = {arg bands = 40, low = 20, high = 20000;
var source = PlayBuf.ar(1,c,loop:1);
Out.kr(b,FluidMFCC.kr(source, 13, bands, low, high, 13) / 10);
Out.kr(b,FluidMFCC.kr(source, 13, bands, low, high, maxNumCoeffs:13) / 10);
source.dup;
}.play;
)

@ -25,9 +25,6 @@ ARGUMENT:: minFreq
ARGUMENT:: maxFreq
The highest boundary of the highest band of the model, in Hz.
ARGUMENT:: maxNumBands
The maximum number of Mel bands that can be modelled. This sets the number of channels of the output, and therefore cannot be modulated.
ARGUMENT:: normalize
This flag enables the scaling of the output to preserve the energy of the window. It is on (1) by default.
@ -46,6 +43,9 @@ ARGUMENT:: fftSize
ARGUMENT:: maxFFTSize
How large can the FFT be, by allocating memory at instantiation time. This cannot be modulated.
ARGUMENT:: maxNumBands
The maximum number of Mel bands that can be modelled. This sets the number of channels of the output, and therefore cannot be modulated.
RETURNS::
A KR signal of STRONG::maxNumBands:: channels, giving the measure amplitudes for each band. The latency is windowSize.
@ -149,7 +149,6 @@ x = {
// set the dry playback volume
x.set(\dry, 0.5)
// create a cluster of sines tuned on each MelBand center frequency, as a sort of vocoder.
(
var lowMel = 1127.010498 * ((20/700) + 1).log;

Loading…
Cancel
Save