- Fri Jun 01, 2018 2:26 am
#199341
Hi,
I'm having a frustrating time finding documentation on the WAV Trigger trigger pin functions that allow users to play one sound file at a time to the end, before moving on to the next one. I know the INIT filemaker allows the user to choose polyphonic or monophonic. The problem I have is that I want to control the WAV Trigger trigger pins with a Mega, and have each sound file play to the end before moving on to the next one, so I assume I need to edit the INIT file to monophonic. However, I'm afraid that each new digitalWrite instruction to each pin will cause the new file to interrupt the previous one, and not allow it to play out. For instance, if I write
digitalWrite(Soundfile_1, LOW); // (using the Mega to ground Trigger pin one)
digitalWrite(Sounffile_2, LOW); // (using the Mega to ground Trigger pin two, etc.)
I'm afraid that file 2 will immediately interrupt file 1 and not let it play out.
I don't want to use delays between each digitalWrite function, as I am also using proximity sensors to tell if someone is approaching the object playing the sound file, and using delays keeps the proximity sensor from updating and returning a value until the delay is over. For instance, if i write:
digitalWrite(Soundfile_1, LOW); // (using the Mega to ground Trigger pin one)
delay (5000);
digitalWrite(Sounffile_2, LOW); // (using the Mega to ground Trigger pin two, etc.)
delay (5000);
The delay functions allow the sound file to play out, But it takes ten full seconds for the proximity sensor to update between each loop (as both delays total ten seconds).
Does anyone know how to get each sound file to play out completely without having to resort to using delay commands?
Any input is appreciated; I'm running out of time to finalize my project for my Arduino class. Thanks!
I'm having a frustrating time finding documentation on the WAV Trigger trigger pin functions that allow users to play one sound file at a time to the end, before moving on to the next one. I know the INIT filemaker allows the user to choose polyphonic or monophonic. The problem I have is that I want to control the WAV Trigger trigger pins with a Mega, and have each sound file play to the end before moving on to the next one, so I assume I need to edit the INIT file to monophonic. However, I'm afraid that each new digitalWrite instruction to each pin will cause the new file to interrupt the previous one, and not allow it to play out. For instance, if I write
digitalWrite(Soundfile_1, LOW); // (using the Mega to ground Trigger pin one)
digitalWrite(Sounffile_2, LOW); // (using the Mega to ground Trigger pin two, etc.)
I'm afraid that file 2 will immediately interrupt file 1 and not let it play out.
I don't want to use delays between each digitalWrite function, as I am also using proximity sensors to tell if someone is approaching the object playing the sound file, and using delays keeps the proximity sensor from updating and returning a value until the delay is over. For instance, if i write:
digitalWrite(Soundfile_1, LOW); // (using the Mega to ground Trigger pin one)
delay (5000);
digitalWrite(Sounffile_2, LOW); // (using the Mega to ground Trigger pin two, etc.)
delay (5000);
The delay functions allow the sound file to play out, But it takes ten full seconds for the proximity sensor to update between each loop (as both delays total ten seconds).
Does anyone know how to get each sound file to play out completely without having to resort to using delay commands?
Any input is appreciated; I'm running out of time to finalize my project for my Arduino class. Thanks!