Forums > MaxMSP

Practical difference between int 0 and float 0 for "line~"?

May 14, 2014 | 10:09 pm

Hello, I was tackling "MSP Tutorial 3: Wavetable Oscillator", and noticed the author used the message of "0, 1. 20 0.5 80 0.125 500 0. 400" to be sent to "line~" for ADSR purpose.
Is there any practical reason behind the differentiation between "0" and "0."?
Why this shouldn’t be "0., 1. 20 0.5 80 0.125 500 0. 400" or "0, 1. 20 0.5 80 0.125 500 0 400"?

Many thanks for your knowledge,
Masa


May 14, 2014 | 10:46 pm

"Is there any practical reason behind the differentiation between "0" and "0."?"

No practical reason in that tutorial. The message is sent to ‘line~’ the signal-rate object(signals are always floating-point/decimal-numbers), but might have a more practical reason if used with the non-signal version ‘line’(see helpfile, shows you how it can use integers or floats).
Where the signal-version ‘line~’ is concerned, you can leave decimals out wherever you don’t need them(even the ’1.’ could be written as ’1′).


May 20, 2014 | 1:50 pm

One minor thing: I’d recommend that you not use the "initial_target, target time target time" format in favor of "initial_target 0. target time target time". The first one will send it in two messages and you may see slight timing differences on performing the envelope. If you use the second one, all of the messages arrive at line~ in the same message so the performance of the envelope will always be exactly the same.

You can also force function to do this by setting it to line mode, though my preference is to put a "route list" between function’s 2nd outlet and line~’s input, because most of the time I don’t want my envelopes resetting all the way to 0 if they are not at 0 already.


May 22, 2014 | 8:42 am

Hi, RAJA_THE_RESIDENT_ASSWIPE. Thanks a lot again.

From your post, these are the knowledge I didn’t know and I find it useful.

signals are always floating-point/decimal-numbers

Where the signal-version ‘line~’ is concerned, you can leave decimals out wherever you don’t need them(even the ’1.’ could be written as ’1′).


May 22, 2014 | 9:18 am

Thank you very much, PETER MCCULLOCH.

Could you kindly give me the example of "initial_target, target time target time" and "initial_target 0. target time target time"?

Also I am not sure about "route list". It would be great if you could possibly show me the simple example of the patch.


May 22, 2014 | 10:14 am

Sure, here’s a couple of examples.

– Pasted Max Patch, click to expand. –

May 22, 2014 | 10:54 am

You are so kind!
Thank you very much. That helps me a lot.


Viewing 7 posts - 1 through 7 (of 7 total)