I have two automated instruments playing independently their own music from memory cards or by downloading midi music from the net and playing it. So they use microcontrollers with bluetooth and wifi capabilities.
What would be a good approach to get them play simultaneously the same tune? I'd need a wireless signal from one to the other synchronising their clocks somehow. If I knew their clocks were synchronised to say 10 ms accuracy, I could have them start on a given time. If both instruments read the time from the same wifi router, would their clocks tick within a 10 ms difference? Or if I knew there was a constant delay between sending a command, say in bluetooth, and receiving it, or if I knew such delay would vary within 10 ms, I could just have the master instrument give the command to play, delay for the known time, then both instruments would start to play within 10 ms accuracy. Any thoughts?
You can test with loopback if that delay is constant.
But safer would be to verify it:
A starts a counter and sends synch command to B. B starts counter and sends confirmation to A.
A verifies that the loop was done within time limit for example 5ms and confirms you that A and B are in synch and ready to rock.
A can also fine tune its counter since it knows how long it took to do the loop.
Synching to 1 sec doable, 10ms questionable.
If they're both getting stuff off the internet, then have them connect to a timeserver and set their local time using that. Then give them a time a few seconds into the future at which to start. You should be able to get sub-millisecond precision that way.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.