Forum

    • Register
    • Login
    • Search
    • Categories

    Dynamically loading samples (Sampler, AudioLoopPlayer)

    Scripting Forum
    2
    3
    35
    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.
    • oskarsh
      oskarsh last edited by oskarsh

      Hey there!

      I'm trying to load some small generated samples over the network into different players. I've already got them loaded into the AudioLoopPlayer, but I'd love to have even more options for players. I'm thinking the sampler could be perfect for this, but I'm not sure if I can load .wav files on the fly.

      So my questions are:

      • Is it possible to have multiple AudioLoopPlayers, with each one being played by a different note?
      • Can I dynamically load .wav files into the Sampler? I don't need fast disk streaming.
      • Will I need to create a sample map to load into the sampler dynamically?

      Thanks for any help you can give me!

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

        I think you might find this useful - https://github.com/christophhart/hise_tutorial/tree/master/CustomSampleImport

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

        oskarsh 1 Reply Last reply Reply Quote 2
        • oskarsh
          oskarsh @d.healey last edited by

          @d-healey,

          Thanks for sharing your knowledge! I've gone through the code snippets and while it seems complex, it definitely gets the job done. I did want to mention that when loading the sample from the file path using local s = [Sampler1.parseSampleFile(filePath)];, it gives you a JSON sample map.

          To create the correct mapping, I used s[0]['LoKey'] and s[0]['HiKey'] to alter the JSON sample map. You can also set other common sample map parameters here.
          Since I'm able to predict that I'll always have the exact same mapping, this method works perfectly for me!

          Thanks again for your help!

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

          11
          Online

          1.1k
          Users

          6.8k
          Topics

          62.3k
          Posts