proper brick and gui scaling, minbpm/maxbpm

This commit is contained in:
2022-06-23 09:04:50 +02:00
parent baeea26410
commit 768dc4df83
3 changed files with 57 additions and 16 deletions

View File

@@ -11,13 +11,18 @@ class Oscillator {
float value; // is returned, constrained between "low" and "high"
float low = -1.0;
float high = 1.0;
float minBPM, maxBPM;
boolean playing, pause, valInvert;
Oscillator(float bpm_, int[] osciModes_) {
minBPM = 5;
maxBPM = 15;
bpm(bpm_);
possibleModes = osciModes_;
mode = possibleModes[int(random(possibleModes.length))];
play();
}
void amplitude(float low_, float high_) {
@@ -62,7 +67,7 @@ class Oscillator {
beatCount++;
if (random(1) > .5) {
mode = possibleModes[int(random(possibleModes.length))];
bpm(int(random(2, 20)));
bpm(random(minBPM, maxBPM));
}
}