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

View File

@ -23,12 +23,12 @@ MenuItem menuItems[] = {
{ "Playback", MENU_ID_PLAYBACK, false, false, 1 },
{ "Melody", MENU_ID_MELODY, false, false, 1 },
{ "Scale", MENU_ID_SCALE, false, false, 1 },
{ "Steps", MENU_ID_STEPS, false, false, 1 },
{ "Tempo", MENU_ID_TEMPO, false, false, 1 },
{ "Song Mode", MENU_ID_SONG_MODE, false, false, 1 },
{ "Track", MENU_ID_GROUP_TRACK, true, true, 0 },
{ "Track", MENU_ID_TRACK_SELECT, false, false, 1 },
{ "Mute", MENU_ID_MUTE, false, false, 1 },
{ "Steps", MENU_ID_STEPS, false, false, 1 },
{ "Flavour", MENU_ID_FLAVOUR, false, false, 1 },
{ "Intensity", MENU_ID_INTENSITY, false, false, 1 },
{ "Mutation", MENU_ID_MUTATION, false, false, 1 },

View File

@ -19,13 +19,13 @@ enum MenuItemID {
MENU_ID_PLAYBACK,
MENU_ID_MELODY,
MENU_ID_SCALE,
MENU_ID_STEPS,
MENU_ID_TEMPO,
MENU_ID_SONG_MODE,
MENU_ID_GROUP_TRACK,
MENU_ID_TRACK_SELECT,
MENU_ID_MUTE,
MENU_ID_STEPS,
MENU_ID_FLAVOUR,
MENU_ID_INTENSITY,
MENU_ID_MUTATION,

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;
// --- 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) {
color = getNoteColor(note, !sequence[t][s].accent);
note_color = getNoteColor(note, !sequence[t][s].accent);
}
}
pixels.setPixelColor(getPixelIndex(col, note_row), note_color);
if (isPlaying && s == (playbackStep % numSteps[t])) {
// --- 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]) {
color = COLOR_MUTED_PLAYHEAD;
step_color = COLOR_MUTED_PLAYHEAD;
} else {
color = (note != -1) ? COLOR_PLAYHEAD : COLOR_PLAYHEAD_DIM;
step_color = COLOR_PLAYHEAD;
}
}
pixels.setPixelColor(getPixelIndex(col, row), color);
}
pixels.setPixelColor(getPixelIndex(col, step_row), step_color);
}
}
} else {

View File

@ -667,7 +667,7 @@ static void updateLeds() {
// It's a TRACK section item (Track, Mute, Flavour, Mutation, Themes)
ledDisplayMode = MODE_MONO;
}
} else if (local_currentState == UI_EDIT_FLAVOUR || local_currentState == UI_RANDOMIZE_TRACK_EDIT || local_currentState == UI_SCALE_EDIT || local_currentState == UI_SCALE_NOTE_EDIT || local_currentState == UI_SCALE_TRANSPOSE) {
} else if (local_currentState == UI_EDIT_STEPS || local_currentState == UI_EDIT_FLAVOUR || local_currentState == UI_RANDOMIZE_TRACK_EDIT || local_currentState == UI_SCALE_EDIT || local_currentState == UI_SCALE_NOTE_EDIT || local_currentState == UI_SCALE_TRANSPOSE) {
// These are entered from TRACK section items
ledDisplayMode = MODE_MONO;
}