Forums > MaxMSP

what math to fill multislider with sine wave?

August 14, 2011 | 2:26 pm

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


August 14, 2011 | 2:46 pm
– Pasted Max Patch, click to expand. –

August 14, 2011 | 2:51 pm

Thank you!

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


August 14, 2011 | 3:01 pm

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.


August 14, 2011 | 7:09 pm

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?


August 14, 2011 | 7:37 pm

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.


December 26, 2011 | 12:21 pm

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


December 26, 2011 | 1:26 pm

How’s this?

– Pasted Max Patch, click to expand. –

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