So to recap and to consolidate information, sampleRate is not reported to a MIDI-FX plugin. I solved this by allowing text input into an already existing label originally designed to get numerical input only. “44.1k” and “48k” make the plugin adapt to different sample rates.
I also implemented AudioPlayhead to optionally allow automatic sync to the host tempo.
Then I tried to implement parameter recall with get- / setSateInformation, but since the plugin was pretty much finished by then, that’s too much of a change apparently, it pretty much exploded in my face with small clouds of smoke going up everywhere.
So I took one step back and now consider it done. No point in rewriting it from the ground up just to get back the window the size it was. For the first plugin I ever did it’s pretty functional and does what it should and then some.
This plugin, aptly named Tempomat, captures a live drummer’s (MIDI) snare hits and calculates and displays the tempo from that. That’s the upper number.
The lower number is the target tempo, this can be synced to the host, set manually or via a MIDI CC message and thus can be saved per song or section. The target tempo serves several purposes:
- it’s a direct visual guide in comparison to the actual tempo
- it sets up a corridor in which precise snare hits are rewarded with the number in green
- it sets up several other corridors in which half time, double time, dotted eights etc are detected correctly and all displayed as the source tempo, in blue
Also, the lower label accepts text input of sample rates and “auto” to re-engage automatic sync to the host tempo.
Thanks everyone for helping me get there.