Thanks, @kbra, your explanation is very good. Let me expand on it.
External clock synchronization
Manual external clock compensation is needed because the master clock might also have non-zero latency. Additionally, in hardware-only setups users often resort to MIDI daisy-chaining which adds additional latency.
This is not a Polyend Tracker-specific problem and the solution isn’t atypical either. Look at how Renoise solves that same problem:
It’s also global and manual.
Tracker’s status: Importantly, there are no known issues with our implementation of this. External clock synchronization is considered a solved problem.
Internal clock synchronization
If you’re using Tracker as the master clock, essentially the question we’re after is:
If you have “C-4 M01” on one track and “C-4 01” on another track during the same step, do they sound at the same time?
The answer here depends on many factors which is why we don’t have this yet in Polyend Tracker. At this point you need to compensate latency on the MIDI receiver end. On that same picture above you see that the “MIDI Clock Master” section in Renoise also has an Offset slider. That slider isn’t all that you need to consider.
- If the MIDI out that you’re sending to is a synth with zero latency, the “C-4 M01” note will sound sooner than “C-4 01” because Tracker’s audio engine has some internal latency due to its audio buffer it needs for its synthesis engines, reverb, master limiter, and our hardware codec’s “bass boost” and “space enhancer”.
- However, that synth might either have latency of its own, or it can be chained to a pedal or other processor that adds some latency of its own. So calculating this latency automatically isn’t possible to figure out.
- Better yet, the question arises: how are you listening to your external synth sequenced by Tracker? Are both Tracker and your external synth mixed by some other mixer or DAW? Or is the external synth’s sound engine routed back to Tracker via its “Line In” audio input? In the latter case, the sound from the synth is additionally shifted by Tracker’s audio buffer.
- Finally, the kicker: what if you have more than one device connected to MIDI? “C-4 M01” (MIDI channel 1) might have different latency from “C-4 M02” (MIDI channel 2).
Again, is this a Polyend Tracker-specific problem? Nope. Let’s see how Renoise solves this. Apart from the “Offset” slider we’ve seen already, it’s got “automatic plugin delay compensation”. It can do this because VST plugins report their latency to the VST host. Tracker works with hardware and this kind of reporting is impossible.
On top of this, Renoise has an instrument-specific MIDI OUT latency setting:
That’s not all. To deal with the situation of audio from the external MIDI synth being routed back to Renoise, it’s got a special mode in its #Line Input device:
Tracker’s status: I hope you can appreciate that this is a lot of functionality to be implemented. I’m working on this personally, this issue is tracked as #570.
Live clock drift
Realistically, no two hardware devices clock the same in a live setting. This is why MIDI doesn’t just send “start” and “stop” messages but also sends clock with a high PPQN. This is how you keep multiple devices in sync. Because MIDI is a serial protocol with relatively low resolution, it still has some jitter. Jitter means that the timing between two CLOCK messages is never exactly the same. In most circumstances it doesn’t matter but if you care about phasing between multiple devices, there are special devices which are specifically designed to output rock-solid clock, usually through an audio port and not MIDI. Those devices cost more than the Tracker.
Tracker’s status: Tracker’s current internal live clocking can be +/- 0.05% off from the declared BPM. This is within norm for hardware sequencers, we won’t be doing anything about this.
Song export clock drift
Tracker’s offline song rendering also can be off by +/- 0.05% from the declared BPM. We don’t consider this a deal breaker as all DAWs currently allow for audio stretching to match whatever BPM you need, if the 0.05% difference is unacceptable for you. Alternatively, you can export live with AUDIO OUT clocking Tracker externally from your DAW, making the timing match exactly what you need.
Tracker’s status: Unlike the live clock drift, we feel like we can do better than +/- 0.05%. Due to the audio engine’s implementation this is not a trivial improvement to make. We make no promises as to when this will be addressed.
Stems
To reiterate, we are fixing performance of stem export as well as issues with stems alignment between each other. This is tracked as #697. Stems have the same clock drift as song export (see above). The drift is identical between all stems so they stay in sync with one another when laid out on a multitrack audio editor.
I hope this clears things up. Cheers!