# Get MA2 Speed Master BPM value

In some cases, it might be useful to get the BPM value of a Speed Master from an MA2 desk. One common use-case is to use the MA2 Speed Master as the global master for the remaining systems.

While there is no dedicated way to retrieve a BPM value from a Speed Master, you can retrieve the running "cue" name of an executor, which, for a Speed Master, is essentially the current BPM value.&#x20;

Here's an example ShowCockpit LUA script:

```lua
-- Get 'GrandMA2' element
GrandMA2 = GetElement('GrandMA2')

-- Returns the name of the current cue
-- (in fact for speedmasters it shows the BPM value)
-- For example: "60.0 BPM"
v = GrandMA2.GetExecutorCurrentCue(1)

-- Remove the " BPM" part of the name
v = string.gsub(v, " BPM", "")

-- Convert to Number
v = tonumber(v)

-- Variable v contains the speedmaster BPM value as a number
print(v)
```

Because the `GetExecutorCurrentCue` function returns a string containing the units (for example, `"60.0 BPM"`), we need to remove that text part and then convert the string to a number.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://academy.showcockpit.com/showcockpit-for-windows/tutorials/lua-scripts/get-ma2-speed-master-bpm-value.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
