HISE Logo Forum
    • Categories
    • Register
    • Login

    AHDSR to modulate filter cutoff in Scriptnode

    Scheduled Pinned Locked Moved Solved ScriptNode
    20 Posts 4 Posters 836 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.
    • A
      aaronventure @arcy
      last edited by

      @arcy you need your envelope to modulate your cutoff. so the envelope is a scaler in this case. the envelope already outputs 0-1. you just need to multiply your cutoff with that value.

      in a separate modchain, add a math.add value and plug your Cutoff parameter into it. now add a math.mul node and plug your CV into that. now add a peak node and plug that into the frequency of your filter.

      arcyA 1 Reply Last reply Reply Quote 0
      • arcyA
        arcy @aaronventure
        last edited by

        @aaronventure thanks! now my Env knob correctly set the amount of modulation to the cutoff. Now how can I use my Cutoff knob to open the filter freq?

        A 1 Reply Last reply Reply Quote 0
        • A
          aaronventure @arcy
          last edited by

          @arcy your cutoff knob sets the math.add. (remember, this needs its own separate modchain node because it doesn't want any other signal there). your env sets the math.mul to apply scaling to the cutoff. your peak node sends the resultant value to whatever you plug in into, in this case the freq knob.

          if you now move the cutoff parameter, your freq should also be adjusting

          arcyA 2 Replies Last reply Reply Quote 1
          • arcyA
            arcy @aaronventure
            last edited by

            @aaronventure ooooook now it works, I confused the previous message. Thanks!!

            1 Reply Last reply Reply Quote 1
            • arcyA arcy has marked this topic as solved on
            • arcyA
              arcy @aaronventure
              last edited by arcy

              @aaronventure sorry, could you keep an eye?

              ok2.png

              It seems that all works but my env knob can't go to the multiplier because it's already plugged with CV...

              A 1 Reply Last reply Reply Quote 0
              • arcyA arcy has marked this topic as unsolved on
              • A
                aaronventure @arcy
                last edited by aaronventure

                @arcy it's a math problem.

                you need to decide how will your envelope behave. will the env button add the envelope to the current cutoff value, or will it apply the envelope to the current cutoff value?

                Then write this out as a math problem.

                If you want the envelope to apply to your current cutoff value and want to control the amplitude of the envelope itself, the equation is cutoff - (cutoff - cutoff * envelope) * amount = frequency.

                If you want the envelope to act on top of the cutoff value, it's a bit more problematic because you have to watch for limits and scale it appropriately.

                Now you just recreate this in scriptnode.

                arcyA 1 Reply Last reply Reply Quote 0
                • arcyA
                  arcy @aaronventure
                  last edited by

                  @aaronventure
                  So, in an example:

                  CUTOFF knob turn the filter freq to 400hz.
                  if ENV is 0, the freq behave normally without ADSR. The more I turn clockwise my ENV knob the more the modulation react FROM the current frequency (400 in our case).

                  It's the normal behaviour of any synth filter.

                  A 1 Reply Last reply Reply Quote 0
                  • A
                    aaronventure @arcy
                    last edited by

                    @arcy then you first need to decide the amount that the env knob is affecting. Is it simply multiplying the frequency and that's the max that the envelope can reach? Is it working off of a percentage of the delta between fmax and fcurrent? is it working off a percentage of the entire frequency range?

                    if it's working off the entire frequency range, your equation is current + 20000*env*amt with a clipper at the end. you'll likely have to fiddle with tables or skew values in your knobs to get the right curve because of the logarithmic response for filter frequency.

                    1 Reply Last reply Reply Quote 0
                    • arcyA
                      arcy
                      last edited by

                      Hi guys, I solved the problem with the pma node. I hope this can be useful for all:

                      6967c82b-1a54-4b4c-97a3-5952aceaca11-image.png

                      @aaronventure from a math pov your advice is super! I'll try to apply it with a custom Faust module.

                      Bye!

                      B 1 Reply Last reply Reply Quote 2
                      • arcyA arcy has marked this topic as solved on
                      • B
                        Ben Catman @arcy
                        last edited by

                        @arcy hey man, thx for posting your solution. Exactly what i was looking for. Great, thx!!!

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

                        52

                        Online

                        1.7k

                        Users

                        11.7k

                        Topics

                        102.1k

                        Posts