minim audio trigger with sensors; conceptually struggling with logic argument of program
in
Core Library Questions
•
1 year ago
so, i have a sensor that shoots out a number to processing, which when the number is read, an audio file plays.
now what i want to do: once the entire song goes through a loop, (i am monitoring the songs length) i want it to check the same logic before that triggered the audio track. heres the idea of what I'm doing, but its not repeating the track again after it plays:
- if ( myPort.available() > 0) { // If data is available,
- val = myPort.read(); // read it and store it in val
- }
- // Set background to white
- if (val == 1) { // arduino is sending a "1" when a sensor argument is met.
- groove.play(); //the song plays entirely. the argument does not interfere if its met.
- if (x < 18.0 && val ==1){ //x is measuring the length of song, float numbers 1-20 (20 is end). not working.
- groove.play();
1