chordsheetjs 15.3.1 → 15.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/pdf/index.js CHANGED
@@ -309,6 +309,7 @@ const $af8d31735c159a26$export$ba1aa2356c5f40b7 = 0;
309
309
  const $af8d31735c159a26$export$dfea9b8ecbbb8623 = 'start_tag';
310
310
  const $af8d31735c159a26$export$3d329a2c209fbc28 = 'end_tag';
311
311
  const $af8d31735c159a26$export$97c0a36af1d48540 = 'auto';
312
+ const $af8d31735c159a26$export$34df5089b632c747 = 'german';
312
313
 
313
314
 
314
315
  /**
@@ -1725,501 +1726,9 @@ var $6ebb068142750218$export$2e2bcd8739ae039 = $6ebb068142750218$var$enharmonics
1725
1726
 
1726
1727
 
1727
1728
 
1728
- /*
1729
- ⚠️⚠️⚠️ NOTE: this file has been generated automatically.
1730
- Please do NOT edit this file directly, but instead:
1731
- - edit the data source, located in `data/scales.ts`
1732
- - run `yarn build:code-generate` to re-generate this file.
1733
- */
1734
- const $e620f8085909724b$export$7e1516eaf3ebe01f = {
1735
- [(0, $af8d31735c159a26$export$27c95a7104c1f7aa)]: {
1736
- [(0, $af8d31735c159a26$export$39615881bb0d21f6)]: {
1737
- [(0, $af8d31735c159a26$export$f0f7b592ea674eb2)]: {
1738
- C: 0,
1739
- D: 2,
1740
- E: 4,
1741
- F: 5,
1742
- G: 7,
1743
- A: 9,
1744
- B: 11
1745
- },
1746
- [(0, $af8d31735c159a26$export$f5b1d6b4244c9536)]: {
1747
- B: 0,
1748
- C: 1,
1749
- D: 3,
1750
- E: 5,
1751
- F: 6,
1752
- G: 8,
1753
- A: 10
1754
- },
1755
- [(0, $af8d31735c159a26$export$1ea14522906630af)]: {
1756
- D: 1,
1757
- E: 3,
1758
- F: 4,
1759
- G: 6,
1760
- A: 8,
1761
- B: 10,
1762
- C: 11
1763
- }
1764
- },
1765
- [(0, $af8d31735c159a26$export$f23edc19d247fd25)]: {
1766
- [(0, $af8d31735c159a26$export$f0f7b592ea674eb2)]: {
1767
- C: 0,
1768
- D: 2,
1769
- E: 4,
1770
- F: 5,
1771
- G: 7,
1772
- A: 9,
1773
- B: 11
1774
- },
1775
- [(0, $af8d31735c159a26$export$f5b1d6b4244c9536)]: {
1776
- B: 0,
1777
- C: 1,
1778
- D: 3,
1779
- E: 5,
1780
- F: 6,
1781
- G: 8,
1782
- A: 10
1783
- },
1784
- [(0, $af8d31735c159a26$export$1ea14522906630af)]: {
1785
- D: 1,
1786
- E: 3,
1787
- F: 4,
1788
- G: 6,
1789
- A: 8,
1790
- B: 10,
1791
- C: 11
1792
- }
1793
- }
1794
- },
1795
- [(0, $af8d31735c159a26$export$539a6499f4711c57)]: {
1796
- [(0, $af8d31735c159a26$export$39615881bb0d21f6)]: {
1797
- [(0, $af8d31735c159a26$export$f0f7b592ea674eb2)]: {
1798
- Do: 0,
1799
- Re: 2,
1800
- Mi: 4,
1801
- Fa: 5,
1802
- Sol: 7,
1803
- La: 9,
1804
- Si: 11
1805
- },
1806
- [(0, $af8d31735c159a26$export$f5b1d6b4244c9536)]: {
1807
- Si: 0,
1808
- Do: 1,
1809
- Re: 3,
1810
- Mi: 5,
1811
- Fa: 6,
1812
- Sol: 8,
1813
- La: 10
1814
- },
1815
- [(0, $af8d31735c159a26$export$1ea14522906630af)]: {
1816
- Re: 1,
1817
- Mi: 3,
1818
- Fa: 4,
1819
- Sol: 6,
1820
- La: 8,
1821
- Si: 10,
1822
- Do: 11
1823
- }
1824
- },
1825
- [(0, $af8d31735c159a26$export$f23edc19d247fd25)]: {
1826
- [(0, $af8d31735c159a26$export$f0f7b592ea674eb2)]: {
1827
- Do: 0,
1828
- Re: 2,
1829
- Mi: 4,
1830
- Fa: 5,
1831
- Sol: 7,
1832
- La: 9,
1833
- Si: 11
1834
- },
1835
- [(0, $af8d31735c159a26$export$f5b1d6b4244c9536)]: {
1836
- Si: 0,
1837
- Do: 1,
1838
- Re: 3,
1839
- Mi: 5,
1840
- Fa: 6,
1841
- Sol: 8,
1842
- La: 10
1843
- },
1844
- [(0, $af8d31735c159a26$export$1ea14522906630af)]: {
1845
- Re: 1,
1846
- Mi: 3,
1847
- Fa: 4,
1848
- Sol: 6,
1849
- La: 8,
1850
- Si: 10,
1851
- Do: 11
1852
- }
1853
- }
1854
- },
1855
- [(0, $af8d31735c159a26$export$4d318981b5a83836)]: {
1856
- [(0, $af8d31735c159a26$export$39615881bb0d21f6)]: {
1857
- [(0, $af8d31735c159a26$export$f0f7b592ea674eb2)]: {
1858
- 1: 0,
1859
- 2: 2,
1860
- 3: 4,
1861
- 4: 5,
1862
- 5: 7,
1863
- 6: 9,
1864
- 7: 11
1865
- },
1866
- [(0, $af8d31735c159a26$export$f5b1d6b4244c9536)]: {
1867
- 7: 0,
1868
- 1: 1,
1869
- 2: 3,
1870
- 3: 5,
1871
- 4: 6,
1872
- 5: 8,
1873
- 6: 10
1874
- },
1875
- [(0, $af8d31735c159a26$export$1ea14522906630af)]: {
1876
- 2: 1,
1877
- 3: 3,
1878
- 4: 4,
1879
- 5: 6,
1880
- 6: 8,
1881
- 7: 10,
1882
- 1: 11
1883
- }
1884
- },
1885
- [(0, $af8d31735c159a26$export$f23edc19d247fd25)]: {
1886
- [(0, $af8d31735c159a26$export$f0f7b592ea674eb2)]: {
1887
- 1: 0,
1888
- 2: 2,
1889
- 3: 3,
1890
- 4: 5,
1891
- 5: 7,
1892
- 6: 8,
1893
- 7: 10
1894
- },
1895
- [(0, $af8d31735c159a26$export$f5b1d6b4244c9536)]: {
1896
- 1: 1,
1897
- 2: 3,
1898
- 3: 4,
1899
- 4: 6,
1900
- 5: 8,
1901
- 6: 9,
1902
- 7: 11
1903
- },
1904
- [(0, $af8d31735c159a26$export$1ea14522906630af)]: {
1905
- 2: 1,
1906
- 3: 2,
1907
- 4: 4,
1908
- 5: 6,
1909
- 6: 7,
1910
- 7: 9,
1911
- 1: 11
1912
- }
1913
- }
1914
- },
1915
- [(0, $af8d31735c159a26$export$1321df9b16c30c6a)]: {
1916
- [(0, $af8d31735c159a26$export$39615881bb0d21f6)]: {
1917
- [(0, $af8d31735c159a26$export$f0f7b592ea674eb2)]: {
1918
- I: 0,
1919
- II: 2,
1920
- III: 4,
1921
- IV: 5,
1922
- V: 7,
1923
- VI: 9,
1924
- VII: 11
1925
- },
1926
- [(0, $af8d31735c159a26$export$f5b1d6b4244c9536)]: {
1927
- VII: 0,
1928
- I: 1,
1929
- II: 3,
1930
- III: 5,
1931
- IV: 6,
1932
- V: 8,
1933
- VI: 10
1934
- },
1935
- [(0, $af8d31735c159a26$export$1ea14522906630af)]: {
1936
- II: 1,
1937
- III: 3,
1938
- IV: 4,
1939
- V: 6,
1940
- VI: 8,
1941
- VII: 10,
1942
- I: 11
1943
- }
1944
- },
1945
- [(0, $af8d31735c159a26$export$f23edc19d247fd25)]: {
1946
- [(0, $af8d31735c159a26$export$f0f7b592ea674eb2)]: {
1947
- I: 0,
1948
- II: 2,
1949
- III: 3,
1950
- IV: 5,
1951
- V: 7,
1952
- VI: 8,
1953
- VII: 10
1954
- },
1955
- [(0, $af8d31735c159a26$export$f5b1d6b4244c9536)]: {
1956
- I: 1,
1957
- II: 3,
1958
- III: 4,
1959
- IV: 6,
1960
- V: 8,
1961
- VI: 9,
1962
- VII: 11
1963
- },
1964
- [(0, $af8d31735c159a26$export$1ea14522906630af)]: {
1965
- II: 1,
1966
- III: 2,
1967
- IV: 4,
1968
- V: 6,
1969
- VI: 7,
1970
- VII: 9,
1971
- I: 11
1972
- }
1973
- }
1974
- }
1975
- };
1976
- const $e620f8085909724b$export$40141681ebb03523 = {
1977
- [(0, $af8d31735c159a26$export$27c95a7104c1f7aa)]: {
1978
- [(0, $af8d31735c159a26$export$39615881bb0d21f6)]: {
1979
- [(0, $af8d31735c159a26$export$f0f7b592ea674eb2)]: {
1980
- 0: 'C',
1981
- 2: 'D',
1982
- 4: 'E',
1983
- 5: 'F',
1984
- 7: 'G',
1985
- 9: 'A',
1986
- 11: 'B'
1987
- },
1988
- [(0, $af8d31735c159a26$export$f5b1d6b4244c9536)]: {
1989
- 0: 'B#',
1990
- 1: 'C#',
1991
- 3: 'D#',
1992
- 5: 'E#',
1993
- 6: 'F#',
1994
- 8: 'G#',
1995
- 10: 'A#'
1996
- },
1997
- [(0, $af8d31735c159a26$export$1ea14522906630af)]: {
1998
- 1: 'Db',
1999
- 3: 'Eb',
2000
- 4: 'Fb',
2001
- 6: 'Gb',
2002
- 8: 'Ab',
2003
- 10: 'Bb',
2004
- 11: 'Cb'
2005
- }
2006
- },
2007
- [(0, $af8d31735c159a26$export$f23edc19d247fd25)]: {
2008
- [(0, $af8d31735c159a26$export$f0f7b592ea674eb2)]: {
2009
- 0: 'C',
2010
- 2: 'D',
2011
- 4: 'E',
2012
- 5: 'F',
2013
- 7: 'G',
2014
- 9: 'A',
2015
- 11: 'B'
2016
- },
2017
- [(0, $af8d31735c159a26$export$f5b1d6b4244c9536)]: {
2018
- 0: 'B#',
2019
- 1: 'C#',
2020
- 3: 'D#',
2021
- 5: 'E#',
2022
- 6: 'F#',
2023
- 8: 'G#',
2024
- 10: 'A#'
2025
- },
2026
- [(0, $af8d31735c159a26$export$1ea14522906630af)]: {
2027
- 1: 'Db',
2028
- 3: 'Eb',
2029
- 4: 'Fb',
2030
- 6: 'Gb',
2031
- 8: 'Ab',
2032
- 10: 'Bb',
2033
- 11: 'Cb'
2034
- }
2035
- }
2036
- },
2037
- [(0, $af8d31735c159a26$export$539a6499f4711c57)]: {
2038
- [(0, $af8d31735c159a26$export$39615881bb0d21f6)]: {
2039
- [(0, $af8d31735c159a26$export$f0f7b592ea674eb2)]: {
2040
- 0: 'Do',
2041
- 2: 'Re',
2042
- 4: 'Mi',
2043
- 5: 'Fa',
2044
- 7: 'Sol',
2045
- 9: 'La',
2046
- 11: 'Si'
2047
- },
2048
- [(0, $af8d31735c159a26$export$f5b1d6b4244c9536)]: {
2049
- 0: 'Si#',
2050
- 1: 'Do#',
2051
- 3: 'Re#',
2052
- 5: 'Mi#',
2053
- 6: 'Fa#',
2054
- 8: 'Sol#',
2055
- 10: 'La#'
2056
- },
2057
- [(0, $af8d31735c159a26$export$1ea14522906630af)]: {
2058
- 1: 'Reb',
2059
- 3: 'Mib',
2060
- 4: 'Fab',
2061
- 6: 'Solb',
2062
- 8: 'Lab',
2063
- 10: 'Sib',
2064
- 11: 'Dob'
2065
- }
2066
- },
2067
- [(0, $af8d31735c159a26$export$f23edc19d247fd25)]: {
2068
- [(0, $af8d31735c159a26$export$f0f7b592ea674eb2)]: {
2069
- 0: 'Do',
2070
- 2: 'Re',
2071
- 4: 'Mi',
2072
- 5: 'Fa',
2073
- 7: 'Sol',
2074
- 9: 'La',
2075
- 11: 'Si'
2076
- },
2077
- [(0, $af8d31735c159a26$export$f5b1d6b4244c9536)]: {
2078
- 0: 'Si#',
2079
- 1: 'Do#',
2080
- 3: 'Re#',
2081
- 5: 'Mi#',
2082
- 6: 'Fa#',
2083
- 8: 'Sol#',
2084
- 10: 'La#'
2085
- },
2086
- [(0, $af8d31735c159a26$export$1ea14522906630af)]: {
2087
- 1: 'Reb',
2088
- 3: 'Mib',
2089
- 4: 'Fab',
2090
- 6: 'Solb',
2091
- 8: 'Lab',
2092
- 10: 'Sib',
2093
- 11: 'Dob'
2094
- }
2095
- }
2096
- },
2097
- [(0, $af8d31735c159a26$export$4d318981b5a83836)]: {
2098
- [(0, $af8d31735c159a26$export$39615881bb0d21f6)]: {
2099
- [(0, $af8d31735c159a26$export$f0f7b592ea674eb2)]: {
2100
- 0: '1',
2101
- 2: '2',
2102
- 4: '3',
2103
- 5: '4',
2104
- 7: '5',
2105
- 9: '6',
2106
- 11: '7'
2107
- },
2108
- [(0, $af8d31735c159a26$export$f5b1d6b4244c9536)]: {
2109
- 0: '#7',
2110
- 1: '#1',
2111
- 3: '#2',
2112
- 5: '#3',
2113
- 6: '#4',
2114
- 8: '#5',
2115
- 10: '#6'
2116
- },
2117
- [(0, $af8d31735c159a26$export$1ea14522906630af)]: {
2118
- 1: 'b2',
2119
- 3: 'b3',
2120
- 4: 'b4',
2121
- 6: 'b5',
2122
- 8: 'b6',
2123
- 10: 'b7',
2124
- 11: 'b1'
2125
- }
2126
- },
2127
- [(0, $af8d31735c159a26$export$f23edc19d247fd25)]: {
2128
- [(0, $af8d31735c159a26$export$f0f7b592ea674eb2)]: {
2129
- 0: '1',
2130
- 2: '2',
2131
- 3: '3',
2132
- 5: '4',
2133
- 7: '5',
2134
- 8: '6',
2135
- 10: '7'
2136
- },
2137
- [(0, $af8d31735c159a26$export$f5b1d6b4244c9536)]: {
2138
- 1: '#1',
2139
- 3: '#2',
2140
- 4: '#3',
2141
- 6: '#4',
2142
- 8: '#5',
2143
- 9: '#6',
2144
- 11: '#7'
2145
- },
2146
- [(0, $af8d31735c159a26$export$1ea14522906630af)]: {
2147
- 1: 'b2',
2148
- 2: 'b3',
2149
- 4: 'b4',
2150
- 6: 'b5',
2151
- 7: 'b6',
2152
- 9: 'b7',
2153
- 11: 'b1'
2154
- }
2155
- }
2156
- },
2157
- [(0, $af8d31735c159a26$export$1321df9b16c30c6a)]: {
2158
- [(0, $af8d31735c159a26$export$39615881bb0d21f6)]: {
2159
- [(0, $af8d31735c159a26$export$f0f7b592ea674eb2)]: {
2160
- 0: 'I',
2161
- 2: 'II',
2162
- 4: 'III',
2163
- 5: 'IV',
2164
- 7: 'V',
2165
- 9: 'VI',
2166
- 11: 'VII'
2167
- },
2168
- [(0, $af8d31735c159a26$export$f5b1d6b4244c9536)]: {
2169
- 0: '#VII',
2170
- 1: '#I',
2171
- 3: '#II',
2172
- 5: '#III',
2173
- 6: '#IV',
2174
- 8: '#V',
2175
- 10: '#VI'
2176
- },
2177
- [(0, $af8d31735c159a26$export$1ea14522906630af)]: {
2178
- 1: 'bII',
2179
- 3: 'bIII',
2180
- 4: 'bIV',
2181
- 6: 'bV',
2182
- 8: 'bVI',
2183
- 10: 'bVII',
2184
- 11: 'bI'
2185
- }
2186
- },
2187
- [(0, $af8d31735c159a26$export$f23edc19d247fd25)]: {
2188
- [(0, $af8d31735c159a26$export$f0f7b592ea674eb2)]: {
2189
- 0: 'I',
2190
- 2: 'II',
2191
- 3: 'III',
2192
- 5: 'IV',
2193
- 7: 'V',
2194
- 8: 'VI',
2195
- 10: 'VII'
2196
- },
2197
- [(0, $af8d31735c159a26$export$f5b1d6b4244c9536)]: {
2198
- 1: '#I',
2199
- 3: '#II',
2200
- 4: '#III',
2201
- 6: '#IV',
2202
- 8: '#V',
2203
- 9: '#VI',
2204
- 11: '#VII'
2205
- },
2206
- [(0, $af8d31735c159a26$export$1ea14522906630af)]: {
2207
- 1: 'bII',
2208
- 2: 'bIII',
2209
- 4: 'bIV',
2210
- 6: 'bV',
2211
- 7: 'bVI',
2212
- 9: 'bVII',
2213
- 11: 'bI'
2214
- }
2215
- }
2216
- }
2217
- };
2218
-
2219
-
2220
1729
 
2221
1730
  const $bff5407e03fdc8ee$var$regexes = {
2222
- symbol: /^(?<key>((?<note>[A-Ga-g])(?<accidental>#|b)?))(?<minor>m)?$/,
1731
+ symbol: /^(?<key>((?<note>[A-Ha-h])(?<accidental>#|b)?))(?<minor>m)?$/,
2223
1732
  solfege: /^(?<key>((?<note>Do|Re|Mi|Fa|Sol|La|Si|do|re|mi|fa|sol|la|si)(?<accidental>#|b)?))(?<minor>m)?$/,
2224
1733
  numeric: /^(?<key>(?<accidental>#|b)?(?<note>[1-7]))(?<minor>m)?$/,
2225
1734
  numeral: /^(?<key>(?<accidental>#|b)?(?<note>I{1,3}|IV|VI{0,2}|i{1,3}|iv|vi{0,2}))$/
@@ -2306,27 +1815,28 @@ const $bff5407e03fdc8ee$var$PREFERS_FLAT_NUMBERS = [
2306
1815
  key: note,
2307
1816
  keyType: keyType,
2308
1817
  minor: minor || false,
2309
- accidental: accidental || null
1818
+ accidental: accidental || null,
1819
+ preferredNotation: keyType === (0, $af8d31735c159a26$export$27c95a7104c1f7aa) && (0, $21a34a464e7bc609$export$4da2456f0a9c9a18)(note) ? (0, $af8d31735c159a26$export$34df5089b632c747) : null
2310
1820
  });
2311
1821
  }
2312
- /* eslint-disable-next-line max-lines-per-function */ static resolve({ key: key, keyType: keyType, minor: minor, accidental: accidental }) {
1822
+ /* eslint-disable-next-line max-lines-per-function */ static resolve({ key: key, keyType: keyType, minor: minor, accidental: accidental, preferredNotation: preferredNotation }) {
2313
1823
  const keyString = `${key}`;
2314
1824
  const isMinor = this.isMinor(keyString, keyType, minor);
2315
- if (keyType === (0, $af8d31735c159a26$export$27c95a7104c1f7aa) || keyType === (0, $af8d31735c159a26$export$539a6499f4711c57)) {
2316
- const grade = this.toGrade(keyString, accidental || (0, $af8d31735c159a26$export$3fdd332fe3104970), keyType, isMinor);
2317
- if (grade !== null) return new $bff5407e03fdc8ee$var$Key({
2318
- grade: 0,
2319
- minor: isMinor,
2320
- type: keyType,
2321
- accidental: accidental || null,
2322
- preferredAccidental: accidental || null,
2323
- referenceKeyGrade: grade,
2324
- originalKeyString: keyString
2325
- });
2326
- }
2327
- const number = this.getNumberFromKey(keyString, keyType);
1825
+ const notation = (0, $21a34a464e7bc609$export$9bc1c71527523e02)(keyString, preferredNotation);
1826
+ const lookupAccidental = (0, $21a34a464e7bc609$export$7d9735233c5272d2)(keyString, accidental, notation) ?? accidental;
1827
+ const grade = keyType === (0, $af8d31735c159a26$export$27c95a7104c1f7aa) || keyType === (0, $af8d31735c159a26$export$539a6499f4711c57) ? (0, $21a34a464e7bc609$export$f524439d316753cc)(keyString, lookupAccidental || (0, $af8d31735c159a26$export$3fdd332fe3104970), keyType, isMinor) : null;
1828
+ if (grade !== null) return new $bff5407e03fdc8ee$var$Key({
1829
+ grade: 0,
1830
+ minor: isMinor,
1831
+ type: keyType,
1832
+ accidental: accidental || null,
1833
+ preferredAccidental: accidental || null,
1834
+ referenceKeyGrade: grade,
1835
+ originalKeyString: keyString,
1836
+ preferredNotation: notation
1837
+ });
2328
1838
  return new $bff5407e03fdc8ee$var$Key({
2329
- number: number,
1839
+ number: this.getNumberFromKey(keyString, keyType),
2330
1840
  minor: isMinor,
2331
1841
  type: keyType,
2332
1842
  accidental: accidental || null,
@@ -2350,14 +1860,6 @@ const $bff5407e03fdc8ee$var$PREFERS_FLAT_NUMBERS = [
2350
1860
  (0, $21a34a464e7bc609$export$b680e6b2c82f8c2f)('keyWithModifier is deprecated, use keyWithAccidental instead');
2351
1861
  return this.keyWithAccidental(key, accidental, type);
2352
1862
  }
2353
- static toGrade(key, accidental, type, isMinor) {
2354
- const mode = isMinor ? (0, $af8d31735c159a26$export$f23edc19d247fd25) : (0, $af8d31735c159a26$export$39615881bb0d21f6);
2355
- const grades = (0, $e620f8085909724b$export$7e1516eaf3ebe01f)[type][mode][accidental];
2356
- if (key in grades) return grades[key];
2357
- const upperCaseKey = key.toUpperCase();
2358
- if (upperCaseKey in grades) return grades[upperCaseKey];
2359
- return null;
2360
- }
2361
1863
  static isMinor(key, keyType, minor) {
2362
1864
  switch(keyType){
2363
1865
  case 'numeral':
@@ -2400,13 +1902,14 @@ const $bff5407e03fdc8ee$var$PREFERS_FLAT_NUMBERS = [
2400
1902
  */ static distance(oneKey, otherKey) {
2401
1903
  return this.wrapOrFail(oneKey).distanceTo(otherKey);
2402
1904
  }
2403
- constructor({ grade: grade = null, number: number = null, minor: minor, type: type, accidental: accidental, referenceKeyGrade: referenceKeyGrade = null, referenceKeyMode: referenceKeyMode = null, originalKeyString: originalKeyString = null, preferredAccidental: preferredAccidental = null, explicitAccidental: explicitAccidental = false }){
1905
+ constructor({ grade: grade = null, number: number = null, minor: minor, type: type, accidental: accidental, referenceKeyGrade: referenceKeyGrade = null, referenceKeyMode: referenceKeyMode = null, originalKeyString: originalKeyString = null, preferredAccidental: preferredAccidental = null, explicitAccidental: explicitAccidental = false, preferredNotation: preferredNotation = null }){
2404
1906
  this.number = null;
2405
1907
  this.minor = false;
2406
1908
  this.referenceKeyGrade = null;
2407
1909
  this.referenceKeyMode = null;
2408
1910
  this.originalKeyString = null;
2409
1911
  this.explicitAccidental = false;
1912
+ this.preferredNotation = null;
2410
1913
  this.grade = grade;
2411
1914
  this.number = number;
2412
1915
  this.minor = minor;
@@ -2417,6 +1920,7 @@ const $bff5407e03fdc8ee$var$PREFERS_FLAT_NUMBERS = [
2417
1920
  this.referenceKeyMode = referenceKeyMode;
2418
1921
  this.originalKeyString = originalKeyString;
2419
1922
  this.explicitAccidental = explicitAccidental;
1923
+ this.preferredNotation = preferredNotation;
2420
1924
  }
2421
1925
  distanceTo(otherKey) {
2422
1926
  const otherKeyObj = $bff5407e03fdc8ee$var$Key.wrapOrFail(otherKey);
@@ -2458,7 +1962,7 @@ const $bff5407e03fdc8ee$var$PREFERS_FLAT_NUMBERS = [
2458
1962
  }
2459
1963
  calculateGradeFromNumber() {
2460
1964
  if (this.number === null) throw new Error('Cannot calculate grade, number is null');
2461
- this.grade = $bff5407e03fdc8ee$var$Key.toGrade(this.number.toString(), this.accidental || (0, $af8d31735c159a26$export$3fdd332fe3104970), (0, $af8d31735c159a26$export$4d318981b5a83836), this.isMinor());
1965
+ this.grade = (0, $21a34a464e7bc609$export$f524439d316753cc)(this.number.toString(), this.accidental || (0, $af8d31735c159a26$export$3fdd332fe3104970), (0, $af8d31735c159a26$export$4d318981b5a83836), this.isMinor());
2462
1966
  this.number = null;
2463
1967
  }
2464
1968
  toChordSymbol(key, referenceKeyWasMinor = false) {
@@ -2581,13 +2085,20 @@ const $bff5407e03fdc8ee$var$PREFERS_FLAT_NUMBERS = [
2581
2085
  if ((this.isChordSymbol() || this.isChordSolfege()) && this.referenceKeyGrade === null) throw new Error('Not possible, reference key grade is null');
2582
2086
  let { minor: minor } = this;
2583
2087
  if (this.referenceKeyMode) minor = this.referenceKeyMode === (0, $af8d31735c159a26$export$f23edc19d247fd25);
2584
- return (0, $21a34a464e7bc609$export$65f5b958d546bb3f)({
2088
+ const rendered = (0, $21a34a464e7bc609$export$65f5b958d546bb3f)({
2585
2089
  type: this.type,
2586
2090
  accidental: this.accidental,
2587
2091
  preferredAccidental: this.preferredAccidental,
2588
2092
  grade: this.effectiveGrade,
2589
2093
  minor: minor
2590
2094
  });
2095
+ return this.applyGermanRendering(rendered);
2096
+ }
2097
+ applyGermanRendering(rendered) {
2098
+ if (this.preferredNotation !== (0, $af8d31735c159a26$export$34df5089b632c747) || !this.isChordSymbol()) return rendered;
2099
+ if (this.accidental === null && this.effectiveGrade === 10) return 'B';
2100
+ if (rendered === 'B') return 'H';
2101
+ return rendered;
2591
2102
  }
2592
2103
  getNoteForNumber() {
2593
2104
  if (this.number === null) throw new Error('Not possible, grade and number are null');
@@ -2692,15 +2203,16 @@ const $bff5407e03fdc8ee$var$PREFERS_FLAT_NUMBERS = [
2692
2203
  if (key) {
2693
2204
  // Preserve explicit accidental choices made via useAccidental()
2694
2205
  if (this.explicitAccidental) return this.clone();
2695
- const rootKeyString = $bff5407e03fdc8ee$var$Key.wrapOrFail(key).toString({
2206
+ const rootKeyString = (0, $21a34a464e7bc609$export$4f126a839166f96d)($bff5407e03fdc8ee$var$Key.wrapOrFail(key).toString({
2696
2207
  showMinor: true
2697
- });
2208
+ }));
2698
2209
  const enharmonics = (0, $6ebb068142750218$export$2e2bcd8739ae039)[rootKeyString];
2699
- const thisKeyString = this.toString({
2210
+ const thisKeyString = (0, $21a34a464e7bc609$export$4f126a839166f96d)(this.toString({
2700
2211
  showMinor: false
2701
- });
2212
+ }));
2702
2213
  if (enharmonics && enharmonics[thisKeyString]) return $bff5407e03fdc8ee$var$Key.parseOrFail(enharmonics[thisKeyString]).set({
2703
- minor: this.minor
2214
+ minor: this.minor,
2215
+ preferredNotation: this.preferredNotation
2704
2216
  });
2705
2217
  }
2706
2218
  return this.clone();
@@ -2717,6 +2229,7 @@ const $bff5407e03fdc8ee$var$PREFERS_FLAT_NUMBERS = [
2717
2229
  originalKeyString: this.originalKeyString,
2718
2230
  preferredAccidental: this.preferredAccidental,
2719
2231
  explicitAccidental: this.explicitAccidental,
2232
+ preferredNotation: this.preferredNotation,
2720
2233
  ...overwrite ? attributes : {}
2721
2234
  });
2722
2235
  }
@@ -2878,15 +2391,15 @@ function $186e70452612e168$var$peg$parse(input, options) {
2878
2391
  chordType: "symbol"
2879
2392
  };
2880
2393
  };
2881
- const peg$c10 = /^[A-Ga-g]/;
2394
+ const peg$c10 = /^[A-Ha-h]/;
2882
2395
  const peg$c11 = peg$classExpectation([
2883
2396
  [
2884
2397
  "A",
2885
- "G"
2398
+ "H"
2886
2399
  ],
2887
2400
  [
2888
2401
  "a",
2889
- "g"
2402
+ "h"
2890
2403
  ]
2891
2404
  ], false, false);
2892
2405
  const peg$c12 = "/";
@@ -4024,19 +3537,26 @@ const $186e70452612e168$export$98e6a39c04603d36 = $186e70452612e168$var$peg$pars
4024
3537
  * Tries to parse a chord string into a chord
4025
3538
  * Any leading or trailing whitespace is removed first, so a chord like ` \n E/G# \r ` is valid.
4026
3539
  * @param chordString the chord string, eg `Esus4/G#` or `1sus4/#3`.
3540
+ * @param {ChordParseOptions} [options] parse options
3541
+ * @param {Notation|null} [options.notation] when `'german'`, `B` is interpreted as B-flat (grade 10)
3542
+ * and `H` as B natural (grade 11), and output renders accordingly. Defaults to English semantics where
3543
+ * `B` is B natural and `H` is accepted as an alias for it.
4027
3544
  * @returns {Chord|null}
4028
- */ static parse(chordString) {
3545
+ */ static parse(chordString, options = {}) {
4029
3546
  try {
4030
- return this.parseOrFail(chordString);
3547
+ return this.parseOrFail(chordString, options);
4031
3548
  } catch (_error) {
4032
3549
  return null;
4033
3550
  }
4034
3551
  }
4035
- static parseOrFail(chordString) {
3552
+ static parseOrFail(chordString, options = {}) {
4036
3553
  const trimmedChord = chordString.trim();
4037
3554
  try {
4038
3555
  const ast = (0, $186e70452612e168$export$98e6a39c04603d36)(trimmedChord);
4039
- return new $26f57998457eb2d4$var$Chord(ast);
3556
+ return new $26f57998457eb2d4$var$Chord({
3557
+ ...ast,
3558
+ notation: options.notation ?? null
3559
+ });
4040
3560
  } catch (error) {
4041
3561
  const errorObj = error;
4042
3562
  throw new (0, $6ffa22d6e9dde667$export$2e2bcd8739ae039)(`Failed parsing '${trimmedChord}': ${errorObj.message}`);
@@ -4293,7 +3813,7 @@ const $186e70452612e168$export$98e6a39c04603d36 = $186e70452612e168$var$peg$pars
4293
3813
  return this.suffix === otherChord.suffix && this.optional === otherChord.optional && (0, $bff5407e03fdc8ee$export$2e2bcd8739ae039).equals(this.root, otherChord.root) && (0, $bff5407e03fdc8ee$export$2e2bcd8739ae039).equals(this.bass, otherChord.bass);
4294
3814
  }
4295
3815
  static determineRoot(options) {
4296
- const { root: root, base: base, accidental: accidental, suffix: suffix, chordType: chordType } = options;
3816
+ const { root: root, base: base, accidental: accidental, suffix: suffix, chordType: chordType, notation: notation } = options;
4297
3817
  if (root) return root;
4298
3818
  if (!base) return null;
4299
3819
  if (!chordType) throw new Error('Can\'t resolve at this point without a chord type');
@@ -4301,11 +3821,12 @@ const $186e70452612e168$export$98e6a39c04603d36 = $186e70452612e168$var$peg$pars
4301
3821
  key: base,
4302
3822
  keyType: chordType,
4303
3823
  minor: (0, $21a34a464e7bc609$export$51fabfbeed747719)(base, chordType, suffix ?? null),
4304
- accidental: accidental ?? null
3824
+ accidental: accidental ?? null,
3825
+ preferredNotation: notation ?? null
4305
3826
  });
4306
3827
  }
4307
3828
  static determineBass(options) {
4308
- const { bass: bass, bassBase: bassBase, bassAccidental: bassAccidental, chordType: chordType } = options;
3829
+ const { bass: bass, bassBase: bassBase, bassAccidental: bassAccidental, chordType: chordType, notation: notation } = options;
4309
3830
  if (bass) return bass;
4310
3831
  if (!bassBase) return null;
4311
3832
  if (!chordType) throw new Error('Can\'t resolve at this point without a chord type');
@@ -4313,7 +3834,8 @@ const $186e70452612e168$export$98e6a39c04603d36 = $186e70452612e168$var$peg$pars
4313
3834
  key: bassBase,
4314
3835
  accidental: bassAccidental ?? null,
4315
3836
  minor: false,
4316
- keyType: chordType
3837
+ keyType: chordType,
3838
+ preferredNotation: notation ?? null
4317
3839
  });
4318
3840
  }
4319
3841
  isMinor() {
@@ -4462,7 +3984,7 @@ var $26f57998457eb2d4$export$2e2bcd8739ae039 = $26f57998457eb2d4$var$Chord;
4462
3984
  return this.useAccidental(accidental);
4463
3985
  }
4464
3986
  changeChord(func) {
4465
- const chordObj = (0, $26f57998457eb2d4$export$2e2bcd8739ae039).parse(this.chords.trim());
3987
+ const chordObj = this.chord;
4466
3988
  if (chordObj) {
4467
3989
  const changedChord = func(chordObj);
4468
3990
  return this.set({
@@ -5383,11 +4905,529 @@ const $e12151f977ef7bf6$var$mapping = {
5383
4905
  var $e12151f977ef7bf6$export$2e2bcd8739ae039 = $e12151f977ef7bf6$var$mapping;
5384
4906
 
5385
4907
 
4908
+ /*
4909
+ ⚠️⚠️⚠️ NOTE: this file has been generated automatically.
4910
+ Please do NOT edit this file directly, but instead:
4911
+ - edit the data source, located in `data/scales.ts`
4912
+ - run `yarn build:code-generate` to re-generate this file.
4913
+ */
4914
+ const $e620f8085909724b$export$7e1516eaf3ebe01f = {
4915
+ [(0, $af8d31735c159a26$export$27c95a7104c1f7aa)]: {
4916
+ [(0, $af8d31735c159a26$export$39615881bb0d21f6)]: {
4917
+ [(0, $af8d31735c159a26$export$f0f7b592ea674eb2)]: {
4918
+ C: 0,
4919
+ D: 2,
4920
+ E: 4,
4921
+ F: 5,
4922
+ G: 7,
4923
+ A: 9,
4924
+ B: 11
4925
+ },
4926
+ [(0, $af8d31735c159a26$export$f5b1d6b4244c9536)]: {
4927
+ B: 0,
4928
+ C: 1,
4929
+ D: 3,
4930
+ E: 5,
4931
+ F: 6,
4932
+ G: 8,
4933
+ A: 10
4934
+ },
4935
+ [(0, $af8d31735c159a26$export$1ea14522906630af)]: {
4936
+ D: 1,
4937
+ E: 3,
4938
+ F: 4,
4939
+ G: 6,
4940
+ A: 8,
4941
+ B: 10,
4942
+ C: 11
4943
+ }
4944
+ },
4945
+ [(0, $af8d31735c159a26$export$f23edc19d247fd25)]: {
4946
+ [(0, $af8d31735c159a26$export$f0f7b592ea674eb2)]: {
4947
+ C: 0,
4948
+ D: 2,
4949
+ E: 4,
4950
+ F: 5,
4951
+ G: 7,
4952
+ A: 9,
4953
+ B: 11
4954
+ },
4955
+ [(0, $af8d31735c159a26$export$f5b1d6b4244c9536)]: {
4956
+ B: 0,
4957
+ C: 1,
4958
+ D: 3,
4959
+ E: 5,
4960
+ F: 6,
4961
+ G: 8,
4962
+ A: 10
4963
+ },
4964
+ [(0, $af8d31735c159a26$export$1ea14522906630af)]: {
4965
+ D: 1,
4966
+ E: 3,
4967
+ F: 4,
4968
+ G: 6,
4969
+ A: 8,
4970
+ B: 10,
4971
+ C: 11
4972
+ }
4973
+ }
4974
+ },
4975
+ [(0, $af8d31735c159a26$export$539a6499f4711c57)]: {
4976
+ [(0, $af8d31735c159a26$export$39615881bb0d21f6)]: {
4977
+ [(0, $af8d31735c159a26$export$f0f7b592ea674eb2)]: {
4978
+ Do: 0,
4979
+ Re: 2,
4980
+ Mi: 4,
4981
+ Fa: 5,
4982
+ Sol: 7,
4983
+ La: 9,
4984
+ Si: 11
4985
+ },
4986
+ [(0, $af8d31735c159a26$export$f5b1d6b4244c9536)]: {
4987
+ Si: 0,
4988
+ Do: 1,
4989
+ Re: 3,
4990
+ Mi: 5,
4991
+ Fa: 6,
4992
+ Sol: 8,
4993
+ La: 10
4994
+ },
4995
+ [(0, $af8d31735c159a26$export$1ea14522906630af)]: {
4996
+ Re: 1,
4997
+ Mi: 3,
4998
+ Fa: 4,
4999
+ Sol: 6,
5000
+ La: 8,
5001
+ Si: 10,
5002
+ Do: 11
5003
+ }
5004
+ },
5005
+ [(0, $af8d31735c159a26$export$f23edc19d247fd25)]: {
5006
+ [(0, $af8d31735c159a26$export$f0f7b592ea674eb2)]: {
5007
+ Do: 0,
5008
+ Re: 2,
5009
+ Mi: 4,
5010
+ Fa: 5,
5011
+ Sol: 7,
5012
+ La: 9,
5013
+ Si: 11
5014
+ },
5015
+ [(0, $af8d31735c159a26$export$f5b1d6b4244c9536)]: {
5016
+ Si: 0,
5017
+ Do: 1,
5018
+ Re: 3,
5019
+ Mi: 5,
5020
+ Fa: 6,
5021
+ Sol: 8,
5022
+ La: 10
5023
+ },
5024
+ [(0, $af8d31735c159a26$export$1ea14522906630af)]: {
5025
+ Re: 1,
5026
+ Mi: 3,
5027
+ Fa: 4,
5028
+ Sol: 6,
5029
+ La: 8,
5030
+ Si: 10,
5031
+ Do: 11
5032
+ }
5033
+ }
5034
+ },
5035
+ [(0, $af8d31735c159a26$export$4d318981b5a83836)]: {
5036
+ [(0, $af8d31735c159a26$export$39615881bb0d21f6)]: {
5037
+ [(0, $af8d31735c159a26$export$f0f7b592ea674eb2)]: {
5038
+ 1: 0,
5039
+ 2: 2,
5040
+ 3: 4,
5041
+ 4: 5,
5042
+ 5: 7,
5043
+ 6: 9,
5044
+ 7: 11
5045
+ },
5046
+ [(0, $af8d31735c159a26$export$f5b1d6b4244c9536)]: {
5047
+ 7: 0,
5048
+ 1: 1,
5049
+ 2: 3,
5050
+ 3: 5,
5051
+ 4: 6,
5052
+ 5: 8,
5053
+ 6: 10
5054
+ },
5055
+ [(0, $af8d31735c159a26$export$1ea14522906630af)]: {
5056
+ 2: 1,
5057
+ 3: 3,
5058
+ 4: 4,
5059
+ 5: 6,
5060
+ 6: 8,
5061
+ 7: 10,
5062
+ 1: 11
5063
+ }
5064
+ },
5065
+ [(0, $af8d31735c159a26$export$f23edc19d247fd25)]: {
5066
+ [(0, $af8d31735c159a26$export$f0f7b592ea674eb2)]: {
5067
+ 1: 0,
5068
+ 2: 2,
5069
+ 3: 3,
5070
+ 4: 5,
5071
+ 5: 7,
5072
+ 6: 8,
5073
+ 7: 10
5074
+ },
5075
+ [(0, $af8d31735c159a26$export$f5b1d6b4244c9536)]: {
5076
+ 1: 1,
5077
+ 2: 3,
5078
+ 3: 4,
5079
+ 4: 6,
5080
+ 5: 8,
5081
+ 6: 9,
5082
+ 7: 11
5083
+ },
5084
+ [(0, $af8d31735c159a26$export$1ea14522906630af)]: {
5085
+ 2: 1,
5086
+ 3: 2,
5087
+ 4: 4,
5088
+ 5: 6,
5089
+ 6: 7,
5090
+ 7: 9,
5091
+ 1: 11
5092
+ }
5093
+ }
5094
+ },
5095
+ [(0, $af8d31735c159a26$export$1321df9b16c30c6a)]: {
5096
+ [(0, $af8d31735c159a26$export$39615881bb0d21f6)]: {
5097
+ [(0, $af8d31735c159a26$export$f0f7b592ea674eb2)]: {
5098
+ I: 0,
5099
+ II: 2,
5100
+ III: 4,
5101
+ IV: 5,
5102
+ V: 7,
5103
+ VI: 9,
5104
+ VII: 11
5105
+ },
5106
+ [(0, $af8d31735c159a26$export$f5b1d6b4244c9536)]: {
5107
+ VII: 0,
5108
+ I: 1,
5109
+ II: 3,
5110
+ III: 5,
5111
+ IV: 6,
5112
+ V: 8,
5113
+ VI: 10
5114
+ },
5115
+ [(0, $af8d31735c159a26$export$1ea14522906630af)]: {
5116
+ II: 1,
5117
+ III: 3,
5118
+ IV: 4,
5119
+ V: 6,
5120
+ VI: 8,
5121
+ VII: 10,
5122
+ I: 11
5123
+ }
5124
+ },
5125
+ [(0, $af8d31735c159a26$export$f23edc19d247fd25)]: {
5126
+ [(0, $af8d31735c159a26$export$f0f7b592ea674eb2)]: {
5127
+ I: 0,
5128
+ II: 2,
5129
+ III: 3,
5130
+ IV: 5,
5131
+ V: 7,
5132
+ VI: 8,
5133
+ VII: 10
5134
+ },
5135
+ [(0, $af8d31735c159a26$export$f5b1d6b4244c9536)]: {
5136
+ I: 1,
5137
+ II: 3,
5138
+ III: 4,
5139
+ IV: 6,
5140
+ V: 8,
5141
+ VI: 9,
5142
+ VII: 11
5143
+ },
5144
+ [(0, $af8d31735c159a26$export$1ea14522906630af)]: {
5145
+ II: 1,
5146
+ III: 2,
5147
+ IV: 4,
5148
+ V: 6,
5149
+ VI: 7,
5150
+ VII: 9,
5151
+ I: 11
5152
+ }
5153
+ }
5154
+ }
5155
+ };
5156
+ const $e620f8085909724b$export$40141681ebb03523 = {
5157
+ [(0, $af8d31735c159a26$export$27c95a7104c1f7aa)]: {
5158
+ [(0, $af8d31735c159a26$export$39615881bb0d21f6)]: {
5159
+ [(0, $af8d31735c159a26$export$f0f7b592ea674eb2)]: {
5160
+ 0: 'C',
5161
+ 2: 'D',
5162
+ 4: 'E',
5163
+ 5: 'F',
5164
+ 7: 'G',
5165
+ 9: 'A',
5166
+ 11: 'B'
5167
+ },
5168
+ [(0, $af8d31735c159a26$export$f5b1d6b4244c9536)]: {
5169
+ 0: 'B#',
5170
+ 1: 'C#',
5171
+ 3: 'D#',
5172
+ 5: 'E#',
5173
+ 6: 'F#',
5174
+ 8: 'G#',
5175
+ 10: 'A#'
5176
+ },
5177
+ [(0, $af8d31735c159a26$export$1ea14522906630af)]: {
5178
+ 1: 'Db',
5179
+ 3: 'Eb',
5180
+ 4: 'Fb',
5181
+ 6: 'Gb',
5182
+ 8: 'Ab',
5183
+ 10: 'Bb',
5184
+ 11: 'Cb'
5185
+ }
5186
+ },
5187
+ [(0, $af8d31735c159a26$export$f23edc19d247fd25)]: {
5188
+ [(0, $af8d31735c159a26$export$f0f7b592ea674eb2)]: {
5189
+ 0: 'C',
5190
+ 2: 'D',
5191
+ 4: 'E',
5192
+ 5: 'F',
5193
+ 7: 'G',
5194
+ 9: 'A',
5195
+ 11: 'B'
5196
+ },
5197
+ [(0, $af8d31735c159a26$export$f5b1d6b4244c9536)]: {
5198
+ 0: 'B#',
5199
+ 1: 'C#',
5200
+ 3: 'D#',
5201
+ 5: 'E#',
5202
+ 6: 'F#',
5203
+ 8: 'G#',
5204
+ 10: 'A#'
5205
+ },
5206
+ [(0, $af8d31735c159a26$export$1ea14522906630af)]: {
5207
+ 1: 'Db',
5208
+ 3: 'Eb',
5209
+ 4: 'Fb',
5210
+ 6: 'Gb',
5211
+ 8: 'Ab',
5212
+ 10: 'Bb',
5213
+ 11: 'Cb'
5214
+ }
5215
+ }
5216
+ },
5217
+ [(0, $af8d31735c159a26$export$539a6499f4711c57)]: {
5218
+ [(0, $af8d31735c159a26$export$39615881bb0d21f6)]: {
5219
+ [(0, $af8d31735c159a26$export$f0f7b592ea674eb2)]: {
5220
+ 0: 'Do',
5221
+ 2: 'Re',
5222
+ 4: 'Mi',
5223
+ 5: 'Fa',
5224
+ 7: 'Sol',
5225
+ 9: 'La',
5226
+ 11: 'Si'
5227
+ },
5228
+ [(0, $af8d31735c159a26$export$f5b1d6b4244c9536)]: {
5229
+ 0: 'Si#',
5230
+ 1: 'Do#',
5231
+ 3: 'Re#',
5232
+ 5: 'Mi#',
5233
+ 6: 'Fa#',
5234
+ 8: 'Sol#',
5235
+ 10: 'La#'
5236
+ },
5237
+ [(0, $af8d31735c159a26$export$1ea14522906630af)]: {
5238
+ 1: 'Reb',
5239
+ 3: 'Mib',
5240
+ 4: 'Fab',
5241
+ 6: 'Solb',
5242
+ 8: 'Lab',
5243
+ 10: 'Sib',
5244
+ 11: 'Dob'
5245
+ }
5246
+ },
5247
+ [(0, $af8d31735c159a26$export$f23edc19d247fd25)]: {
5248
+ [(0, $af8d31735c159a26$export$f0f7b592ea674eb2)]: {
5249
+ 0: 'Do',
5250
+ 2: 'Re',
5251
+ 4: 'Mi',
5252
+ 5: 'Fa',
5253
+ 7: 'Sol',
5254
+ 9: 'La',
5255
+ 11: 'Si'
5256
+ },
5257
+ [(0, $af8d31735c159a26$export$f5b1d6b4244c9536)]: {
5258
+ 0: 'Si#',
5259
+ 1: 'Do#',
5260
+ 3: 'Re#',
5261
+ 5: 'Mi#',
5262
+ 6: 'Fa#',
5263
+ 8: 'Sol#',
5264
+ 10: 'La#'
5265
+ },
5266
+ [(0, $af8d31735c159a26$export$1ea14522906630af)]: {
5267
+ 1: 'Reb',
5268
+ 3: 'Mib',
5269
+ 4: 'Fab',
5270
+ 6: 'Solb',
5271
+ 8: 'Lab',
5272
+ 10: 'Sib',
5273
+ 11: 'Dob'
5274
+ }
5275
+ }
5276
+ },
5277
+ [(0, $af8d31735c159a26$export$4d318981b5a83836)]: {
5278
+ [(0, $af8d31735c159a26$export$39615881bb0d21f6)]: {
5279
+ [(0, $af8d31735c159a26$export$f0f7b592ea674eb2)]: {
5280
+ 0: '1',
5281
+ 2: '2',
5282
+ 4: '3',
5283
+ 5: '4',
5284
+ 7: '5',
5285
+ 9: '6',
5286
+ 11: '7'
5287
+ },
5288
+ [(0, $af8d31735c159a26$export$f5b1d6b4244c9536)]: {
5289
+ 0: '#7',
5290
+ 1: '#1',
5291
+ 3: '#2',
5292
+ 5: '#3',
5293
+ 6: '#4',
5294
+ 8: '#5',
5295
+ 10: '#6'
5296
+ },
5297
+ [(0, $af8d31735c159a26$export$1ea14522906630af)]: {
5298
+ 1: 'b2',
5299
+ 3: 'b3',
5300
+ 4: 'b4',
5301
+ 6: 'b5',
5302
+ 8: 'b6',
5303
+ 10: 'b7',
5304
+ 11: 'b1'
5305
+ }
5306
+ },
5307
+ [(0, $af8d31735c159a26$export$f23edc19d247fd25)]: {
5308
+ [(0, $af8d31735c159a26$export$f0f7b592ea674eb2)]: {
5309
+ 0: '1',
5310
+ 2: '2',
5311
+ 3: '3',
5312
+ 5: '4',
5313
+ 7: '5',
5314
+ 8: '6',
5315
+ 10: '7'
5316
+ },
5317
+ [(0, $af8d31735c159a26$export$f5b1d6b4244c9536)]: {
5318
+ 1: '#1',
5319
+ 3: '#2',
5320
+ 4: '#3',
5321
+ 6: '#4',
5322
+ 8: '#5',
5323
+ 9: '#6',
5324
+ 11: '#7'
5325
+ },
5326
+ [(0, $af8d31735c159a26$export$1ea14522906630af)]: {
5327
+ 1: 'b2',
5328
+ 2: 'b3',
5329
+ 4: 'b4',
5330
+ 6: 'b5',
5331
+ 7: 'b6',
5332
+ 9: 'b7',
5333
+ 11: 'b1'
5334
+ }
5335
+ }
5336
+ },
5337
+ [(0, $af8d31735c159a26$export$1321df9b16c30c6a)]: {
5338
+ [(0, $af8d31735c159a26$export$39615881bb0d21f6)]: {
5339
+ [(0, $af8d31735c159a26$export$f0f7b592ea674eb2)]: {
5340
+ 0: 'I',
5341
+ 2: 'II',
5342
+ 4: 'III',
5343
+ 5: 'IV',
5344
+ 7: 'V',
5345
+ 9: 'VI',
5346
+ 11: 'VII'
5347
+ },
5348
+ [(0, $af8d31735c159a26$export$f5b1d6b4244c9536)]: {
5349
+ 0: '#VII',
5350
+ 1: '#I',
5351
+ 3: '#II',
5352
+ 5: '#III',
5353
+ 6: '#IV',
5354
+ 8: '#V',
5355
+ 10: '#VI'
5356
+ },
5357
+ [(0, $af8d31735c159a26$export$1ea14522906630af)]: {
5358
+ 1: 'bII',
5359
+ 3: 'bIII',
5360
+ 4: 'bIV',
5361
+ 6: 'bV',
5362
+ 8: 'bVI',
5363
+ 10: 'bVII',
5364
+ 11: 'bI'
5365
+ }
5366
+ },
5367
+ [(0, $af8d31735c159a26$export$f23edc19d247fd25)]: {
5368
+ [(0, $af8d31735c159a26$export$f0f7b592ea674eb2)]: {
5369
+ 0: 'I',
5370
+ 2: 'II',
5371
+ 3: 'III',
5372
+ 5: 'IV',
5373
+ 7: 'V',
5374
+ 8: 'VI',
5375
+ 10: 'VII'
5376
+ },
5377
+ [(0, $af8d31735c159a26$export$f5b1d6b4244c9536)]: {
5378
+ 1: '#I',
5379
+ 3: '#II',
5380
+ 4: '#III',
5381
+ 6: '#IV',
5382
+ 8: '#V',
5383
+ 9: '#VI',
5384
+ 11: '#VII'
5385
+ },
5386
+ [(0, $af8d31735c159a26$export$1ea14522906630af)]: {
5387
+ 1: 'bII',
5388
+ 2: 'bIII',
5389
+ 4: 'bIV',
5390
+ 6: 'bV',
5391
+ 7: 'bVI',
5392
+ 9: 'bVII',
5393
+ 11: 'bI'
5394
+ }
5395
+ }
5396
+ }
5397
+ };
5398
+
5386
5399
 
5387
5400
 
5388
5401
  function $21a34a464e7bc609$export$79570e60478bce41(value, functions) {
5389
5402
  return functions.reduce((acc, fn)=>fn(acc), value);
5390
5403
  }
5404
+ function $21a34a464e7bc609$export$4da2456f0a9c9a18(key) {
5405
+ return key === 'H' || key === 'h';
5406
+ }
5407
+ function $21a34a464e7bc609$export$59c434f66823d8be(key) {
5408
+ if (key === 'H') return 'B';
5409
+ if (key === 'h') return 'b';
5410
+ return key;
5411
+ }
5412
+ function $21a34a464e7bc609$export$4f126a839166f96d(keyString) {
5413
+ return keyString.startsWith('H') ? `B${keyString.slice(1)}` : keyString;
5414
+ }
5415
+ function $21a34a464e7bc609$export$7d9735233c5272d2(key, accidental, notation) {
5416
+ if (notation === (0, $af8d31735c159a26$export$34df5089b632c747) && accidental === null && (key === 'B' || key === 'b')) return 0, $af8d31735c159a26$export$1ea14522906630af;
5417
+ return null;
5418
+ }
5419
+ function $21a34a464e7bc609$export$9bc1c71527523e02(keyString, explicit) {
5420
+ if (explicit) return explicit;
5421
+ return $21a34a464e7bc609$export$4da2456f0a9c9a18(keyString) ? (0, $af8d31735c159a26$export$34df5089b632c747) : null;
5422
+ }
5423
+ function $21a34a464e7bc609$export$f524439d316753cc(key, accidental, type, minor) {
5424
+ const grades = (0, $e620f8085909724b$export$7e1516eaf3ebe01f)[type][minor ? (0, $af8d31735c159a26$export$f23edc19d247fd25) : (0, $af8d31735c159a26$export$39615881bb0d21f6)][accidental];
5425
+ const lookupKey = type === (0, $af8d31735c159a26$export$27c95a7104c1f7aa) ? $21a34a464e7bc609$export$59c434f66823d8be(key) : key;
5426
+ if (lookupKey in grades) return grades[lookupKey];
5427
+ const upperCaseKey = lookupKey.toUpperCase();
5428
+ if (upperCaseKey in grades) return grades[upperCaseKey];
5429
+ return null;
5430
+ }
5391
5431
  function $21a34a464e7bc609$export$d332d76d125f0cbe(line) {
5392
5432
  return line.items.some((item)=>item instanceof (0, $d454f4215ba01af2$export$2e2bcd8739ae039) && !!item.chords);
5393
5433
  }
@@ -16178,8 +16218,13 @@ const $1c14afc274b727b7$var$TERNARY = 'ternary';
16178
16218
  /**
16179
16219
  * Deserializes a song that has been serialized using {@link serialize}
16180
16220
  * @param {object} serializedSong The serialized song
16221
+ * @param {object} [options] Deserialization options
16222
+ * @param {Notation|null} [options.notation] When `'german'`, chord strings on the song are eagerly
16223
+ * parsed with German notation (`B` = B-flat, `H` = B natural) so the preference survives transpose
16224
+ * and re-serialization. Defaults to English semantics.
16181
16225
  * @returns {Song} The deserialized song
16182
- */ deserialize(serializedSong) {
16226
+ */ deserialize(serializedSong, options = {}) {
16227
+ this.notation = options.notation ?? null;
16183
16228
  this.parseAstComponent(serializedSong);
16184
16229
  return this.song;
16185
16230
  }
@@ -16223,7 +16268,11 @@ const $1c14afc274b727b7$var$TERNARY = 'ternary';
16223
16268
  }
16224
16269
  parseChordLyricsPair(astComponent) {
16225
16270
  const { chord: chord, chords: chords, lyrics: lyrics, annotation: annotation, isRhythmSymbol: isRhythmSymbol } = astComponent;
16226
- return new (0, $d454f4215ba01af2$export$2e2bcd8739ae039)(chord ? new (0, $26f57998457eb2d4$export$2e2bcd8739ae039)(chord).toString() : chords, lyrics, annotation, null, isRhythmSymbol || false);
16271
+ const chordString = chord ? new (0, $26f57998457eb2d4$export$2e2bcd8739ae039)(chord).toString() : chords;
16272
+ const eagerChord = this.notation && chordString ? (0, $26f57998457eb2d4$export$2e2bcd8739ae039).parse(chordString, {
16273
+ notation: this.notation
16274
+ }) : null;
16275
+ return new (0, $d454f4215ba01af2$export$2e2bcd8739ae039)(eagerChord ? eagerChord.toString() : chordString, lyrics, annotation, eagerChord, isRhythmSymbol || false);
16227
16276
  }
16228
16277
  parseTag(astComponent) {
16229
16278
  const { name: name, value: value, location: { offset: offset = null, line: line = null, column: column = null } = {}, chordDefinition: chordDefinition, attributes: attributes, selector: selector, isNegated: isNegated } = astComponent;
@@ -16259,6 +16308,7 @@ const $1c14afc274b727b7$var$TERNARY = 'ternary';
16259
16308
  constructor(){
16260
16309
  this.song = new (0, $6f653df65dfdf4ef$export$2e2bcd8739ae039)();
16261
16310
  this.songBuilder = new (0, $55e8a1b8ef6f6661$export$2e2bcd8739ae039)(this.song);
16311
+ this.notation = null;
16262
16312
  }
16263
16313
  }
16264
16314
  var $1c14afc274b727b7$export$2e2bcd8739ae039 = $1c14afc274b727b7$var$ChordSheetSerializer;
@@ -20766,6 +20816,9 @@ const $dcdae32819884244$export$98e6a39c04603d36 = $dcdae32819884244$var$peg$pars
20766
20816
  * followed by * a space is treated as a soft line break
20767
20817
  * @param {ChordProParserOptions.chopFirstWord} options.chopFirstWord=true If true, only the first lyric
20768
20818
  * word is paired with the chord, the rest of the lyric is put in a separate chord lyric pair
20819
+ * @param {Notation|null} [options.notation] When `'german'`, every chord in the song is parsed using
20820
+ * German notation (`B` = B-flat, `H` = B natural) and rendered accordingly. Defaults to English
20821
+ * semantics where `B` is B natural and `H` is accepted as an alias for it.
20769
20822
  * @see https://peggyjs.org/documentation.html#using-the-parser
20770
20823
  * @returns {Song} The parsed song
20771
20824
  */ parse(chordSheet, options) {
@@ -20773,7 +20826,9 @@ const $dcdae32819884244$export$98e6a39c04603d36 = $dcdae32819884244$var$peg$pars
20773
20826
  tracer: new (0, $129fdebf9cf00694$export$2e2bcd8739ae039)(),
20774
20827
  ...options
20775
20828
  });
20776
- this.song = new (0, $1c14afc274b727b7$export$2e2bcd8739ae039)().deserialize(ast);
20829
+ this.song = new (0, $1c14afc274b727b7$export$2e2bcd8739ae039)().deserialize(ast, {
20830
+ notation: options?.notation ?? null
20831
+ });
20777
20832
  return this.song;
20778
20833
  }
20779
20834
  }
@@ -22213,15 +22268,15 @@ function $ce817e92ec97c0d9$var$peg$parse(input, options) {
22213
22268
  chordType: "symbol"
22214
22269
  };
22215
22270
  };
22216
- const peg$c71 = /^[A-Ga-g]/;
22271
+ const peg$c71 = /^[A-Ha-h]/;
22217
22272
  const peg$c72 = peg$classExpectation([
22218
22273
  [
22219
22274
  "A",
22220
- "G"
22275
+ "H"
22221
22276
  ],
22222
22277
  [
22223
22278
  "a",
22224
- "g"
22279
+ "h"
22225
22280
  ]
22226
22281
  ], false, false);
22227
22282
  const peg$c73 = "/";
@@ -37188,7 +37243,7 @@ const $db9c80925e255cd2$var$endSectionTags = {
37188
37243
  var $db9c80925e255cd2$export$2e2bcd8739ae039 = $db9c80925e255cd2$var$UltimateGuitarParser;
37189
37244
 
37190
37245
 
37191
- var $7491059d3a8d9eaa$export$2e2bcd8739ae039 = '15.3.1';
37246
+ var $7491059d3a8d9eaa$export$2e2bcd8739ae039 = '15.5.0';
37192
37247
 
37193
37248
 
37194
37249