corrected typos and added bail in class definition for maxFFTSize modulatable

nix
Pierre Alexandre Tremblay 7 years ago
parent 80cce5d085
commit 156a86418c

@ -11,5 +11,16 @@ FluidHPSS : MultiOutUGen {
];
^channels
}
checkInputs { ^this.checkNInputs(1) }
checkInputs {
if(inputs.at(15).rate != 'scalar') {
^(": maxFFTSize cannot be modulated.");
};
if(inputs.at(16).rate != 'scalar') {
^(": maxHFlitSize cannot be modulated.");
};
if(inputs.at(17).rate != 'scalar') {
^(": maxPFiltSize cannot be modulated.");
};
^this.checkValidInputs;
}
}

@ -1,7 +1,7 @@
FluidNMFMatch : MultiOutUGen {
*kr { arg in = 0, dictBufNum, maxRank = 1, nIter = 10, winSize = 1024, hopSize = -1, fftSize = -1, maxFFTSize = 16384;
^this.multiNew('control', in, dictBufNum, maxRank, nIter, winSize, hopSize, fftSize, maxFFTSize);
^this.multiNew('control', in.asAudioRateInput(this), dictBufNum, maxRank, nIter, winSize, hopSize, fftSize, maxFFTSize);
}
init {arg ...theInputs;
@ -10,9 +10,9 @@ FluidNMFMatch : MultiOutUGen {
}
checkInputs {
if (inputs.at(0).rate != 'audio', {
^(" input 0 is not audio rate");
});
if(inputs.at(7).rate != 'scalar') {
^(": maxFFTSize cannot be modulated.");
};
^this.checkValidInputs;
}
}

@ -2,4 +2,10 @@ FluidOnsetSlice : UGen {
*ar { arg in = 0, function = 0, thresh = 0.5, debounce = 2, filtSize = 5, frameDelta = 0, winSize = 1024, hopSize = -1, fftSize = -1, maxFFTSize = 16384;
^this.multiNew('audio', in.asAudioRateInput(this), function, thresh, debounce, filtSize, winSize, hopSize, frameDelta, fftSize, maxFFTSize)
}
checkInputs {
if(inputs.at(9).rate != 'scalar') {
^(": maxFFTSize cannot be modulated.");
};
^this.checkValidInputs;
}
}

@ -2,4 +2,10 @@ FluidSTFTPass : UGen {
*ar { arg in = 0, winSize= 1024, hopSize= -1, fftSize= -1, maxFFTSize = 16384;
^this.multiNew('audio', in.asAudioRateInput(this), winSize, hopSize, fftSize, maxFFTSize)
}
checkInputs {
if(inputs.at(4).rate != 'scalar') {
^": maxFFTSize cannot be modulated.";
};
^this.checkValidInputs
}
}

@ -10,5 +10,10 @@ FluidSines : MultiOutUGen {
];
^channels
}
checkInputs { ^this.checkNInputs(1) }
checkInputs {
if(inputs.at(9).rate != 'scalar') {
^(": maxFFTSize cannot be modulated.");
};
^this.checkNInputs(1)
}
}

@ -1,7 +1,7 @@
FluidSpectralShape : MultiOutUGen {
*kr { arg in = 0, winSize = 1024, hopSize = -1, fftSize = -1, maxFFTSize = 16384;
^this.multiNew('control', in, winSize, hopSize, fftSize, maxFFTSize);
^this.multiNew('control', in.asAudioRateInput(this), winSize, hopSize, fftSize, maxFFTSize);
}
init {arg ...theInputs;
@ -10,9 +10,9 @@ FluidSpectralShape : MultiOutUGen {
}
checkInputs {
if (inputs.at(0).rate != 'audio', {
^(" input 0 is not audio rate");
});
if(inputs.at(4).rate != 'scalar') {
^(": maxFFTSize cannot be modulated.");
};
^this.checkValidInputs;
}
}

@ -76,13 +76,13 @@ 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.
ARGUMENT:: maxFFTSize
How large can the FFT be, by allocating memory at instantiation time. This is not modulatable.
How large can the FFT be, by allocating memory at instantiation time. This cannot be modulated.
ARGUMENT::maxHFlitSize
How large can the harmonic filter be modulated to (hFiltSize), by allocating memory at instantiation time. This is not modulatable.
How large can the harmonic filter be modulated to (hFiltSize), by allocating memory at instantiation time. This cannot be modulated.
ARGUMENT:: maxPFiltSize
How large can the percussive filter be modulated to (pFiltSize), by allocating memory at instantiation time. This is not modulatable.
How large can the percussive filter be modulated to (pFiltSize), by allocating memory at instantiation time. This cannot be modulated.
RETURNS::
@ -102,7 +102,7 @@ CODE::
b = Buffer.read(s,File.realpath(FluidHPSS.class.filenameSymbol).dirname.withTrailingSlash ++ "../AudioFiles/Tremblay-AaS-SynthTwoVoices-M.wav");
// run with basic parameters (left is harmonic, right is percussive)
{FluidHPSS.ar(PlayBuf.ar(1,b.bufnum,loop:1))}.play
{FluidHPSS.ar(PlayBuf.ar(1,b.bufnum,loop:1),maxFFTSize:LFNoise0.kr())}.play
// run in mode 1
{FluidHPSS.ar(PlayBuf.ar(1,b.bufnum,loop:1),17,51,1,0.05,40,0.1,-40)}.play

@ -29,7 +29,7 @@ ARGUMENT:: dictBufNum
The server index of the buffer containing the different dictionaries that the input signal will be matched against. Dictionaries must be STRONG::(fft size / 2) + 1:: frames. If the buffer has more than STRONG::maxRank:: channels, the excess will be ignored.
ARGUMENT::maxRank
The maximum number of elements the NMF algorithm will try to divide the spectrogram of the source in. This dictates the number of output channelsfor the ugen. This is not modulatable.
The maximum number of elements the NMF algorithm will try to divide the spectrogram of the source in. This dictates the number of output channelsfor the ugen. This cannot be modulated.
ARGUMENT:: nIter
The NMF process is iterative, trying to converge to the smallest error in its factorisation. The number of iterations will decide how many times it tries to adjust its estimates. Higher numbers here will be more CPU intensive, lower numbers will be more unpredictable in quality.
@ -44,7 +44,7 @@ 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 default to windowSize.
ARGUMENT:: maxFFTSize
How large can the FFT be, by allocating memory at instantiation time. This is not modulatable.
How large can the FFT be, by allocating memory at instantiation time. This cannot be modulated.
RETURNS::
A multichannel kr output, giving for each dictionary component the activation amount.

@ -53,7 +53,7 @@ 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.
ARGUMENT:: maxFFTSize
How large can the FFT be, by allocating memory at instantiation time. This is not modulatable.
How large can the FFT be, by allocating memory at instantiation time. This cannot be modulated.
RETURNS::
An audio stream with impulses at detected transients. The latency between the input and the output is winSize.

@ -26,7 +26,7 @@ ARGUMENT:: fftSize
How large will the FFT be, zero-padding the buffer to the right size, which should be bigger than the windowSize argument, bigger than 4 samples, and should be a power of 2. This is a way to oversample the FFT for extra precision. The -1 default value will default to windowSize.
ARGUMENT:: maxFFTSize
How large can the FFT be, by allocating memory at instantiation time. This is not modulatable.
How large can the FFT be, by allocating memory at instantiation time. This cannot be modulated.
RETURNS::

@ -46,7 +46,7 @@ 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.
ARGUMENT:: maxFFTSize
How large can the FFT be, by allocating memory at instantiation time. This is not modulatable.
How large can the FFT be, by allocating memory at instantiation time. This cannot be modulated.
RETURNS::
An array of two audio streams: [0] is the harmonic part extracted, [1] is the rest. The latency between the input and the output is (( hopSize * minTrackLen) + winSize) samples.

@ -10,13 +10,13 @@ The descriptors are:
LIST::
##the four first statistical moments (https://en.wikipedia.org/wiki/Moment_(mathematics)), more commonly known as:
LIST::
## the spectral centroid (1) in spectral bin. This is the point that splits the spectrum in 2 halves of equal energy. It is the weighted average.
## the spectral centroid (1) in spectral bin. This is the point that splits the spectrum in 2 halves of equal energy. It is the weighted average (histogram).
## the spectral spread (2) in spectral bin. This is the standard deviation of the statistical curve, or the average of the distance to the centroid.
## the normalised skewness (3) as ratio. This indicates how tilted is the statistical curve. If it is below the bin representing half-Nyquist, it is positive.
## the normalised skewness (3) as ratio. This indicates how tilted is the statistical curve in relation to the middle of the spectral frame, i.e. the half-Nyquist. If it is below the bin representing half-Nyquist, it is positive.
## the normalised kurtosis (4) as ratio. This indicates how focused is the statistical curve. If it is peaky, it is high.
::
## the rolloff (5) in bin number. This indicates the bin under which 95% of the energy is included.
## the flatness (6) in dB. This is the ratio of geometric mean to the arithmetic mean. It yields a measure on how noisy a signal is.
## the flatness (6) in dB. This is the ratio of geometric mean to the arithmetic mean of amplitude. It yields a very approfimate measure on how noisy a signal is.
## the crest (7) in dB. This is the ratio of the loudest amplitude over the RMS of the whole frame. A high number is an indication of a loud peak emerging.
The drawings in Peeters 2003 (http://recherche.ircam.fr/anasyn/peeters/ARTICLES/Peeters_2003_cuidadoaudiofeatures.pdf) are useful, as are the commented examples below. For the mathematically-inclined reader, the tutorials and code offered here (https://www.audiocontentanalysis.org/) are interesting to further the understanding.
@ -42,7 +42,7 @@ 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.
ARGUMENT:: maxFFTSize
How large can the FFT be, by allocating memory at instantiation time. This is not modulatable.
How large can the FFT be, by allocating memory at instantiation time. This cannot be modulated.
RETURNS::
A control stream with the seven spectral shape descriptors. The latency is winSize.

Loading…
Cancel
Save