mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-08 04:36:45 +01:00
scroll sequencer
This commit is contained in:
parent
47b2c5da29
commit
7f3425fe04
3 changed files with 18 additions and 7 deletions
|
|
@ -131,7 +131,7 @@ mod horizontal {
|
|||
phrase: &Phrase,
|
||||
ppq: usize,
|
||||
time_z: usize,
|
||||
_time0: usize,
|
||||
time0: usize,
|
||||
note0: usize,
|
||||
) {
|
||||
let Rect { x, y, width, height } = area;
|
||||
|
|
@ -142,7 +142,8 @@ mod horizontal {
|
|||
let (bw, wh) = (bg.dim(), bg.white().not_dim());
|
||||
let offset = 5;
|
||||
for x in x+offset..x+width-offset {
|
||||
let step = (x-offset) as usize * time_z;
|
||||
let step = (time0 + (x-offset) as usize) * time_z;
|
||||
let next_step = (time0 + (x-offset) as usize + 1) * time_z;
|
||||
if step % ppq == 0 {
|
||||
"|".blit(buf, x as u16, y, Some(Style::default().dim()));
|
||||
}
|
||||
|
|
@ -151,13 +152,12 @@ mod horizontal {
|
|||
format!("{}", (step/bar)+1)
|
||||
.blit(buf, x as u16, y, Some(Style::default().bold().not_dim()));
|
||||
}
|
||||
let (a, b) = (step, step + time_z);
|
||||
for index in 0..height-2 {
|
||||
let note_a = note0 + index as usize * 2;
|
||||
let note_b = note0 + index as usize * 2 + 1;
|
||||
let (character, mut style) = match (
|
||||
phrase.contains_note_on(u7::from_int_lossy(note_a as u8), a, b),
|
||||
phrase.contains_note_on(u7::from_int_lossy(note_b as u8), a, b),
|
||||
phrase.contains_note_on(u7::from_int_lossy(note_a as u8), step, next_step),
|
||||
phrase.contains_note_on(u7::from_int_lossy(note_b as u8), step, next_step),
|
||||
) {
|
||||
(true, true) => ("█", wh),
|
||||
(false, true) => ("▀", wh),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue