Milliseconds to Hz for LFO TempoSync Rate
-
How about converting milliseconds to Hz to extend the TempoSync Rate value in an LFO, like 8/1 or 4/1 or 2/1? I'm trying to find a way without modifying the source code.
Is 1 Hz equal to 1000 ms?
-
@JulesV
Yes, 1Hz means 1 cycle per second. -
@Oli-Ullmann said in Milliseconds to Hz for LFO TempoSync Rate:
@JulesV
Yes, 1Hz means 1 cycle per second.1 cycle doesn't mean 1 bar, right?
-
@JulesV
No, it just means that it happens once per second. With an LFO, for example, it is one cycle.
I just looked in the API and foundEngine.getMilliSecondsForTempo(int tempoIndex). That might help you.If you insert this into your script and press compile, you will see the milliseconds for the specified tempo index of the currently selected tempo:
Console.print(Engine.getMilliSecondsForTempo(5));Do this once, change the tempo of HISE, and then compile again. You will then see how the value changes.
Tempo index 5 is quarter notes.
If you want to know all the tempo indexes, load an LFO, switch it to tempo sync, and look at the values. Note: The index starts at 0.
This function might also be helpful:
Engine.getMilliSecondsForQuarterBeatsWithTempo(double quarterBeats, double bpm) -
@Oli-Ullmann Oh, that's great thank you.
I will try this, I hope when the DAW tempo changes, the values would be updated automatically.
-
@JulesV
I've never worked with it before. If it doesn't work right away, you could maybe use a broadcaster for it. But @David-Healey probably knows more about that! :-)If there are any problems, it definitely makes sense to compile HISE as a plug-in and then load the project directly into the DAW to try it out.