The project: The Doorbell From Hell. an annunciator that lets me know when someone enters the driveway, when they exit the driveway and enter the yard, and when they enter or bypass a gate. when you have a 400 foot driveway you have time to change into a tuxedo or a ghillie suit, if you have a proper annunciator.
The Plan:
- When a vehicle breaks the beam at the outer marker, play a sound file from a group of one bell bong / gong / whistle sounds.
- when they cross the inner marker, a file from a second group of dual bell bong / gong / whistle sounds plays
- if they enter my yard, play a sound file from a group of three bell bong / gong / whistle sounds.
- if they enter my neighbors yard, play a sound file consisting of 4 ships bells.
- if they push the obvious in plain sight bright red DONNONOMO button they get one of 200 or so bland sounds; bird songs, elephants, car horns ( DONNONOMO: Don't Know No Mo better than to press the obvious button at my house )
- if they tip the garden gnome, that causes one of 500 or so movie and TV sounds to play
- if they walk around the house without entering by one of the three legitimate gates, one of about 60 obnoxious "lock and load" alerts go off
so, 5 triggers, each trigger sets off one sound from a library of sounds. the sounds are grouped in blocks like 1 - 16 for the single sound, 17 - 32 for the doubles, et cetera
the files were randomized before they were numbered, so if you play them in order, you don't get Bugs Bunny three times in a row.
the sensors are handled, the PA is up and running. working on the GPS time and sensor number dataloger
The Problem: what I need to know is how to tell the WAV Trigger to play the next file in the list, and recycle when you run out of files. If you have 36 lock and load files, and the numbers from 64 to 127 are allocated to this group, something like:
if sensor 4 play
for file# = 64 to 127
( play file# )
if no next file then file#=64
I can't be the first person who needs this, but I can't find any code that does this. does anyone know of a sketch that deals with this?