< Back to IRCAM Forum

Event information in actions

Hi I have (i think) a noob question:

Is there a short way to send the event information in an action message? So I want the pitch and the duration of the note send to max when that note is played.
Also is there a way to convert the duration in beats to duration to ms according to the live-tempo?

Thanks!

Hi,

You may look at the Antescofo System Variables (cf. the support docs made by Jean Louis Giavitto)

The $Pitch variable gives midi pitches. If you want frequencies you need to convert them :

@FUN_DEF midi2hz($MIDI) {  

    440.0 * @exp(($MIDI - 69) * @log(2) / 12)  
}

The $DURATION.

And the $RT_TEMPO is for real-time tempo inferred by the listening machine (the simple expression you’re looking for is then

`@FUN_DEF beat2msec($BEAT) {  

1000*$BEAT*60.0/$RT_TEMPO

}`

Bye

N.

Thanks Nadir! That is exactly what I needed :slight_smile: