Mixing 2d code and 3d (with kinect and touchboard)

Hi there,

I have some doubts about an installation project I’m doing. This project involves music, video, a touchboard and a kinect.

Here’s what the code is supposed to do:

Whenever someone touches one of the touchboard’s electrodes a video will start playing, whenever they stop touching it the video starts going in reverse speed until it reaches 0.

There will be music looping on the background but the volume is gonna be zero at the beginning. When someone touches said electrode, the volume increases, and when they let go, the volume fades out until reaching 0.

On the other hand, the kinect code is programmed to detect depth and, whenever the kinect detects a shape within the threshold, the music in the background slows down. When it detects nothing is within the threshold, the music speeds up back to normal.

Firstly I made the code just with touchboard + videos + sounds, and in another sketch I made the code for kinect + music. Somehow I tried to mix them and I messed it up, don’t know if it’s because I mixed 2d and 3d sketches or simply because my computer can’t cope with so many things happening at the same time.

Sorry for this long text, as you may see we’re a bit desperate here :’( Can you see what is it exactly that messes my code up? Any ideas?

This is the code: https://drive.google.com/open?id=11u7glyd9BIF13U5NKZ334eUMKWpz4dAw

Thank you

1 Like

I don’t have kinect so I can’t check your code but you can create
many PGraphics for your need.
Like this :

PGraphics one, two;
void setup(){
  one = createGraphics(1024, 768, P2D);
  two = createGraphics(1024, 768, P3D);
}
1 Like

You explained what you want to happen. But what, specifically, is happening instead? What is going wrong?