HISE Logo Forum
    • Categories
    • Register
    • Login

    Modify the attack of the sampler from a scripting knob call back

    Scheduled Pinned Locked Moved Scripting
    4 Posts 2 Posters 127 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.
    • D
      DobleDot23
      last edited by

      I've been looking a lot but I couldn't find a good answer. I think it has smt to do with

      const var sampler = Sampler.getSampler("SamplerName");
      sampler.setAttribute(Sampler.Attack, value);

      thats the chatgpt answer but it doesn't work lol.

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

        @DobleDot23

        You could connect the knob directly to the envelope's attack parameter in the interface designer, you don't have to script.

        However if you want to script it you need to get a reference to the envelope, not the sampler.

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

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

          @d-healey Thanks how do I reference the envelope in the script?

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

            @DobleDot23 Same way you did for the sampler, Synth.getModulator("myModulatorsID");

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

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

            42

            Online

            1.7k

            Users

            11.7k

            Topics

            102.3k

            Posts