Attack, Decay, Sustain, Release Sound synthesizers use envelope generators to control how certain parameters of the sound (such as overall loudness) change with time. In many synthesizers an envelope is defined by four parameters, as represented in the following figure from Wikipedia:

Attack time (A): time taken for the envelope to reach its maximum level, starting from zero, when the key is first pressed.
Decay time (D): time taken for the envelope to reach the specified sustain level.
Sustain level (S): level which is maintained, after the initial attack and decay, for as long as the key is being pressed.
Release time (R): time taken for the envelope to reach zero when the key is released.


The challenge
Input the four parameters A, D, S, R and plot the envelope.
Parameters will be integer values from 0 to 127.
The maximum level (reached at the end of the attack phase) will be assumed to be 127.
The horizontal segment at the sustain level will be assumed to have duration 64 (in the actual sound this duration is not fixed, but is determined by the amount of time that the key is held).
Format and further details
The output should be an image in raster or vector format. If it's raster, the polygonal line should occupy at least 50 pixels vertically an horizontally.
The image can be either displayed or produced as a file in a standard image format. The file can be written to disk, or its exact contents can be output, either to STDERR or as function return argument.
The graph need only contain the polygonal line that defines the envelope. The scale of each axis can be freely chosen. Other elements such as axis lines, numeric labels or line colors are optional.
Input means and format are flexible as usual. For example, you can take the four numbers in any order, or an array containing them. A program or a function can be provided. Standard loopholes are forbidden.
Shortest code in bytes wins.
Test cases
Input is in the format [A D S R]. Note that the scale is different in each figure (in accordance with the rule that scale can be freely chosen)
[15 30 70 40]


[64 64 64 64]


[0 10 50 80]


[0 0 90 80]


[5 50 0 0]


[5 50 0 80]


[24 32 127 48]
TikZ, 195 193 181 177 172 167 163 160 159 bytes

Thanks to David Carlisle for his helpful answer here

\documentclass[tikz]{standalone}\begin{document}\tikz\def~#1{\typein[#1];}~\a~\s~\d~\r\def\u{)--(\a+\d}\draw(,)--(\a,127\u,\s\u+64,\s\u+\r+64,);\end{document}


Yes, you heard right TikZ.

Explanation

This uses a couple of techniques to achieve its goal.  The first thing is input.  Most people might not know that LATEX can take input.  Well it can.  This is achieved with the command \typein.  This will halt the compiler and request input from the user as assign it to a variable.

The other main technique is the use of \def.  \def in Tikz is absurdly powerful.  It essentially defines a piece of code and pastes it everywhere you call the variable.  In this code we define two things \typein[#1]{} so that we can assign our variables golfily and )--(\a+\d because this code shows up a bunch of times in the ungolfed version.

Here are two versions of the code (without the wrapper):

Golfed:

\documentclass[tikz]{standalone}\begin{document}\tikz\def~#1{\typein[#1];}~\a~\s~\d~\r\def\u{)--(\a+\d}\draw(,)--(\a,127\u,\s\u+64,\s\u+\r+64,);\end{document}


Ungolfed:

\typein[\a]{}\typein[\s]{}\typein[\d]{}\typein[\r]{}\draw(0,0)--(\a,127)--(\a+\d,)--(\a+\d+64,)--(\a+\d+\r+64,0);


Image:

Since I cannot upload a pdf image directly, and converting it to any other format seems to cause the line to disappear altogether, here is what an image might look like when opened in Preview (input for this image is [64 64 64 64]):



As you can see it is very thin.  However because it is a PDF image and not a raster image does not have to comply with thickness requirements.