music21.languageExcerpts.naturalLanguageObjects

Multi-lingual conversion of pitch, etc. objects

Functions

music21.languageExcerpts.naturalLanguageObjects.generateLanguageDictionary(languageString)
music21.languageExcerpts.naturalLanguageObjects.toChord(pitchArray, languageString)

Converts a list of strings to a music21.chord.Chord object given a language

Supported languages are French, German, Italian, and Spanish

Unsupported strings default to pitch C Natural

>>> languageExcerpts.naturalLanguageObjects.toChord(['Es', 'E', 'Eis'], 'de')
<music21.chord.Chord E- E E#>
music21.languageExcerpts.naturalLanguageObjects.toNote(pitchString, languageString)

Converts a string to a music21.note.Note object given a language

Supported languages are French, German, Italian, and Spanish

Defaults to C Natural

>>> languageExcerpts.naturalLanguageObjects.toNote('Es', 'de')
<music21.note.Note E->
>>> languageExcerpts.naturalLanguageObjects.toNote('H', 'de')
<music21.note.Note B>
>>> for i in ['As', 'A', 'Ais']:
...     print(languageExcerpts.naturalLanguageObjects.toNote(i, 'de'))
<music21.note.Note A->
<music21.note.Note A>
<music21.note.Note A#>
music21.languageExcerpts.naturalLanguageObjects.toPitch(pitchString, languageString)

Converts a string to a music21.pitch.Pitch object given a language.

Supported languages are French, German, Italian, and Spanish

Defaults to C natural

>>> languageExcerpts.naturalLanguageObjects.toPitch('Es', 'de')
<music21.pitch.Pitch E->
>>> languageExcerpts.naturalLanguageObjects.toPitch('H', 'de')
<music21.pitch.Pitch B>
>>> for i in ['As', 'A', 'Ais']:
...     print(languageExcerpts.naturalLanguageObjects.toPitch(i, 'de'))
A-
A
A#