Steps are set in Track section

This commit is contained in:
Dejvino
2026-03-04 23:32:57 +01:00
parent e9f9682663
commit 1014e371ee
4 changed files with 28 additions and 21 deletions
+25 -18
View File
@@ -353,28 +353,35 @@ void UIManager::updateLeds(const Step sequence[][NUM_STEPS], int playbackStep, b
if(playMode == MODE_POLY) {
for(int t=0; t<NUM_TRACKS; t++) {
int currentTrackSteps = numSteps[t];
for(int s=0; s<NUM_STEPS; s++) {
if (s >= numSteps[t]) continue;
int col = s; // Each step is a column
int row = t * 2 + (s / NUM_STEPS);
int col = s % NUM_STEPS;
uint32_t color = 0;
int note = sequence[t][s].note;
if (note != -1) {
color = getNoteColor(note, !sequence[t][s].accent);
}
if (isPlaying && s == (playbackStep % numSteps[t])) {
if (trackMute[t]) {
color = COLOR_MUTED_PLAYHEAD;
} else {
color = (note != -1) ? COLOR_PLAYHEAD : COLOR_PLAYHEAD_DIM;
// --- First row of track pair: Notes ---
int note_row = t * 2;
uint32_t note_color = 0;
if (s < currentTrackSteps) {
int note = sequence[t][s].note;
if (note != -1) {
note_color = getNoteColor(note, !sequence[t][s].accent);
}
}
pixels.setPixelColor(getPixelIndex(col, row), color);
pixels.setPixelColor(getPixelIndex(col, note_row), note_color);
// --- Second row of track pair: Steps & Playhead ---
int step_row = t * 2 + 1;
uint32_t step_color = 0; // Off by default for steps > currentTrackSteps
if (s < currentTrackSteps) {
step_color = COLOR_PLAYHEAD_DIM; // It's a valid step
if (isPlaying && (s == (playbackStep % currentTrackSteps))) {
if (trackMute[t]) {
step_color = COLOR_MUTED_PLAYHEAD;
} else {
step_color = COLOR_PLAYHEAD;
}
}
}
pixels.setPixelColor(getPixelIndex(col, step_row), step_color);
}
}
} else {