I suppose I’m having a little trouble understanding this part of the tutorial in Max and I could use all the help I could get understanding this.
The section of the drawing patch labeled 2 uses scale to draw a shape based on sine wave calculations. A counter object produces output ranging from 0 to the maximum value (set using the two number boxes to the right of the metro object). This is scaled from 0.0 to 6.283185 (2*pi), then sent to a sin object, which calculates the sine of the input value. This produces a sine wave that varies from -1.0 to 1.0 in range. This value is sent to another scale object which maps this range to the integer range 0 to 319 – the size range of the lcd object. This is used to provide the X locations of the line. A similar set of functions are used to set the Y location. These numbers are then inserted into a list (using pack, prepended with the lineto message (using prepend) and then sent to the lcd.
I wonder why are the counter integers scaled to pi (6.283185) and not to another number? Also the number boxes below the scale. Why are .5 chosen?
If the value used were lower or higher than 2π, the entire range of the sine function would not be achieved or be exceeded – in either case creating discontinuities in the resultant (smooth) path. Try it in the example by changing the 6.28… scaling factor.
As for the scaling, afterwards – they appear to be a fudge factor to keep the result within range for the LCD object – not really sure why those values (+0.5) are used in particular (hopefully there is/was a good reason) but they don’t appear to be really significant to the outcome.