Fill message to Buffer~ Integers only?

kclarkmusic's icon

Hehllo,

I'm trying to use a very small buffer~ (16 samples) to hold a sort of 'wavetable' of values to assign to a multislider. The reason is to have a simplified UI based on filling the buffer using classic wave shapes so the user doesn't have to manually draw values for all 16 slider bars, but rather draw a contour with a cycle.

In any case, everything is working fine, but what I've noticed is that the buffer doesn't like float numbers. Using the Fill message: "Fill Sin $1) with the value coming from the dial with a range of .5 - 8, the buffer only updates on whole integer values.

Obviously these are whole number cycles, but it seems that it should accept a float number, in which case the value of the bars would still change in between integer values.

On a side note, is there a more efficient way to do this? Is it possible to bypass the buffer and just send some kind of expression directly to the multislider?

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

Thanks,

Etienne's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Yes there is a better way to do this !
And have a look at the buffer~ reference : it explains that fill sin needs 2 int arguments to specify a rational number of cycles..

kclarkmusic's icon

Awesome thanks! I was thinking this was possible but I'm a bit rusty on my C based math.

I did have some luck adding a 3rd argument as you said.

I'll try this out tonight.

And if I wanted to be able to switch through different wave forms? Just use multiple expressions with the appropriate equation and a gate to switch them?

Cheers,