HISE Logo Forum
    • Categories
    • Register
    • Login

    Can't write the user preset for the radio buttons

    Scheduled Pinned Locked Moved General Questions
    11 Posts 3 Posters 387 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ?
      A Former User
      last edited by A Former User

      Trying to change the Waveform of the synthesizer (for only sine, triangle, square and saw) with a scripted radio button set.

      The below code works but the setting can't be saved into the user preset. All of the buttons are being false when the presets are changed. saveInPreset: true for all buttons.

      const var Synthesizerr = Synth.getChildSynth("Synthesizerr");
      
      const var NUM_WF_BUTTONS = 4;
      const var WFButtons = [];
      const var WFAttrID = [1, 2, 4, 3];
      
      
      for (i = 0; i < NUM_WF_BUTTONS; i++)
      {
          WFButtons[i] = Content.getComponent("WF_Btn" + (i));
          WFButtons[i].setControlCallback(onSubWFButtonControl);
      }
      
      inline function onSubWFButtonControl(component, value)
      {
      	local idx = WFButtons.indexOf(component);
      		
      	for (i = 0; i < WFAttrID.length; i++)
          {        
              Synthesizerr.setAttribute(Synthesizerr.WaveForm1, WFAttrID[idx]);
              WFButtons[i].setValue(i == idx && value);
          }
      
      }
      
      
      HiseSnippet 1312.3oc0XstSabDEdVrmHrSaTSUpZ+SkVgphLBpkWC8hDMJNfwsVMF6j0.sBgnC6N1dDqmwc2YAbihTeD6iPeD5aP6Y1cs8rTikwDHJ9WLmKy46blyskV9BGZPfvGYjq8vATjwGgsGxk81oGgwQ0qhLdDtAIPR8MiIs8vAjf.pKxvHyOpHXjKKJ52+77sIdDtCcBID5.Ayg9RVelbB0VU9YlmWMhKsMqulzaVotifuivSDB3ICtDZ.w4LRW5dDkXKgQFOXWWlT3aKIRZ.xH61B2g18DWvik+.V.6TOp5fExFtnXx0DdtJDqnh1oGyys0H+N.gLvslDExDGEdBtAykMl9jnwmDwvbhF5wCikRCuLofmkN7JoAuo.ICMHkMFROFa63yFHmvQgmGhqygGmNDHrqCkXYQK8kYv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opef4s4c6dMMalyMxLWyMdmi2EeFx8bEJzx7CmW5OGCswKaF8ba99+890hPIi2sAA5F.Cdv6E12FlY5PADy4TO02t.egfR0nykTmUvwlxciN7uvuDlVpyFILsFw7dwF8IN9hSbh+zBUCikin.9MO5exSNbC0Yywe+BFWpXITeXryINNpb5uFhOSWmxKfNar.5r4Bny2r.57sKfNe2Bny2OScTS7eQnTzON+GHzZ2nuvyvHdomnRAz+APukWe.
      
      DanHD 1 Reply Last reply Reply Quote 0
      • DanHD
        DanH @A Former User
        last edited by

        @Steve-Mohican you need @d-healey 's Tabbed Interface script....

        DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
        https://dhplugins.com/ | https://dcbreaks.com/
        London, UK

        ? 1 Reply Last reply Reply Quote 0
        • ?
          A Former User @DanH
          last edited by

          @DanH said in Can't write the user preset for the radio buttons:

          @Steve-Mohican you need @d-healey 's Tabbed Interface script....

          Where can I see it?

          DanHD 1 Reply Last reply Reply Quote 0
          • DanHD
            DanH @A Former User
            last edited by

            @Steve-Mohican his Patreon most likely, but someone was posting something very similar only a day or two ago here

            DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
            https://dhplugins.com/ | https://dcbreaks.com/
            London, UK

            d.healeyD 1 Reply Last reply Reply Quote 0
            • d.healeyD
              d.healey @DanH
              last edited by

              @DanH Probably referring to this video?

              Libre Wave - Freedom respecting instruments and effects
              My Patreon - HISE tutorials
              YouTube Channel - Public HISE tutorials

              DanHD ? 2 Replies Last reply Reply Quote 0
              • DanHD
                DanH @d.healey
                last edited by

                @d-healey that's the one!

                DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
                https://dhplugins.com/ | https://dcbreaks.com/
                London, UK

                1 Reply Last reply Reply Quote 0
                • ?
                  A Former User @d.healey
                  last edited by A Former User

                  @d-healey This tutorial is great, Thank you for that!
                  The above code is almost the same like in the tutorial, is the user preset save working with this?

                  d.healeyD 1 Reply Last reply Reply Quote 0
                  • d.healeyD
                    d.healey @A Former User
                    last edited by d.healey

                    @Steve-Mohican

                    is the user preset save working with this?

                    I can't remember :) It was ages ago when I made that one. Let's ask @DanH I think he's been using this more recently.

                    Libre Wave - Freedom respecting instruments and effects
                    My Patreon - HISE tutorials
                    YouTube Channel - Public HISE tutorials

                    1 Reply Last reply Reply Quote 0
                    • d.healeyD
                      d.healey
                      last edited by d.healey

                      I just took a look at your snippet. If every button is saved in preset then every button will also be restored with the preset. So the last button will always be the active one. We have to save the value separately to the buttons. I'll see what I can come up with.

                      Libre Wave - Freedom respecting instruments and effects
                      My Patreon - HISE tutorials
                      YouTube Channel - Public HISE tutorials

                      1 Reply Last reply Reply Quote 0
                      • d.healeyD
                        d.healey
                        last edited by

                        Quick attempt would be to use a hidden knob.

                        HiseSnippet 1383.3oc4Xs2aaaCDmJIrK1cqncnCa+oPvPgCZVfka1Cfrh5lGdyX0ItUtIannHiQh1lHxjZTToIqn.6i39HrOB6av1Q8vhJSwn0qsqEy+U3872c7zcGSeoviFEIjHqZCNOjhr9Pr64b03sGSXbT2cPVWC2iDonR6TRacdHIJh5irrV76zDrpsDJ42edusHADtGsfDBcff4Qe.aBSUPse6efEDzg3SGvlXH8Fs65I3aKBDw.dVD2DER7NgLhtGQK1BXj0U10moDRWEQQiPVKskv+b2whmwSk+.VD63.p9fCxELTJ4Nh.eMh0TQaOlE32OOtiPHKb+hrvhoYgah6w7YSoWjMtdBC6BMLyGVKTFdKVBdNlvqoA7p.RVFPZoTHcCrqmjEpJ3nwyUwc4vkyPBj1MgRprnEVdI71BPBtZ8IjSncjvgoZznUqlqYemlMWcy50gTejx9ThzNo.fFw9UpTZe2ziqOhpRfYxoFqXJyJkUeuG26nC6bzVOdvf82yELvFaZv8vNaEqTvQfwSdZYN2Wojc2QyvYM6VqYuA.NPj50GJj1MX.ilaZyr+1K3Bf1su8p0edca32T6+D1SAExCdM7ESBEb3PiUz5p3qXeavpqBn+hJtdjVbtRJB1lDDbLTF1PvciONWnLlfpundcFOfwo1Ci4dJlfaWkjM7x89ZPvF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1Qdd550u.l9TsNslCctybnyFygNe4bnyWMG570ygNeyL0QOo99wJwjzZdfP+cSdZokU5xJIk+n+Fvrs6oy
                        

                        Libre Wave - Freedom respecting instruments and effects
                        My Patreon - HISE tutorials
                        YouTube Channel - Public HISE tutorials

                        ? 1 Reply Last reply Reply Quote 0
                        • ?
                          A Former User @d.healey
                          last edited by

                          @d-healey That's wonderful and You're a genius mate! Thank you so much!

                          1 Reply Last reply Reply Quote 1
                          • First post
                            Last post

                          54

                          Online

                          1.7k

                          Users

                          11.7k

                          Topics

                          101.8k

                          Posts