Multiple video layers with audio-dependent opacity

featherfoot's icon

Hi all,

I want to take 3 video streams of live instrumentalists (chromakeyed so the backgrounds are taken out) and layer them on top of one another.
The opacity of each layer will be audio dependent, in that at 0 amplitude each layer will have an opacity of ~10%, at max. amplitude the layer will be 90% opaque, so all layers are constantly present.

Since I want each layer to operate independently from one another should I create a jit.gl plane onto which the individual layers are placed?
Think Model 5 - Granular Synthesis...

Thanks,

Michael

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

Here's a basic idea:

featherfoot's icon

@LSKA, thanks very much, exactly what I was looking for.

How can send the rendered output to Syphon?

I have tried using jit.gl.slab and jit.gl.texture but all I can get is the layers without the opacity plus darkening problems...
Do I have to convert it into a single texture?

layer-patch.maxpat
Max Patch
LSka's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Assuming you're on Max7, you just have to use [jit.world @output_texture 1]:

By the way (and this may be a bug?) , I needed to put a [jit.gl.texture] between [jit.world]'s outlet and [jit.gl.syphonserver] to be able to see the rendered scene in Syphon Recorder, otherwise I'd just get a grey background. (nevermind I needed that texture anyway to set the @flip 1 attribute)