MCPcopy Create free account
hub / github.com/PerroEngine/Perro / start_note

Method start_note

perro_source/audio_stack/perro_pawdio/src/midi.rs:891–905  ·  view source on GitHub ↗
(&mut self, note: SoundFontMixerNote)

Source from the content-addressed store, hash-verified

889 self.synth
890 .process_midi_message(note.channel.0 as i32, 0xC0, note.program.0 as i32, 0);
891 self.synth.process_midi_message(
892 note.channel.0 as i32,
893 0x90,
894 note.note.0 as i32,
895 note.velocity as i32,
896 );
897 self.notes.insert(note.id, (note.channel, note.note));
898 if !note.held {
899 self.auto_releases
900 .push((self.sample + duration_samples(note.sustain), note.id));
901 }
902 }
903
904 fn release_note(&mut self, id: u64) {
905 if let Some((channel, note)) = self.notes.remove(&id) {
906 self.synth
907 .process_midi_message(channel.0 as i32, 0x80, note.0 as i32, 0);
908 }

Callers 1

process_controlsMethod · 0.45

Calls 3

duration_samplesFunction · 0.85
insertMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected