I have built the following patch for an interactive performance in order to achieve the following:
Button 1 will record a sound each time, which will be assigned a unique name "recording%d"
Button 2 will playback the most recently recorded sound file
Once 4 sound files are recorded, Button 3 will begin playback of these files, sequenced to a backing track. When the backing track finishes, all playback stops. During playback, all sound is routed to be recorded as a new sound file, which is also given a unique name "party%d".
Button 4 is set up as a panic button, to end playback if it is started in error via a momentary press. If the button is help down for 5 seconds it shuts down the pi.
I had hoped that by including a project save function (triggered just prior to shutdown), that the patch would remember the number assigned for each subsequent "party%d" sound file. However, when the Pi is rebooted it reverts to zero, and begins overwriting the prior sound files. I designed the patch so that the "recording%d" files are replaced every time, but I want to save the "party%d" files.
How can I get the patch to remember and continue where it left off? IE, "party1.wav" & "party2.wav" were created last time the device was on and the patch was running, so this time, once the pi boots up and the patch opens, we need to start with "party3.wav" and carry on from there.
Apologies that the patch is messy, I am still learning!