Forum
    • Categories
    • Register
    • Login

    Combobox List Alphabetically

    Scheduled Pinned Locked Moved General Questions
    comboboxlistingalphabetical
    19 Posts 3 Posters 3.3k 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.
    • soundsyncS
      soundsync @David Healey
      last edited by

      @d-healey Thanks. Does it go within the "rootlist" element? I've tried placing it where I suspected it would go but get the error "Unknown function 'sort'" whenever I try to compile.

      David HealeyD 1 Reply Last reply Reply Quote 0
      • David HealeyD
        David Healey @soundsync
        last edited by

        @trillbilly allList.sort() probably.

        Free HISE Bootcamp Full Course for beginners.
        YouTube Channel - HISE tutorials
        My Patreon - More HISE tutorials

        soundsyncS 1 Reply Last reply Reply Quote 0
        • soundsyncS
          soundsync @David Healey
          last edited by soundsync

          @d-healey ahhh, yes, I see now. I added this and it did nothing to effect the list. I also use allList.sortNatural which did work, but now it loads the samples out of order (kind of like when you move samplemaps around or add new samplemaps).

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

            @trillbilly said in Combobox List Alphabetically:

            @d-healey ahhh, yes, I see now. I added this and it did nothing to effect the list. I also use allList.sortNatural which did work, but now it loads the samples out of order (kind of like when you move samplemaps around or add new samplemaps).

            -probably because you are not sorting allIds, try sorting e.getAudioFileList instead...

            Guessing something like this(not at my machine):

            var afl =[];
            for(e in expansionList)
            {
                afl = e.getAudioFileList();
                afl.sortNatural();
                for(af in afl)
                {
                    allList.push(af.split("}")[1]);
                    allIds.push(af);
                }
            }
            

            HISE Development for hire.
            www.channelrobot.com

            soundsyncS 1 Reply Last reply Reply Quote 0
            • soundsyncS
              soundsync @Lindon
              last edited by

              @Lindon Thanks, that seemed to do the trick! 2 samples are still out of order but they load the correct audiofile. Ill try deleting and exporting t hem again to see if they fall in place.

              LindonL soundsyncS 2 Replies Last reply Reply Quote 0
              • LindonL
                Lindon @soundsync
                last edited by

                @trillbilly that may well be a naming issue - lower and upper case etc.

                HISE Development for hire.
                www.channelrobot.com

                soundsyncS 2 Replies Last reply Reply Quote 0
                • soundsyncS
                  soundsync @Lindon
                  last edited by

                  @Lindon I dont think its naming. Ive posted a pic of the names below. Its exactly as I named the audiofiles. I just got into the studio and will try the delete method to see if it works.

                  alt text

                  1 Reply Last reply Reply Quote 0
                  • soundsyncS
                    soundsync @Lindon
                    last edited by

                    @Lindon @d-healey I changed name with no results. I also deleted and exported the samples again with a new name and still, the new files show at the bottom of the list.

                    I will export some new samples to the audiofiles folder and see if they load correctly.

                    1 Reply Last reply Reply Quote 0
                    • soundsyncS
                      soundsync @soundsync
                      last edited by

                      @d-healey @Lindon When I add new samples to AudioFiles, they are also at the bottom of the list now, even after recompiling. Here is the new code with @d-healey advice and script. Can you see what Ive done wrong?

                      const var SlotSelectors = 
                      [Content.getComponent("SampleSelection1"),
                      Content.getComponent("SampleSelection2"),
                      Content.getComponent("SampleSelection3"),
                      Content.getComponent("SampleSelection4")];
                      
                      const var AudioLoopPlayers = [Synth.getAudioSampleProcessor("LoopPlayer1"),
                      Synth.getAudioSampleProcessor("LoopPlayer2"),
                      Synth.getAudioSampleProcessor("LoopPlayer3"),
                      Synth.getAudioSampleProcessor("LoopPlayer4"),];
                      
                      
                      const var expHandler = Engine.createExpansionHandler();
                      const var expansionList = expHandler.getExpansionList();
                      
                      
                      const var allList = [];
                      const var allIds = [];
                      
                      const var rootList = Engine.loadAudioFilesIntoPool();
                      
                      allList.push("No Sample Loaded");
                      allIds.push("");
                      
                      for(r in rootList)
                      {
                          allList.push(r.split("}")[1]);
                          allIds.push(r);
                      }
                      
                      
                      var afl =[];
                      for(e in expansionList)
                      {
                          afl = e.getAudioFileList();
                          afl.sortNatural();
                          for(af in afl)
                          {
                              allList.push(af.split("}")[1]);
                              allIds.push(af);
                          }
                      }
                      
                      for(s in SlotSelectors)
                          s.set("items", allList.join("\n"));
                      
                      
                      
                      inline function onSlotSelectorControl(component, value)
                      {
                          local index = SlotSelectors.indexOf(component);
                          
                          if(value != 0)
                          {
                      	AudioLoopPlayers[index].setFile(allIds[value-1]);
                          }
                      };
                      
                      const var numbers = [64, 48];
                      const var ids = [-1, -1];
                      
                      for(s in SlotSelectors)
                          s.setControlCallback(onSlotSelectorControl);
                      
                      David HealeyD 1 Reply Last reply Reply Quote 0
                      • David HealeyD
                        David Healey @soundsync
                        last edited by

                        @trillbilly Why are you using sortNatural instead of sort?

                        Free HISE Bootcamp Full Course for beginners.
                        YouTube Channel - HISE tutorials
                        My Patreon - More HISE tutorials

                        soundsyncS 1 Reply Last reply Reply Quote 0
                        • soundsyncS
                          soundsync @David Healey
                          last edited by

                          @d-healey I was just trying to see if it made any difference. They both do the same thing in this case. Sorts all previous audiofiles but new audiofiles list at the bottom and out of order.

                          David HealeyD 1 Reply Last reply Reply Quote 0
                          • David HealeyD
                            David Healey @soundsync
                            last edited by

                            @trillbilly What happens if you sort root list instead? I haven't looked through your code so there might be something obvious but I don't have time at the moment

                            Free HISE Bootcamp Full Course for beginners.
                            YouTube Channel - HISE tutorials
                            My Patreon - More HISE tutorials

                            soundsyncS 1 Reply Last reply Reply Quote 0
                            • soundsyncS
                              soundsync @David Healey
                              last edited by

                              @d-healey Youree right, it is part of my issue, I sorted the allList.sort instead of rootList.sort. This fixed the issue for the most part. Now my issue is.

                              1. I have a repeating sample, and they are not even one above the other. It only repeats one time.

                              example:
                              GTR A
                              GTR B
                              GTR A
                              GTR C
                              GTR D
                              so on...

                              1. If I add a new sample that has a name that would go before my current first sample (GTR A) then that sample doesnt show. Its almost like it replaces that sample with itself?
                              David HealeyD 1 Reply Last reply Reply Quote 0
                              • David HealeyD
                                David Healey @soundsync
                                last edited by

                                @trillbilly You could just put a number at beginning of each one and then you get the order you want.

                                Free HISE Bootcamp Full Course for beginners.
                                YouTube Channel - HISE tutorials
                                My Patreon - More HISE tutorials

                                soundsyncS 1 Reply Last reply Reply Quote 0
                                • soundsyncS
                                  soundsync @David Healey
                                  last edited by

                                  @d-healey I could, but doesnt look as good from the user end. I was hoping to name them GTR Name, PAD Name, SYN Name, etc so they are easy to view in the dropdown combobox.

                                  I will keep plucking away for the time being. Just strange behavior is all.

                                  David HealeyD 1 Reply Last reply Reply Quote 0
                                  • David HealeyD
                                    David Healey @soundsync
                                    last edited by David Healey

                                    @trillbilly You don't have to display the numbers to the end user ;) They're just used for sorting. Look up substring()

                                    Free HISE Bootcamp Full Course for beginners.
                                    YouTube Channel - HISE tutorials
                                    My Patreon - More HISE tutorials

                                    soundsyncS 1 Reply Last reply Reply Quote 0
                                    • soundsyncS
                                      soundsync @David Healey
                                      last edited by

                                      @d-healey Of course they are lol. I will check it out. Thanks.

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

                                      11

                                      Online

                                      2.4k

                                      Users

                                      13.8k

                                      Topics

                                      120.3k

                                      Posts