Forums > Jitter

Polyphonic Image sampler/flipbook in OpenGL

Feb 26 2012 | 7:24 pm


I have a question, perhaps someone can help here? Any pointers appreciated…

I am trying to build a sort of ‘image-sampler’ and I’d like to figure out how to take most advantage of hardware-acceleration. Similar to a MIDI-based sampler it should in response to triggers (e.g. velocity values) select and output a certain ‘image’ -instead of an audio-sample. I was thinking to make a poly~ where each voice would correspond to a ‘velocity’ value and handle the rendering of a specific image. Different keynumbers would be represented as individual instances of this poly~ object (or maybe a poly~ in a poly~?). Thing is, that they all need to be ‘mixed’ together (they can ‘overlay’).

So what I am basically looking for is an efficient way to dump a number of images (pngs with alpha) into an OpenGL context and fade them in and out individually. The result of playing this sampler should look kind of like a flipbook without a predetermined sequence of images.

I don’t know much about video in OpenGL, I suppose a starting point would be Tutorial 34: Using Textures, and Tutorial 49: Colorspaces … ? Maybe this thread?


PS I’m on Max5.1.9 and MacOS10.6.8 (MBPro17")

Feb 27 2012 | 8:23 am

Hi Marlon,

if you were in Max 6 you should check out jit.mgraphics. Send the output to a

— Pasted Max Patch, click to expand. —
Feb 27 2012 | 6:56 pm

Thanks, however unfortunately I’m running this project in Max5. And I still wonder how to do the mixing of up to 127 simultaneous images afterwards… :-S


Feb 27 2012 | 7:30 pm

hi marlon.
you are probably going to want to create a poly~ instance containing a object with @blend_enable 1 @depth_enable 0.

you can then use the alpha component of the color attribute to control the opacity of the image.
or you can experiment with different @blend_mode settings to get different blend styles.

May 20 2012 | 2:03 pm

I’m sure the professional flipbook creator can help you:

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

Forums > Jitter