Compare when the keyboard emits each note, how the host timestamps it, and where audio starts rendering. A complete note list cannot establish correct timing, and the receipt log is a separate time axis from audio output.
Use a dedicated test computer and a synthetic MIDI sequence. MIDI carries control events such as notes, while the computer renders audio samples. The keyboard can have its own reference, and computer playback can use an independent timebase. The frequency example below does not identify the part fitted in a commercial keyboard.
One note passes through at least three events
First the event is generated. A digital test source can record scheduled emission time. A keyboard can add delay from scanning, contact state, and firmware. Second the host receives and timestamps it. Some timestamp units represent ticks of the host clock, rather than milliseconds supplied by the device. Third the application places the event in a render block and audio emerges after buffering.
Specify whether acceptance concerns recorded event position, monitored sound latency, or both. Recording and monitoring may have different compensation paths. Applying monitoring latency directly to recorded notes can add error. Keep original units and the time origin with each log.
Use a common point to map host time to audio frames
If a host timestamp and audio-frame index are known for the same instant, estimate the frame difference from the elapsed host time and sample rate in that continuous run. Host ticks since boot are not audio-frame indices. After stopping or restarting the stream, establish a new frame origin.
Verify the host tick unit. The sample rate is frames per second. Block size is the number of frames rendered together. Dividing block size by sample rate gives block duration. If the app schedules each event at the next block start and drops its within-block offset, the delay can vary with its position relative to that boundary.
Worked example: when a 3 ms offset is scheduled in the next block
Assume host time is correctly converted to seconds, the continuous stream runs at 48,000 frames per second, and the rate does not change. An event 3 ms after the common reference is 48,000 × 0.003 = 144 frames later. A 256-frame block lasts 256 ÷ 48,000 seconds, about 5.33 ms.
If the reference is the start of a block, the event belongs at offset 144 in that block. Placing it at the next block start instead gives offset 256. The difference is 112 frames, about 2.33 ms. This hypothetical calculation illustrates one timing error with all notes still present. Scheduling must respect arrival time, buffering, and allowed lead time. A late event cannot be inserted in frames already rendered.
Recalculate after a restart or sample-rate change. A block duration calculated for 44.1 kHz does not apply to a 48 kHz run. For an offset that grows over a long session, check reuse of an old rate mapping or origin. Distinguish constant latency, block-phase variation, and accumulating drift.
Gather evidence for software and hardware separately
Send known, evenly spaced notes using software or an owned event generator. Use a synthesized sound with a clear onset and retain the pairing between note ID and output sample. Start with a simple route without unrelated processing in the test setup. Keep user configurations and live systems separate. Vary only block size or only input path per comparison.
| Boundary | Record | Check |
|---|---|---|
| Test source | Synthetic IDs, intervals, and expected times | Whether each event was emitted |
| Host reception | Raw timestamp, units, and common reference | Whether arrival time or origin was misused |
| Rendering | Sample rate, block length, in-block offset, and time used | Whether the event was moved to the next block |
| Monitoring and recording | Output sample position, recorded note position, and separate compensation | Whether sound latency and recording offset differ |
If changing block size changes the delay pattern while source and host reception stay normal, check scheduling and compensation. If periodic omissions, repeats, or scan anomalies precede host receipt, examine the oscillator, clock tree, scanner, and bus. If recorded notes are correct but playback differs, measure plug-in and output-buffer latency independently.
Test events near the beginning, middle, and end of a render block and compare their first audible sample. Similar averages can conceal a fixed delay in one version and a sharp late-block increase in another. Retain the evidence that distinguishes the two.
Specify the 12 MHz part and overall latency separately
TAITIEN's wide-temperature OY series covers 12 MHz CMOS active quartz oscillators. Confirm the actual order code, output, supply, load, temperature, frequency specification, and control pins. Match the oscillator circuit. A passive crystal footprint does not accept an active oscillator just because frequency matches.
Define end-to-end latency using named start and stop events and specified sampling and buffering conditions. Start a component substitution when the clock itself is shown to fail a requirement. Compare host receipt, recording, and output from both boards under matched conditions.
Start a new log sequence when restarting the app, switching audio devices, or reopening a stream. Establish a new timestamp-to-frame mapping from the available paired device data. Distinguish duplicated event handling within one run from IDs starting over in a new run.
Frequently asked questions
If all notes arrive, should we check order? Yes. Timestamp scheduling can still produce duplicate times or a wrong order. Compare IDs and content.
If monitoring sounds late, should we subtract a constant from every recorded note? Compare the recording position with actual monitoring output first. Identify where delay appears, then evaluate compensation for each path.
