HISE Logo Forum
    • Categories
    • Register
    • Login

    Slider Array to control sliderpack + set Label text?

    Scheduled Pinned Locked Moved General Questions
    5 Posts 2 Posters 42 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.
    • DanHD
      DanH
      last edited by

      I'm designing an arp. I want to use sliders rather than a sliderpack to control the arp's sliderpack and write the value of the changed slider to a label. I don't want to have to create a callback for each slider! Is there a clever way to do this? I feel like I've done something similar before... 😆

      HiseSnippet 1112.3ocuWE0aaaCDlxILsQaonsXuMf.g7j8RPfksaRL5FpSbR1LZShWcWvF5JRoknrIhLogDcaLF5KCX+O1Oi8zP9erW1Saut+AaGEkikVrcbD1hdPPG48ou63c73wlABGZXnH.YX9pg8oHiOF2ZHW1sdWBiiZrOx3A3iHgRZfkdn8F1mDFRcQFFK7kpALVdQTzye8r8H9DtCc7PHzoBlC8ErdL43QaV64Le+CItzWw5kP6J0Z3H30E9hAf8r.tHpOw4bRG5wDkZ4vnuhD1EY7Y3hOoZ0hs2Y6pE81x1lrS0c1pMonsaEG5N1jRU8r2tT61NNHikNvkIEAsjDIMD9o6IbG1pq38bMAmxBYs8oJAaTKfY8vn5cY9tMGs3DhPFK1b7R0B5kpOAeDykc03iWxdXzDViQjbQyH2rLI6agIYjvjVTaROB2xIf0WNdFk87Q3FbHB5QfXSRSQqKJ2KW.WW.Zvka1ibN8v.P3JD42pXwMrfWEdpoIDeBkVuiDX0xm4RCZBAHaquvZD7NTYcQu9BNHjesD5rVZz9j1T+y1MHfLDP+5IC+EJk.jaXZMsmY.rTVAVNq.qrVg2jxKOmKZeSN4yAcloONcXkxFrxYCVr2YZ5IBrxy.Op3SsXVedBuTgZSeJuirKL05qWHhlevb4kSDueM6MaFRgepjdgbsMfEJ+ATH6XjEjHoQomVbWHezkdQdVZ8+f2.tijI3VB9wBI8Dd9Bl.elevz5eOkm2DmS4vABeeZvDmVUgJXV.yyGzqMMXjcMRQXGY5s4KMeayczq+ITTvavYxS5SikOT36p19p995EEPwAPn7.N1BAUkQEGdPbwA8RJhA+j6gix+PQF+nJwE99+7Yn4FboTf+8u9W9iaA3xo.e4p+zucK.WIE3254kj4E0febJvprpnevJ3DoYo8d0iKQRPFeJ1dqMgGu0UuqVGdU9DsLB8MM1WoDTFMdEGhB8oARlJXarO8cv4d5ZxKi2mFdtTzG97p8TfObiAkKFaReWsgWIXETKTNTk5XhOUwnCwG8dlqDNZDarJnQWJqSWoRhihRIlaRKoHEa7i.p6FBKqI7muyHrhlve8+ZBmqDsoDQurcsqH6hTj4BRg5Jf8DC3IZh5g0RZDKoMhUhMhniih3+9X8onSi5Z8qME+b0I6mSkhRInn1amaJTmBjvLuMLVNoS4dWvXkDLdYmLy306aC5XT3NvmHS2FopA63IfCcR06lp+LdHSNLYC32hdKKNydKmWS7Q3lLoS2Iai4lfMBEL++vFi6HeE7AddTG4XCbQ7geaVa+9Fn+khARFuyQDY.SUS43A8ZA2bwgBry4T+PU3OmZSjVtnRVsBzhxciD9a3IdRakrQ7j1ilD0i3DHNyQenlpm+6GMBXS7n6DsLb4LP1ZBmg0CtBxYpq.k7WcMfkxJvxYEXkrB7IYE3VYE31YE3N2LP0MD2cfTzSusAgNp4AQcTXXb.m.YfQYqn+AvzVVDG
      

      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 Use a single callback function and apply it to all sliders.

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

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

          @d-healey this is where I'm at with that 😆 Please help!

          inline function ArpValues()
          {
          	
          	for (i = 0; i < knob_Array.get.length; i++)
          	    {
          			local v = knob_Array[i].getValue();
          
          			label_Array[i].set("text", v);
          	        SliderPack1.setSliderAtIndex(i, v);
          	    }
          	
          }
          

          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 d.healey

            @DanH

            Not at my computer so can't view your snippet at the moment.

            You want something like this

            const sliders = Content.getAllComponents("arpSliders");
            
            for (x in sliders)
            {
                x.setControlCallback(onarpSlidersControl);
            }
            
            inline function onartpSlidersControl(component, value)
            {
                local index = sliders.indexOf(component);
            
                /// Do what you want here
            }
            
            

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

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

              @d-healey got it working, thanks!

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

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

              19

              Online

              1.7k

              Users

              11.8k

              Topics

              102.4k

              Posts