Applying AHDSR Envelope to Customized FX Effect



  • Hello, @Christoph-Hart!
    I am going to make a customized FX effect binary module and load it dynamically.
    And here I have faced some problems.
    I want to apply AHDSR envelope to the parameter of my new effect, for example cutoff of LPF.
    0_1498464773672_upload-cc12880c-6e6f-428a-bd1c-a6a2561715cf
    However, I can't be sure how I can add modulators and link them to parse values to loaded binary module.
    Please let me get some simple example for it.
    Thanks.



  • This is not easy because the current C++ to Javascript API doesn't work on voice level (and performance starts to become an issue there). However I could add support for custom filter algorithms in the default filter module as I can imagine that people want to make their own filters. Would that be ok?



  • I want to add following filter module, where ADSR envelope should be applied for filter parameters: cutoff, resonance, ...

    0_1498495483283_upload-7dd48e2c-02c1-4c67-9de7-7e704f4b40ca

    And moreover, I need to apply LFO modulation to cutoff parameter value.
    I have C++ codes for it and I hope to get how I can do those things.



  • If you don't have special algorithms for your filter, it should be sufficient to use the filters (and add missing algorithms) in HISE as they offer modulation of the cutoff frequency with all possible modulators on voice level. What filters do you need besides the all pass?



  • Low pass, High pass, Band Pass, Notch, Allpass, Peak, Hybrid are just what I want.
    And the most important thing is to know how I can connect AHDSR envelope or LFO modulation to filter/effect parameters.
    It may cause some issues because of managing parameters between threads. So I need to be serious to do that.



  • Have a look at the polyphonic filter. Most of the filter types are there and can be automated with LFO. Mutlithreading is no problem here because modulators are rendered on the audio thread.



  • Yeah, I can find some filters in polyphonic filter. But there are few parameters that I can control. Is it possible to add parameters or change algorithms of such filters?
    And you are saying modulators are rendered on the audio thread, so may I set parameter values in "processBlock" function of customized Script Fx?



  • What other parameters do you need? I wanted to improve the filters for a long time anyway so if you have some ideas, let me know.

    You can call setParameter() from any thread, it tries to be as lock free as possible (using atomics for single values etc). But I am not sure why you want to set the parameter in the processBlock function, if you use the filters from HISE, you don't need to touch the script FX stuff.



  • This is an example patch with an envelope, velocity and LFO modulating the cutoff frequency of a state variable lowpass filter:

    HiseSnippet 1061.3oc6X8zbaTCEWqczzTZZfRyvzi9.bhgL1tAZ4T2Dm3VO0tw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