UNPKG

abc-notation-transposition

Version:

A robust utility for transposing ABC Notation by half steps.

35 lines (32 loc) 1.09 kB
const {transposePitchChromatically} = require('../../../../functions/transpose-pitch-by-key'); const {KEYS} = require('../../../../constants'); test('Expect transposePitchChromatically to correctly transpose various pitches.', () => { const pitchLetter = 'F'; const keySignatureAccidental = '^'; const deviation = -3; const storedAccidentals = { A: "=", B: "=", C: "=", D: "=", E: "=", F: "^", G: "=" } expect(transposePitchChromatically(pitchLetter, keySignatureAccidental, deviation, storedAccidentals)).toEqual(['E', '_', true]); }); test('Expect transposePitchChromatically to correctly transpose various pitches.', () => { const pitchLetter = 'G'; const keySignatureAccidental = '='; const deviation = 3; const storedAccidentals = { A: "=", B: "=", C: "=", D: "=", E: "=", F: "^", G: "=" } expect(transposePitchChromatically(pitchLetter, keySignatureAccidental, deviation, storedAccidentals)).toEqual(['A', '^', true]); });