HISE Logo Forum
    • Categories
    • Register
    • Login

    Samplemap Categories ?

    Scheduled Pinned Locked Moved General Questions
    16 Posts 5 Posters 1.2k 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.
    • DalartD
      Dalart
      last edited by

      I found the forum post I was referring to here: https://forum.hise.audio/topic/1146/viewport/22

      Looks like this was a @Christoph-Hart creation and will have to wait for him to have the time to chime in.

      1 Reply Last reply Reply Quote 0
      • DalartD
        Dalart
        last edited by

        Has anyone figured this out yet ?

        I'd like to be able to filter samplemaps per combobox basically.

        Example: ComboBox1 only show samplemaps that contain the word "Kick".
        ComboBox2 only show samplemaps that contain the word "Snare".

        I currently do not have any folders or sorting going on, just standard setup in the samplemaps folder.

        Thank you for any answers !!

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

          You can filter strings using regex or indexOf. So just loop through all the sample map names and pick out the ones that have the text you're interested in.

          For example

          for (i = 0; i < sampleMapNames; i++)
          {
              if (sampleMapNames[i].indexOf("kick") != -1)
                  Console.print("This is a kick sample map);
          }
          

          Libre Wave - Freedom respecting instruments and effects
          My Patreon - HISE tutorials
          YouTube Channel - Public HISE tutorials

          1 Reply Last reply Reply Quote 0
          • DalartD
            Dalart
            last edited by

            Thank you David, I shall tinker around with this.

            1 Reply Last reply Reply Quote 0
            • DalartD
              Dalart
              last edited by

              Ok it has been awhile since I asked for help on this question and I appreciate the answer I received.

              After bouncing around on projects for a few months I have gotten back to this position again and can't figure out how to implement this for loop and use it with the code for a combo box below.

              My mind is not connecting the dots on this one (extreme n00b here), so Im asking for help again.

              I went back to this thread where @d-healey created a code for me using a for loop method but I was uncertain how to apply the same technique for a combo box.

              Thanks in advance for anyone who has time to help !

              for (i = 0; i < sampleMapNames; i++)
              {
                  if (sampleMapNames[i].indexOf("kick") != -1)
                      Console.print("This is a kick sample map");
              }
              
              const var Sampler = Synth.getSampler("Sampler");
              const var sampleMapList = Sampler.getSampleMapList();
              ComboBox.set("items", sampleMapList.join("\n"));
              inline function onComboBoxControl(component, value)
              {
              Sampler.loadSampleMap(sampleMapList[value-1]);	
              };
              
              ComboBox.setControlCallback(onComboBoxControl);
              
              LindonL 1 Reply Last reply Reply Quote 0
              • LindonL
                Lindon @Dalart
                last edited by Lindon

                @Dalart said in Samplemap Categories ?:

                Ok it has been awhile since I asked for help on this question and I appreciate the answer I received.

                After bouncing around on projects for a few months I have gotten back to this position again and can't figure out how to implement this for loop and use it with the code for a combo box below.

                My mind is not connecting the dots on this one (extreme n00b here), so Im asking for help again.

                I went back to this thread where @d-healey created a code for me using a for loop method but I was uncertain how to apply the same technique for a combo box.

                Thanks in advance for anyone who has time to help !

                for (i = 0; i < sampleMapNames; i++)
                {
                    if (sampleMapNames[i].indexOf("kick") != -1)
                        Console.print("This is a kick sample map");
                }
                
                const var Sampler = Synth.getSampler("Sampler");
                const var sampleMapList = Sampler.getSampleMapList();
                ComboBox.set("items", sampleMapList.join("\n"));
                inline function onComboBoxControl(component, value)
                {
                Sampler.loadSampleMap(sampleMapList[value-1]);	
                };
                
                ComboBox.setControlCallback(onComboBoxControl);
                

                so just change this;

                var myPreferedList = [];
                for (i = 0; i < sampleMapNames; i++) {
                    if (sampleMapNames[i].indexOf("kick") != -1)
                         myPreferedList.push(sampleMapNames[i]);
                        //Console.print("This is a kick sample map");
                }
                

                to get an array of names and then put that in your combobox:

                ComboBox.set("items", myPreferedList.join("\n"));

                HISE Development for hire.
                www.channelrobot.com

                1 Reply Last reply Reply Quote 0
                • DalartD
                  Dalart
                  last edited by

                  Im not sure I understand how:

                  var myPreferedList = [];
                  

                  would get the contents of:

                  const var sampleMapList = Sampler.getSampleMapList();
                  
                  LindonL 1 Reply Last reply Reply Quote 0
                  • LindonL
                    Lindon @Dalart
                    last edited by

                    @Dalart -- this was just a modification of your example of how to look through an array of names for the ones you want then put them into another array.

                    So can you work out how to apply this approach to SampleMapList?

                    HISE Development for hire.
                    www.channelrobot.com

                    DalartD 1 Reply Last reply Reply Quote 0
                    • DalartD
                      Dalart @Lindon
                      last edited by

                      @Lindon Havent had a chance to figure it out yet. Had a heart attack a week ago, will see if I can figure it out today.

                      Dan KorneffD L 2 Replies Last reply Reply Quote 0
                      • Dan KorneffD
                        Dan Korneff @Dalart
                        last edited by

                        @Dalart said in Samplemap Categories ?:

                        Had a heart attack a week ago

                        🤕 hope you're feeling better

                        Dan Korneff - Producer / Mixer / Audio Nerd

                        1 Reply Last reply Reply Quote 0
                        • L
                          LeeC @Dalart
                          last edited by

                          Take it steady @Dalart.
                          Hope you're recovering mate!

                          1 Reply Last reply Reply Quote 0
                          • DalartD
                            Dalart
                            last edited by Dalart

                            Thanks for the recovery wishes, It has been awhile and I seem to be recovering so far.

                            So I wandered back to this project and tried the solution above that Lindon helped me with but Im not getting any result in the ComboBox list can someone help find what Im doing wrong here ?

                            The code I used in my attempt is:

                            const var ComboBox1 = Content.getComponent("ComboBox1");
                            const var Sampler1 = Synth.getSampler("Sampler1");
                            const var sampleMapList1 = Sampler1.getSampleMapList();
                            
                            var myPreferedList1 = sampleMapList1;
                            for (i = 0; i < sampleMapNames; i++) {
                                if (sampleMapNames[i].indexOf("Kick") != -1)
                                     myPreferedList1.push(sampleMapNames[i]);
                                    
                            }
                            
                            ComboBox1.set("items", myPreferedList1.join("\n"));
                            
                            inline function onComboBox1Control(component, value)
                            {
                            Sampler1.loadSampleMap(myPreferedList1[value-1]);	
                            };
                            
                            ComboBox1.setControlCallback(onComboBox1Control);
                            

                            I am trying to limit which samplemaps are visible in each ComboBox I am using for each sampler.
                            None of my samplemaps are numbered as in Kick1, Kick 2, but are named like BasicKick, HeavyKick, etc.

                            LindonL 1 Reply Last reply Reply Quote 0
                            • LindonL
                              Lindon @Dalart
                              last edited by Lindon

                              @Dalart

                              HiseSnippet 1502.3oc4XstaSbDEd23rTrgPAD+nUpUZjU+gsTvwFHPkPU3DmDTDDvJNPqTZDZxtismlcmY0L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XywtBHYtYaY+UNISXqkOesVxzUcZuPadoDOe2sNtvtasS5tuR9t+4Nlgo0hmeVCdev6v2ArtbuHerpLUr98GIFft7RbdZdMljplTr5+AvO2dl7yclUS1BB2q4zmpbGOa7txLvqtq8uY7l7Zm0b1c3PhqJGrq5r2OrrOsY4fxWGCkq6LPIH3.JaTxjYCdp4jNm9iwCPCW3GfBb.FdA5uTvs2zc6HndIJq825Z1psB3QrR6UBxOjDRvJ33uPLWr6gG9PAOJb5nd6CLMKGI.pDnTTzvSYDntqJli8DbobHjNl0RVzT+HwHcsJWygjyIBYYcOIJ.N6YLhuTe4TOw6YRh9rl5d.VInurn2lco8QXy4M7pbibmoju0Tx2dJ46Lk7lSIe2ojuWtbFKstynpyVO5626Es27c3v9rEiCCVm9XHyK3ILMLaOh0TdRSAWyJ8F3U3mhLiGxegOA+NiO9yw9qO1sxhA2+jeJT0TLNfpOp1kcNbUEznw30Atyg3HeUp1xiMNfy3gi4Lpa4KFPi9nQDQQrOyDZKkBtWlq4FcOj3SvxB2r+ltOFdUJVT999GTsnyhWKl240W3DCWjdVG5+FzkU9eOc47JcWIgrDA6tP8u7y4K6XFuizrwepf5g7HEvxlxz4.zgCfm.3RJRJpewZhbasrFPCHLOivuCeRL1IkAUarSpQK2zkBxsjua9k.1UHLM0g4Uf9.2rewVZI7PCMj.Vu+QPY.1Uvega7OzQi0KZz.njY9+fqpyAZYT1OOxwocq1VA.W0Kbc0WDtITgmcL2ZIh41KQL2YIhYykHl6tDwbukHluctwnelvVQJdP7PRPQ+ciarr2Mqwph0e3OFxmM
                              

                              HISE Development for hire.
                              www.channelrobot.com

                              1 Reply Last reply Reply Quote 0
                              • LindonL
                                Lindon
                                last edited by

                                or your simpler version :

                                HiseSnippet 1409.3oc4XstaaaCEVJNrqVqonsn+X+XCPyX+vFM0vtsIc.YA04ZQPtYDk1MfthBFYZaNKQJPQkEuh9NMrmf9nrGg9FrcH0cGmTuf0KXyFHvmaje7bN57QktBtKILjKLLqd73.hg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wCzskPP+uwM2Bl4at0UP733dNzeqfausy5QP9RTV6u2QuUq4yiXk1qDjeDIffkP4uz7giN5oBdTvjQ8tmnaVNFnwFAohhFNjQf7tr3YbCAOLrObbzqUXQSciDCT4pbMGQNkHBKq6fHen1yXDO0rYSSP0yBIpZM0cerTPOqn25co0wXc8FtNqVt8DxOXB4GNg7ilPdoIjWdB4GmK6jdIAUmQUzZ69ia+pVKcNNluX13Xf0oKFN4E7DFOlsGwZJ1Gmks0Hpv01mxkdu1m02I+i2j1JyFbeOu1P0TL5PUUmsXmBOcBZTX7N.6YebjmLUa4IE6yY7fgbF0s7yBPu8fADQQrO0CzZRI7nXtl614HhGAGV3g4uqydTFAKJ+H9+nbQ6YOWbY0quBECWa03M6+avPV4+8LjWVp6lI7i1vtKjelWmuAROQ2VQ.+oBpGwij.wZJ4FBX.c.VeWRQdv4TbqwxsTxJ.4PX8zB+E7IwX6TRSkw1oFMbSWJ3rk7a86BXVgvTTG5K94AzwdEaoCg6VnfDPz8QAk9XWA+UtwuniBqWWqAPIS++qpJZekrc6zWtAgZ0rkgOvU8JWW0CB2GxvSOlGbEh4gWgXdzUHlktBwr7UHlGeEh46uzXTWSXsHI2OdHInn6VwMVlak0XUw3uwgniZD
                                

                                HISE Development for hire.
                                www.channelrobot.com

                                DalartD 1 Reply Last reply Reply Quote 1
                                • DalartD
                                  Dalart @Lindon
                                  last edited by

                                  @Lindon said in Samplemap Categories ?:

                                  HiseSnippet 1409.3oc4XstaaaCEVJNrqVqonsn+X+XCPyX+vFM0vtsIc.YA04ZQPtYDk1MfthBFYZaNKQJPQkEuh9NMrmf9nrGg9FrcH0cGmTuf0KXyFHvmaje7bN57QktBtKILjKLLqd73.hg4MPNiYxgaLDSYF6rog4MQ6iCkDgcrp0GGfCCI8LLMq7TkBypyan+7tmrN1CybI4pLLdNm5R1i5Sk4Z61YWpm213djio9E79Qc1wky1f6wi.7TA0xH.6NBOfb.V41bHCyqsUOpjKbjXIIzvb9048F6Lj+qrX+e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0cerTPOqn25co0wXc8FtNqVt8DxOXB4GNg7ilPdoIjWdB4GmK6jdIAUmQUzZ69ia+pVKcNNluX13Xf0oKFN4E7DFOlsGwZJ1Gmks0Hpv01mxkdu1m02I+i2j1JyFbeOu1P0TL5PUUmsXmBOcBZTX7N.6YebjmLUa4IE6yY7fgbF0s7yBPu8fADQQrO0CzZRI7nXtl614HhGAGV3g4uqydTFAKJ+H9+nbQ6YOWbY0quBECWa03M6+avPV4+8LjWVp6lI7i1vtKjelWmuAROQ2VQ.+oBpGwij.wZJ4FBX.c.VeWRQdv4TbqwxsTxJ.4PX8zB+E7IwX6TRSkw1oFMbSWJ3rk7a86BXVgvTTG5K94AzwdEaoCg6VnfDPz8QAk9XWA+UtwuniBqWWqAPIS++qpJZekrc6zWtAgZ0rkgOvU8JWW0CB2GxvSOlGbEh4gWgXdzUHlktBwr7UHlGeEh46uzXTWSXsHI2OdHInn6VwMVlak0XUw3uwgniZD

                                  Thank You @Lindon, I appreciate your help once again.

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

                                  49

                                  Online

                                  1.7k

                                  Users

                                  11.7k

                                  Topics

                                  102.0k

                                  Posts