Slimming down a script(for best efficiency)



  • @d-healey said in Slimming down a script(for best efficiency):

    You don't need valGain or valPan, you can just refer to these attributes directly with SimpleGain_SMP0.Gain and SimpleGain_SMP0.Balance.

    Doing this: the Slider is not responding correctly..

    inline function onSMP0Control(component, value)
    {
            SMP_INDEX = 0;//Sampler
            
            //Get Volume value
            //valGain = (SimpleGain_SMP0.getAttribute(0));
            SimpleGain_SMP0.Gain;
            Content.getComponent("SMP_Gain").setValue(SMP0.Gain);
            //Get Pan value
            //valPan = (SimpleGain_SMP0.getAttribute(3));
            SimpleGain_SMP0.Balance;
            Content.getComponent("SMP_Pan").setValue(SMP0.Balance);
               
    };
    Content.getComponent("SMP0").setControlCallback(onSMP0Control);
    
    //SMP 1
    inline function onSMP1Control(component, value)
    {
            SMP_INDEX = 1;//Sampler
            
            //Get Volume value
            SimpleGain_SMP1.Gain;
            Content.getComponent("SMP_Gain").setValue(SMP1.Gain);
            //Get Pan value
            SimpleGain_SMP1.Balance;
            Content.getComponent("SMP_Pan").setValue(SMP1.Balance);
          
    };
    Content.getComponent("SMP1").setControlCallback(onSMP1Control);
    


  • @ustk said in Slimming down a script(for best efficiency):

    @ten7kur This is how I would approach it:

    HiseSnippet 1958.3oc6Z0saSbDEd23rzXWREk1K5MUZZTuvVklZyesRoHVxOPSIFrrSApPTX7tyZOhcmwZ2woIEEoJ0mBtiGgdauiGo9FzdlY206rK1NlPfBT6bimeNy467cNyLmyD2Jj6Phh3gFlk28fADCySa04.ln+F8wTlw1aZX9AVM29da01X8CFfihHtFllktgbPyxKZn972WccrOl4Px5xv3NbpCYGZ.Uj0aK6aR88uN1krKMPa1WzdaGNaCtOeH.jRV0MFfcdLtG4VX4zVvxv7Ta4RE7vNBrfDYXt35b2C5zm+qr34eGZDsqOQ1ngQGXgh695beWIhk8ZrQepuaqTCNxvvzpUl4WJ17+TqlTW5n9yngynF.kIgNeXtvzfWCc3Ue1gmoF7VLFderUGmP5.Q1HRr8gVayDjPOL3BzgU7bMVX2kr1f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D
    

    It might be subtle to grasp for the beginner, but it allows you to add as many modules/samplers as you need with almost no maintenance cost...

    And the simplest solution if your code allows it:

    HiseSnippet 1909.3oc6Zs0aSbDEd23roXCAUn7.OzJsEUUYqllZGtUoTDlbApKDvxldSUzzw6N1dD6NypYGGHEgD+M5a8mPesukeR8eP6YlcWuytw1rDBTRqMBjmyLm47cNmYNWFbaNyAGFx3Flke39AXCyyX0cepX3lCQDpQqsLLeOqcZ8Ca2wXi8CPggXWCSyR2QNoY4EMTe9qatAxCQcvojLL9NFwAeOhOQjRscy6R77tMxE+Phu1puRyVNL5lLO1H.HkrpaDfbdLZ.99H4xVvxvboscIBFuq.IvgFlKtAyc+tCYOgFs9uiDR54gkCZXzE1nHx2l44JQrjpwlCIdtsST3PCCSq1opeoH0+BV6PbIiomZFde0D1obnaOLWXVvqgN7pWb3YpAuEif24r55vIAhzYjX6zVsnBLuOBbA5vJZsFKzeQqMYvJnhU8QOFeaNLXLGUu50puh8UqWu15KWQ9mu3Kr6hEBBcfcaDE6EtbEv6DJr2CwSloM0Kz9F1+Tx1N.K1j4GvnvfpWp6Nsara5JaboZqrbE6o8oP6wkp8n0mwd.eT.eiQBAf0LH1OnK1C6H1PPmMlqOabNKj9RgWho8is6h7C7vRKoDTDFc4JDpGghs6OhpHXynY.sTrblWUmDYtBnXdiv0VtxyhDZeF2tJATt5qaSr+JcuzpdX5.wPf9m8Y0dVJFS+l1h+IxiVMDN1lHw9HuPbs0UK84QbD8u57jAqqRnt3m9f9ofsV1sTvAfC1pmC+UA6d1DZVmTM6dqFJMwJN1D440CBGTcxVknSsZlt6yD3GPqVqxypTtxyqXmep98m3bwaG3Yl3zx.V7YwXU5H+dXdhqAVnzNQ5GS29F2v9tTVuZJxOarwO5xl88v8Exaaio+8n8vf4w+NXJlifPKRKxsDBNo2HAt5gmFXtQhvWuR98WLDa2gLX3quPVaE6OOVJIaSzwiJOGhRkMLn0zCCpGk1I5Zk1BYzVTh3AAX5zBNZDeWDBStTrG.VpP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sXV9qKZEAWaYnN6+ajorzIsLkGOt4zRSUG4uSh3mPKMSIIYS4qPtE1Ckwv88YaF6GadnznW7fVvMItnMyCwya1KcboqKV3yFRU5jyYYY3HvjeRBvpiDmb.76Kekf2AfaG1HYg.IkLYA0U0EpkzAqWc0BxJ1hFWO4+UjtXpqZveCehmrQRoXxIajLYQMIm0JpRFaPC4h2w8emwRUimsrj7+K66bR1JP2h+t5+PGyRXprlRUafdPA5d5QXCgtMjPBJ08UraoFy6VZd2Ry6VZd2RuRcKs17tkl2sz+e5VZpIIk+lMZdD5VxXd2Ry6VZd2Ry6VZd2R+K2szaCT91PF9HGNaWmne8fR6woTT.KAU8a0ur0Nxw1i+MCZYUe05xe1Djccbjob+bvKNYdV6HvykOB7bki.OW8Hvy0NB7b8i.Oe4L4Q1PxsFIX9QQXABs2N5vq41iO7Vx3e.WOD.yA
    

    Note that you can still use control callbacks for the knobs instead of the property editor connections...

    I like your solution!! Need to sit for a moment and digest it. But Sampler1(on Button SMP1) is not displaying the correct values. Even though the code is the same?!?!



  • @Christoph-Hart said in Slimming down a script(for best efficiency):

    Donβ€˜t call the getComponent method in the control callback, but store it in a variable. The rest is cosmetics.

    Was trying all sorts to get the value before.
    Ok. Variable it is!
    Thanks!



  • @ten7kur And a lot easier than my first solution
    After all, I removed the non-necessary for loops:

    HiseSnippet 1873.3oc6ZszbSbDDdWKu.VAmBHbHWRUSbwAop.iDlGoJJJV7CHNf.UR7JEEAFu6HooX0LplcjAGJph+FbK+Dx0bieR4dNjzyL6pcVYIYgwP3gru34QO8W+08Lc2xptfGPhi4BG2Et6N8HNtG0q4NLYm05foLmMW2w8vd017gazvY0c5giiIgNttEtgZQ2El2Q+yee0UwQXV.IaJGm6yoAjaQ6RkYyV2+lznnqiCI2k10Z2m2ey.NaMdDuO.jBdUb5gCdFtM41X01lyyw8PaDRkbQSIVRhcbmeUd3NM6veNyr+6SioaEQTCp5zDNHyzWmGEpPrZVm05PiBqmZvwNNtd0yL+BFy+jd0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in Slimming down a script(for best efficiency):

    But Sampler1(on Button SMP1) is not displaying the correct values

    Seems good here when I import the snippet...



  • @ustk said in Slimming down a script(for best efficiency):

    HiseSnippet 1873.3oc6ZszbSbDDdWKu.VAmBHbHWRUSbwAop.iDlGoJJJV7CHNf.UR7JEEAFu6HooX0LplcjAGJph+FbK+Dx0bieR4dNjzyL6pcVYIYgwP3gru34QO8W+08Lc2xptfGPhi4BG2Et6N8HNtG0q4NLYm05foLmMW2w8vd017gazvY0c5giiIgNttEtgZQ2El2Q+yee0UwQXV.IaJGm6yoAjaQ6RkYyV2+lznnqiCI2k10Z2m2ey.NaMdDuO.jBdUb5gCdFtM41X01lyyw8PaDRkbQSIVRhcbmeUd3NM6veNyr+6SioaEQTCp5zDNHyzWmGEpPrZVm05PiBqmZvwNNtd0yL+BFy+jd0ngzAymQCGSu.JSBa9vctIAup1vqxzCOWK3MuAdG2qYff1SlshBaei2lLIQzBCt.aXY1qybO3vdqwgcvjK2E+Lx0EvfART5BWrxoQWnRkxWdwhpeO6YQJ+KpFOreDIdwhfuIVh1FKPM61SsTxJnqfdjNXY41D4FsZQBjkVpIsauHh9DdRyZ0qrT4SuXQzD9YuNgpKU9wWdxGgFyq1WJAfNDbaRhfCcUISi1TV.z1Z7t83LX.nvo.liUx8FdZzcSFeq7XqV8mno4qL9yVugkT9k7xUGOYwf0Wx3MAMuIKj7BDuER1gfh0zAIDEiUjrXwhpyjF9hA99eD0zrDxPcTNawhTVDkQPs5yzSf3rbTqBIBdTofTXbZ.pQ8IkWr3KMTCsEpjYpWlwUY+E.yGzgFzIEVHZ7.nlsK.lfYmSyKSUV2cZko5xWdLJnIQpofmY7DKni8R33kiIx6qfWo7Q3OBT4iUD70jRAcq9xQuA0DkUJdvgBdf2yyL4I0xo1yqVr3qf+rEWfJsEBhaxwCkQaozWhiXMbTzVvKnkFseJ8htwcqCBAxQRYsGomNgi1amrEIGvEBRLruP3TQc0FlYSixVimFBNUcWtngIr8civtyi5xVw2paO6g8BaY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GY+3xH95UV4et55jHbNh6A4aO5W82UNyi4uIbSRHqyivhgo8BGTgzyO0wFY+2M9bHVV8bDP4eNAXcHwmO.9Xp91+D.tM38Uenzo0G4AEQ0DJbLfXWJ0bpxyLiqj9A60jvB0C9W3mjEqlV2kZwpoKNsTx25YJaAAVnP9It+6nd5B5Pp5u+R12EjdTfsk725OTT2BDlp.RcOeQP03Q1uvFCsVnfDTW66XqQUm0ZzrVil0ZzrViFeqQmaVqQyZM5qmViFaFQ8+iy8QqQNucVqQyZMZVqQyZMZVqQ++1ZzGCT9wPGcwAB9SBLeaaT7wQzy.LAS+kodAuZpwnAeGe77prbE02ZA5SBBTobOC3EGsLmaeHyJ6CYN+9PlKrOj4h6CYtz9PleZhxnZH4Z8k7tlWXgIpugI30ciAAuEb9O.h9mpl.

    Just checked. Yea! All working!! yhhh..
    Many Many thanks @ustk ! Need to sit and study this. Im grinning!:))))))
    Thanks all for the inputs!!



  • @ustk

    for (b in SmpSelectBtns) b.setControlCallback(onSmpSelectBtnsControl);
    

    ughhh!
    I understand that "b" is "SmpSelectBtns" array But ive never seen a ControlCallback like this!!
    My digestions struggling at this moment😱 😳



  • @ten7kur That isn't the control callback, that's assigning the function called onSmpSelectBtnsControl as a callback function to each button b.



  • @d-healey said in Slimming down a script(for best efficiency):

    t's assigning the function c

    mhm i see. Its a FOR statment/loop after the function.
    Never seen it like this.
    Though im getting the Logic, the code is still Extra Wings for me. Will digest hopefully πŸ™ƒ



  • @ten7kur Did you see my HISE Scripting 101 video?



  • @d-healey said in Slimming down a script(for best efficiency):

    @ten7kur Did you see my HISE Scripting 101 video?

    I did, though its been some time. Will view it again.


Log in to reply
 

17
Online

648
Users

2.6k
Topics

21.5k
Posts