Polyphonic Image sampler/flipbook in OpenGL
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? https://cycling74.com/forums/newb-can-jitter-batch-import-images-and-sequence-them
Cheers,
Marlon
PS I'm on Max5.1.9 and MacOS10.6.8 (MBPro17")
Hi Marlon,
if you were in Max 6 you should check out jit.mgraphics. Send the output to a jit.gl.videoplane.
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
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.
I'm sure the professional flipbook creator can help you: http://bit.ly/oMbfWa