Skip to content

A gen code of custom ADSR envelope.

Notifications You must be signed in to change notification settings

h1data/max-custom-adsr

Repository files navigation

日本語の説明はこちら

What is this?

A gen code of custom ADSR envelope. The concept is a hybrid one of adsr~ and live.adsr~, and use with live.adsrui.

Requirement

Max 8.3.0 or above. 8.2.x is okay but not in timing accuracy and may cause click noise when retrigger.

Usage

Create gen~ object and load the gendsp file. Input note on/off amplitude, pulse signal for retrigger, and messages from live.adsrui to gen~.

custom-adsr-image

See the sample patch for details.

Input messages

  • loopmode [int]: Switches envelope mode as the same as live.adsr~.
    0: normal ADSR (default)
    1: trigger mode (play to end mode in adsr~)
    2: loop mode

  • legato [int]: Switches the behavior when received note on while the envelope is active, as the same as adsr~.
    0: retrigger mode (default)
    none 0: legato mode

  • retrigger [float]: retrigger delay in msec, as the same as adsr~.

  • speed [float]: speed ratio of the envelope for 'Time<Vel' feature. (default=1.0)

  • float / signal

    • In the left inlet: note on / note off amplitude in 0 to 1.
    • In the second inlet: trigger input for retrigger behavior. Must be pulse signal from click~.
    • In the third inlet: attack time (the rest of inlets are same as live.adsr~)
    • In the fourth inlet: decay time
    • In the fifth inlet: sustain
    • In the sixth inlet: release time
    • In the seventh inlet: initial
    • In the eighth inlet: peak
    • In the ninth inlet: final
    • In the tenth inlet: attack slope
    • In the eleventh inlet: decay slope
    • In the twelfth inlet: release slope

Output

  • in the left outlet: the envelope signal.
  • in the second outlet: outputs 1 when the envelope is active. As the same as the second outlet of live.adsr~.
    <TIP> you can make mute message for thispoly~ from this output and edge~.
  • in the third outlet: outputs 1 when the envelope is active except release phase. Otherwise outputs 0. As the same as the second outlet of adsr~.

Miscellaneous

  • Curve shapes are not perfectly the same as live.adsr~.

About

A gen code of custom ADSR envelope.

Topics

Resources

Stars

Watchers

Forks

Languages