Is there a way to set the BPM of a tempo marker through an FMOD studio script?

Use case: I’m creating a script that streamlines a workflow of ours which basically imports a lot of information about an audio track following a template.

One outstanding thing I’ve been trying to do is to specify the event’s BPM, either by adding a new tempo marker or updating an existing one. As far as I know, there’s no way to do either, is that correct?


Here is a scripting example of creating a tempo marker:

/* -------------------------------------------
   FMOD Studio Script Example:
   Add Tempo Marker
 */{ name: "FMOD Examples\\Add Temo Marker",
    isEnabled: function() { var event = studio.window.browserCurrent(); return event && event.isOfExactType("Event"); },
    execute: function() {
        var event = studio.window.browserCurrent();
        var len = event.timeline.markers.length;
        var marker = event.timeline.markers[len] = studio.project.create("TempoMarker")
        marker.timeline = event.timeline;
        marker.markerTrack = event.markerTracks[0]
        marker.position = 1
        if (!marker.isValid)
            alert("Failed to create marker")

Hope this helps!

That’s awesome, thank you. Is there any way to set the tempo for that marker then?

Nevermind, it’s under marker.tempo:

marker.tempo = bpm;

1 Like

Thank you for sharing the solution.

If you have any more questions please do not hesitate to ask.