/////////////////////////////////////////////////////////////////////////////////////////////////// //keymap!(KEYS_MIDI_EDITOR = |s: MidiEditor, _input: Event| MidiEditCommand { //key(Up) => SetNoteCursor(s.note_pos() + 1), //key(Char('w')) => SetNoteCursor(s.note_pos() + 1), //key(Down) => SetNoteCursor(s.note_pos().saturating_sub(1)), //key(Char('s')) => SetNoteCursor(s.note_pos().saturating_sub(1)), //key(Left) => SetTimeCursor(s.time_pos().saturating_sub(s.note_len())), //key(Char('a')) => SetTimeCursor(s.time_pos().saturating_sub(s.note_len())), //key(Right) => SetTimeCursor((s.time_pos() + s.note_len()) % s.clip_length()), //ctrl(alt(key(Up))) => SetNoteScroll(s.note_pos() + 3), //ctrl(alt(key(Down))) => SetNoteScroll(s.note_pos().saturating_sub(3)), //ctrl(alt(key(Left))) => SetTimeScroll(s.time_pos().saturating_sub(s.time_zoom().get())), //ctrl(alt(key(Right))) => SetTimeScroll((s.time_pos() + s.time_zoom().get()) % s.clip_length()), //ctrl(key(Up)) => SetNoteScroll(s.note_lo().get() + 1), //ctrl(key(Down)) => SetNoteScroll(s.note_lo().get().saturating_sub(1)), //ctrl(key(Left)) => SetTimeScroll(s.time_start().get().saturating_sub(s.note_len())), //ctrl(key(Right)) => SetTimeScroll(s.time_start().get() + s.note_len()), //alt(key(Up)) => SetNoteCursor(s.note_pos() + 3), //alt(key(Down)) => SetNoteCursor(s.note_pos().saturating_sub(3)), //alt(key(Left)) => SetTimeCursor(s.time_pos().saturating_sub(s.time_zoom().get())), //alt(key(Right)) => SetTimeCursor((s.time_pos() + s.time_zoom().get()) % s.clip_length()), //key(Char('d')) => SetTimeCursor((s.time_pos() + s.note_len()) % s.clip_length()), //key(Char('z')) => SetTimeLock(!s.time_lock().get()), //key(Char('-')) => SetTimeZoom(if s.time_lock().get() { s.time_zoom().get() } else { NoteDuration::next(s.time_zoom().get()) }), //key(Char('_')) => SetTimeZoom(if s.time_lock().get() { s.time_zoom().get() } else { NoteDuration::next(s.time_zoom().get()) }), //key(Char('=')) => SetTimeZoom(if s.time_lock().get() { s.time_zoom().get() } else { NoteDuration::prev(s.time_zoom().get()) }), //key(Char('+')) => SetTimeZoom(if s.time_lock().get() { s.time_zoom().get() } else { NoteDuration::prev(s.time_zoom().get()) }), ////// TODO: kpat!(Char('/')) => // toggle 3plet ////// TODO: kpat!(Char('?')) => // toggle dotted //});