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

**URL:** <https://qa.fmod.com/t/is-there-a-way-to-set-the-bpm-of-a-tempo-marker-through-an-fmod-studio-script/20796>\
**Category:** FMOD Studio\
**Created:** [October 23, 2023, 1:45pm UTC](https://qa.fmod.com/t/is-there-a-way-to-set-the-bpm-of-a-tempo-marker-through-an-fmod-studio-script/20796 "2023-10-23T13:45:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![powens86](https://avatars.discourse-cdn.com/v4/letter/p/71e660/32.png) [@powens86](https://qa.fmod.com/u/powens86)\
**Post date:** [October 23, 2023, 1:45pm UTC](https://qa.fmod.com/t/is-there-a-way-to-set-the-bpm-of-a-tempo-marker-through-an-fmod-studio-script/20796/1 "2023-10-23T13:45:05Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)\
**Post date:** [October 23, 2023, 11:15pm UTC](https://qa.fmod.com/t/is-there-a-way-to-set-the-bpm-of-a-tempo-marker-through-an-fmod-studio-script/20796/2 "2023-10-23T23:15:02Z")

</div>

Hi,

Here is a scripting example of creating a tempo marker:

```auto
/* -------------------------------------------
   FMOD Studio Script Example:
   Add Tempo Marker
   -------------------------------------------
 */

studio.menu.addMenuItem({ 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!

---

<div class="post-metadata">

**Author:** ![powens86](https://avatars.discourse-cdn.com/v4/letter/p/71e660/32.png) [@powens86](https://qa.fmod.com/u/powens86)\
**Post date:** [October 23, 2023, 11:27pm UTC](https://qa.fmod.com/t/is-there-a-way-to-set-the-bpm-of-a-tempo-marker-through-an-fmod-studio-script/20796/3 "2023-10-23T23:27:22Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![powens86](https://avatars.discourse-cdn.com/v4/letter/p/71e660/32.png) [@powens86](https://qa.fmod.com/u/powens86)\
**Post date:** [October 24, 2023, 1:06am UTC](https://qa.fmod.com/t/is-there-a-way-to-set-the-bpm-of-a-tempo-marker-through-an-fmod-studio-script/20796/4 "2023-10-24T01:06:16Z")

</div>

Nevermind, it’s under marker.tempo:

` marker.tempo = bpm;`

---

<div class="post-metadata">

**Author:** ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)\
**Post date:** [October 24, 2023, 1:46am UTC](https://qa.fmod.com/t/is-there-a-way-to-set-the-bpm-of-a-tempo-marker-through-an-fmod-studio-script/20796/5 "2023-10-24T01:46:18Z")

</div>

Thank you for sharing the solution.

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