mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-09 05:06:43 +01:00
wip: add note to phrase
This commit is contained in:
parent
a0eef1f626
commit
2606381d8c
3 changed files with 17 additions and 3 deletions
|
|
@ -114,8 +114,20 @@ impl Handle<Tui> for PhraseEditor<Tui> {
|
|||
true => {},
|
||||
false => {},
|
||||
},
|
||||
key!(KeyCode::Char('a')) => if self.entered {},
|
||||
key!(KeyCode::Char('i')) => if self.entered {},
|
||||
key!(KeyCode::Char('a')) => if self.entered {
|
||||
if let (Some(phrase), Some(time), Some(note)) = (
|
||||
&self.phrase,
|
||||
self.time_axis.point,
|
||||
self.note_axis.point,
|
||||
) {
|
||||
let mut phrase = phrase.write().unwrap();
|
||||
let key: u7 = u7::from((127 - note) as u8);
|
||||
let vel: u7 = 100.into();
|
||||
phrase.notes[time].push(MidiMessage::NoteOn { key, vel });
|
||||
phrase.notes[time + self.note_len].push(MidiMessage::NoteOff { key, vel });
|
||||
}
|
||||
},
|
||||
key!(KeyCode::Char('s')) => if self.entered {},
|
||||
|
||||
_ => { return Ok(None) }
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue