logattack
logattack() -> llll
Generates audio descriptor to compute the log (base 10) of the attack time of buffer's envelope. The attack time is defined as the time duration from when the sound becomes perceptually audible to when it reaches its maximum intensity. By default, the start of the attack is estimated as the point where the signal envelope reaches 20% of its maximum value in order to account for possible noise presence. Also by default, the end of the attack is estimated as as the point where the signal envelope has reached 90% of its maximum value, in order to account for the possibility that the max value occurres after the log-attack, as in trumpet sounds. See analyze
.
The resulting buffer will be updated with the following keys:
logattack
logattack_start
logattack_stop
logattack
is a mirror implementation of the same algorithm in the Essentia library.
For more details on the algorithm, please check the Essentia Algorithms reference.
Output
logattack descriptor [llll]
Usage
logattack
is meant to be used with the analyze
function:
$buffer = importaudio('singing.wav'); ## input buffer
$descr = logattack(); ## generate logattack audio descriptor
$buffer.inspect('before analysis');
$buffer = $buffer.analyze($descr); ## apply analysis
$buffer.inspect('after analysis')