summaryrefslogtreecommitdiffstats
path: root/player.mjs
diff options
context:
space:
mode:
authorBrian Cully <bjc@spork.org>2025-07-28 14:07:40 -0400
committerBrian Cully <bjc@spork.org>2025-07-28 14:08:54 -0400
commit7ca6bcfb6cab46103f2f6d8e714c3e06b8157033 (patch)
treefbfbc4d2ddb6e9b9532c614e77d446f007eb2fd5 /player.mjs
parent20edfe198d508a556f971ec7b9fe8fa957da15c7 (diff)
downloadchords-7ca6bcfb6cab46103f2f6d8e714c3e06b8157033.tar.gz
chords-7ca6bcfb6cab46103f2f6d8e714c3e06b8157033.zip
add player tests
Diffstat (limited to 'player.mjs')
-rw-r--r--player.mjs19
1 files changed, 0 insertions, 19 deletions
diff --git a/player.mjs b/player.mjs
index 55ce64f..070a8b7 100644
--- a/player.mjs
+++ b/player.mjs
@@ -44,23 +44,4 @@ export default class {
console.debug('Player#stop', this);
this.notes.forEach(n => n.stop());
}
-
- test() {
- const cNote = Note.fromString('C');
- console.assert(cNote.distanceTo(cNote) === 0);
- const dNote = Note.fromString('D');
- console.assert(cNote.distanceTo(dNote) === 2);
- const dSharpNote = Note.fromString('D♯');
- console.assert(cNote.distanceTo(dSharpNote) === 3);
-
- const aNote = Note.fromString('A', 'A to A');
- console.assert(toCents([aNote, 4], [aNote, 3]) === -1200);
- const bNote = Note.fromString('B');
- console.assert(toCents([aNote, 4], [bNote, 4]) == 200, 'A4 to B4 is 200 cents');
- // E F F# G G# A
- const eNote = Note.fromString('E');
- console.assert(toCents([aNote, 4], [eNote, 4]) === -500, 'E4 is 500 cents lower than A4');
-
- console.assert(toCents([aNote, 4], [bNote, 3]) === -1000, 'A4 to B3 is 100 cents above -1200');
- }
}