callback = (time) => {
if (randFromArr([0, 1])) mutable note = randFromArr(scale.notes);
if (randFromArr([0, 1])) mutable octave = randFromArr(octaves);
noteIndex < 11 ? mutable noteIndex++ : (mutable noteIndex = 0);
mutable noteWillBePlayed = randFromArr([0, 1]);
if (noteWillBePlayed) {
synth.triggerAttackRelease(
`${note}${octave}`,
"64n",
time,
d3.randomUniform(0.1, 1)()
);
} else {
if (altSynthToggle) {
altSynth.triggerAttackRelease(
`${note}${octave}`,
"32n",
time,
d3.randomUniform(0.5, 1)()
);
}
}
membraneSynth.triggerAttackRelease(
`${chromaticScale[noteIndex]}${randFromArr([0, 1])}`,
"16n",
time,
d3.randomUniform(0.4, 0.8)()
);
bassSynth.triggerAttackRelease(
`${bassNote}${randFromArr([1, 2])}`,
"12n",
time + bassOffset,
d3.randomUniform(0.4, 1)()
);
}