Forum
    • Categories
    • Register
    • Login

    Enable Specific Sampler for Synth.playNote()

    Scheduled Pinned Locked Moved Solved General Questions
    3 Posts 2 Posters 59 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.
    • O
      obolig
      last edited by

      I'm working on a project with many samples. This has led me to place multiple samples on the same keys, but in different samplers. I'm ignoring the original event and creating a new one using Synth.playNote(). How can I make it so that only a specified sampler is triggered by this event?

      In addition to this, can I adjust the gain of this note using the returned event ID of Synth.playNote()?

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

        @obolig Put the script that plays the note within the sampler's MIDI processor chain, then it will only affect that sampler.

        You can use Synth.addVolumeFade to control the gain.

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

        1 Reply Last reply Reply Quote 0
        • O
          obolig
          last edited by

          Thank you for the help @David-Healey ! This worked perfectly.

          I would like to include a few additional notes. There is a good bit of information that needed to be passed to each sampler. The interface relayed this information to controls in the MIDI Processors via interface control callbacks in the following format:
          scriptProcessor.setAttribute(controlIdx, value);

          In the onNoteOn block, Message.ignoreEvent(true) and Message.makeArtificial() were called. The note IDs produced by the Synth.playNote() command were stored in an array that was referenced when turning off the notes with Synth.noteOffByEventId() in the onNoteOff block.

          1 Reply Last reply Reply Quote 0
          • O obolig has marked this topic as solved
          • First post
            Last post

          6

          Online

          3.0k

          Users

          14.0k

          Topics

          121.8k

          Posts