HISE Logo Forum
    • Categories
    • Register
    • Login

    Sampler Gain - Slider bug?

    Scheduled Pinned Locked Moved General Questions
    7 Posts 3 Posters 75 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.

      d.healeyD 1 Reply Last reply Reply Quote 0
      • d.healeyD
        d.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.

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

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

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

          d.healeyD 1 Reply Last reply Reply Quote 0
          • d.healeyD
            d.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.

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

            P 1 Reply Last reply Reply Quote 0
            • P
              paper_lung @d.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

              d.healeyD ChazroxC 2 Replies Last reply Reply Quote 0
              • d.healeyD
                d.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).

                Libre Wave - Freedom respecting instruments and effects
                My Patreon - HISE tutorials
                YouTube Channel - Public 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

                  22

                  Online

                  1.9k

                  Users

                  12.3k

                  Topics

                  107.4k

                  Posts