HISE Logo Forum
    • Categories
    • Register
    • Login

    LFO Shape Designer

    Scheduled Pinned Locked Moved General Questions
    28 Posts 2 Posters 1.4k 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 @d.healey
      last edited by

      @d-healey oh sorry, I think I'm confusing things!

      So every time a new shape is added to the sequence it will add / remove some table points. So lets say a table has only two points:

      tableShape1.setTablePoint(0, 0, 0.00, 0, 0.2);
      tableShape1.setTablePoint(0, 1, 0.75, 0, 0.2);
      

      Then a shape is dragged on and the code would become:

      tableShape1.setTablePoint(0, 0, 0.00, 0, 0.2);
      tableShape1.setTablePoint(0, 1, 0.15, 0.5, 0.2);
      tableShape1.setTablePoint(0, 2, 0.75, 0, 0.2);
      

      So actually perhaps the x/y/curve values don't need to change, only the index does. And adding the points obviously...

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

        @DanH

        So you need an array to store the table points, you then run the loop over the array to add the points to the table.

        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 but I HATE arrays! 😆

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

            @DanH You need to embrace them.

            And array is just like have multiple variables but with less code.

            So you could use lots of variables like this

            const myVar0 = 10;
            const myVar1 = 20;
            const myVar2 = 30;
            const myVar3 = 40;
            
            Console.print(myVar3); // 40
            

            or you can use a single array

            const myArr = [10, 20, 30, 40];
            
            Console.print(myArr[3]); // 40
            

            They are not much different, but arrays are much more useful for doing batch jobs because you can loop over them.

            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 you forget that I inspired you to make the make the arrays video a few years ago 😆

              I've come a long way since then :) Not far enough however...

              I've just seen there's an api for it perhaps:

              Screenshot 2024-05-29 at 11.21.02.png

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

                @DanH said in LFO Shape Designer:

                I've just seen there's an api for it perhaps:

                Looks like it will save you from a loop, Looks like it will save you from a loop, Looks like it will save you from a loop, Looks like it will save you from a loop

                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 perhaps, if it worked!

                  tableShape1.setTablePointsFromArray([0, 0.5, 0.30, [0]], [0.5, 0.75, 0.5, [1]], [1, 0.9, 0.9, [2]]);
                  

                  Screenshot 2024-05-29 at 11.48.26.png

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

                    @DanH Looks like it's only for Tables, not ScriptTables

                    8f96ded2-a453-4782-9ffb-946d3a655b3b-image.png

                    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 ok so my script is:

                      const var Table1 = Content.getComponent("Table1");
                      const var LFO1 = Synth.getModulator("LFO1");
                      const var tableShape1 = Synth.getTableProcessor("LFO1");
                      const var makeShape = Content.getComponent("makeShape");
                      
                      inline function onmakeShapeControl(component, value)
                      {
                      
                              tableShape1.reset(0);
                              tableShape1.setTablePointsFromArray([0, 0.5, 0.30], [0.5, 0.75, 0.5], [1, 0.9, 0.9]);
                      
                      };
                      
                      Content.getComponent("makeShape").setControlCallback(onmakeShapeControl);
                      

                      The other API's (add/setTablePoint) work fine here....

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

                        @DanH TableProcessor != Table

                        Try this

                        60e5d10a-8d73-4d5b-8603-2ccec6ebc752-image.png

                        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 ah, yes got it working, thanks :) Ok so this array needs to dynamically load points into the table..

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

                            @DanH Each time you update your array you call that function to update the table

                            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 can the array have a dynamic number of variables?

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

                                @DanH An array is a variable. You can dynamically change the values within it. Check out the API

                                58987627-5459-4816-8029-a2e20dfa858c-image.png

                                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 so push and remove might help here I guess....

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

                                    @d-healey or concat 😆

                                    Making some (slow) progress... please let me know any pointers if you have any... :folded_hands:

                                    HiseSnippet 1391.3oc2X8tZabDDeOYeoQJMgFZ9PoPgC+IEhQH4XmXSojyVVJHpjknxMotlPX8oUVa7c6d8tU1UMDHuA8UqOB4QnuAsyr2oSqhkkUEIgPOLKd14O6uY1YmYr6DI8XwwxHhU9CGExHVeoc2QB0fpCnbAow9Dq6Z2swA0bd9tOqlyg6tWyZj8FERiiY8HVVq7TTLq7qRze+8S1i5SEdrIaQHOSx8XM4Ab0jc639ibe+5zdrC4AFR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OySMAfqZW+W93LVj4weyji+asepu7Dp+j.E7jDPBKY7nuKksSFemLApLmYY+qEcV1vEdVVqUl2rqUVxYWW8ytYWWz73u9RWMweBesM0D12MAl1XoRM1RKZdsvYOdnzmFg7qGw9sgLgmA+28DLunwjzJ2+z84Pgo9xnfz9CoR9MtMYmBg.SaeHCJYBSG6YlB1MPJUC3hSmNa6dtMkxvZ5xh8LMRmAzXb9AcYPCy.l8PYKZL7GBTEl25LSlMNUHiXIyjXte0gwJYvXG3SU21tJVntcq0w1OZyRZ935Nn9Or8GF5+KUHqL+7pbKb5Ojh4jkUguB9LrYSBJyxs+LEkysk3J++tk3OIGpf5AsnpHNLwj8ACC5B8b7XvoKDLeb9cqb3y2D5xHstF.SzSS7OvWJyJHsUJyJiY9I4LBndQxW5k72.fOjtodGvuE5+6O4sagzNyX3+.nq1K87l1TWRwMVVEe3xp3lKqhasrJ9nkUwGurJt80qHNzwtCgVGIOMIjVcpkTQ2JqiELg9+BXlzwJK
                                    
                                    1 Reply Last reply Reply Quote 0
                                    • DanHD
                                      DanH @DanH
                                      last edited by

                                      This post is deleted!
                                      1 Reply Last reply Reply Quote 0
                                      • DanHD
                                        DanH @DanH
                                        last edited by DanH

                                        @d-healey ok so I have figured out some of the permutations of drawing tables with the array and joining two or more arrays.

                                        HiseSnippet 1413.3oc2X0sZibCEViSlzX2cKMz8hRgBCAJ3PCFam+ZYorNwwYwz3DScZ1BgvVkYjiEYFoYmQNolxB6aP6iUuoPeD5iPeCZORy3Yz3X630rY2PmKLQ572m9zQ5bTZGvsIgg7.jQ9SF3SPFOxry.lnW8dXJC0bejwJlcZdTCqWr6oMrNY28NrAZuA93vPhCxvXgmKUyH+hH02+7r8vtXlMIcJD5TN0lbH0iJRmscsum55d.1gbB0SS6Mq0zlypyc48AHsfYYjO19J7kjivR0xYhLVpgCUvC5HvBRHxXw83NC5zieCKR+SogzKbIxAUPc.GEM8AbWGIhkyhp2i55zd3RODgLLamRDKDQDOwrE0glLeJg7oJAV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x7F0UhfoorxfBaw0HtS3rG0m6hCjxOHf7p9Dlsl7+9Yx7hlooU09sZu.tXpKOvKtLXrledsCIWBTftuOg.WVBuuzVOEriGmK5QYWlMa6I0Njy8antVzQ2Is6gCks4ntFTyMfaOg2BGBOktNzX3U5BadIiGPhZcRe958CEbugKfYsofNBhupq.iyL2Voej7usN7yFG+tY7ayMbUlddQtYN8ERQrRxJjYwO.KVDgxjbyGnnbpkzV3+2kz9AdeAbdtEVDPgNdLOpuWGnlgMAhNiQbkOSvHm73Wz3xxwpyvDliZv+BewBqHGaDKrxPguWhgG1Nf+R6nmZHOHsrZFXcyT++Oya1RN1ZLuwvCpJ8Ra6rt5VFVcdMbi40vMmWC2ZdMb640vclWC+l61PYSC61Gt5O5nIB0pcinazMRp3.cX+efrRnYF
                                        

                                        I'm now wondering how to make the x/y/curve values inside the array to be dynamic. So if I do, for example:

                                        reg x1 = 0.255;
                                        const var newShapeArray2 = [[x1, 0, 0.5], [0.375, 1, 0.5], [0.376, 0, 0.5], [0.376, 0, 0.5]]
                                        
                                        inline function onshape2Control(component, value)
                                        {
                                        
                                        		local newShape = [];
                                        		x1 = 0.355;
                                        		newShape.concat(flatArray, newShapeArray2);
                                        		
                                        		tableShape1table.reset();
                                        		tableShape1table.setTablePointsFromArray(newShape);
                                        };
                                        
                                        Content.getComponent("shape2").setControlCallback(onshape2Control);
                                        

                                        ... the array doesn't update the value of x1 - because the value is set on oninit. So can you update / refresh the array before calling it? Or maybe I need to clear it then push it?

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

                                          @DanH said in LFO Shape Designer:

                                          So can you update / refresh the array before calling it?

                                          It's just like any other variable, you can change the value whenever you like

                                          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 Ok well in this case I can't figure out a neat way to do it... Any ideas?

                                            d.healeyD 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            28

                                            Online

                                            1.7k

                                            Users

                                            11.8k

                                            Topics

                                            103.0k

                                            Posts