diff --git a/crates/tek_core/src/space.rs b/crates/tek_core/src/space.rs index b76edd07..ee4e24ae 100644 --- a/crates/tek_core/src/space.rs +++ b/crates/tek_core/src/space.rs @@ -2,19 +2,19 @@ use crate::*; macro_rules! impl_axis_common { ($A:ident $T:ty) => { impl $A<$T> { - pub fn start_inc (&mut self) -> $T { + #[inline] pub fn start_inc (&mut self) -> $T { self.start += 1; self.start } - pub fn start_dec (&mut self) -> $T { + #[inline] pub fn start_dec (&mut self) -> $T { self.start = self.start.saturating_sub(1); self.start } - pub fn point_inc (&mut self) -> Option<$T> { + #[inline] pub fn point_inc (&mut self) -> Option<$T> { self.point = self.point.map(|p|p + 1); self.point } - pub fn point_dec (&mut self) -> Option<$T> { + #[inline] pub fn point_dec (&mut self) -> Option<$T> { self.point = self.point.map(|p|p.saturating_sub(1)); self.point } diff --git a/crates/tek_sequencer/src/sequencer_cmd.rs b/crates/tek_sequencer/src/sequencer_cmd.rs index 420b6823..248b9ca8 100644 --- a/crates/tek_sequencer/src/sequencer_cmd.rs +++ b/crates/tek_sequencer/src/sequencer_cmd.rs @@ -89,7 +89,12 @@ impl Handle for PhraseEditor { key!(KeyCode::Char('`')) => { self.mode = !self.mode; }, key!(KeyCode::Enter) => { self.entered = true; }, key!(KeyCode::Esc) => { self.entered = false; }, - + key!(KeyCode::PageUp) => { + self.note_axis.start = self.note_axis.start.saturating_sub(3); + } + key!(KeyCode::PageDown) => { + self.note_axis.start = self.note_axis.start + 3; + } key!(KeyCode::Up) => match self.entered { true => { self.note_axis.point_dec(); }, false => { self.note_axis.start_dec(); }, @@ -108,15 +113,17 @@ impl Handle for PhraseEditor { }, key!(KeyCode::Char(',')) => match self.entered { true => { self.note_len = prev_note_length(self.note_len) }, - false => { self.time_axis.scale = prev_note_length(self.time_axis.scale) }, + false => { self.time_axis.scale = next_note_length(self.time_axis.scale) }, }, key!(KeyCode::Char('.')) => match self.entered { true => { self.note_len = next_note_length(self.note_len) }, - false => { self.time_axis.scale = next_note_length(self.time_axis.scale) }, + false => { self.time_axis.scale = prev_note_length(self.time_axis.scale) }, }, key!(KeyCode::Char('a')) => if self.entered { self.put(); - self.time_axis.point = self.time_axis.point.map(|time|time + self.note_len); + self.time_axis.point = self.time_axis.point.map(|time|{ + time + self.note_len / self.time_axis.scale + }); }, key!(KeyCode::Char('s')) => if self.entered { self.put(); diff --git a/crates/tek_sequencer/src/sequencer_tui.rs b/crates/tek_sequencer/src/sequencer_tui.rs index 63b22640..5f3676ab 100644 --- a/crates/tek_sequencer/src/sequencer_tui.rs +++ b/crates/tek_sequencer/src/sequencer_tui.rs @@ -139,7 +139,7 @@ impl Content for PhraseEditor { if *focused { if *entered { lower_left = "[Esc] Exit edit mode [A]ppend [S]et".to_string(); - lower_right = format!("[,.] Length: {} {lower_right}", ppq_to_name(*note_len)); + lower_right = format!("[,.] Note: {} {lower_right}", ppq_to_name(*note_len)); } else { lower_left = "[Enter] Edit notes".to_string(); lower_right = format!("[,.] {lower_right}"); @@ -206,7 +206,7 @@ impl PhraseEditor { } else { 'ยท' }); - cell.set_fg(Color::Gray); + cell.set_fg(Color::Rgb(48, 64, 56)); cell.modifier = Modifier::DIM; }); }