linking values



  • I got a knob for selecting samplemaps, but I want to be able to select it from a combobox as well, and make the knob jump to the value of the selected samplemap, any ideas ?



  • @Jay In the callback of the knob, set the value of the combobox, and vice versa so they update each other



  • @Jay

    myKnob.setValue(myCombobox.getValue());
    myKnob.changed();
    


  • @Lindon in the setValue you can just write valuebecause you're already in the callback of the combobox
    And no need to change(), otherwise you will tigger the callbacks in loop. you don't want the action to be performed twice, just to update the knbo itself. So:

    myKnob.setValue(value);
    

    is enough, and same in the other callback



  • @ustk no theres no "loop" HISE is smart enough to not do that. - I think --.... now you've got me wondering...



  • @ustk it didn't work



  • @Jay This is what I got:

    const var PresetName1 = Content.getComponent("PresetName1");
    const var PresetNumberDisplay = Content.getComponent("PresetNumberDisplay");
    const var PresetNumberDisplay1 = Content.getComponent("PresetNumberDisplay1");

    const var cmbSampleMap1 = Content.getComponent("cmbSampleMap1");
    cmbSampleMap1.set("items", samplemaps.join("\n"));
    const var PresetName2 = Content.getComponent("PresetName2");

    inline function ondialKnbControl(component, value)
    {
    mainSampler.loadSampleMap(samplemaps[value]);
    PresetName1.set("text", samplemaps[value]);
    PresetNumberDisplay.set("text", PresetNumber[value]);
    PresetNumberDisplay1.set("text", PresetNumber[value]);
    };
    Content.getComponent("dialKnb").setControlCallback(ondialKnbControl);
    // ================================================ Preset Browser with Knob



  • @Jay

    HiseSnippet 887.3ocsV0taSCCE0oqFnAJZHwCf09UqXLRfM.IzDk0sgpfMpHvD+C453tZsD6nDmAEDOE7pwCBuAv0NoMsivznRze06GmqO95iuNCSULdVlJE4z5cSS3HmagClJ0S5OgJjnA6ibtM9HZllmRJbs2zDZVFOD43r1KMNbZ0DY+8ymuGMhJY7JWHzIJAi+ZQrPW4cXuWIhhNjFxemHdgr2t2.lR1WEoxA9rF1CkPYmQOkeL0jVCLx4ZGDJzpz.MUyyfb1SENMXh5Sxh7OQjIFEwMF9n.nPEtQ8mHhBGNaulgPNMGVsyWqXmeW7QhPwb+Ucf0sAHUHVrG3zXYJ0bIJ4+2nzgpnPSA9KzyYA50rfd2AGvREI5pHFtcS7.Ib3LlBs8EoUQtnF+vA2WAYH0aESOieXJXLGQmG64sIYGOutOqsaaWn4moImSgiZU7H0dpO6S1kLC9obM3NQIAiNaLOiMJv11UHiDRNYbtjoEJIQIekTMx2.OUE0gMC6lvJDky6118qscaMuNakw0mXBzwFlbOhe2mQdvCtmOYDmQyy3DVYtDQFA7Rgs5ljyfEw3vqvwVsc+lkP0SaKk1nqYwJIVeZTzHPl0YY9Z1UKrUNVo4uQ1oq6Wca49MWxECMdbswJKVDOs1vF4e5kAriLOdDOcVKaVhflXYQ20tZhNVQOYgDUxARg9MI7R6JYoeMxRTYSEDnMJYHjp1JOWuTdN6.EIBMpy4muH6Vn5x9c6gtXItcYIBhDg7TaAtN1dnbQvq2C89A6S0TyUkRRADMgmpEl9gy97yg4NEWbZg2mmclVkXYcoT.5YWQd+4pkc2dSWzHlBwvNXvPn4wYFb9tOz8Qta6tioYcw05R1f1J8cnRSM+YB7Ga0q1vvH3j.wWfpfw9aACM9yIDvbJUXdDUu7vKyT5x.f3ZooDlIAxLgd5hSw+Gln4U6DsZkNWQ5dG7PglMod91nF9Zzh+m4a46CswGLdLmoqHaS7geXUeL3efJuUkqExSOhpSEFcxw4wAvSjLNvDojGkYjLMLWOKr8L1lNS.WFZM9E7qLnuw1oLn+rffZikp9Hq3Fo4EnaX8.bRZe7sE7U.fMY9UQL1CTgwvCiejwLsh66iP0i4gq.lGsBX1dEvryJf4wq.lmrBXd5khw7MIuHWqhKtl.NFdfcjniyARJnxrJRzuAD8wjNI
    


  • @d-healey Thank you.

    That solved 1 case, but what if I want to make the knob jump when the preset is selected from combobox?



  • I'm sure you could work this out for yourself...

    HiseSnippet 911.3ocsV81aSiCF2oal6Z3JZHce.r3UchwVBrMNIDhdqa6TE2FUW3lP7Fv0wc0ZI1QINbTP7oiuP7M.drSRSZoq2TkVd2ye983e9W7yi8vTEimkoRQNse8zDNx42vASk5I8mPERzfiQN2CeFMSySIE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CK

    Screen Shot 2020-02-21 at 11.30.50 AM.png

    With a Link to website.



  • @Jay said in linking values:

    @d-healey You ROCK

    I just did what @Lindon and @ustk said 😛



  • @d-healey yeah but you did it - we just talked about it...:-)



  • @Lindon said in linking values:

    @ustk no theres no "loop" HISE is smart enough to not do that. - I think --.... now you've got me wondering...

    Sure there's a protection for that, but still, you don't need to trigger the callback that performs what has already been performed, you just want to change the value



  • @Jay This is what I want it to do, Thank you Guys for your help @d-healey @Lindon @ustk


Log in to reply
 

8
Online

622
Users

2.5k
Topics

20.3k
Posts