Polyrhythm tracks
This commit is contained in:
+12
-12
@@ -51,8 +51,8 @@ void UIManager::showMessage(const char* msg) {
|
||||
|
||||
void UIManager::draw(UIState currentState, int menuSelection,
|
||||
int midiChannel, int tempo, MelodyStrategy* currentStrategy,
|
||||
int queuedTheme, int currentThemeIndex,
|
||||
int numScaleNotes, const int* scaleNotes, int melodySeed, int numSteps,
|
||||
int queuedTheme, int currentThemeIndex,
|
||||
int numScaleNotes, const int* scaleNotes, int melodySeed, int currentTrackNumSteps,
|
||||
bool mutationEnabled, bool songModeEnabled,
|
||||
const Step sequence[][NUM_STEPS], int playbackStep, bool isPlaying,
|
||||
int randomizeTrack, const bool* trackMute, const int* trackIntensities) {
|
||||
@@ -64,7 +64,7 @@ void UIManager::draw(UIState currentState, int menuSelection,
|
||||
|
||||
switch(currentState) {
|
||||
case UI_MENU_MAIN:
|
||||
drawMenu(menuSelection, currentState, midiChannel, tempo, currentStrategy->getName(), queuedTheme, currentThemeIndex, numScaleNotes, scaleNotes, melodySeed, numSteps, mutationEnabled, songModeEnabled, isPlaying, randomizeTrack, trackMute, trackIntensities);
|
||||
drawMenu(menuSelection, currentState, midiChannel, tempo, currentStrategy->getName(), queuedTheme, currentThemeIndex, numScaleNotes, scaleNotes, melodySeed, currentTrackNumSteps, mutationEnabled, songModeEnabled, isPlaying, randomizeTrack, trackMute, trackIntensities);
|
||||
break;
|
||||
case UI_SETUP_CHANNEL_EDIT:
|
||||
display.println(F("SET MIDI CHANNEL"));
|
||||
@@ -95,7 +95,7 @@ void UIManager::draw(UIState currentState, int menuSelection,
|
||||
display.setCursor(20, 25);
|
||||
display.setTextSize(2);
|
||||
display.print(F("LEN: "));
|
||||
display.print(numSteps);
|
||||
display.print(currentTrackNumSteps);
|
||||
display.setTextSize(1);
|
||||
display.setCursor(0, 50);
|
||||
display.println(F(" (Press to confirm)"));
|
||||
@@ -233,8 +233,8 @@ void UIManager::drawNumberEditor(const char* title, int value, int minVal, int m
|
||||
}
|
||||
|
||||
void UIManager::drawMenu(int selection, UIState currentState, int midiChannel, int tempo, const char* flavourName,
|
||||
int queuedTheme, int currentThemeIndex, int numScaleNotes,
|
||||
const int* scaleNotes, int melodySeed, int numSteps, bool mutationEnabled,
|
||||
int queuedTheme, int currentThemeIndex, int numScaleNotes,
|
||||
const int* scaleNotes, int melodySeed, int currentTrackNumSteps, bool mutationEnabled,
|
||||
bool songModeEnabled, bool isPlaying, int randomizeTrack, const bool* trackMute, const int* trackIntensities) {
|
||||
|
||||
// Calculate visual cursor position and scroll offset
|
||||
@@ -294,7 +294,7 @@ void UIManager::drawMenu(int selection, UIState currentState, int midiChannel, i
|
||||
}
|
||||
}
|
||||
} else if (id == MENU_ID_TEMPO) { display.print(F(": ")); display.print(tempo); }
|
||||
else if (id == MENU_ID_STEPS) { display.print(F(": ")); display.print(numSteps); }
|
||||
else if (id == MENU_ID_STEPS) { display.print(F(": ")); display.print(currentTrackNumSteps); }
|
||||
else if (id == MENU_ID_SONG_MODE) { display.print(F(": ")); display.print(songModeEnabled ? F("ON") : F("OFF")); }
|
||||
else if (id == MENU_ID_TRACK_SELECT) { display.print(F(": ")); display.print(randomizeTrack + 1); }
|
||||
else if (id == MENU_ID_MUTE) { display.print(F(": ")); display.print(trackMute[randomizeTrack] ? F("YES") : F("NO")); }
|
||||
@@ -342,7 +342,7 @@ int UIManager::getPixelIndex(int x, int y) {
|
||||
void UIManager::updateLeds(const Step sequence[][NUM_STEPS], int playbackStep, bool isPlaying,
|
||||
UIState currentState, bool songModeEnabled,
|
||||
int songRepeatsRemaining, bool sequenceChangeScheduled, PlayMode playMode,
|
||||
int selectedTrack, int numSteps, int numScaleNotes, const int* scaleNotes, const bool* trackMute) {
|
||||
int selectedTrack, const int* numSteps, int numScaleNotes, const int* scaleNotes, const bool* trackMute) {
|
||||
pixels.clear();
|
||||
|
||||
const uint32_t COLOR_PLAYHEAD = pixels.Color(0, 255, 0);
|
||||
@@ -354,7 +354,7 @@ void UIManager::updateLeds(const Step sequence[][NUM_STEPS], int playbackStep, b
|
||||
if(playMode == MODE_POLY) {
|
||||
for(int t=0; t<NUM_TRACKS; t++) {
|
||||
for(int s=0; s<NUM_STEPS; s++) {
|
||||
if (s >= numSteps) continue;
|
||||
if (s >= numSteps[t]) continue;
|
||||
|
||||
int row = t * 2 + (s / NUM_STEPS);
|
||||
int col = s % NUM_STEPS;
|
||||
@@ -366,7 +366,7 @@ void UIManager::updateLeds(const Step sequence[][NUM_STEPS], int playbackStep, b
|
||||
color = getNoteColor(note, !sequence[t][s].accent);
|
||||
}
|
||||
|
||||
if (isPlaying && s == playbackStep) {
|
||||
if (isPlaying && s == (playbackStep % numSteps[t])) {
|
||||
if (trackMute[t]) {
|
||||
color = COLOR_MUTED_PLAYHEAD;
|
||||
} else {
|
||||
@@ -381,12 +381,12 @@ void UIManager::updateLeds(const Step sequence[][NUM_STEPS], int playbackStep, b
|
||||
// --- Mono Mode (original) ---
|
||||
const Step* trackSequence = sequence[selectedTrack];
|
||||
for (int s = 0; s < NUM_STEPS; s++) {
|
||||
if (s >= numSteps) continue;
|
||||
if (s >= numSteps[selectedTrack]) continue;
|
||||
|
||||
int x = s % NUM_STEPS;
|
||||
int yBase = (s / NUM_STEPS) * 2;
|
||||
uint32_t color = 0, dimColor = 0;
|
||||
bool isCursorHere = (isPlaying && s == playbackStep);
|
||||
bool isCursorHere = (isPlaying && s == (playbackStep % numSteps[selectedTrack]));
|
||||
if (trackSequence[s].note != -1) {
|
||||
color = getNoteColor(trackSequence[s].note, trackSequence[s].tie);
|
||||
dimColor = getNoteColor(trackSequence[s].note, true);
|
||||
|
||||
Reference in New Issue
Block a user