HISE Logo Forum
    • Categories
    • Register
    • Login

    How to reliably save samplemaps in preset? (Expansions)

    Scheduled Pinned Locked Moved Solved General Questions
    6 Posts 3 Posters 139 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.
    • StraticahS
      Straticah
      last edited by Straticah

      Hey there i have a basic setup that loads the samplemaps of my 3 expansions into a multi column dropdown for the user to choose from (works fine!)

      15a81d18-4607-4b1a-a837-64a8da64592a-image.png

      We have been adding a few more samplemaps today and experienced that the old presets dont work anymore because the combobox only saves a value/index (but array+values change due to variable expansion content)

      <Control type="ScriptComboBox" id="ComboBox1" value="123.0"/>
      

      That is why i would prefer saving my samplemaps as a path inside of the preset file instead - quick example mockup:

      <CustomData>
        <Data key="ComboBox1_SampleMap" value="{EXP::Hardware Lab}Absorbing"/>
        <Data key="ComboBox2_SampleMap" value="{EXP::Pro Essentials}Detuner"/>
      </CustomData>
      

      Any ideas on how to solve this? Maybe Expansion-specific indexing (i dont think that is possible)? I think i am overlooking something beacuse with this setup expansions in general would not be possible...

      creating user interfaces: www.vst-design.com
      founder @prototype.audio https://www.prototype.audio/

      bendursoB 1 Reply Last reply Reply Quote 0
      • StraticahS Straticah marked this topic as a question
      • bendursoB
        bendurso @Straticah
        last edited by bendurso

        @Straticah Oh, I just reread your original question—you were actually asking how to do it.

        Yes, I used a label to save the samplemap name. The combobox still relies on the samplemaps array (with saveInPreset disabled), but I use the label to store the string name. Then I restore the combobox by matching the samplemap name.

        edit: actually, David told me to do this a couple a months ago lol.

        Christoph HartC 1 Reply Last reply Reply Quote 1
        • bendursoB
          bendurso @Straticah
          last edited by

          @Straticah Oh, I did something similar a few days ago.

          I asked ChatGPT to create a script to transform all the numeric values ​​into strings. To do this, I gave it the list of sample maps for each expansion (using Expansion.getSampleMapList), letting it know that the combo box has index 1. It worked like a charm.

          I can't find the script.. but in my case it was a little different because I used a hidden label to store the names of the samplemaps. Then of course it's required to update all the expansions.

          StraticahS 1 Reply Last reply Reply Quote 1
          • StraticahS
            Straticah @bendurso
            last edited by Straticah

            @bendurso Yes that makes a lot of sense - whats the way you used to save strings to a preset?

            Edit: oh i see you used a hidden label

            creating user interfaces: www.vst-design.com
            founder @prototype.audio https://www.prototype.audio/

            StraticahS bendursoB 2 Replies Last reply Reply Quote 0
            • StraticahS
              Straticah @Straticah
              last edited by

              @Christoph-Hart sry to bother - is there a less hacky way?
              @bendurso I would have never thought about that good idea.

              creating user interfaces: www.vst-design.com
              founder @prototype.audio https://www.prototype.audio/

              1 Reply Last reply Reply Quote 0
              • bendursoB
                bendurso @Straticah
                last edited by bendurso

                @Straticah Oh, I just reread your original question—you were actually asking how to do it.

                Yes, I used a label to save the samplemap name. The combobox still relies on the samplemaps array (with saveInPreset disabled), but I use the label to store the string name. Then I restore the combobox by matching the samplemap name.

                edit: actually, David told me to do this a couple a months ago lol.

                Christoph HartC 1 Reply Last reply Reply Quote 1
                • StraticahS Straticah has marked this topic as solved
                • Christoph HartC
                  Christoph Hart @bendurso
                  last edited by Christoph Hart

                  Multiple options:

                  1. Use a hidden panel with saveInPreset=true and store all loaded sample map in a JSON array, then call Panel.setValue() with this. In its control callback, restore all comboboxes / load the sample maps. The comboboxes must not be savedInPreset for this to work.
                  2. Use the custom user preset system and define your data model as you wish.

                  Number 2 is probably overkill, so I would go with option 1.

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

                  16

                  Online

                  1.9k

                  Users

                  12.5k

                  Topics

                  108.7k

                  Posts