mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-08 04:36:45 +01:00
wip: inc/dec phrase length
This commit is contained in:
parent
26d75340f6
commit
ff342963a1
3 changed files with 56 additions and 13 deletions
|
|
@ -342,7 +342,7 @@ impl<E: Engine> PhraseLength<E> {
|
|||
self.pulses / (self.bpb * self.ppq)
|
||||
}
|
||||
pub fn beats (&self) -> usize {
|
||||
self.pulses % (self.bpb * self.ppq)
|
||||
(self.pulses % (self.bpb * self.ppq)) / self.ppq
|
||||
}
|
||||
pub fn ticks (&self) -> usize {
|
||||
self.pulses % self.ppq
|
||||
|
|
@ -359,3 +359,19 @@ impl<E: Engine> PhraseLength<E> {
|
|||
}
|
||||
#[derive(Copy,Clone)]
|
||||
pub enum PhraseLengthFocus { Bar, Beat, Tick }
|
||||
impl PhraseLengthFocus {
|
||||
pub fn next (&mut self) {
|
||||
*self = match self {
|
||||
Self::Bar => Self::Beat,
|
||||
Self::Beat => Self::Tick,
|
||||
Self::Tick => Self::Bar,
|
||||
}
|
||||
}
|
||||
pub fn prev (&mut self) {
|
||||
*self = match self {
|
||||
Self::Bar => Self::Tick,
|
||||
Self::Beat => Self::Bar,
|
||||
Self::Tick => Self::Beat,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue