Skip to main content

readback_mismatches

Function readback_mismatches 

Source
pub fn readback_mismatches(
    sent: &PresetState,
    saved: &[u8],
    bpm: Bpm,
) -> Result<Vec<Mismatch>, RenderError>
Expand description

Compares the preset JSON of a sent state with the one in a saved state: the name, the tuning and every control, a number under settings. Keys the plug-in adds on save are ignored.

The tempo control, beats_per_minute in beats per second, is compared with bpm instead of the sent value. A plug-in in a host sets it from the host’s tempo on every block, so the saved value shows the tempo the render played at. The expected value is the one Vital computes, vital_beats_per_second.

The comparison is Vital-shaped: the tempo key is a Vital key. A Serum 2 read-back needs its own rule.

§Errors

Returns RenderError::Internal when the sent state, which this program built, holds no preset JSON, and RenderError::State when the saved state holds none.