        }
    }

    pub fn midi_in(&mut self, midi_message: MidiMessage) {
        let stack = match self.channels[0].as_mut() {
            Some(stack) => stack,
            None => return,
        };
        match midi_message {
            MidiMessage::NoteOn(_channel, note, _velocity) => {
                self.pitch = note.to_freq_f64();