Random Selections from Polybuffer?

dannyflint's icon

Hi I posted a thread but had no response.....

I was previously looking at sflist for the answer but perhaps polybuffer~ is the object?

I really need to know the least convoluted way of randomly swapping samples in a buffer that is read by the 2d.wave~ object, this random swapping would be in time to a metro object.

I hope somebody can help

Peace

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

Danny

dannyflint's icon

OK so I managed to work it out thanks to bastardizing bits of code from other patches :)

Does anybody know how to loose the clicks/pops that occur when the different samples are flicked between?

Peace

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

Danny

Mark Durham's icon

I had a brief look at your patch, but couldn't work it. Uploading a patch which is ready to go or has instructions really helps.

I think I get the idea though. If you change the buffer~ which the 2dwave~ reads from you are always going to get a click. Perhaps the solution is to have 2 players and then crossfade between them (using Line~ perhaps). So for every transition you set the buffer on the player not in use then crossfade over to it, thereby avoiding the click.

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

By the very nature of what you're trying to do, there will be discontinuities, hence clicks.
You could try adapting the wavefader abstraction in the /Examples/sampling folder i.e just substituting 2d.wave~ for wave~, but that's only one source of several for discontinuities.
I think you're trying to randomise too many parameters at once - avoiding clicks is almost impossible when everything is changing with little or no reference to each other, and you can get plenty of glitchy sounds from 2d.wave~ without randomising everything. Taking out the randomisation of the loop end point, for example instantly reduces the number of clicks,
And using signal based randomisation (rand~) rather than metro driven random nos. should also help.
Here's a version with some of those modifications - it still clicks, but hopefully a bit less so!
Cheers
Roger