analyze
analyze(
@buffer ## llll (required)
@descriptors ## llll (required)
@winstartfromzero 0
@framesize 512
@hopsize 512
@numframes 'auto'
@overlap 1
@wintype 'hann'
@winnormalized 1
@envattack 10
@envrelease 100
@onsetdetectionmethod 'complex'
@peaksmaxnum 100
@peaksorderby 'complex'
@peaksmagthresh 0
@peaksmaxfreq 5000
@peaksminfreq 0
@summary 3
@summaryweight 1
@summarypositive 0
@ampunit 0
@antimeunit 1
@envtimeunit 0
@frequnit 0
@pitchunit 0
@timeunit 0
@yinmaxfreq 22050
@yinminfreq 20
@yintolerance 1
@frametime 0
@bufinterp 0
) -> llll
Applies a sequence of audio analysis operations to the input buffer, via audio descriptors. These descriptors are generated through functions (e.g., see flux
, dissonance
, spectrum
), which contain the parameters for that specific audio analysis.
The resulting buffer will be updated with the following keys:
analyze
info
analyze
is a mirror implementation of the same algorithm in the Essentia library.
For more details on the algorithm, please check the Essentia Algorithms reference.
Arguments
@buffer
[llll]: Buffer to analyze. (required)@descriptors
[llll]: List of audio descriptors. (required)@winstartfromzero
[int]: Center first window at@framesize / 2
instead of0
. (default:0
).0
: Off1
: On
@framesize
[int]: Analysis frame size or window size. (default:512
).@hopsize
[int]: Analysis hop size. (default:512
).@numframes
[int/symbol]: Number of analysis frames. (default:'auto'
).'auto'
: Infer from@framesize
and@hopsize
.>0
: Ignores@hopsize
.
@overlap
[int]: Overlap factor between analysis window size and hop size. (default:1
).@wintype
[int]: Window type (default:'hann'
).'rectangular'
'triangular'
'sine'
'hann'
'hamming'
'blackman'
'nuttall'
'blackmannuttall'
'blackmanharris'
'gaussian'
'sqrthann'
'sqrthamming'
@winnormalized
[int]: Normalize analysis windows to have an area of 1 and then scaled by a factor of 2. (default:1
).@envattack
[int/float]: Attack time for computing envelopes. (default:10
).@envrelease
[int]: Release time for computing envelopes. (default:100
).@onsetdetectionmethod
[symbol]: Onset detection method. (default:'complex'
).'hfc'
: High frequency content.'complex'
: The complex-domain spectral difference function.'complex_phase'
: The simplified complex-domain spectral difference function taking into account phase changes, weighted by magnitude.'flux'
: Spectral flux.'melflux'
: Similar to spectral flux, but using half-rectified energy changes in Mel-frequency bands.'rms'
: Difference function, measuring the half-rectified change of the RMS of the magnitude spectrum.
@peaksmaxnum
[int]: Maximum number of peaks for peaks analysis. (default:100
).@peaksorderby
[symbol]: Ordering method of the peaks in the peaks analysis. (default:'complex'
).'hfc'
: High frequency content.'complex'
: The complex-domain spectral difference function.'complex_phase'
: The simplified complex-domain spectral difference function taking into account phase changes, weighted by magnitude.'flux'
: Spectral flux.'melflux'
: Similar to spectral flux, but using half-rectified energy changes in Mel-frequency bands.'rms'
: Difference function, measuring the half-rectified change of the RMS of the magnitude spectrum.
@peaksmagthresh
[int/float]: Magnitude threshold for the peaks analysis. (default:0
).@peaksmaxfreq
[int/float]: Maximum frequency for the peaks analysis. (default:5000
).@peaksminfreq
[int/float]: Minimum frequency for the peaks analysis. (default:0
).@summary
[int]: Summarization mode, for global analyses that are computed on a frame-by-frame basis. (default:3
).0
: Use first frame.1
: Use last frame.2
: Use middle frame.3
: Average through frames.4
: Median through frames.5
: Mode through frames.
@summaryweight
[int]: Summarization weight, when@summary
is4
. (default:1
).0
: None.1
: Rms.2
: Loudness.
@summarypositive
[int]: Only summarize with positive values. (default:0
).0
: Off1
: On
@ampunit
[int]: Amplitude unit. (default:0
).0
: Linear1
: Decibels
@antimeunit
[int]: Analysis time unit. (default:1
).0
: Milliseconds1
: Samples2
: Duration ratio
@envtimeunit
[int]: Envelope time unit. (default:0
).0
: Milliseconds1
: Samples2
: Duration ratio3
: Milliseconds difference4
: Samples difference
@frequnit
[int]: Frequency unit. (default:0
).0
: Hertz1
: BPM2
: Midicents3
: MIDI
@pitchunit
[int]: Pitch unit. (default:0
).0
: Midicents1
: MIDI2
: Hertz3
: Ratio
@timeunit
[int]: Time unit. (default:0
).0
: Milliseconds1
: Samples2
: Duration ratio3
: Milliseconds difference4
: Samples difference
@yinmaxfreq
[int/float]: Maximum frequency for the YIN analysis. (default:22050
).@yinminfreq
[int/float]: Minimum frequency for the YIN analysis. (default:20
).@yintolerance
[int/float]: Tolerance for the YIN analysis. (default:1
).@frametime
[int]: Retrieve analysis window time positions as a separate feature. (default:0
).0
: Off1
: On
@bufinterp
[int]: Interpolation mode. (default:0
).0
: No interpolation1
: Lower neighbor2
: Linear
Output
Analyzed buffer [llll]
Usage
$buffer = importaudio('flute.wav');
## define one or more audio descriptors
$descriptors = pitchmelodia() larm();
## apply analysis
$buffer = $buffer.analyze($descriptors);
## extract results
$larm = $buffer.getkey('larm');
$pitchmelodia = $buffer.getkey('pitchmelodia')