Better arp

This commit is contained in:
Dejvino
2026-02-17 00:49:17 +01:00
parent 6734572a67
commit 225d04a53c
6 changed files with 146 additions and 64 deletions
+15
View File
@@ -19,6 +19,21 @@ public:
randomSeed(micros());
}
void generateScale(int* scaleNotes, int& numScaleNotes) override {
numScaleNotes = random(3, 13); // 3 to 12 notes
for (int i = 0; i < 12; i++) {
scaleNotes[i] = i; // Fill with all notes
}
// Shuffle
for (int i = 0; i < 12; i++) {
int j = random(12);
int temp = scaleNotes[i];
scaleNotes[i] = scaleNotes[j];
scaleNotes[j] = temp;
}
sortArray(scaleNotes, numScaleNotes);
}
void mutate(Step* sequence, int numSteps, int* scaleNotes, int numScaleNotes) override {
// Mutate 1 or 2 steps
int count = random(1, 3);