I am making a simple "sequencer" that reads through an array of VCS controls. I wanted something simpler and more controllable than the AnalogueSequencer which I've achieved with some CapyTalk in a few SoundToGlobalControllers... But I have a problem resetting the sequencer - it keeps missing the first item in the array. I can see why it's happening but not sure the best way to solve the problem.
I've got a Start button that's supposed to reset the position within the sequence and start it. I'm using a TriggeredSoundToGlobal:
GeneratedEvent: !Gate
Value: 1
Trigger: !Start
which sets !Gate to 1 when the Start button is pushed.
Then I use a SoundToGlobalController to create a clock signal for stepping through the array:
GeneratedEvent: !ArrayGate
Value: !Gate bpm: !BPM
And another STGC to index into the array:
GeneratedEvent: !Position
Value: !ArrayGate nextIndexMod: 48 reset: !Start
Pressing the Start button does reset the !Position array index to 0, but it also starts the !ArrayGate which immediately advances !Position to 1. Which is the problem - when I hit Start, I miss the first element of the array.
I've tried using turnOnAfter: to delay the reset signal but that just makes a mess and I've been looking at alignWith: but I can't see how that would help either. I know I must be missing something obvious and simple. Any ideas?