Hey guys! I am trying to find a way to have a big text label update in real time based on the global tempo of the project. Im not really a programmer, but I thought I would give it a try rather than just asking for help right away:
That works great, thanks! Only one small issue (which I dont know if it can be fixed), is when I use tap tempo with midi:
I get large decimal values. Is there a way to limit the text output to round to the nearest 0.1 (tenths place)? Seeing 123.6, 85.4, or 120.0 looks a lot cleaner than large values.
I looked through some of the documentation and found the Round() function (rounds a floating point number to nearest integer). Added that into your script, and it outputs a result with no decimals.
Here’s the full script with tap tempo included if anyone also wants it:
Var
Tapper : Widget
TempoLabel : Widget
intialbeats : double
// Sets intial BPM
Initialization
intialbeats = GetBPM()
SetWidgetLabel(TempoLabel,intialbeats)
end
//Changes TempoLabel when BPM changes
On TempoChanged (beats : double)
SetWidgetLabel(TempoLabel,Round(beats))
end
//tap tempo
On WidgetValueChanged(newValue : double) from Tapper
Tap()
End