Skip to main content

encode_single_note_tuning

Function encode_single_note_tuning 

Source
pub fn encode_single_note_tuning(
    device_id: u8,
    program: u8,
    note: u8,
    freq: f64,
) -> Result<[u8; 12], AudioError>
Expand description

Encode a single-note tuning change as a 12-byte real-time SysEx: F0 7F <dev> 08 02 <program> 01 <note> <xx yy zz> F7.

The 3 frequency bytes are xx = nearest ET semitone (0..127), then a 14-bit fraction of one semitone as yy (high 7 bits) and zz (low 7 bits).

ยงErrors

AudioError::InvalidParameter if device_id, program, or note exceed 7 bits, or freq is not a positive, in-range frequency.