onsets
onsets(
@alpha 0.1
@delay 5
@framerate 86.1328
@silencethreshold 0.02
) -> llll
Generates an audio descriptor to compute the onset positions in a buffer.
The resulting buffer will be updated with the following keys:
onsets
info
onsets
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
@alpha
[float]: Proportion of the mean included to reject smaller peaks—filters very short onsets. (default:0.1
).@delay
[int]: Number of frames used to compute the threshold—size of short-onset filter. (default:5
).@framerate
[float]: Frames per second. (default:86.1328
).@silencethreshold
[float]: Threshold for silence. (default:0.02
).
Output
Onsets descriptor [llll]
Usage
onsets
is meant to be used with the analyze
function:
$buffer = importaudio('singing.wav'); ## input buffer
$descr = onsets(); ## generate onsets audio descriptor
$buffer.view('before analysis');
$buffer = $buffer.analyze($descr); ## apply analysis
$buffer.view('after analysis')