HISE Logo Forum
    • Categories
    • Register
    • Login

    Help Me Get SliderPack Values please! Thank You!

    Scheduled Pinned Locked Moved Unsolved Scripting
    11 Posts 3 Posters 101 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.
    • 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

                        28

                        Online

                        1.8k

                        Users

                        12.1k

                        Topics

                        105.8k

                        Posts