Hello.
temposmoothness is not a parameter of a moving average. It is linked to the rate of correction in the inference of the tempo. The algorithm to infer the tempo follow the work of E. Large and M. Jones: The dynamics of attending: How people track time-varying events (Psychological review, 106(1):119, 1999).
Can you make more precise your statement “I would like to improve the performance”? What kind of problem do you encounter?
Notice that you can easily compute your own notion of tempo. However, by experience, the tempo computed by Antescofo is more robust and relevant than a lot of ad hoc solutions. Nevetheless, here is a possible approach if you want to implement your own notion of tempo. Using a whenever
it is possible compute something each time a musical event occurs (the precise computation is irrelevant, the algorithm here is just for the sake of the example):
$last_now := -1
$last_rnow := -1
$my_tempo := $RT_TEMPO
whenever ($PITCH)
{
if ($last_now > 0)
{
$tmp := 60 * ($RNOW - $last_rnow)/($NOW - $last_now)
$my_tempo := 0.6 * $tmp + 0.3 * [1#]:$my_tempo + 0.2 * $RT_TEMPO
}
$last_event := $NOW
$last_rnow := $RNOW
}
; ...
Group @tempo := $my_tempo
{
; ...
}
The variable $my_tempo
is an average between the “instantaneous tempo” corresponding to the duration elapsed between two events, its last value and the tempo computed by Antescofo. This tempo is then used to drive a group of action…
Again, the precise computation given here is just for the sake of the example. A moving average will suffer from latency in the tracking of the tempo. This naive example will not give anything useful in a variety of musical situation.
See section 6.4 Temporal Variables in the documentation for the computation of a tempo, following the approach by Large and Jones, of an arbitrary activity, using a variable. For instance, it offers mechanism to compute a tempo by looking only on a subset of musical event.