Published
Edited
Jul 28, 2020
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
{
while (true) {
yield Promises.delay(1000, synth.triggerAttackRelease(randFromScale, '6n'));
}
}
Insert cell
{
while (true) {
yield Promises.delay(500, synth.triggerAttackRelease(fromMidiNote, '16n'));
}
}
Insert cell
Insert cell
Insert cell
Insert cell
midiNote = {
midiNoteBtn;
return Math.floor(Math.random() * 60) + 30; // less range than the full 217 to remove highs and lows
}
Insert cell
fromMidiNote = {
randHarmonyBtn;
return tonal.Midi.midiToNoteName(midiNote);
}
Insert cell
randFromScale = {
justHarm;
return randFromArr(scale.notes);
}
Insert cell
scaleFlavour = {
newScale;
return randFromArr(scaleNames);
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more