HISE Logo Forum
    • Categories
    • Register
    • Login

    AHDSR to modulate filter cutoff in Scriptnode

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

      Hi! I'm trying to create a Faust filter within Scriptnode. Now I have to modulate the cutoff by an AHDSR, but I did not find any doc that explains that.
      Please anyone could help me?
      Faust filter adsr.png

      LindonL 1 Reply Last reply Reply Quote 0
      • LindonL
        Lindon @arcy
        last edited by

        @arcy so add a midi (I think) container and put your envelope in there - then route its output to the filter freq.

        HISE Development for hire.
        www.channelrobot.com

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

          @Lindon said in AHDSR to modulate filter cutoff in Scriptnode:

          @arcy so add a midi (I think) container and put your envelope in there - then route its output to the filter freq.

          mmh are you sure? If I add a midi container I get an input output error.

          LindonL 1 Reply Last reply Reply Quote 0
          • LindonL
            Lindon @arcy
            last edited by

            @arcy you probably need to spend a bit more time in scriptNode to work out how to get modulator and midi containers set up.

            HISE Development for hire.
            www.channelrobot.com

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

              @Lindon for sure, but docs lacks of many info about that and in other threads I did not find any useful info, so it's not that simple to learn...
              Anyway, I don't need midi. I only have an env parameter that I'll connect to my UI.

              LindonL 1 Reply Last reply Reply Quote 0
              • LindonL
                Lindon @arcy
                last edited by Lindon

                @arcy said in AHDSR to modulate filter cutoff in Scriptnode:

                @Lindon for sure, but docs lacks of many info about that and in other threads I did not find any useful info, so it's not that simple to learn...
                Anyway, I don't need midi. I only have an env parameter that I'll connect to my UI.

                how do you plan to trigger your envelope? -actually you might just need a separate container for the env i cant off hand remember..

                HISE Development for hire.
                www.channelrobot.com

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

                  @Lindon generally an envelope trigger by the gate signal...

                  LindonL 1 Reply Last reply Reply Quote 0
                  • LindonL
                    Lindon @arcy
                    last edited by

                    @arcy ..so you are most of the way there then...

                    HISE Development for hire.
                    www.channelrobot.com

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

                      @Lindon ok, so I put a midi container to gate my mod container and the signal path correctly flow through the container and the ADSR visually react...but inside the mod container I can't target the CV out to the freq filter...

                      Screenshot 2024-05-14 174827.png

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

                        Ok, disconnecting my Cutoff parameter knob now I can target the freq with the CV output...but now I don't know how can I control the freq with my knob AND control the amount of envelope...

                        Screenshot 2024-05-14 175541.png

                        A 1 Reply Last reply Reply Quote 0
                        • 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

                                            49

                                            Online

                                            1.7k

                                            Users

                                            11.7k

                                            Topics

                                            101.9k

                                            Posts