Forums > Jitter

Polyphonic Image sampler/flipbook in OpenGL

February 26, 2012 | 7:24 pm

Hi,

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? http://www.cycling74.com/forums/topic.php?id=6733

Cheers,
Marlon

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


February 27, 2012 | 8:23 am

Hi Marlon,

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

http://www.cycling74.com/forums/topic.php?id=37912

– Pasted Max Patch, click to expand. –

February 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

Marlon


February 27, 2012 | 7:30 pm

hi marlon.
you are probably going to want to create a poly~ instance containing a jit.gl.videoplane 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: http://bit.ly/oMbfWa


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