VoicingDictionary¶
voicing_dictionary ¶
Pre-built voicing dictionaries for Voicing.
A voicing dictionary maps chord symbols to lists of interval-set strings
("3M 5P 7M 9M" etc.). Three dictionaries are provided:
| Dictionary | Contents |
|---|---|
triads |
Major, minor, diminished, augmented triads in three inversions |
lefthand |
Jazz left-hand piano voicings (m7, ^7, 7, m7b5, ...) |
all |
Union of triads and lefthand |
lookup resolves chord-symbol
aliases (so looking up "Maj7" finds the "^7" entry).
Example
from tonal_py import VoicingDictionary "M" in VoicingDictionary.triads True VoicingDictionary.lookup("m7") == VoicingDictionary.lefthand["m7"] True
Source parity: @tonaljs/voicing-dictionary
lookup ¶
Look up voicings for a chord symbol with alias resolution.
First tries dictionary[symbol] directly. If that misses, tokenizes
the symbol via Chord.get("C" + symbol) and tries each of its
aliases against the dictionary.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
symbol
|
str
|
A chord symbol ( |
required |
dictionary
|
dict[str, list[str]] | None
|
The dictionary to search. Defaults to |
None
|
Returns:
| Type | Description |
|---|---|
list[str] | None
|
A list of interval-set strings, or |
Example
from tonal_py import VoicingDictionary VoicingDictionary.lookup("m7") ['3m 5P 7m 9M', '7m 9M 10m 12P'] VoicingDictionary.lookup("nonsense") is None True