Audio level determines which video plays

Hi!

I’m trying to make an audiovisual installation that reacts to the level of noise the audience makes. This is my first time working with touchdesigner and I could use some help.

I made two video’s:

Video 1: controlled by the level of noise measured in the audience (so the amount of db determines what video is shown) I cut this video up in 4 parts, so when the audience produces between 40 and 55 db, part 1 is shown, between 55 and 70db part 2 is shown, 70 and 85db part 3 is shown and between 85 and 100db part 4 is shown.

Video 2: As soon as the audience produces more than 100db, video 2 starts playing completely without being influenced by the level of noise.

After the second video is done it should start again with the first video, so it would basically be an installation that could run al night.

I’ve tried a lot of different things and asked chatgpt for advice but it all just doesn’t work. Is there anyone who knows how to achieve this?

Are you able to share what you have tried, what you are were able to get working and what you weren’t able to get working?

So I made two things, i circled them in red and blue on the screenshot

Red: this measures the audio level. I converted it from amplitude to db so I can easily set my parameters to the audio levels that I will measure in the room that the installation is gonna be shown. So the express CHOP has a formula in it to convert it to db, the math CHOP adds 100 so it is a positive number. The 4 logic CHOPS all have different bounds between 0-100 db and the 4 math CHOPS connected to them multiply them by 0, 1, 2 or 3 so my output is not just 0 or 1 anymore but 4 different numbers. Then I merged them, but this is where I got stuck.

Blue: This one actually kind of works, I tried this yesterday. The 4 movie files connected to switch1 do change according to the level of audio, I just don’t really know how to make it more precise. It would be ideal if I could set the db levels like I have in the red option.

I also don’t know how to make switch2 work. It should start playing as soon as a 100db treshold is met and then it should loop back to the first part of the installation, so it can play all night.

Sorry for the rambling and thanks for reaching out!!

Sounds like a really interesting project. If you like, could you share the blue network as a Tox? I can take a look (FYI I am also a beginner here).

BTW I am find Perplexity AI to be much better than Chat GPT for Touch questions.

I don’t know what a Tox file is, but here is my project file if that is of any use!
I managed to add a few things since the screenshot I just send, so the only thing still left to solve is looping the whole thing.

I added a logic CHOP that gives me a 1 output when the threshold is met and I added a hold CHOP to it so it doesn’t switch back to 0 and the moviefilein5 video plays completely. Now I need to figure out a way to reset the holdCHOP when moviefilein5 is done playing.

Here is my project:
Accomplice poging 2.12.toe (105.2 KB)

And thanks for the AI tip, Chat GPT was not accurate most of the time and it pissed me off haha

1 Like

Another update. I added a chain to moviefilein5 to detect when the video ends. I added an info CHOP > select CHOP (channel name: last_frame) > logic CHOP (set to off when zero) > math CHOP that combines moviefilein5 and the logic CHOP to the hold CHOP.

Now it gives off a signal when the last frame is shown, but it doesn’t reset the hold. So that’s the last part I’m trying to figure out.

Any luck? I couldn’t recreate the result with your updates, but you could try adding an expression to the sample parameter of the hold, something like:

int(op(‘logic1’)[‘last_frame’] != 0)

Unfortunately not. I tried adding the expression to the sample parameter but it just gives me an error.