Linking Tap Tempo with FX Speed (I've solved it!)

NOTE! This has not been tested in version 4.4 (Dylos) or above - but it should work, as long as you change the Onyx = GetElement(‘Onyx’) to Onyx = GetElement(‘Onyx - OSC’) inside the script.

If anyone is interested, this is a LUA-script (for ShowCockpit) that allows you to Tap a playback Button of choice in Onyx, and trigger the Beat function while simultaneously setting your FX Speed Playback Fader to the same BPM.

Instructions copied from the script file:

– 1 - Select all fixtures you want controlled by BPM
– 2 - Save their FX Speed @ 100% to a Main Playback Fader of choice
– (edit the PlaybackFader value in the Settings below to suit your needs)
– 3 - Create a Playback Button in Onyx that runs macro “External Macro 100”
– 4 - Create a Mapping here in ShowCockpit that executes this script from the Onyx button
– “ExternalMacro100” with these parameters:
– Pre-execute: bpm=1
– Post-execute: bpm=0
– 5 - Hit that Playback Button!

So I’ve just found this post and I have a couple of questions.
I’m running the newest version of Onyx (actually a beta version) and I cant seem to get the script to work properly.
Everything works fine except that it seems like it calculates the bpm wrong. When pressing my MIDI Button (which is mapped to execute the script and execute the playback button) Onyx show me the true BPM count while the variable called “avgBpm” shows something wrong. “avgBpm” is always set to something between 130 and 140. This in turn obs sets the fader value to something wrong.

I don’t understand LUA enough to know how you wrote the code so is there any chance you could look into that? Or is this a porblem caused by being on the newer ONYX Version/having delayed OSC Playback? Or am I doing something wrong entirely?