< Back to IRCAM Forum

temposmoothness documentation

Hi Nice People,

I would like to improve the performance I’m getting with AnteScofo, and have been wondering about tweaking some of the internal commands, such as temposmoothness. My guess is that it performs some kind of moving average tempo tracking, where lower values might imply lower sensitivity to tempo changes, however this is just a hunch. I have tried values ranging from 0.1 to 10.0 however I’m getting similar results.

I have already looked at the AnteScofo reference (Rev. April 8, 2015) and there are no details about this or any of the other variables (except the variable types on section 4.6 Internal Commands). Is there any other document that I could pay attention to?

Thanks in advance.

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.

@vigliensoni : There is an existential problem with temposmoothness command actually! It is simply not effectif as you’d imagine and that’s why I haven’t done much publicity about it!!

In case @giavitto’s detailed response does not satisfy your need, what are you looking for exactly and what would be your need? Are you intending to smooth out the tempo detection? Or would you rather disable tempo decoding on specific events?

Hi @acont, @giavitto ,

Thank you for following up on my question.

What I would like to control is the degree of sensitivity in the calculated musician’s real-time tempo. My hunch is that whilst a smoothed version of the calculated tempo might be good for pieces with more stable tempo, a more varying tempo estimation might be good for pieces with more irregular tempo. Also, according to Cambouropoulos et al. (2001), listeners “prefer beat sequences that are slightly smoother than the onset times of the corresponding musical notes”, and so I would like to give it a try.

As mentioned by Jean-Louis, I’ll check section 6.4 Temporal Variables in the Antescofo documentation to see if there is something out-of–the-box. I will also try to compute a moving average version of the tempo (past values only, though)

All the best

@vigliensoni: Have a look at the recent post “Synchronization Strategies Examples” by @echeveste. The answer to your inquiery is in the ‘@tempovar’ example.

In brief, what you want (following Cambouropoulos et al) is to decode tempo not on every event, but for example on every down beat depending on the nature of the music. Using that example, you’ll be able to define your own tempo decoding which (for example) will decode tempo every 4 beats. This will smooth out tempo (musically) and will evade local fluctuations (which in some music styles should not be considered).

Let us know if you have any questions.

Hi @acont, @echeveste,

@tempovar is exactly what I was trying to implement! Thank you very much for the tip and the nice work!

All the best for you, nice people.