### what math to fill multislider with sine wave?

Hi,

Quick question: what math is necessary to fill a multislider of 512 sliders (range -1. to 1.) with a sine wave? I’m setting up a multislider to write into a buffer~ and would like to initialize with a sine wave.

Cheers,

Jay

**all**of the following text. Then, in Max, select

*New From Clipboard*.

```
----------begin_max5_patcher----------
410.3ocuT9saBBCEF+Z3onoYWrsvXzxeT2c64XwrTgp1kRKAJYLM9tOZAl5h
CIJyKfS5omx466GbXqsEbgrhV.Au.dCXYs01xxjRmvpcsELkTEyIElxfokbE
qfyRn4Pml8KXan58BQ31LhxTlfSUlif1mTVp5x1UZSJ0WYzFU.gN0Wf4samQ
TwqYhUumSiUMUfC7b8b.XbfNDhLArmuq2OmhkXzpbwGOEA0o1Yaqu4LPSJne
Ve1N+onUlVC2v0dDrJWVlAOkU6L0RoPIHoFKAeMmQ3vqAB5GWGjQ3Z6dV13Y
BSlzr3zjIXDICsJKGTvD2e2RziQt3o9nogOWCK2Gf88MwPAE5OA0kCIzjHSH
bVeTxeDoDWRRVPDq9eQhoCW.VPyvFdfmpCQd8QE7HRkxMLyXk2nLR42KVb1G
YB00PoPSHp2ILzgTxT.jyD+9+sllnyeL5Jjk4wchuYd0AruMIzBESPTLo3fZ
hNpl0rjDpY6NCkxRxj0NuUBf4m703PUj+.TTvMUQn5tgOih7uoJBO.FgtBEU
uXm82byiHq.
-----------end_max5_patcher-----------
```

Thank you!

Is it possible to explain briefly why this math produces a sine wave?

The 512 numbers produced by uzi go from 0 to 511 (0 to almost 512). Inside the expr object those numbers are multiplied by 6.283185 which is pi times 2, then divided by 512. The result is to give a series of 512 numbers that go from 0 to (almost) 2π. Imagine those numbers as the changing angle in radians as a point travels around the circumference of a unit circle. Take the sine of those numbers and you get one cycle of a sine wave of amplitude 1.

Thanks, Christopher.

So maybe this is a huge jump from the last question… But say I want to represent a 512 sample buffer in a 16 slider multislider. In viewing the buffer this would appear as a series of steps. How would I go about interpolating from one step to the next, to again create a smooth curve?

As soon as you reduce 512 points down to 16 points, you’ve lost a LOT of information about the intervening points. So there’s no way to guarantee that whatever method you use to create 512 points from 16 will really resemble the original 512.

There are many ways to interpolate between 16 points to create a more continuous curve of 512. The most common general ways to get smooth curves are polynomial interpolation and spline interpolation.

How can I display a wave-form from a buffer in a multislider rough quantized.

The image of the ms should be similar to a waveform object but less precise?

I need the multislider to display the content of a buffer on an iPod via C74, which doesn’t support the wave form object.

best,

frank

How’s this?

**all**of the following text. Then, in Max, select

*New From Clipboard*.

```
----------begin_max5_patcher----------
850.3ocuX0sjaBBF8ZySA0da5tBh+jdWeN5zYGMhQZULifS2r6r8YuBnIY2M
th6nbSLhn78c3bN7AOuwwMs9QB2E7cvOANNOuwwQ0jrAm96cbqRdbeYBW0M2
80UUDlvcq9YBxiBU60GILPBfW2xxxokjgNvZqnrRhP81v9FoY52I82eKLbnm
40LAKohndzOZnIkW8MpaECeDu9VOlH1WPYGdngrWnSg.H5Nus.Xjm7xtcxeQ
c+G7qqFCN8I0XH6qr0W1rQ9yVCAfJBmmbf7N.ngjjcyjFcijFO2jd.4zMINc
jnyXW2y41MvCbj+U3gef5l3kEOFiPHwCP2CnMDPZadNowXJAZAoD9XnlEnQB
OzZvIFCCRSXG.0L.kIHGlA.3sf.PbjJigXkj.ayz+dP5I0bOnjvNHJ5vA.Oo
5H2TfHHdIYBHUxGEpHBXu0.IRaEhZlwoW3LE6R9zGJ3gwJMNBc15aHG+DICi
72tn7cyp4l5xErbtb4k0IBix7dqNzcAK+r6H.x9htoEiWvCOaws+nd+aAtTo
tSewD3QaCF3YSafuBpyA7RZFowXkuevxq7wJmvvUopfQnFe49tQBGemoRFen
EkL8ZEsgX.bUfk1pTyW2y+rznqezp1JU+BmIhL.qcAxv2PNGLFN0KflzZsGs
zjHCDPm+RMcwrfz7.gkjVpd7BRvtGfMkaghWLtkgtMPbf0MiE.JfZJgCMa4F
ZBZzTHCBgtn4VGfYd0ff7VoZPfgqWIHhhFBuvTh+N6rYqgkX0a6Dis3xLsOQ
UdblhHwKVIHJ1v1K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