pub fn from_tuning<T: Tuning>(tuning: T, refkey: u8) -> Option<Self> {
        assert!(refkey < 127);

        let mut pitches = Vec::with_capacity(127);
        for i in 0..127 {
            if let Some(hz) = tuning.pitch(i - i32::from(refkey)) {
                pitches.push(hz)
            }
            else {
                return None
            }
        }

        Some(MidiTuning {
            pitches
        })
    }
/// Lineary maps the tuning to MIDI steps. `refkey` is a MIDI note of the reference pitch.
Lineary maps the tuning to MIDI steps. `refkey` is a MIDI note of the reference pitch.
Lineary maps the tuning to MIDI steps . ` refkey ` is a MIDI note of the reference pitch .
pub fn from_tuning<T: Tuning>(tuning: T, refkey: u8) -> Option<Self> {
        assert!(refkey < 127);
        let mut pitches = Vec::with_capacity(127);
        for i in 0..127 {
            if let Some(hz) = tuning.pitch(i - i32::from(refkey)) {
                pitches.push(hz)
            }
            else {
                return None
            }
        }
        Some(MidiTuning {
            pitches
        })
    }
pub fn from_tuning < T : Tuning > ( tuning : T , refkey : u8 ) -> Option < Self > { assert ! ( refkey 127 ) ; let mut pitches = Vec :: with_capacity ( 127 ) ; for i in 0 .. 127 { if let Some ( hz ) = tuning . pitch ( i - i32 :: from ( refkey ) ) { pitches . push ( hz ) } else { return None } } Some ( MidiTuning { pitches } ) }
Lineary maps the tuning to MIDI steps.
Lineary maps the tuning to MIDI steps .
tuning
T
refkey
u8
tuning
T
refkey
u8