Simple button conundrum...
-
@Lunacy-Audio
Cheers dude. That does work for switching the modes, but the only thing with this way around is that the values don't change on the GUI. So even when you are in ms mode, i't still shows 1/16 (or whichever speed is selected) reflecting which option is selected in the component specific properties.
-
@SteveRiggs For sure. There are a few solutions to this. You can hide and show two different knobs the way you are currently, but a much cleaner way is to actually change the mode of the knob in the script. Here's a really simple example:
HiseSnippet 968.3ocsV0saaaCElxwbaVctnEXO.D9JGfrV4s1tgELTu3jL30kDiorhcWACEULQnHEjn5pWQ.1k6psa260dQ1Sv1NjT1RI0oM0.iWX3yOeG9wCOmC0rBMiWVpKPA8NcQNGE7w33EJy7IyoBEZ59nf6hOhVZ3EDup8VjSKK4Inffs9VqhfdcQt0e+z8nRphwaTgPOWKX7uWjILMZmM9YBo7PZB+TQVKuez3oLsZhVpq.9rENBkSYWPOmeL05VGLJ3CNHQXzEwFpgWB9rmNYQ7b8Oq79+bQo3LI2JLBECAxqFMYtPlLa4YsDgB5Nq4juk+j+I3iDIhU5ax.2yYfzfncNHnyUoT2qPoQ2DkNTKSrA3FnWPK500Su6iiYEhbSiEK2tCdpBtbRoPZuMs79h5v5fmnAOTlGjQufeXAHrBwvmDEsC4wQQaua+v9gBkTn3jzJEyHzJhVsWkwnUirQnPKGxzY4ZEDqcHujJq3a2O708CIvRpYTIIuPmWtqWi+WQJYn2URsm10CeHwvgPQJWnXMpcvIecaOsqAY5D9fuhL3TKFn5jMXGxJOtbW2euzigKK4WamxJeW6PyF.ki2br6G1aYprjauFx4EFAuDxoYeW7IGObvyT5yFAAvsM1b5kt75RTmyMSVlAGNnN2NXaazpyvSnR4YPM+vqm5sAq08xwZC+D0vsCecXuvKCIW2TZ5ZsUGLIuXslsG+h2Fvgppry3EKu8W5HThd0df6b65AX97RKG0poJg4jbdsbSWh0l+TuzZDZ0gssplyXasti1ZbqQ0a1Dhpu2f1wN0tCtZbMi2stYzeKgD.G6gquxPtrS6gfnaBdrTjvKbv+Prq5YMf+wo6SMT6PgZB0T5A51m+RXBqeDQO797xKL5bGiqqzfamaAmeEJ.G7mvtsv9me2S5UQn26j1uZEkIrwKVI7qoisMWvfaraVeFswwe6uFCuqjGK9Ed6GQxDIIR9LcovV7Ys7O+Krd5eLtrJMUXIJFZpgmQdiQjvfZcRkjZt5za6yT0FrQr8XR6nPErSKZyf2iQ5Qqcj9n0UMcKo68wyDF170y2Nqgu1xy+m4a8Cj8wGjlxYlFx1Ee3OsouF9dPkePWYDpyOhZJb2+GWkECei.iCLQofY91Z1N1RVubjU1lYh4pDmfsBp13HqbPswQKMBUlrB8KX9FU6SvejSCvIk6qO5AeFDHSV0ghwQOHBAUqhWvX1TwmBbe8X9rM.ymuAXdzFf4wa.lmrAX9hM.yW9VwX+nruoxny7sIfhYG3lTFDbfhBUYtJRz+AHoajaG
-
@Lunacy-Audio
Ahhh I see! Thanks mate. Thats been bugging me for ages! This will save some time now. Much appreciated!
-
Happy to help
-
There is some strange behaviour with this configuration.
When you set it to a sync value , then to ms you get a certain value . If you go back to sync and then to MS you get another value ? Same with the other way around ?
-
@lalalandsynth It's normal behaviour, because you cannot directly transalte ms (0-2000+) to sync (0-18) and vice versa.
1/4 (5th sync position) => 5ms
250ms => 1/64T (250 is greater than 18...)
You need to re-calculate the approaching value usingEngine.getMilliSecondsForQuarterBeatsWithTempo()
and consort...That is said, what is the difference with
Engine.getMilliSecondsForQuarterBeats()
?
The API says "current tempo"... So it is the host tempo I imagine? -
Yes, but its strange that it goes from a 1/4 to 8 ms , then you do the same thing again and it goes to 5 ms , that is very unexpected behaviour. If you look at the start of the example I dont change anything , just hit the button again and get different results.
-
@lalalandsynth You're right I noticed that once too… it is maybe because of some rounding somewhere in the process… dunno…
-
@ustk How to apply this on a label instead? So that when tempoSync is activated the label changes from ms to n/n? Thanks
-
Update, tried again using
Engine.getQuarterBeatsForMilliSeconds(double milliSeconds)
, the numbers get to 0.00nnnn. I'm sure it's possible to get the tempo format value to the label just like in the knob. Just need to know how. -
@Sawer What about
Engine.getTempoName()
? -
@d-healey
Looks like this function doesn't work anymore. Tried also assigning it to a variable but nothing. Not in the autocomplete list as well. -
@Sawer You're not using the latest version of HISE?
-
@d-healey I am. Is that function working at your end?
-
I am. Is that function working at your end?
Yes, on the latest develop branch.
It was added back in February.
-
@d-healey Ok, will upgrade today.
-
@d-healey Update and working! Thanks