HISE Logo Forum
    • Categories
    • Register
    • Login

    Load/Save Table(envelope) shapes

    Scheduled Pinned Locked Moved Feature Requests
    48 Posts 9 Posters 3.1k 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 @Lindon
      last edited by

      @Lindon Is it possible to script a 'Save Table Shape' button and a 'Load Table Shape' button for simple porting of shapes between modules in the plugin?

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

      ustkU 1 Reply Last reply Reply Quote 0
      • ustkU
        ustk @DanH
        last edited by ustk

        @DanH Could you explain "between modules" please?
        If you want other modules to change at the same time you could simply link them
        But if you actually want to store different shapes, then you could use exportAsBase64 and restore I guess (never tested)

        EDIT: in fact, that was the whole purpose of this thread...

        Can't help pressing F5 in the forum...

        DanHD 1 Reply Last reply Reply Quote 0
        • DanHD
          DanH @ustk
          last edited by

          @ustk So for example, if I have two seperate LFOs in a plugin and I want to copy the shape from one to the other one.

          I think though what I really want is the ability to save an LFO shape in one instance of a plugin and be able to import that shape into a different instance of the same plugin.

          Does that make sense?!

          I have been trying to sript the buttons using those API's but I don't quite know how to make it work

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

          ustkU 1 Reply Last reply Reply Quote 0
          • ustkU
            ustk @DanH
            last edited by ustk

            @DanH Ok so you have to use the fileSystem and save/restore the base64 shape to/from the external file you've created
            https://docs.hise.audio/scripting/scripting-api/filesystem/index.html

            Can't help pressing F5 in the forum...

            DanHD 2 Replies Last reply Reply Quote 0
            • DanHD
              DanH @ustk
              last edited by

              @ustk Thanks mate, will take a look! No doubt I will be messaging you again soon! :face_with_tears_of_joy:

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

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

                What's wrong with copy/paste?
                Peek 2020-12-17 17-44.gif

                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 Thanks David, this is great for working within Hise, but I want the User to be able to do the same within the plugin... and even across plugins if possible!

                  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 @ustk's answer is the way to go then, save the string to a file.

                    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 Do you think it would be possible to create a mini preset browser for it like this https://forum.hise.audio/topic/3273/custom-mini-preset-browser-example-using-filesystem-api

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

                      1 Reply Last reply Reply Quote 0
                      • DanHD
                        DanH @ustk
                        last edited by

                        @ustk Can't see how to 'save' a file from that link.. do you know how? Do I need to wrap it in a callback function from a button?

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

                        1 Reply Last reply Reply Quote 0
                        • Casey KolbC
                          Casey Kolb
                          last edited by

                          Did you load the snippet from that post into HISE? There's everything in there that you'd need to make what you're describing. You just need to export the table as base64 and save that string to a file. When you load the file, you restore the table from the base64 string like @ustk said.

                          Casey Kolb
                          Founder & CEO of Lunacy Audio
                          Composer | Producer | Software Developer

                          DanHD 1 Reply Last reply Reply Quote 0
                          • DanHD
                            DanH @Casey Kolb
                            last edited by

                            @Lunacy-Audio I took a look at it the other day, thanks for posting it up :)

                            I'm a bit at a loss trying to work these base64 API's but will take another look at that snippet and see if any clues are inside!

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

                            1 Reply Last reply Reply Quote 0
                            • Casey KolbC
                              Casey Kolb
                              last edited by Casey Kolb

                              The table's are definitely confusing! Took me a while to get a hang of them.

                              This is where you'll need to start:

                              // retrieve table processor from backend synth
                              var tableProcessor = Synth.getTableProcessor("Velocity Modulator1");
                              
                              // export backend table as base 64 - this is what you save in the preset file
                              var tableData = tableProcessor.exportAsBase64(0);
                              
                              // restore backend table from base 64
                              tableProcessor.restoreFromBase64(0, tableData);
                              

                              Casey Kolb
                              Founder & CEO of Lunacy Audio
                              Composer | Producer | Software Developer

                              DanHD 1 Reply Last reply Reply Quote 0
                              • DanHD
                                DanH @Casey Kolb
                                last edited by

                                @Lunacy-Audio Aaaaaahhh... ok that makes more sense! Brilliant, thanks mate :)

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

                                1 Reply Last reply Reply Quote 1
                                • Casey KolbC
                                  Casey Kolb
                                  last edited by Casey Kolb

                                  Also note: You never actually need to do anything with the visible table in the UI. It should just be linked to the backend table and you do all of the processing on the backend table.

                                  Casey Kolb
                                  Founder & CEO of Lunacy Audio
                                  Composer | Producer | Software Developer

                                  DanHD 1 Reply Last reply Reply Quote 0
                                  • DanHD
                                    DanH @Casey Kolb
                                    last edited by

                                    @Lunacy-Audio How do you mean? The UI table is just a dummy? In this case my visible table in the UI is a global LFO. So I need to create a new table to replace this one, and link it to the Global LFO?

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

                                    1 Reply Last reply Reply Quote 0
                                    • Casey KolbC
                                      Casey Kolb
                                      last edited by

                                      I just mean in the code you only do work on the backend table. The user uses the front end table as usual, but it's linked to the backend table. You just need to set the processorId on the front end table component.

                                      Casey Kolb
                                      Founder & CEO of Lunacy Audio
                                      Composer | Producer | Software Developer

                                      DanHD 1 Reply Last reply Reply Quote 0
                                      • DanHD
                                        DanH @Casey Kolb
                                        last edited by

                                        @Lunacy-Audio Oh right haha, all good :) Thank you

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

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

                                          @Lunacy-Audio Ok I'm officially lost :smiling_face_with_open_mouth_closed_eyes:

                                          I can't find a way to save the Base64 string as a preset / file of any sort.

                                          I did manage to restore a default Table shape using a simple button callback and the restoreFromBase64 API.

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

                                          1 Reply Last reply Reply Quote 0
                                          • Casey KolbC
                                            Casey Kolb
                                            last edited by

                                            It's just a few lines. This is all in that snippet I posted. You just need to save the base64 string instead of the other two knobs I save in the example.

                                            var tableProcessor = Synth.getTableProcessor("Velocity Modulator1");
                                            var tableData = tableProcessor.exportAsBase64(0);
                                            var userPresetFolder = FileSystem.getFolder(FileSystem.UserPresets);
                                            var presetFile = userPresetFolder.getChildFile("MyCoolTableData.preset");
                                            presetFile.writeObject(tableData);
                                            

                                            Casey Kolb
                                            Founder & CEO of Lunacy Audio
                                            Composer | Producer | Software Developer

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

                                            24

                                            Online

                                            1.8k

                                            Users

                                            12.1k

                                            Topics

                                            105.7k

                                            Posts