Thanks for the reply. I must have been unclear in my question — sorry.
I’m trying to keep an external device in sync with norns global clock. For proof of concept I’m just coding for a teensy in arduino IDE.
I can receive the clock signals from norns over usb midi but I can’t tell when norns is on a 1/4 note or whole note boundary for example. So whatever is running on norns (eg awake) is nicely synced with norns clock via its own clock.sync calls, and my external device keeps time — because it gets the midi 248 messages — but can be misaligned because it didn’t necessarily start counting when norns did.
Ideally I’d like my device to be able to pick up the clock regardless of what script is running. Clock reset would be one way to do that but as far as I can tell no midi message is sent from norns to indicate the reset has taken place.
I hope that made the issue clearer! Thanks again.
Edit: here’s a bit of code extracted from my clock handler so you can see what is going on.
void myClock() { // handle MIDI clock tick
if (count > 3) {
digitalWrite(LED,LOW);
}
count++;
if(count > 23) {
count = 0;
digitalWrite(LED,HIGH);
}
}
The issue is that my device’s count from 0 - 23 may not be aligned with norns 1/4 notes, i.e. the count variable above may not be reset to 0 on a multiple of 24 ticks according to norns.