Happy Holidays! I have been struggling to get the hosts tempo over time. My goal is to get the tempo and use it as a variable anywhere in my script. The issue is once the function is ran it gets the tempo only at that exact moment. If an end-user changes the tempo later the script isn’t aware of the tempo change. I want to be able to continually tell the script to get the tempo. So far I’ve tried several things but none have worked. Anyone knows how I can enhance the following scipt?
T1 = getTempo()
I’ve tried scripts such as the one below but nothing has worked.
defineParameter("TempoDetect", nil, 0, 0, 10, 1) --Fast loop for sun gradient function calcModulation() local freq = 100 local rate = getSamplingRate() / 32 local TempoDetect = TempoDetect + freq / rate if TempoDetect >= 10 then TempoDetect = TempoDetect - 10 return getTempo(T1) end end
Anyone know what I am doing incorrectly? No matter what I have tried I either end up with nil value for T1 or I end up only being able to get the tempo once.