HISE Logo Forum
    • Categories
    • Register
    • Login

    Can a specific samplemap be loaded by passing the filename as string?

    Scheduled Pinned Locked Moved Scripting
    7 Posts 2 Posters 428 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.
    • FrankbeatF
      Frankbeat
      last edited by

      So far, I relied on the function

      sampleMaps=Synth.getSampler('Sam1').getSampleMapList();
      

      and browse through all available maps by a slider with this in the callback:

      Synth.getSampler('Sam1').loadSampleMap(sampleMaps[value]);
      

      But now that I need to restrict specific samplers to choose between very few maps only, so: Can I make an array with the filename strings of let's say 3 specific sample maps?

      Using HISE from the develop branch (Feb '23)

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

        @Frankbeat What does the sampleMaps array that you're currently using contain?

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

        FrankbeatF 1 Reply Last reply Reply Quote 0
        • FrankbeatF
          Frankbeat @d.healey
          last edited by Frankbeat

          @d-healey I don't yet use an array for this at all. I just use the built in function that looks up all maps that are contained in the project folder. But how would I do it, if Sampler 1 must only load maps bass-drum-1 and bass-drum2 but not maps with names other than those?

          Using HISE from the develop branch (Feb '23)

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

            @Frankbeat loadSampleMap(sampleMaps[value]); You're using an array here, it's called sampleMaps it was populated by the getSampleMapList function.

            So take a look inside the array (use the variable watch table or the trace command), and then you'll have the answer to your original question.

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

            FrankbeatF 1 Reply Last reply Reply Quote 0
            • FrankbeatF
              Frankbeat @d.healey
              last edited by

              @d-healey So I just need to call

              .loadSampleMap(samplemapnamehere.xml)
              

              ?

              Using HISE from the develop branch (Feb '23)

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

                @Frankbeat I'm not sure if the extension is required, just do the same as what's in the sampleMaps array.

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

                FrankbeatF 1 Reply Last reply Reply Quote 1
                • FrankbeatF
                  Frankbeat @d.healey
                  last edited by

                  @d-healey Solved, thank you very much! Indeed the suffix isn't needed.

                  Using HISE from the develop branch (Feb '23)

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

                  49

                  Online

                  1.7k

                  Users

                  11.7k

                  Topics

                  102.2k

                  Posts