Simple button conundrum...



  • @SteveRiggs Try this:

    HiseSnippet 2505.3oc6ZssbaabFFTRarIrkicrZa5za1pocFJKGERJYY43jQv5.cTiNvQPV4fqGGHfkj6XvcY..0A63Y7k8tz65aQm7H3GgLsu.9QvuAo+6B.hEPjRPxxxd5DdgFsG928e+9OuKp6wsI99bOsBE25fNDsBWFYd.Kn0hsrnLsUVRzQ8VV9DO71laosvAcr78INZEJL78EynPwQzj+d87KX4ZwrIIcoosMmZSVk1lFjzaciuh55VyxgrEssxrmwXEaNaQtKuKvMCiJq0wx9IVMIqaIl1PHsBevxNz.tmYfU.wWqvHKvcNvrEeOV372l5S2wkHZTQyDVnvtqwccDbrnWsEaQccpGep80zJfpmfACGhAigVi5P60eBVbU4.3DJTwiBCcTrWkim8J2O1qfB6MRH6cMjosGsSPxHBd6RnUXADuFVfHPksBmq1PsGAsHGlAKXp1VOgTyCZzihRyVt7Mw2pb4It6n5ip+oep+dz.6V3NVLhqOFZzBuS2f.NyeTcPL4Gf20xCu9CV6wK7fs1Zi0MweAt5cUGKZ5P+O7QoFHZMi5WrYIisZsMZKFRpCNUSRvxMZPrCJMtbfwmH0BcnIuF2oqqEHBRle1U2+.l8.VewPGdGxRP58nGMip2f6gKQgoV9tXJ9yUwFniImbhQ0e1n5X3WDx7P5ifYGKSfkdQd6NbFznz3KHmx33IgkbxJSH1AAkgP2QQXcwLNDcI63T9hoyB73tKZ45tCXhUhyB2tn9ED8bwIhxboLBtQWlc.kyvYlWI63s8l.X41kjbBoMJE2inYTuhetbaKWL0Ye3DDwUSQYNj82nQx5Ey1IjkEbCAhobIrlAshg23Iqrco.so7AiwXlWxBeAlFuWw+hDpBbJ1JpzeFlLnJkYZs8SMI4bRVqj+64x+64QfpPeOf2roKAuCIXOBggcavwsiUq7AXFawbv7FMRY2guwMVeisve8Fa9Uqr98me9abCcccEYy57.xFrRSn+L8h5vdlcnFM56XQ3gKwquCK7Q6cTDVh0s8NDuXUf3IBNqR6MDkOug1gZ0JSjyVgQ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Egt7Ek8.malzucQzZh13de0MHT4oJKt0M5issEv8mTQSq+zT8TPyzmBZl4TPysNEzL6oflaeJnYtijFQvn60ERGNzTD5n9xgIBWnWL7BCq8+fdc9yq
    


  • @ulrik Brilliant mate. Thank you. Thats a much tidier way to do it as well. I assume the callbacks for the buttons were getting confused with the way I had it before?



  • @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.

    Screen Shot 2020-07-28 at 18.44.24.png Screen Shot 2020-07-28 at 18.44.20.png Screen Shot 2020-07-28 at 18.44.14.png



  • @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 ?
    MS.gif



  • @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 using Engine.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…


Log in to reply
 

5
Online

692
Users

2.8k
Topics

23.5k
Posts