unified compact flag in groovebox

This commit is contained in:
🪞👃🪞 2025-01-02 18:40:29 +01:00
parent c9a79b1f29
commit 511ff91864
12 changed files with 129 additions and 188 deletions

View file

@ -22,7 +22,7 @@ render!(Tui: (self: PianoHorizontal) => Bsp::s(
impl PianoHorizontal {
/// Draw the piano roll foreground using full blocks on note on and half blocks on legato: █▄ █▄ █▄
fn draw_bg (buf: &mut BigBuffer, phrase: &MidiClip, zoom: usize, note_len: usize) {
for (y, note) in (0..127).rev().enumerate() {
for (y, note) in (0..=127).rev().enumerate() {
for (x, time) in (0..buf.width).map(|x|(x, x*zoom)) {
let cell = buf.get_mut(x, y).unwrap();
cell.set_bg(phrase.color.darkest.rgb);
@ -47,7 +47,7 @@ impl PianoHorizontal {
let mut notes_on = [false;128];
for (x, time_start) in (0..phrase.length).step_by(zoom).enumerate() {
for (y, note) in (0..127).rev().enumerate() {
for (y, note) in (0..=127).rev().enumerate() {
if let Some(cell) = buf.get_mut(x, note) {
if notes_on[note] {
cell.set_char('▂');