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.
    • d.healeyD
      d.healey @DanH
      last edited by

      @DanH said in LFO Shape Designer:

      In my head this just seems super tricky

      All you need is a loop. From 0 to the number of table points.

      Another UX you could use instead of dragging, and which avoids the need for drawing table points, is using copy paste of the tables.

      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

        All you need is a loop. From 0 to the number of table points.

        How would you update the other values?

        Another UX you could use instead of dragging, and which avoids the need for drawing table points, is using copy paste of the tables.

        Its like adding tables together, rather than one whole table (which is what I've just made on that other thread). Unless I've misunderstood? Dragging seems in vogue and intuitive right now.

        Thanks :)

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

          @DanH said in LFO Shape Designer:

          How would you update the other values?

          Not sure what you mean by other values, maybe I've misunderstood the concept.

          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 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+5zdrC4AFRuoaCOonpzWNDfzJ1kIgTuynmxNfhhkylXciZ83JYTWEUwhIVqtmr2ntCjWHRj+Y7X9I9LjnBoKXnjsqK86gHF2kTc.2uWmwtdLgXY2YRfXkj.w8raw6wy1eR.4qzLblngY7vJ2zvakofWES3U1.dy.RVFPZ0DHAWEdQ7P0DNHdtkcCghE0mBgcSnjHKI2FqZWUBRHTkBnmwpGADYZT7QkKutCrb+uu.D4iUNmSibNjBXrhyO3LVwSYppxfPo.HJtVB60lRkl0aiJnSdPwaI6MzmBQhhqgrlVXEZftCngrozQa2Lm6ZTT+qf1FakYihn6XnFWvU6FEQGAxe7wfCWtzF3xCK+h0cNtbosPhGqW2JYmDBsP67hWXBAA6BCSUphVvs0FH0Zajn6VIJCaUISjMPaUn.W3yELm9CEdJtT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W5k72.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
                                            • First post
                                              Last post

                                            15

                                            Online

                                            1.7k

                                            Users

                                            11.8k

                                            Topics

                                            103.0k

                                            Posts