mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-24 20:18:34 +00:00
add common chord symbol aliases
This commit is contained in:
parent
52b8d9d361
commit
9b3fa83516
@ -208,7 +208,28 @@ export const voicing = register('voicing', function (pat) {
|
|||||||
.outerJoin();
|
.outerJoin();
|
||||||
});
|
});
|
||||||
|
|
||||||
const withEmptyAsMajor = (set) => ({ ...set, '': set['^'] });
|
export function voicingAlias(symbol, alias, setOrSets) {
|
||||||
|
setOrSets = !Array.isArray(setOrSets) ? [setOrSets] : setOrSets;
|
||||||
|
setOrSets.forEach((set) => {
|
||||||
|
set[alias] = set[symbol];
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
registerVoicings('ireal', withEmptyAsMajor(simple));
|
// no symbol = major chord
|
||||||
registerVoicings('ireal-ext', withEmptyAsMajor(complex));
|
voicingAlias('^', '', [simple, complex]);
|
||||||
|
|
||||||
|
Object.keys(simple).forEach((symbol) => {
|
||||||
|
// add aliases for "-" === "m"
|
||||||
|
if (symbol.includes('-')) {
|
||||||
|
let alias = symbol.replace('-', 'm');
|
||||||
|
voicingAlias(symbol, alias, [complex, simple]);
|
||||||
|
}
|
||||||
|
// add aliases for "^" === "M"
|
||||||
|
if (symbol.includes('^')) {
|
||||||
|
let alias = symbol.replace('^', 'M');
|
||||||
|
voicingAlias(symbol, alias, [complex, simple]);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
registerVoicings('ireal', simple);
|
||||||
|
registerVoicings('ireal-ext', complex);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user