12 users online: Anas, BallisticAristocrat, Laplantestrong, MarioSonic4life, monkey03297, Natsuz2, Paperdomo101, PlainOleTrey, ShadowBoxer_Sandshrew, Shuttles, SteamyPanini, TheJank - Guests: 71 - Bots: 157
Users: 55,590 (2,468 active)
Latest user: StrangeEric

ADSR Command

Since I wasn't able to find something really useful about it here I decided to write something about the $ED command. (originally written on PukiWikie but translated and rewritten for proper understanding by me)

The ADSR Command

The $ED command allows you to add sharpness to an instrument, fading and much more.
For more details see picture below:

(1) Wait until the tone reaches the maximum volume. (Red)
(2) Then add some sharpness to it. (Blue)
(3) Delay of the tone. (Green)
(4) Fading of the tone. (maximum volume is 1/10 for the specified time)


(1) & (2) are commands in $XX
(3) & (4) are commands in $YY

See table for values and usage.

Let's say you want the length of 0,38 seconds (380 msec).
(1) = 5 from the table.

$XX works as follows:

(1) = 5, (2) = 3 would be $65 in that case.
(3x10 = 30 → 60 + 5 = 65)

All you do is mulitply (2) by 10 and add (1) to it.

$YY works as follows:

(3) = 5, 4 = 1D would be $BD in that case.
(5x2 = A → Ax10 = A0 → A0 + 1D = BD)

This is a bit more complex but still easy after all, since you can use the calculator for it. :P

All you do is mulitply (3) by 2, then mulitply the result by 10 and add (4) to it.

Credtis for original explanation and images go to PukiWiki.

I hope this helps using $ED command. :)
Yes, it does use that command. Also, I googled ADSR and found this on Wikipedia:


How quickly the sound reaches full volume after the sound is activated.

How quickly the sound drops to the sustain level after the initial peak.

The "constant" volume that the sound takes after decay until the note is released. Note that this parameter specifies a volume level rather than a time period.

How quickly the sound fades when a note ends.
All songs where it says "N-SPC Patch" and probably some others.
Ah, that explains the point of $YY. Experimented with it a bit, but never really paid enough attention to realize it has to do with ADSR.

Nice one Ice Man.
Wow looking at page 3 sometimes really makes sense...

Thanks for the tutorial Ice Man it really helped.
Obsoleted by interactive AMK readme.
Your layout has been removed.