Counting cycles on BS2P
Hi,
I'm a beginner so don't laugh. I want to play·the next in a sequence of WAV files from a sampler each time my program passes a certain point. I want to play up to 32 files sequentially·if the·program progresses that far. So, I've got each of the 32 unique serial commands listed with Labels of "counting1" through "counting32".
How can I play the first sample, called·counting1, the first cycle and then increment to the next sample each time the program advances that far?
Buck
I'm a beginner so don't laugh. I want to play·the next in a sequence of WAV files from a sampler each time my program passes a certain point. I want to play up to 32 files sequentially·if the·program progresses that far. So, I've got each of the 32 unique serial commands listed with Labels of "counting1" through "counting32".
How can I play the first sample, called·counting1, the first cycle and then increment to the next sample each time the program advances that far?
Buck

Comments
counter VAR Byte counter = 0 'initialize Main: 'do a bunch of stuff ' more stuff ' time for a wav file GOSUB Play_Next_Wave ' more stuff ' more stuff 'time for another wav GOSUB Play_Next_Wave Done: GOTO Done END 'subroutine Play_Next_Wave: counter = counter+1 IF counter > 32 THEN counter = 1 ON counter-1 GOTO Wav1, Wav2, Wav3, Wav4 'add in labels for all your wav outs Wav1: 'your serial code here RETURN Wav2: 'your serial code here RETURN 'etcAlthough a better way to do it would probably be to store your actual serial commands in EE data, and read back the commands themselves, rather than lots of serial commands over and over.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
That looks like just what I needed. I'll try it tomorrow.
Buck