Skip to content

keep performance mode timing at any lines per beat - #43

Merged
llozd merged 3 commits into
mainfrom
performance-lpb-scaling
Nov 16, 2026
Merged

llozd merged 3 commits into
mainfrom
performance-lpb-scaling

Conversation

@llozd

@llozd llozd commented Nov 16, 2026

Copy link
Copy Markdown
Owner

Summary & Goal

Performance mode was written for a fixed 4 lines per beat. Since LPB, Pattern Length and Step Stutter count rows, so at 16 LPB they run four times as fast and Pattern Length can only loop 2 bars. This makes them behave as they did at 4 LPB, at any LPB.

Behavior & Changes

  • Pattern Length values (1 to 128) are 16th notes, converted to rows and clamped to 1..512. At 16 LPB, 16 loops 64 rows (one bar) and 128 loops 512 rows.
  • Step Stutter periods are scaled by LPB / 4, with a 2 tick minimum (the retrigger check is stepTimer % period == 1, so 1 would never fire).
  • New Sequencer::scaleToLinesPerBeat() does the rounding, shared with the metronome's count-in length.
  • Labels are unchanged. LFO speed effects still follow the step, as they do across the engine.
  • README LPB section, CHANGELOG and OpenSpec (performance-lpb-scaling) updated. lines-per-beat is now marked tested on Tracker+.

Target Devices

  • Original Polyend Tracker (MK66)
  • Polyend Tracker+ (IMX)
  • Polyend Tracker Mini (IMX)

Hardware Testing Status

Device Tested on Hardware by Author Needs Community Hardware Testing Not Applicable Notes / Tested By
Original Tracker (MK66) [ ] [x] [ ]
Tracker+ (IMX) [ ] [x] [ ]
Tracker Mini (IMX) [ ] [x] [ ]

How to Test

  1. Set a project to 4 LPB, play a pattern in performance mode and try Pattern Length (16, 128) and Step Stutter (1, 1/4, 4) on a track. Note how they sound.
  2. Change the project to 16 LPB (Project Settings > Lines per beat) and repeat: loops and stutters should last the same musical time. Pattern Length 128 should loop 512 rows.
  3. Repeat at 1 and 12 LPB. At 1 LPB, Pattern Length 1 and 2 loop a single row.

Developer Checklist

  • I have read and understood the Contribution & Pull Request Guidelines (CONTRIBUTING.md).
  • This PR implements one single feature or bug fix (no unrelated refactors or formatting sweeps).
  • make all compiles cleanly for all three devices (Original, Plus, Mini).
  • Memory usage (SRAM_DTC, EXTERNAL_RAM, FLASH) was checked and stays within safe hardware headroom.
  • No heap allocations (new/malloc) or SD card I/O were added to real-time audio callbacks.
  • Existing .mt projects, .pti instruments, .pts synth patches, and mtConfig settings remain backward-compatible.

@llozd
llozd marked this pull request as ready for review November 16, 2026 08:11
@llozd
llozd merged commit d2a46a8 into main Nov 16, 2026
1 check passed
@llozd
llozd deleted the performance-lpb-scaling branch November 23, 2026 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant