diff options
| author | Brian Cully <bjc@spork.org> | 2025-07-28 14:07:40 -0400 |
|---|---|---|
| committer | Brian Cully <bjc@spork.org> | 2025-07-28 14:08:54 -0400 |
| commit | 7ca6bcfb6cab46103f2f6d8e714c3e06b8157033 (patch) | |
| tree | fbfbc4d2ddb6e9b9532c614e77d446f007eb2fd5 /player.mjs | |
| parent | 20edfe198d508a556f971ec7b9fe8fa957da15c7 (diff) | |
| download | chords-7ca6bcfb6cab46103f2f6d8e714c3e06b8157033.tar.gz chords-7ca6bcfb6cab46103f2f6d8e714c3e06b8157033.zip | |
add player tests
Diffstat (limited to 'player.mjs')
| -rw-r--r-- | player.mjs | 19 |
1 files changed, 0 insertions, 19 deletions
@@ -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'); - } } |
