isomorphic steps
Some checks failed
/ build (push) Failing after 12m47s

This commit is contained in:
Nycki 2026-04-04 15:01:09 -07:00
parent 23e0c008a8
commit ed45d2a72f

View file

@ -31,7 +31,7 @@
); );
} }
// arrange notes so that moving three keys sideways is exactly an octave. makes it easy to play octaves. everything else is wonky though... // arrange notes "isomorphically". moving sideways is 5 semitones, moving diagonally upwards is 2 semitones.
function useEqualSteps() { function useEqualSteps() {
const rows = [ const rows = [
"1234567890-=", "1234567890-=",
@ -42,7 +42,7 @@
tone = {}; tone = {};
rows.map((row, y) => { rows.map((row, y) => {
row.split('').map((key, x) => { row.split('').map((key, x) => {
const semitone = x * 4 + y - 20; const semitone = Math.floor(x * 5 + y * 2 - 28);
tone[key] = 440 * 2 ** (semitone / 12); tone[key] = 440 * 2 ** (semitone / 12);
}) })
}); });