Music21 and Dorico testing on Mac

Thank you Ben… okay…

If you don’t have Python 3.x installed, the instructions at Python.org are better than any I could write.

If you don’t have Music21 installed, then (if python is installed) go to a command prompt and type “pip install music21”. And again, there are instructions at this link if you need them: music21: a Toolkit for Computer-Aided Musicology

The modified file configure.py is attached below. Once you have both python and music21; In your python installation, there should now be a ./Lib/site-packages/music21 directory. Please unzip the file and place it there.

configure.py.zip (14.2 KB)

I assume you are familiar with Python and Music21, but just go to a command prompt and type “Python” Then type these two lines

import music21
music21.configure.run()

What should happen is that it takes a few minutes to configure Music21, and in the process it should ask you if you want to use Dorico as a music XML Reader. Once you say yes, something like the following command will verify that the Dorico integration is set up properly:

bwv295 = music21.corpus.parse(‘bach/bwv295’)
bwv295.show()

… should bring it up in Dorico.

And again - thank you!


If you are regular user of music21, or if you get interested, there is another file that I created that you can have if you want . Its called ChordDeck, and it basically lets you type in a complex chord progression quickly to display as notes in Dorico. It goes

from ChordDeck import *

chords = fromShorthand(“Em7 Bb7(b5) C/G F#Maj9”)
chords.show()

or whatever. At the moment it will create the notes for each chord as whole notes. The C/G will create an inversion for you, as will “IVc” where the “c” indicates the second inversion. For roman numerals, you can specify the key as in:

chords = fromShorthand(“I IV V ii V bVII”, key=“Eb”)
chords .show()

I extended the nomenclature a bit to do a little more that I wanted. The underscore on “C_9” for example will give you a rootless C9. and “C^9” Will give you a C9 “Cup” inversion of any extended chord that Jazz pianists apparently like to play that is a little different than either first or second inversion.

If you read python, you will see there are various methods in there for creating the bones of practice or training worksheets that treat the various possible chords as if they were cards in a flashcard deck - intended mostly for a person who wants to have some ability at Jazz comping on the piano… majorDeck() returns a random selection of major Chords, and you can guess what sixNineDeck() or whatever does. The really challenging one is deck() which gets you a little bit of whatever to practice.

ChordDeck.zip (5.1 KB)

1 Like