Quantcast
Channel: Library Questions - Processing 2.x and 3.x Forum
Viewing all articles
Browse latest Browse all 2896

How can you 'split' the void draw, in a part that doesn't loop and a part that does loop?

$
0
0

I wrote a code that I want to connect to a arduino. If you press a button, you should see an animation and hear a sound. I wrote the code for the animation and the sound in two different functions (one for the animation and one for the sound). But when I put both functions in the void draw, the music starts playing again and again (with the frame rate). I tried to put a noLoop(); and a loop() in both functions, or place noLoop() above the music function and a loop() above the animation function in the void draw, but this doesn't work: you get one picture of the animation and hear the music. So the animation doesn't loop as well. So if you place a noLoop inside the void draw, it won't loop. Does someone has any idea how to solve this?


Viewing all articles
Browse latest Browse all 2896

Trending Articles