complex envelopes with line~

Pete's icon

I am struggling to understand the numeric arguments in the Basics Tutorial 3: Wavetable Oscillator. I think I understand the example 0, 0 1 500 0. 500 - so firstly the value of 0 is sent to line~ to reset the volume to 0; then '0 1 500' refers to 500ms referring from a volume of 0 to 1; and back to volume 0 over 500ms...I think.

What I dont understand is the longer arguments in opening the tutorial such as 0, 1. 100 0.5 800 0.125 10 0. 400

Firstly, when is a '.' (period) required in max? What difference does it make? The tutorial refers to ADSR but I cant to figure out which value corresponds to which ADS or R. Is it better to think of the numbers as referring to breaks in the line? I dont have the best of mathematical brains BTW, so explain like I'm 5.

Pete's icon

Nevermind, think I got it - the audio just tracks a volume-time (ms) set of values in the message.

I'm still not clear on the use of 'period' in max, so any help appreciated.

Christopher Dobrian's icon

The 'period' is just a decimal point.

Many non-MSP Max objects distinguish between integer (no fractional part) and floating-point (having a fractional part). They use int by default, and the way to you tell them to use float rather than int is to include a decimal point in the typed-in argument.

MSP objects always use floats, so they don't care whether you specify numbers with or without decimal points.

Max Patch
Copy patch and select New From Clipboard in Max.

(See example below.)

Roman Thilenius's icon

most objects which takes floats will also accpet ints.

so in the line~ helpfile you can think of "1" as "1." or "1.0"

me personally will always use decimal points in my code to make things clearer.

-110