Skip to content

Commit b6eb522

Browse files
authoredMay 19, 2024··
Fix normalize Cb to B in Db (#1183)
Resolves #1171 Thanks to @beltonk for reporting
1 parent b36c39c commit b6eb522

File tree

4 files changed

+8
-15
lines changed

4 files changed

+8
-15
lines changed
 

‎src/normalize_mappings/enharmonic-normalize.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const enharmonics: Record<string, Record<string, string>> = {
1919
'Bb': 'A#',
2020
},
2121
'Db': {
22-
'B': 'Cb',
22+
'Cb': 'B',
2323
'F#': 'Gb',
2424
'G#': 'Ab',
2525
'A#': 'Bb',

‎test/key/normalize.test.ts

+5-12
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
import { buildKey } from '../utilities';
2+
23
import {
3-
ChordProParser, NUMERIC, SYMBOL, TextFormatter,
4+
NUMERAL,
5+
NUMERIC,
6+
SOLFEGE,
7+
SYMBOL,
48
} from '../../src';
5-
import { NUMERAL, SOLFEGE } from '../../src/constants';
69

710
describe('Key', () => {
811
describe('normalize', () => {
@@ -69,15 +72,5 @@ describe('Key', () => {
6972
it('normalizes bIV', () => {
7073
expect(buildKey('IV', NUMERAL, 'b').normalize().toString()).toEqual('III');
7174
});
72-
73-
it('normalizes Db key', () => {
74-
const song = new ChordProParser()
75-
.parse('[E] [E/B] [E/C#] [E/A]')
76-
.setKey('E')
77-
.setCapo(3);
78-
79-
const rendered = new TextFormatter().format(song).trim();
80-
expect(rendered).toEqual('Db Db/Ab Db/Bb Db/Gb');
81-
});
8275
});
8376
});

‎test/numeral_chord/to_chord_symbol_string.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ const majorExamples = {
121121
'V': 'Ab',
122122
'bVI': 'A',
123123
'VI': 'Bb',
124-
'bVII': 'Cb',
124+
'bVII': 'B',
125125
'VII': 'C',
126126
},
127127

‎test/numeric_chord/to_chord_symbol_string.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ const majorExamples = {
121121
'5': 'Ab',
122122
'b6': 'A',
123123
'6': 'Bb',
124-
'b7': 'Cb',
124+
'b7': 'B',
125125
'7': 'C',
126126
},
127127

0 commit comments

Comments
 (0)
Please sign in to comment.