HISE Logo Forum
    • Categories
    • Register
    • Login

    Help Me Get SliderPack Values please! Thank You!

    Scheduled Pinned Locked Moved Unsolved Scripting
    11 Posts 3 Posters 99 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.
    • ChazroxC
      Chazrox
      last edited by Chazrox

      Im working on an Arp preset menu. I've got all of the values properly reading in and out for the sliders, knobs and comboboxes. The only thing I cant seem to get is all the values of the slider packs. I can think of the long way to do it but I want to do it in a loop. Can somebody give me some advice on what im doing wrong here please. 🙏

              reg sp2Values = [];
      
      		local NumSliders = knbNumSliders.getValue();
      		
      		for (i = 0; i < NumSliders.length; i++)
      		{ 
      			sp2Values.push(SliderPack2.getSliderValueAt(i));		
      		}
      		Console.print("SliderPack2 values: " + sp2Values);
      

      this is what I get with this....
      Screenshot 2025-07-12 at 1.21.00 AM.png
      this isnt one instance, this is me mashing the save button lol.

      d.healeyD 2 Replies Last reply Reply Quote 0
      • ChazroxC Chazrox marked this topic as a question
      • d.healeyD
        d.healey @Chazrox
        last edited by

        @Chazrox sp2values is an array so it's working correctly

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

        ChazroxC 1 Reply Last reply Reply Quote 0
        • ChazroxC
          Chazrox @d.healey
          last edited by

          @d-healey How do I print out all the individual values?

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

            @Chazrox said in Help Me Get SliderPack Values please! Thank You!:

            SliderPack2.getSliderValueAt(i)

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

            ChazroxC 2 Replies Last reply Reply Quote 0
            • ChazroxC
              Chazrox @d.healey
              last edited by

              @d-healey How come its not working for me? It just says "Array" . 🤣

              d.healeyD A 2 Replies Last reply Reply Quote 0
              • ChazroxC
                Chazrox @d.healey
                last edited by

                @d-healey also...

                shows up in .json as "[]"

                Screenshot 2025-07-12 at 1.47.07 AM.png

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

                  @Chazrox because your trying to print the array, Console.print only prints strings, so you need to either print the value in the loop where you're getting it or convert the array to a string

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

                  ChazroxC 1 Reply Last reply Reply Quote 0
                  • ChazroxC
                    Chazrox @d.healey
                    last edited by

                    @d-healey help please. 🙏 Im trying to push these numbers to a globally declared array so I can save it to my preset menu. I found a thread where you talked about having to deal with .getSliderValueAt(); within the onControl callback so Im trying this now.

                    Does this still work? I know that was an old thread.

                    function onControl(number, value)
                    {
                    		
                    		
                    		local numSliders = SliderPack2.getNumSliders();
                    		
                    		
                    		for (i = 0; i <numSliders.length; i++)
                    		{
                    			sp2Values.push(SliderPack2.getSliderValueAt(i));
                    			//Value gives you the index of the slider
                    		}
                    		
                    			Console.print("Index: " + value + " Slider Value: " + sp2Values); 
                    		
                    		
                    
                    		
                    
                    		
                    }
                    
                    d.healeyD 1 Reply Last reply Reply Quote 0
                    • A
                      aaronventure @Chazrox
                      last edited by

                      @Chazrox Console.print(trace(yourArray)) ;

                      1 Reply Last reply Reply Quote 2
                      • d.healeyD
                        d.healey @Chazrox
                        last edited by d.healey

                        @Chazrox

                        Maybe this helps explain it better

                        const n = 10;
                        
                        Console.print(n); // 10
                        
                        const s = "Hello";
                        
                        Console.print(s); // Hello
                        
                        const a = [1, 2, 3]
                        
                        Console.print(a); // [array]
                        
                        Console.print(a[0]); // 1
                        
                        Console.print(trace(a)); // [1, 2, 3]
                        

                        Trace converts an array or object to a string.

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

                        ChazroxC 1 Reply Last reply Reply Quote 1
                        • ChazroxC
                          Chazrox @d.healey
                          last edited by

                          @d-healey I Love a good cheat sheet! Thank You! 🙏

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

                          22

                          Online

                          1.8k

                          Users

                          12.1k

                          Topics

                          105.7k

                          Posts