Forum
    • Categories
    • Register
    • Login

    Sampler Gain - Slider bug?

    Scheduled Pinned Locked Moved General Questions
    7 Posts 3 Posters 405 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.
    • P
      paper_lung
      last edited by

      I'm either missing something or there's a bug - when I apply a slider to a Sampler gain value, if the slider is set to Decibel, the control doesn't work and sets the Sampler gain value to -100db. I'm just using the component editor. What am I missing? I can't use a simple gain, as the sampler is in a synthesizer group and it looks like that isn't an option.

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

        @paper_lung The sampler uses a different range. There is an engine function that can do the conversion for you.

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

        P 1 Reply Last reply Reply Quote 0
        • P
          paper_lung @David Healey
          last edited by

          @d-healey Thanks. Am I looking for Engine.getGainFactorForDecibels? Do you have any examples of how this works?

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

            @paper_lung That's the one. Pass in the decibel value (your slider value) and it will give you a gain factor value, which is what the sampler's gain uses.

            If this is a user controllable slider on your interface it's usually better to connect it to a simple gain effect instead of directly to the sampler's gain. This is because the sampler's gain doesn't have any smoothing so if you move the slider quickly while audio is playing you will sometimes hear audio artifacts.

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

            P 1 Reply Last reply Reply Quote 0
            • P
              paper_lung @David Healey
              last edited by

              @d-healey Cool thanks, that's worked, but as you say - there's audio artefacts. I might have to use script fx instead, in that case, as simple gain doesn't seem to be available in synthesizer grouped instruments

              David HealeyD ChazroxC 2 Replies Last reply Reply Quote 0
              • David HealeyD
                David Healey @paper_lung
                last edited by

                @paper_lung In a synth group you could add a CC modulator and connect your slider to its DefaultValue knob. You'll need to write a function to convert the decibel value to a range of 0-127 (ChatGPT can help with this).

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

                1 Reply Last reply Reply Quote 0
                • ChazroxC
                  Chazrox @paper_lung
                  last edited by

                  @paper_lung drop a snippet.

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

                  24

                  Online

                  2.1k

                  Users

                  13.1k

                  Topics

                  113.4k

                  Posts