First off, I apologise for the noise you’re about to hear, the videos didn’t upload to youtube well and the sound is pretty offensive. I swear in the processing sketch it is a lot smoother.
I took the sound experiments, which can be found from the post Processing Sound Experiments, and started to apply them to an interactive sketch. With my first attempt I used a sketch which uses the camera input to test if the middle pixel is bright or dim. If the camera input recognises the pixel as bright, the screen goes white and a synth sound is triggered. If the pixel is dim, the screen turns black and a lower pitched synth sound is triggered. The problem I face now is that I can’t stop the sound and both play at the same time. I have used an if statement but still unsure how to stop this.
I changed method here and changed the sound from being created in processing, to importing sounds. This uses the same sketch but uses an imported wav or mp3 file. This means the sound ends when the recorded sound ends and also stops if the screen changes. However, the sound is being restarted every new frame because its in the void draw rather than void setup.
I think from this point I may put the sound part on hold so I can build a substantial prototype and try incorporate the sound element later when I have a better understanding of the program.