[ANN] grainbuffer~ updated/fixed/improved

Mark-David Hosale's icon

Dear Max Community,
I am proud to announce that:

grainbuffer~ has been fixed/updated from original 32-bit version (Max 4.5 & Max 5) to 64-bit (Max 6) version. The source has been migrated to Git Hub.

grainbuffer~is a MSP object that exploits the buffer~ object built into the Max/MSP environment.

(A shout out to Eduardo Dominguez who helped me beta test the object in Max6 and M4L)

New features include:

Multi-channel expansion: option for 1 - 32 channels of spatialized grains, which is specified after the buffer~ name. Uses a modified equal power pan logic, which may be suitable for ring-like speaker layouts. For multi-dimensional spatializtion (azimuth and elevation) 1 channel is recommended with an external spatialization scheme (such as ambisonics). Note on output channels: Default (no argument for output channels) is Stereo Max 4 Live Compatiblity mode, which is the same as if the argument provided = 2. This object will crash in M4L if a another value is provided for this argument.

Everything is updated to 64-bit resolution.

The arbitrary limit on the grain pool was increased to allow for higher resolution grain densities. This coincides with processor performance improvements since the original creation of this object.

CAVEATS: while the object seems to compile properly in Windows, there was no system available to me to test the object... so (on Windows) use at your own risk. This will be confirmed/updated as soon as the opportunity arises.

Any feedback welcomed!!

Description:

grainbuffer~ is a flexible tool that allows independent control over the buffer and the grain creation. For example, users can set the rate at which the grains read from the buffer independent of their dispersion or duration. Also, loop points in the buffer can be set, allowing the user to decide which portion of the buffer will be granulated. In addition, the buffer read point can be randomized. This randomization produces various effects ranging from a 'blurring' effect to that of total randomness of grain sources.

The lastest version of grainbuffer~ is 64-bit and now features multichannel output with up to 32 channels of spatialized grains.

All parameters can be randomized. Randomizable features include the frequency, amplitude, pan position, duration and dispersion (distance between grain start times). The randomness of each of these parameters is set by a range indicating an upper and a lower limit. If the limits are set the same then the grainbuffer~ will only generate single value for that parameter.

Finally, the user can select the type of envelope. Envelope types include, sine, linear, exponential, trapezoid, parabolic, percussive, evissucrep (backwards percussive), and, of course, random, which chooses a new grain envelope randomly for each individual grain.

--
kind regards,

Mark-David Hosale

johnisfaster's icon

It says it may work on windows, anyone tested it on xp? I can test a bit but my max knowledge is so limited Itll take me a while to figure out if Im just using it wrong or if Im experiencing bugs.

Mark-David Hosale's icon

Hi John-
2 things:
1) is you would have to be on 64-bit windows for it to work (just making sure...)
2) you could try compiling it yourself. Here are the directions:
https://cycling74.com/sdk/MaxSDK-6.0.4/html/chapter_platform.html

In theory it should compile okay, but from my experience that doesn't always mean it will work. If you do try compiling it let me know how it goes.

best-
md

do.while's icon

Hi Mark ! thank you for your work and sharing it !

im trying to compile it on W7 64x with VS 2013 . as your experience , it compiles well but crashes at oppening . anyway im having issues with SDK examples likewise so perhaps its not a valuable test of mine .

Mark-David Hosale's icon

Hi -
Thank you for the attempt. I agree the first step is to get the examples to compile. The example to get working is index~ ... this is more or less the foundation for the grainbuffer~
BTW I had had some issues on occasion with the vcproj files not linking correctly. The mysterious fix for me was to reinstall the SDK.
Wishing you all the best-
Mark-David

do.while's icon

reinstal SDK ? its just a folder ... anyway
its possible for you to build 64 version so i can test it/use it ? im really curious about IF THIS WORKS with your compiler . and definitely i would love to have this object to play with !!

EDIT :
i will try with cygwin

oli larkin's icon

hi mark-david,

this is a really nice granular object, but unfortunately this latest version seems to crash max (6.15 osx 10.68 x86).

Also I wondered did you add some interpolation to grain playback. this was missing in the original and i added some different types, as well as grain pitch envelopes.

cheers,

oli

Mark-David Hosale's icon

@DO..WHILE - by 'reinstalling' I was suggesting that you go though the set-up steps again. In theory the SDK examples should compile without issue, if they don't it get somewhat ambiguous as to why not. The likely issue is either files are in the wrong place or something about the IDE is not set correctly. - hope that helps.

@Oli -
Thanks for the feedback, but I will need more information that you are providing to diagnose the crash... do you have a crash log and patcher files that you can share with me? - also,what do you mean by crash? Does the object explode? or does the whole app crash? what are you doing when it crashes? Does a particular parameter combination cause the crash? etc.

Also I wondered did you add some interpolation to grain playback. this was missing in the original and i added some different types, as well as grain pitch envelopes.

I am not sure what you mean by interpolation here...

best-
mark-david

oli larkin's icon

it crashes with the help patch you provide, when i click to start the dsp

oli larkin's icon

when you repitch grains, you probably want to provide some kind of interpolation/resampling, otherwise it sounds grungy.

oli

Mark-David Hosale's icon

when you repitch grains, you probably want to provide some kind of interpolation/resampling, otherwise it sounds grungy.

Thanks Oli,
that makes sense. That should be included.
Also I saw your note about the grain list size being the culprit for the crash...
I guess I should drop it down to 512 for compatibility reasons. But, ideally this limit would be a variable. I'll look into that.
Thanks for all of the great feedback so far.
You mentioned you were playing with this code before, would you like to contribute to the project?
best-
mark-david

Mark-David Hosale's icon

Hello-
For those of you who are following this project I have compiled and tested a working version of this object on 64-bit Windows. You can download the mxe64 along with the project files here:
http://www.mdhosale.com/grainbuffer/
https://github.com/mdhosale/grainbuffer

This was tested on Windows 7.1 64-bit
let me know if you have any comments, etc.

kind regards,

Mark-David

do.while's icon

Hi Mark !
its all working !

but interpolation is missing . as ive been working on such implementation lately i could provide simple solution with the code if you want to save some time .

Mark-David Hosale's icon

Sure send it along-
thanks

do.while's icon