Arduino controlled soundfile in Processing

This post was flagged by the community and is temporarily hidden.

Hi, I tried running your sketches, had to comment out all the audio parts that I don’t have the libraries. Couldn’t get the start to work with the 'A’s going back and forth. It can be difficult to get that kind of logic to work in all circumstances. In the Ard code you are using serial for 2 purposes: Serial.write(plantMidi); - characters transmitted to Processing, Serial.print("Plant value: "); - information messages. Both these outputs will go to the Processing sketch. This is usually not good unless you’ve specially designed the Processing code to select out what it wants and discard the information messages.

You could try this to work out what’s going on. At each point in the logic of serialEvent(), after each {, insert a statement like print(“a”); (then b,c etc. obviously). From the pattern of what’s printed out you’ll see what’s happening.

Another option would be to try a working example I made. I’m reasonably sure it will work first time. If you like it you could merge parts of your sketches into it.

This post was flagged by the community and is temporarily hidden.

I’m not seeing where you update anything in the ambientSound() method. You are just calling the function in the draw() loop. You need to either pass your potVal or plantVal to the ambientSound() method or call it in some way in your method to get the update from the Arduino.

Have you created a working adjustable pitch playback example without the Arduino library?

Also, your posts keep getting ignored or flagged, I’m assuming it’s the offensive user name. Maybe look into that. We all try to be as respectful as possible on the forum.

Good luck with your project.

1 Like