pubPhotos
LATEST NEWS from my Prolatio and music21 blogs:
[December 9, 2017 16:46 pm] « » [prolatio]
In my article “Difference, Disability, and Composition in the Late Middle Ages: Of Antonio ‘Zachara’ da Teramo and Francesco ‘Il Cieco’ da Firenze,” chapter 26 in Oxford [University Press] Handbook of Music & Disability Studies, edited by Blake Howe, Stephanie Jensen-Moulton, Neil Lerner, and Joseph Straus, pp. 517­–28, there is a discussion of Petrus frater dictus Palma ociosaand how his "deformed hand" (Palma ociosa) may have impacted his perception as a singer and a teacher in light of the importance of the (Guidonian) Hand in instructing singing.  In the context of a paragraph of original research, cited articles, and common knowledge not requiring a footnote, this discussion is none of the above.  I should have cited Christopher Page, The 'Summa musice': a Thirteenth-Century Manual for Singers (Cambridge: CUP, 1991), which as Daniel Leech-Wilkinson's Grove article notes, is the place where this theory is discussed (pp. 72, 158, and lines 692-96).  I regret the omission and ask Page's forgiveness for the oversight.
[August 6, 2017 17:11 pm] « » [music21]
The first release of music21 version 4 was released today (August 6, 2017).  This is the first major release of music21 in a year, and it brings with it a wealth of new tools for analyzing music with a computer and performing digital musicology, music theory, and composition.

Download from https://github.com/cuthbertLab/music21/releases or from the terminal, type:

    pip3 install --upgrade music21

(or without the "3" if you are using Python 2)

Version 4 is the last version of music21 that will support Python 2.7.  If you run Version 4 on Python 2.7, you will see a warning that it's time to move up to the brilliance that is Python 3.6.

As with all new "X" release names, v.4 has backward incompatible behaviors that I think are worth it for the great new features. 
Among the 272 commits since v.3.1:
Major new features:
  • Graphing rewrite!
.plot() and Graphing has always been one of the most powerful parts of music21 since long before v.1.0 (mad props, Christopher Ariza!) but it's also been one of the most daunting aspects of using music21. It shouldn't be any more. The code has gone through a major rewrite to improve the simplicity of doing easy things and the power when doing difficult things. The easy things are documented in Chapter 22 and the hard things in Chapter 44.
  • Local Corpora are great!
There's been a major rewrite of the corpus.corpora.LocalCorpus() function that makes it a fantastic way to work quickly with files you are working on from your own hard drive.  Set up your own local corpus, add paths to it, set the cacheFilePath to somewhere to store the metadata and you'll be able to search for pieces with particular features and metadata without needing to parse the score.

  • Style!
the all new style module and style.Style object handles aspects of a note or other object's visual display that are not (usually) semantic. This class has allowed a major increase in the ability to properly preserve MusicXML visual formatting on input and export.
Style objects are created only when needed, so el.hasStyleInformation() allows for checking for the presence of a .style object without creating one.
(To be documented more soon)
  • Major rewrite of TinyNotation allows for easy extensibility.
Documented in the User's Guide! Check it out!
  • Always improving docs
The User's Guide goes up to chapter 24 now, with major new examples in Chapter 20 along with rewritten chapters on keys, time signatures, sorting, and so on and so on. Plus all examples are now Retina quality for viewing fine details of scores.
Documentation has been moved out of the music21 directory into the root directory -- it is no longer installed with music21 from pip -- this change was necessitated by the move to retina quality graphics, but reduces the installation size from 90MB to 15MB for the full corpus version and 6MB for the no-corpus version.  All documents are now tested with nbval, to ensure they stay up to date.
Other new features
  • Stream.measures() now optionally allows for indexes (where 0 always is the first measure; -1 is the last, and so on) making .getElementsByClass('Measure') not necessary in most cases.
  • much better metadata processing in musicxml, humdrum, and braille
  • improved braille translation (tuplets) -- thanks Bo-Chen
  • better beaming, meter, and tuplets in ABC
  • output directly to PDF if MuseScore is installed.
  • Nested Tuplets! including in MusicXML.
  • Non-traditional key signatures
  • New works by Clara Schumann in the corpus.
  • stream.iterators.OffsetIterator() -- iterate groups of objects by offset.
  • improvements to analysis.discrete
  • demos/build_melody shows how to build MidiFile directly (thanks PeterMitrano!)
  • corpus paths are now searchable in corpus.search()
  • matplotlib and musescore graphics in Jupyter notebook are now retina quality.
  • Chord.add() and Chord.remove() allow for direct manipulation of chords.
  • Improvements to parallel processing in music21.
  • Ottava spanners now come in two types, transposing and non-transposing -- reflecting whether the pitches under the spanner already reflect the transposition (non-transposing) or not.
  • Palestrina humdrum has been reorganized and parses completely.
  • Many improvements to spanners and RomanNumerals.
  • Beams work much better and transfer in and out of MusicXML more completely.
  • Every MusicXML 3.0 articulation is now supported.
  • Core routines in stream.core have now been exposed publicly.  They are dangerous to use, but for anyone working on their own parsers, they can speed up insertions and appends by an order of magnitude.
Others, including bugs squashed:
  • Warning on Python 2 that music21 v. 4 is the last version to support Py 2.
  • Stream.template() is a great way to get an empty stream that otherwise matches the current Stream.  Replaces the obsolete .measureTemplate()
  • ABC key signature and mode error fixed.
  • RecursiveIterator gets a .currentOffsetInHierarchy, which can let even more places remove the dependence on .flat.  In fact, .flat uses the .recurse() method internally, because recurse() is now so fast.
  • AudioSearch bugs fixed (thanks jjrob13)
  • Chord.normalOrderString (thanks emzhang)
  • Removed lots of old crutches including the "analysisData" on Stream, Note.editorial, and others. Style fixes most of this.
  • fix to Bach BWV 386 (thanks alexcoplan) and to Beethoven Opus 59 no 3, movement 1.
  • Note.pitches returns a tuple not list, just like Chord.pitches
  • Converter can deal with some wrong file extensions now.
  • Instrument reprs are fixed
  • configure finds many more notation programs.
  • ties are imported better between elements in and out of voices in musicxml
  • configure works on macOS when user directory contains spaces.
  • Bugs in ending and restarting a recursiveIterator fixed.
  • doc errors fixed (thanks Andrew Sanchez)
  • bestClef() has been moved to the clef module where it belongs.
  • MusicXML sound tag now is placed properly (thanks Almog Cohen)
  • MIDI output from transposed scores now plays in concert pitch.
  • Breves are now acceptable as full measure rests.
Deprecations and deprecated elements removed
  • (this list does not contain changes to the alpha/ directory which can change at any time)
  • Note.ps, and Note.accidental, Note.pitchClass, Note.pitchClassString, Note.diatonicNoteNum, and Note.microtone are all deprecated. Use Note.pitch.ps, etc. instead.
  • Chord.normalForm is deprecated because it gave the wrong answer. use normalOrder instead; same with normalFormString
  • SpannerBundle.list is deprecated; use list(SpannerBundle) instead
  • with the advent of .style, el.color is deprecated, use el.style.color instead
  • Stream.stream() is deprecated -- now that the transition to iterators is done, there should be no need for this.
  • REMOVED stream.getOffsetByElement; use s.elementOffset(el) instead.
  • REMOVED stream.haveBeamsBeenMade; use stream.streamStatus.haveBeamsBeenMade
  • REMOVED stream.makeTupletBrackets(); use stream.makeNotation.makeTupletBrackets(s)
  • REMOVED stream.realizeOrnaments; use stream.makeNotation.realizeOrnaments(s)
  • REMOVED VirtualCorpus -- it may return at some point but with a lot more features.
  • nbconvert is no longer packaged with music21
  • .exe files are no longer generated -- they were rarely used and pip is a better choice for Windows users now.

As the last version of music21 to run on Python 2, version 4 will have a longer support period for security patches and major bug fixes that render large parts of the system unusable for multiple users. This LTS (Long-term support) will run until the clock on python 2 runs out. (Currently two more years and eight months).  After that time, Python 2 will no longer be supported by the Python Foundation, and thus, by music21 either.  We're looking forward to joining the glorious Python 3-only feature and finally get to use some great features to make development faster and more stable.  Music21 v. 5 will be released at about the same time Django v. 2 (Py3 only) and a year after IPython/Jupyter made their first Python 3 only release.  Matplotlib will soon follow.  Python 3 is the future of humanistic and scientific programming.
As always, we thank the community for great support.  We'd always love to hear how you use music21 via the Google Groups mailing list.  Music21 was made possible by grants from the Seaver Institute, the National Endowment for the Humanities, and the School of Humanities, Arts, and Social Sciences / Music and Theater Arts Section at MIT.
[August 22, 2016 12:52 pm] « » [music21]
Version 3 of music21 is here!  This is the first major release in 11 months, with nearly 600 commits since the last version.  As a new major version, there are both huge new features as well as significant (often backwards incompatible) changes.

Upgrades for most users should work automatically by typing:

   pip3 install --upgrade music21

or (Python 2)

   pip install --upgrade music21

Or download from GitHub

A summary of the most important changes since v.2.2 are below:

Fun and easy to understand changes:

Lots more MusicXML support -- better support for time signatures, for grace notes, for spanners, for metadata, for...you name it!  And the system is refactored in such a way as to make contributing missing features quite easy.

MIDI files play back in Jupyter/IPython contexts.  Lots of improvements there for people who use MuseScore.

The User's Guide has become much more awesome, and you can play with all the good features there.

Many new ways to search scores -- LyricSearcher is fully polished and documented in the User's Guide.  Carl Lian's search.serial is upgraded from alpha to a full release that will be easy to expand in the future -- want to know where certain motives are used or transformed? This will make it easy to do. And search.segment -- the old standby -- is even better than ever (see below)

Try splitting notes and recombining them -- lots of intelligence going into this.

There's a big difference between taking a passage up a major third and taking it up 4 semitones.  In Chromatic contexts, music21 will now spell things how a musician would like to see them.  If you're working with MIDI data, without explicit enharmonics specified, you'll appreciate this.

Go ahead and use '~/../dir' and things like that in your file parsing -- music21 groks all that.

Look at you, fancy programmer, with your 4-CPU laptop! Why not give common.runParallel(tasks, function) a try and get music21 working 2-3x faster than before?  (just make sure that "tasks" isn't a list of Streams).  Oh, and if you're using search.segment to search for a particular passage inside a large collection of files, don't worry about using runParallel -- we'll do that for you automatically.

Docs are pretty and much better.  The User's Guide is the place to start.

Too many other changes to mention, but some shoutouts to Shimpe for new Lilypond code (triplet chords, etc.), Frank Zalkow for enharmonic spelling , dynamics, tempos and other things,  Chris Antilla for continued dedication to MEI processing, Emily Zhang for hashing functions and speeding up MIDI quantization,  Sonovice for articulation handling,  Dr. Schmidt for Chord symbol translations, Bagratte for IO cross Py2/3 fixes, Bo-Cheng Jhan for great braille contributions.


Big under the hood changes.

Big, backwards incompatible change: Many calls such as .parts, .notes, .getElementsByClass(), .getElementsByOffset(), etc. no longer return Streams.  They now are iterators (returning something called a StreamIterator).  For most uses, this is not going to change anything.  You can still use: for n in myStream.notes: and it'll work great. It makes many parts of music21 much, much faster.  For small scores, the differences will be small.  For large scores, the differences will be tremendous, especially when filters are chained, such as: myScore.recurse().notes.getElementsByClass('Chord').getElementsByOffset(0.0).  You're going to find that writing iterator chains is an amazing way to only get at items you want, especially with custom filters.  To get the old behavior, just add .stream() to the end of your iteration.

Because none of these filters change the activeSite of an element, you'll find that this is much more stable than before.

If you want to know what the note after a given note is in a musical context, call n.next() or n.previous().  If it's the last note of a measure, it'll move on the first note of the next. And once you've called .next() on one note of a stream, the remaining calls will be super super fast. I still haven't wrapped my mind completely around this paradigm, but it sure beats all the fooling around I used to do to figure out if one note was the same pitch as the next one, etc.

If you've been using music21 for some time, but have never looked at the docs for base.contextSites(), do it -- this is a very fast and extremely powerful way of figuring out how two objects relate to each other.  Together with the .next(), .previous(), and better support for .derivation, many extremely powerful systems can be written in music21 easily that could only be written with huge difficulty before.

Nearly all functions marked deprecated in v.2. have been removed.  Lots of super obscure functions in .base.Music21Object or .sites.Sites are gone.  This is a positive step since it'll make the documentation for these objects simple enough to understand.

Sorting works.  I mean, it just works.  With grace notes, with oddly positioned elements, with what have you. And it's pretty darn fast. This might seem like something small, but it's enormous for us.

Corpus managing is much simplified -- if you ever thought in the past, "Hey, I'd like to use a custom corpus" and then thought, "uhh...no thanks..." give a look at what is needed to set one up now.  You'll be glad for it!

Musescore and not Lilypond is used in Jupyter/IPython notebooks.

Complex durations are a lot less complex -- and faster.  

PyLint on all code -- I estimate that at least 200 undetected bugs vanished through this major effort. 


The Future

As noted in messages to the music21 mailing list (music21list at Google Groups), v.3.1 is the first non-beta release in the v.3 lineup.  Version 3 happens to share a version number with Python 3, but that is merely coincidence.  Music21 version 3 continues to work with Python 2.7 as well as Python 3.4.  Version 3 adds explicit support for Python 3.5 and drops support for Python 3.3. Music21 will continue to develop into a Version 4 to be released next summer (4.0.x will be alpha and beta releases and 4.1.0 will be the public release).  Version 4 will likely be the last version to support Python 2.

This release represents the end of a year's sabbatical where I got to work on low-low-level music21 functions that I didn't think anyone else would want to.  Due to teaching and other obligations, I'll be taking off work on the heart of music21 until the holidays (I'll still be taking bug fixes, etc.) and working more on documentation, examples, and applications.  The changes put in place for music21 v.3 has made working with it a lot more fun for me, so you'll probably see more a lot more applications get added, first to the alpha directory and then into the main set.  I've also put up a version 4 roadmap (trees are almost done, they should make it in. Style objects will be introduced so that beautiful musical scores can be created or at least imported and exported properly without major speed loses) so if anyone wants to take the lead on a project you can do so.  I'm working on a project called STAMR, Small Tools for Agile Music Research, which should create standalone tools using music21 and music21j for musicologists to get their work done faster.  Given that I'm teaching music fundamentals online again, you should see music21 and music21j integration working far better than ever before.

Thanks to MIT for supporting my work, and the Seaver Institute and the NEH for initial funding to make music21 a success.  And thanks to this great community for all your contributions in the past and contributions to come.



[August 9, 2016 17:51 pm] « » [prolatio]
There are lots of examples of each of the 24 correct syllogism forms to be found on the internet, and lots of references to the fact that there are 256 possible syllogism forms. But nowhere could I find examples of logically incorrect syllogisms. So I decided (September 2015) to write a program to generate them all. I don't know why -- maybe someone else will be tickled by some of the more absurd ones below.

The program to generate them follows after the list.

The Key:

Each syllogism form is listed with its Figure type and its three linkages:
(A=All, E=No, I=Some, O=Some Not)


If a form is logical then it is in bold and its Medieval mnemonic is listed.
A “weak” form can be supplanted by a stronger form (See Barbara vs. Barbari)
An “existential” form is logical only if the middle element has at least one member.
e.g.: No jockeys in this room are women; All jockeys in this room are short people;
Therefore: Some short people in this room are not women.  (3eao: Felapton)
(is only necessarily true if there’s at least one jockey in the room)
The software that generated this list did not check whether the major or minor premise is correct or incorrect, only whether the conclusion is logical.
thus you might find statements such as: “all humans are women; some men are humans; therefore, some men are women,” which is a logical statement given the incorrect premises. Most syllogisms below are both incorrect and illogical.


The List


1aaa (Barbara)
All pets are furry beasts.
All rabbits are pets.
Therefore, all rabbits are furry beasts.
-----------------------


1aae
All chairs are furniture.
All stools are chairs.
Therefore, no stools are furniture.
-----------------------


1aai (Barbari) [weak] [existential]
All musicologists are scholars.
All musicians are musicologists.
Therefore, some musicians are scholars.
-----------------------


1aao
All animals are rational beings.
All people are animals.
Therefore, some people are not rational beings.
-----------------------


1aea
All delicious foods are platos.
No tacos are delicious foods.
Therefore, all tacos are platos.
-----------------------


1aee
All insects are animals.
No spiders are insects.
Therefore, no spiders are animals.
-----------------------


1aei
All pets are furry beasts.
No rabbits are pets.
Therefore, some rabbits are furry beasts.
-----------------------


1aeo
All animals are rational beings.
No people are animals.
Therefore, some people are not rational beings.
-----------------------


1aia
All animals are rational beings.
Some people are animals.
Therefore, all people are rational beings.
-----------------------


1aie
All insects are animals.
Some spiders are insects.
Therefore, no spiders are animals.
-----------------------


1aii (Darii)
All pets are furry beasts.
Some rabbits are pets.
Therefore, some rabbits are furry beasts.
-----------------------


1aio
All musicologists are scholars.
Some musicians are musicologists.
Therefore, some musicians are not scholars.
-----------------------


1aoa
All chairs are furniture.
Some stools are not chairs.
Therefore, all stools are furniture.
-----------------------


1aoe
All insects are animals.
Some spiders are not insects.
Therefore, no spiders are animals.
-----------------------


1aoi
All plants are fungi.
Some flowers are not plants.
Therefore, some flowers are fungi.
-----------------------


1aoo
All plants are fungi.
Some flowers are not plants.
Therefore, some flowers are not fungi.
-----------------------


1eaa
No chairs are furniture.
All stools are chairs.
Therefore, all stools are furniture.
-----------------------


1eae (Celarent)
No pets are furry beasts.
All rabbits are pets.
Therefore, no rabbits are furry beasts.
-----------------------


1eai
No insects are animals.
All spiders are insects.
Therefore, some spiders are animals.
-----------------------


1eao (Celaront) [weak] [existential]
No chairs are furniture.
All stools are chairs.
Therefore, some stools are not furniture.
-----------------------


1eea
No insects are animals.
No spiders are insects.
Therefore, all spiders are animals.
-----------------------


1eee
No insects are animals.
No spiders are insects.
Therefore, no spiders are animals.
-----------------------


1eei
No women are humans.
No men are women.
Therefore, some men are humans.
-----------------------


1eeo
No insects are animals.
No spiders are insects.
Therefore, some spiders are not animals.
-----------------------


1eia
No delicious foods are platos.
Some tacos are delicious foods.
Therefore, all tacos are platos.
-----------------------


1eie
No musicologists are scholars.
Some musicians are musicologists.
Therefore, no musicians are scholars.
-----------------------


1eii
No animals are rational beings.
Some people are animals.
Therefore, some people are rational beings.
-----------------------


1eio (Ferio)
No pets are furry beasts.
Some rabbits are pets.
Therefore, some rabbits are not furry beasts.
-----------------------


1eoa
No plants are fungi.
Some flowers are not plants.
Therefore, all flowers are fungi.
-----------------------


1eoe
No women are humans.
Some men are not women.
Therefore, no men are humans.
-----------------------


1eoi
No women are humans.
Some men are not women.
Therefore, some men are humans.
-----------------------


1eoo
No pets are furry beasts.
Some rabbits are not pets.
Therefore, some rabbits are not furry beasts.
-----------------------


1iaa
Some pets are furry beasts.
All rabbits are pets.
Therefore, all rabbits are furry beasts.
-----------------------


1iae
Some chairs are furniture.
All stools are chairs.
Therefore, no stools are furniture.
-----------------------


1iai
Some chairs are furniture.
All stools are chairs.
Therefore, some stools are furniture.
-----------------------


1iao
Some musicologists are scholars.
All musicians are musicologists.
Therefore, some musicians are not scholars.
-----------------------


1iea
Some delicious foods are platos.
No tacos are delicious foods.
Therefore, all tacos are platos.
-----------------------


1iee
Some musicologists are scholars.
No musicians are musicologists.
Therefore, no musicians are scholars.
-----------------------


1iei
Some plants are fungi.
No flowers are plants.
Therefore, some flowers are fungi.
-----------------------


1ieo
Some insects are animals.
No spiders are insects.
Therefore, some spiders are not animals.
-----------------------


1iia
Some delicious foods are platos.
Some tacos are delicious foods.
Therefore, all tacos are platos.
-----------------------


1iie
Some plants are fungi.
Some flowers are plants.
Therefore, no flowers are fungi.
-----------------------


1iii
Some women are humans.
Some men are women.
Therefore, some men are humans.
-----------------------


1iio
Some pets are furry beasts.
Some rabbits are pets.
Therefore, some rabbits are not furry beasts.
-----------------------


1ioa
Some chairs are furniture.
Some stools are not chairs.
Therefore, all stools are furniture.
-----------------------


1ioe
Some chairs are furniture.
Some stools are not chairs.
Therefore, no stools are furniture.
-----------------------


1ioi
Some insects are animals.
Some spiders are not insects.
Therefore, some spiders are animals.
-----------------------


1ioo
Some musicologists are scholars.
Some musicians are not musicologists.
Therefore, some musicians are not scholars.
-----------------------


1oaa
Some musicologists are not scholars.
All musicians are musicologists.
Therefore, all musicians are scholars.
-----------------------


1oae
Some chairs are not furniture.
All stools are chairs.
Therefore, no stools are furniture.
-----------------------


1oai
Some musicologists are not scholars.
All musicians are musicologists.
Therefore, some musicians are scholars.
-----------------------


1oao
Some pets are not furry beasts.
All rabbits are pets.
Therefore, some rabbits are not furry beasts.
-----------------------


1oea
Some plants are not fungi.
No flowers are plants.
Therefore, all flowers are fungi.
-----------------------


1oee
Some animals are not rational beings.
No people are animals.
Therefore, no people are rational beings.
-----------------------


1oei
Some pets are not furry beasts.
No rabbits are pets.
Therefore, some rabbits are furry beasts.
-----------------------


1oeo
Some insects are not animals.
No spiders are insects.
Therefore, some spiders are not animals.
-----------------------


1oia
Some plants are not fungi.
Some flowers are plants.
Therefore, all flowers are fungi.
-----------------------


1oie
Some pets are not furry beasts.
Some rabbits are pets.
Therefore, no rabbits are furry beasts.
-----------------------


1oii
Some women are not humans.
Some men are women.
Therefore, some men are humans.
-----------------------


1oio
Some plants are not fungi.
Some flowers are plants.
Therefore, some flowers are not fungi.
-----------------------


1ooa
Some insects are not animals.
Some spiders are not insects.
Therefore, all spiders are animals.
-----------------------


1ooe
Some women are not humans.
Some men are not women.
Therefore, no men are humans.
-----------------------


1ooi
Some animals are not rational beings.
Some people are not animals.
Therefore, some people are rational beings.
-----------------------


1ooo
Some plants are not fungi.
Some flowers are not plants.
Therefore, some flowers are not fungi.
-----------------------


2aaa
All humans are women.
All men are women.
Therefore, all men are humans.
-----------------------


2aae
All animals are insects.
All spiders are insects.
Therefore, no spiders are animals.
-----------------------


2aai
All furniture are chairs.
All stools are chairs.
Therefore, some stools are furniture.
-----------------------


2aao
All rational beings are animals.
All people are animals.
Therefore, some people are not rational beings.
-----------------------


2aea
All furry beasts are pets.
No rabbits are pets.
Therefore, all rabbits are furry beasts.
-----------------------


2aee (Camestres)
All scholars are musicologists.
No musicians are musicologists.
Therefore, no musicians are scholars.
-----------------------


2aei
All fungi are plants.
No flowers are plants.
Therefore, some flowers are fungi.
-----------------------


2aeo (Camestros) [weak] [existential]
All furry beasts are pets.
No rabbits are pets.
Therefore, some rabbits are not furry beasts.
-----------------------


2aia
All furniture are chairs.
Some stools are chairs.
Therefore, all stools are furniture.
-----------------------


2aie
All fungi are plants.
Some flowers are plants.
Therefore, no flowers are fungi.
-----------------------


2aii
All humans are women.
Some men are women.
Therefore, some men are humans.
-----------------------


2aio
All animals are insects.
Some spiders are insects.
Therefore, some spiders are not animals.
-----------------------


2aoa
All platos are delicious foods.
Some tacos are not delicious foods.
Therefore, all tacos are platos.
-----------------------


2aoe
All furry beasts are pets.
Some rabbits are not pets.
Therefore, no rabbits are furry beasts.
-----------------------


2aoi
All platos are delicious foods.
Some tacos are not delicious foods.
Therefore, some tacos are platos.
-----------------------


2aoo (Baroco)
All furniture are chairs.
Some stools are not chairs.
Therefore, some stools are not furniture.
-----------------------


2eaa
No platos are delicious foods.
All tacos are delicious foods.
Therefore, all tacos are platos.
-----------------------


2eae (Cesare)
No platos are delicious foods.
All tacos are delicious foods.
Therefore, no tacos are platos.
-----------------------


2eai
No furry beasts are pets.
All rabbits are pets.
Therefore, some rabbits are furry beasts.
-----------------------


2eao (Cesaro) [weak] [existential]
No rational beings are animals.
All people are animals.
Therefore, some people are not rational beings.
-----------------------


2eea
No fungi are plants.
No flowers are plants.
Therefore, all flowers are fungi.
-----------------------


2eee
No fungi are plants.
No flowers are plants.
Therefore, no flowers are fungi.
-----------------------


2eei
No rational beings are animals.
No people are animals.
Therefore, some people are rational beings.
-----------------------


2eeo
No fungi are plants.
No flowers are plants.
Therefore, some flowers are not fungi.
-----------------------


2eia
No rational beings are animals.
Some people are animals.
Therefore, all people are rational beings.
-----------------------


2eie
No fungi are plants.
Some flowers are plants.
Therefore, no flowers are fungi.
-----------------------


2eii
No furry beasts are pets.
Some rabbits are pets.
Therefore, some rabbits are furry beasts.
-----------------------


2eio (Festino)
No animals are insects.
Some spiders are insects.
Therefore, some spiders are not animals.
-----------------------


2eoa
No humans are women.
Some men are not women.
Therefore, all men are humans.
-----------------------


2eoe
No scholars are musicologists.
Some musicians are not musicologists.
Therefore, no musicians are scholars.
-----------------------


2eoi
No platos are delicious foods.
Some tacos are not delicious foods.
Therefore, some tacos are platos.
-----------------------


2eoo
No fungi are plants.
Some flowers are not plants.
Therefore, some flowers are not fungi.
-----------------------


2iaa
Some scholars are musicologists.
All musicians are musicologists.
Therefore, all musicians are scholars.
-----------------------


2iae
Some platos are delicious foods.
All tacos are delicious foods.
Therefore, no tacos are platos.
-----------------------


2iai
Some platos are delicious foods.
All tacos are delicious foods.
Therefore, some tacos are platos.
-----------------------


2iao
Some humans are women.
All men are women.
Therefore, some men are not humans.
-----------------------


2iea
Some fungi are plants.
No flowers are plants.
Therefore, all flowers are fungi.
-----------------------


2iee
Some fungi are plants.
No flowers are plants.
Therefore, no flowers are fungi.
-----------------------


2iei
Some scholars are musicologists.
No musicians are musicologists.
Therefore, some musicians are scholars.
-----------------------


2ieo
Some furry beasts are pets.
No rabbits are pets.
Therefore, some rabbits are not furry beasts.
-----------------------


2iia
Some humans are women.
Some men are women.
Therefore, all men are humans.
-----------------------


2iie
Some platos are delicious foods.
Some tacos are delicious foods.
Therefore, no tacos are platos.
-----------------------


2iii
Some furry beasts are pets.
Some rabbits are pets.
Therefore, some rabbits are furry beasts.
-----------------------


2iio
Some platos are delicious foods.
Some tacos are delicious foods.
Therefore, some tacos are not platos.
-----------------------


2ioa
Some fungi are plants.
Some flowers are not plants.
Therefore, all flowers are fungi.
-----------------------


2ioe
Some platos are delicious foods.
Some tacos are not delicious foods.
Therefore, no tacos are platos.
-----------------------


2ioi
Some rational beings are animals.
Some people are not animals.
Therefore, some people are rational beings.
-----------------------


2ioo
Some fungi are plants.
Some flowers are not plants.
Therefore, some flowers are not fungi.
-----------------------


2oaa
Some scholars are not musicologists.
All musicians are musicologists.
Therefore, all musicians are scholars.
-----------------------


2oae
Some rational beings are not animals.
All people are animals.
Therefore, no people are rational beings.
-----------------------


2oai
Some humans are not women.
All men are women.
Therefore, some men are humans.
-----------------------


2oao
Some furniture are not chairs.
All stools are chairs.
Therefore, some stools are not furniture.
-----------------------


2oea
Some furniture are not chairs.
No stools are chairs.
Therefore, all stools are furniture.
-----------------------


2oee
Some rational beings are not animals.
No people are animals.
Therefore, no people are rational beings.
-----------------------


2oei
Some animals are not insects.
No spiders are insects.
Therefore, some spiders are animals.
-----------------------


2oeo
Some rational beings are not animals.
No people are animals.
Therefore, some people are not rational beings.
-----------------------


2oia
Some furry beasts are not pets.
Some rabbits are pets.
Therefore, all rabbits are furry beasts.
-----------------------


2oie
Some furry beasts are not pets.
Some rabbits are pets.
Therefore, no rabbits are furry beasts.
-----------------------


2oii
Some furniture are not chairs.
Some stools are chairs.
Therefore, some stools are furniture.
-----------------------


2oio
Some furniture are not chairs.
Some stools are chairs.
Therefore, some stools are not furniture.
-----------------------


2ooa
Some humans are not women.
Some men are not women.
Therefore, all men are humans.
-----------------------


2ooe
Some fungi are not plants.
Some flowers are not plants.
Therefore, no flowers are fungi.
-----------------------


2ooi
Some rational beings are not animals.
Some people are not animals.
Therefore, some people are rational beings.
-----------------------


2ooo
Some humans are not women.
Some men are not women.
Therefore, some men are not humans.
-----------------------


3aaa
All musicologists are scholars.
All musicologists are musicians.
Therefore, all musicians are scholars.
-----------------------


3aae
All musicologists are scholars.
All musicologists are musicians.
Therefore, no musicians are scholars.
-----------------------


3aai (Darapti) [existential]
All women are humans.
All women are men.
Therefore, some men are humans.
-----------------------


3aao
All chairs are furniture.
All chairs are stools.
Therefore, some stools are not furniture.
-----------------------


3aea
All animals are rational beings.
No animals are people.
Therefore, all people are rational beings.
-----------------------


3aee
All animals are rational beings.
No animals are people.
Therefore, no people are rational beings.
-----------------------


3aei
All animals are rational beings.
No animals are people.
Therefore, some people are rational beings.
-----------------------


3aeo
All animals are rational beings.
No animals are people.
Therefore, some people are not rational beings.
-----------------------


3aia
All chairs are furniture.
Some chairs are stools.
Therefore, all stools are furniture.
-----------------------


3aie
All insects are animals.
Some insects are spiders.
Therefore, no spiders are animals.
-----------------------


3aii (Datisi)
All delicious foods are platos.
Some delicious foods are tacos.
Therefore, some tacos are platos.
-----------------------


3aio
All chairs are furniture.
Some chairs are stools.
Therefore, some stools are not furniture.
-----------------------


3aoa
All insects are animals.
Some insects are not spiders.
Therefore, all spiders are animals.
-----------------------


3aoe
All musicologists are scholars.
Some musicologists are not musicians.
Therefore, no musicians are scholars.
-----------------------


3aoi
All delicious foods are platos.
Some delicious foods are not tacos.
Therefore, some tacos are platos.
-----------------------


3aoo
All insects are animals.
Some insects are not spiders.
Therefore, some spiders are not animals.
-----------------------


3eaa
No musicologists are scholars.
All musicologists are musicians.
Therefore, all musicians are scholars.
-----------------------


3eae
No animals are rational beings.
All animals are people.
Therefore, no people are rational beings.
-----------------------


3eai
No insects are animals.
All insects are spiders.
Therefore, some spiders are animals.
-----------------------


3eao (Felapton) [existential]
No musicologists are scholars.
All musicologists are musicians.
Therefore, some musicians are not scholars.
-----------------------


3eea
No musicologists are scholars.
No musicologists are musicians.
Therefore, all musicians are scholars.
-----------------------


3eee
No women are humans.
No women are men.
Therefore, no men are humans.
-----------------------


3eei
No chairs are furniture.
No chairs are stools.
Therefore, some stools are furniture.
-----------------------


3eeo
No animals are rational beings.
No animals are people.
Therefore, some people are not rational beings.
-----------------------


3eia
No insects are animals.
Some insects are spiders.
Therefore, all spiders are animals.
-----------------------


3eie
No musicologists are scholars.
Some musicologists are musicians.
Therefore, no musicians are scholars.
-----------------------


3eii
No chairs are furniture.
Some chairs are stools.
Therefore, some stools are furniture.
-----------------------


3eio (Ferison)
No women are humans.
Some women are men.
Therefore, some men are not humans.
-----------------------


3eoa
No musicologists are scholars.
Some musicologists are not musicians.
Therefore, all musicians are scholars.
-----------------------


3eoe
No women are humans.
Some women are not men.
Therefore, no men are humans.
-----------------------


3eoi
No animals are rational beings.
Some animals are not people.
Therefore, some people are rational beings.
-----------------------


3eoo
No musicologists are scholars.
Some musicologists are not musicians.
Therefore, some musicians are not scholars.
-----------------------


3iaa
Some pets are furry beasts.
All pets are rabbits.
Therefore, all rabbits are furry beasts.
-----------------------


3iae
Some chairs are furniture.
All chairs are stools.
Therefore, no stools are furniture.
-----------------------


3iai (Disamis)
Some insects are animals.
All insects are spiders.
Therefore, some spiders are animals.
-----------------------


3iao
Some musicologists are scholars.
All musicologists are musicians.
Therefore, some musicians are not scholars.
-----------------------


3iea
Some delicious foods are platos.
No delicious foods are tacos.
Therefore, all tacos are platos.
-----------------------


3iee
Some pets are furry beasts.
No pets are rabbits.
Therefore, no rabbits are furry beasts.
-----------------------


3iei
Some plants are fungi.
No plants are flowers.
Therefore, some flowers are fungi.
-----------------------


3ieo
Some pets are furry beasts.
No pets are rabbits.
Therefore, some rabbits are not furry beasts.
-----------------------


3iia
Some musicologists are scholars.
Some musicologists are musicians.
Therefore, all musicians are scholars.
-----------------------


3iie
Some insects are animals.
Some insects are spiders.
Therefore, no spiders are animals.
-----------------------


3iii
Some pets are furry beasts.
Some pets are rabbits.
Therefore, some rabbits are furry beasts.
-----------------------


3iio
Some musicologists are scholars.
Some musicologists are musicians.
Therefore, some musicians are not scholars.
-----------------------


3ioa
Some plants are fungi.
Some plants are not flowers.
Therefore, all flowers are fungi.
-----------------------


3ioe
Some plants are fungi.
Some plants are not flowers.
Therefore, no flowers are fungi.
-----------------------


3ioi
Some musicologists are scholars.
Some musicologists are not musicians.
Therefore, some musicians are scholars.
-----------------------


3ioo
Some chairs are furniture.
Some chairs are not stools.
Therefore, some stools are not furniture.
-----------------------


3oaa
Some animals are not rational beings.
All animals are people.
Therefore, all people are rational beings.
-----------------------


3oae
Some pets are not furry beasts.
All pets are rabbits.
Therefore, no rabbits are furry beasts.
-----------------------


3oai
Some women are not humans.
All women are men.
Therefore, some men are humans.
-----------------------


3oao (Bocardo)
Some delicious foods are not platos.
All delicious foods are tacos.
Therefore, some tacos are not platos.
-----------------------


3oea
Some delicious foods are not platos.
No delicious foods are tacos.
Therefore, all tacos are platos.
-----------------------


3oee
Some animals are not rational beings.
No animals are people.
Therefore, no people are rational beings.
-----------------------


3oei
Some chairs are not furniture.
No chairs are stools.
Therefore, some stools are furniture.
-----------------------


3oeo
Some animals are not rational beings.
No animals are people.
Therefore, some people are not rational beings.
-----------------------


3oia
Some chairs are not furniture.
Some chairs are stools.
Therefore, all stools are furniture.
-----------------------


3oie
Some animals are not rational beings.
Some animals are people.
Therefore, no people are rational beings.
-----------------------


3oii
Some insects are not animals.
Some insects are spiders.
Therefore, some spiders are animals.
-----------------------


3oio
Some musicologists are not scholars.
Some musicologists are musicians.
Therefore, some musicians are not scholars.
-----------------------


3ooa
Some animals are not rational beings.
Some animals are not people.
Therefore, all people are rational beings.
-----------------------


3ooe
Some delicious foods are not platos.
Some delicious foods are not tacos.
Therefore, no tacos are platos.
-----------------------


3ooi
Some delicious foods are not platos.
Some delicious foods are not tacos.
Therefore, some tacos are platos.
-----------------------


3ooo
Some plants are not fungi.
Some plants are not flowers.
Therefore, some flowers are not fungi.
-----------------------


4aaa
All animals are insects.
All insects are spiders.
Therefore, all spiders are animals.
-----------------------


4aae
All furniture are chairs.
All chairs are stools.
Therefore, no stools are furniture.
-----------------------


4aai (Bamalip) [existential]
All humans are women.
All women are men.
Therefore, some men are humans.
-----------------------


4aao
All furniture are chairs.
All chairs are stools.
Therefore, some stools are not furniture.
-----------------------


4aea
All animals are insects.
No insects are spiders.
Therefore, all spiders are animals.
-----------------------


4aee (Calemes)
All animals are insects.
No insects are spiders.
Therefore, no spiders are animals.
-----------------------


4aei
All animals are insects.
No insects are spiders.
Therefore, some spiders are animals.
-----------------------


4aeo (Calemos) [weak] [existential]
All platos are delicious foods.
No delicious foods are tacos.
Therefore, some tacos are not platos.
-----------------------


4aia
All furniture are chairs.
Some chairs are stools.
Therefore, all stools are furniture.
-----------------------


4aie
All platos are delicious foods.
Some delicious foods are tacos.
Therefore, no tacos are platos.
-----------------------


4aii
All fungi are plants.
Some plants are flowers.
Therefore, some flowers are fungi.
-----------------------


4aio
All scholars are musicologists.
Some musicologists are musicians.
Therefore, some musicians are not scholars.
-----------------------


4aoa
All humans are women.
Some women are not men.
Therefore, all men are humans.
-----------------------


4aoe
All furniture are chairs.
Some chairs are not stools.
Therefore, no stools are furniture.
-----------------------


4aoi
All humans are women.
Some women are not men.
Therefore, some men are humans.
-----------------------


4aoo
All rational beings are animals.
Some animals are not people.
Therefore, some people are not rational beings.
-----------------------


4eaa
No platos are delicious foods.
All delicious foods are tacos.
Therefore, all tacos are platos.
-----------------------


4eae
No scholars are musicologists.
All musicologists are musicians.
Therefore, no musicians are scholars.
-----------------------


4eai
No rational beings are animals.
All animals are people.
Therefore, some people are rational beings.
-----------------------


4eao (Fesapo) [existential]
No animals are insects.
All insects are spiders.
Therefore, some spiders are not animals.
-----------------------


4eea
No platos are delicious foods.
No delicious foods are tacos.
Therefore, all tacos are platos.
-----------------------


4eee
No platos are delicious foods.
No delicious foods are tacos.
Therefore, no tacos are platos.
-----------------------


4eei
No animals are insects.
No insects are spiders.
Therefore, some spiders are animals.
-----------------------


4eeo
No fungi are plants.
No plants are flowers.
Therefore, some flowers are not fungi.
-----------------------


4eia
No platos are delicious foods.
Some delicious foods are tacos.
Therefore, all tacos are platos.
-----------------------


4eie
No fungi are plants.
Some plants are flowers.
Therefore, no flowers are fungi.
-----------------------


4eii
No fungi are plants.
Some plants are flowers.
Therefore, some flowers are fungi.
-----------------------


4eio (Fresison)
No rational beings are animals.
Some animals are people.
Therefore, some people are not rational beings.
-----------------------


4eoa
No scholars are musicologists.
Some musicologists are not musicians.
Therefore, all musicians are scholars.
-----------------------


4eoe
No furry beasts are pets.
Some pets are not rabbits.
Therefore, no rabbits are furry beasts.
-----------------------


4eoi
No rational beings are animals.
Some animals are not people.
Therefore, some people are rational beings.
-----------------------


4eoo
No platos are delicious foods.
Some delicious foods are not tacos.
Therefore, some tacos are not platos.
-----------------------


4iaa
Some platos are delicious foods.
All delicious foods are tacos.
Therefore, all tacos are platos.
-----------------------


4iae
Some furry beasts are pets.
All pets are rabbits.
Therefore, no rabbits are furry beasts.
-----------------------


4iai (Dimatis)
Some fungi are plants.
All plants are flowers.
Therefore, some flowers are fungi.
-----------------------


4iao
Some fungi are plants.
All plants are flowers.
Therefore, some flowers are not fungi.
-----------------------


4iea
Some furry beasts are pets.
No pets are rabbits.
Therefore, all rabbits are furry beasts.
-----------------------


4iee
Some humans are women.
No women are men.
Therefore, no men are humans.
-----------------------


4iei
Some rational beings are animals.
No animals are people.
Therefore, some people are rational beings.
-----------------------


4ieo
Some humans are women.
No women are men.
Therefore, some men are not humans.
-----------------------


4iia
Some fungi are plants.
Some plants are flowers.
Therefore, all flowers are fungi.
-----------------------


4iie
Some platos are delicious foods.
Some delicious foods are tacos.
Therefore, no tacos are platos.
-----------------------


4iii
Some furniture are chairs.
Some chairs are stools.
Therefore, some stools are furniture.
-----------------------


4iio
Some furry beasts are pets.
Some pets are rabbits.
Therefore, some rabbits are not furry beasts.
-----------------------


4ioa
Some rational beings are animals.
Some animals are not people.
Therefore, all people are rational beings.
-----------------------


4ioe
Some rational beings are animals.
Some animals are not people.
Therefore, no people are rational beings.
-----------------------


4ioi
Some rational beings are animals.
Some animals are not people.
Therefore, some people are rational beings.
-----------------------


4ioo
Some rational beings are animals.
Some animals are not people.
Therefore, some people are not rational beings.
-----------------------


4oaa
Some rational beings are not animals.
All animals are people.
Therefore, all people are rational beings.
-----------------------


4oae
Some scholars are not musicologists.
All musicologists are musicians.
Therefore, no musicians are scholars.
-----------------------


4oai
Some scholars are not musicologists.
All musicologists are musicians.
Therefore, some musicians are scholars.
-----------------------


4oao
Some scholars are not musicologists.
All musicologists are musicians.
Therefore, some musicians are not scholars.
-----------------------


4oea
Some rational beings are not animals.
No animals are people.
Therefore, all people are rational beings.
-----------------------


4oee
Some furniture are not chairs.
No chairs are stools.
Therefore, no stools are furniture.
-----------------------


4oei
Some furniture are not chairs.
No chairs are stools.
Therefore, some stools are furniture.
-----------------------


4oeo
Some humans are not women.
No women are men.
Therefore, some men are not humans.
-----------------------


4oia
Some furry beasts are not pets.
Some pets are rabbits.
Therefore, all rabbits are furry beasts.
-----------------------


4oie
Some humans are not women.
Some women are men.
Therefore, no men are humans.
-----------------------


4oii
Some furniture are not chairs.
Some chairs are stools.
Therefore, some stools are furniture.
-----------------------


4oio
Some fungi are not plants.
Some plants are flowers.
Therefore, some flowers are not fungi.
-----------------------


4ooa
Some scholars are not musicologists.
Some musicologists are not musicians.
Therefore, all musicians are scholars.
-----------------------


4ooe
Some furniture are not chairs.
Some chairs are not stools.
Therefore, no stools are furniture.
-----------------------


4ooi
Some fungi are not plants.
Some plants are not flowers.
Therefore, some flowers are fungi.
-----------------------


4ooo
Some furry beasts are not pets.
Some pets are not rabbits.
Therefore, some rabbits are not furry beasts.
-----------------------


The (Python3) code to generate the list:


# -*- coding: utf-8 -*-
######################
# syllogisms.py -- generate all possible syllogisms,
#    whether valid or not
#
# Copyright 2015, Michael Scott Cuthbert (cuthbert@mit.edu)
#    Released freely under a BSD license.


from __future__ import print_function


# change these to make it funny...
sylloExamples = [('men', 'women', 'humans'),
             ('people', 'animals', 'rational beings'),
             ('stools', 'chairs', 'furniture'),
             ('spiders', 'insects', 'animals'),
             ('musicians', 'musicologists', 'scholars'),
             ('rabbits', 'pets', 'furry beasts'),
             ('flowers', 'plants', 'fungi'),
             ('tacos', 'delicious foods', 'platos')
             ]


import random
from collections import OrderedDict

class Figure:
   def __init__(self, type=None):
       self.figureType = type
       self.conclusion = ["S", "P"]
       if type == 1:
           self.major = ["M", "P"]
           self.minor = ["S", "M"]
           self.conclusion = ["S", "P"]
       elif type == 2:
           self.major = ["P", "M"]
           self.minor = ["S", "M"]
           self.conclusion = ["S", "P"]
       elif type == 3:
           self.major = ["M", "P"]
           self.minor = ["M", "S"]
           self.conclusion = ["S", "P"]
       elif type == 4:
           self.major = ["P", "M"]
           self.minor = ["M", "S"]
           self.conclusion = ["S", "P"]


class Mood:
   linkMapping = {"a": "all ",
                  "e": "no ",
                  "i": "some ",
                  "o": "some ",    
   }
   postVerbLink = {"a": "",
                   "e": "",
                   "i": "",
                   "o": "not "}
   
   def __init__(self, links):
       self.links = links
       self.majorLink = links[0]
       self.minorLink = links[1]
       self.conclusionLink = links[2]


logical = OrderedDict([("1aaa","barbara"), ("1eae","celarent"),
   ("1aii","darii"), ("1eio","ferio"),
   ("1aai","barbari"), ("1eao","celaront"),
   ("2eae","cesare"), ("2aee","camestres"), ("2eio","festino"),
   ("2aoo","baroco"), ("2eao","cesaro"), ("2aeo","camestros"),
   ("3aii","datisi"), ("3iai","disamis"), ("3eio","ferison"),
   ("3oao","bocardo"), ("3eao","felapton"), ("3aai","darapti"),
   ("4aee","calemes"), ("4iai", "dimatis"), ("4eio","fresison"),
   ("4aeo","calemos"), ("4eao", "fesapo"), ("4aai","bamalip")
])


# existential fallacy -- requires at least one member of the set to exist.
existential = set(["1aai", "1eao", "2eao", "2aeo", "3eao", "3aai", "4aeo", "4eao", "4aai"])


# weakened -- it is possible to make a stronger statement about the claims
#   all instead of some, no instead of some not.
weakened = existential - set(["3eao", "3aai", "4eao", "4aai"])


wordType = {"S": "subject",
           "M": "middle",
           "P": "predicate"}

class Syllogism:    
   def __init__(self, figure, mood, syllowords=None):
       self.figure = Figure(figure)
       self.mood = Mood(mood)
       if syllowords is None:
           syllowords = random.choice(sylloExamples)
       self.subject = syllowords[0]
       self.middle = syllowords[1]
       self.predicate = syllowords[2]
   
   def generate(self):
       allSentences = []
       for sentence in ("major", "minor", "conclusion"):
           sOut = ""
           if sentence == "conclusion":
               sOut = "Therefore, "
           
           linkage = getattr(self.mood, sentence + "Link")
           linkWord = self.mood.linkMapping[linkage]
           if sOut == "":
               linkWord = linkWord.capitalize()
           sOut += linkWord
           sFormat = getattr(self.figure, sentence)
           wt = wordType[sFormat[0]]
           sOut += getattr(self, wt)
           sOut += " are "
           sOut += self.mood.postVerbLink[linkage]
           wt = wordType[sFormat[1]]
           sOut += getattr(self, wt)
           sOut += ". "
           allSentences.append(sOut)
       return("\n".join(allSentences))
   
def generateAll():
   for i in range(1,5):
       for a in "aeio":
           for b in "aeio":
               for c in "aeio":
                   shorthand = "{0}{1}".format(i, a+b+c)
                   print(shorthand, end="")
                   if shorthand in logical:
                       print(" (" + logical[shorthand].capitalize() + ")", end="")
                   if shorthand in weakened:
                       print(" [weak]", end="")
                   if shorthand in existential:
                       print(" [existential]", end="")
                   print("")
                   s = Syllogism(i, a+b+c)
                   print(s.generate())
                   print("-----------------------\n")
   
if __name__ == '__main__':
   generateAll()

[August 3, 2016 20:09 pm] « » [music21]
A release candidate of version 3 of music21 (3.0.6) is available now as a package on GitHub.  As a beta release it's still not 100% ready for general usage, so "pip install music21" will still install version 2.

Get it at:
https://github.com/cuthbertLab/music21/releases 

This is likely to be the Release Candidate also for music21 v.3.  I've indicated several times in the past that music21 v.3 is the last release that I guarantee will continue to support Python 2.  I now suspect that there will be a Python 2.7-compatible v.4, since Python 2.7 is still the shipping version of Python w/ macOS Sierra.

Notes about the substantial changes in Version 3 have been posted on this list several times.  The biggest changes are that .getElementsByClass() and .notes, etc. all return a new class called a “StreamIterator” which makes working with stream filtering much much faster than before, especially for very large streams. 

The new tree-based storage system is still too flaky to turn on by default except in a few cases, and will be deferred to Music21 v.4.

Laundry list of items changed since 3.03-alpha:

min Python 3 version is now 3.4 -- 3.3 should still work but is untested.Notes parsed from MIDI or transposed by a number of semitones now get a .spellingIsInferred attribute which indicates that they can change their spelling ("G#" vs "A-") as needed for the situation. This is incompatible behavior, but much improved!
More User's Guide chapters...
Lots of improvements to Braille output, and refactoring to make more improvements in the future possible. (Thanks Bo-Cheng Jhan! and esp. to Jose Cabal-Ugaz in the first place).
Better documentation for Searching Lyrics (User's Guide, Chapter 28)
MIDI will now handle part names, etc. that use unicode.
Long files (>10 pages) in Musescore automatic PDF generation format now work (thanks Emily Zhang)
TimeSignatures such as 2/4+3/8 display much better now.
TimeSignatures import and export symbols ('common', 'cut', etc.) in MusicXML properly.
Fixes for musicxml parsing where both voices and chords interact.
configure.py now finds common MusicXML readers (Finale, Sibelius, MuseScore) on Windows!
InsertIntoNoteOrChord works in more cases
Streams are faster to calculate their own durations
Major speedups to large makeMeasure() calls.
A failure in makeTies now gives a warning instead of an exception
The old "musicxmlOld" format is removed. 
metronomeMarkBoundaries works better (thanks Frank Zalkow!)
improved ability to specify how to quantize MIDI (thanks EZ!)
improvements to automatic instrument detection.
lots more MEI articulations work (thanks sonovice)
Fingerings import and export to MusicXML better.
noteheadParentheses work well now.
Roman.fromChordAndKey gets quite a few more chords now.
incompatible change: normalOrder instead of normalForm for chords -- gives the untransposed ordering of a chord -- this is the correct behavior; prior behavior is wrong.
incompatible change: Stream.offsetMap is now a method
incompatible change: common.isStr() removed -- use isinstance(s, str) or (s, (str, unicode))
incompatible change: key.KeySignature() no longer supports a .mode attribute.  Use key.Key() instead.  key.KeySignature() objects get an .asKey('major') etc. attribute.
incompatible change: pitches lose ".getMidiPreCentShift()" method.  Just call .midi instead!

in case you missed what is new in v.3.0.3:

Python 3.5 compatible.
Splitting notes via .splitXXXX() is now much safer and more efficiently
Many, many parts of music21 can now use multiprocessing efficiently (see common.misc.runParallel())
BUG: Haydn Opus 74no2 was not actually ever in the corpus and has been removed.
Several MEI bugs fixed (thanks Chris Antilla)
Better automatic generation of chords from pitch classes (thanks Frank Z.)
Triplet chords work in lilypond
midi.realtime works with PyGame on Python3.
Music21Object.next() and .previous() work well and FAST 99.99% of the time.  (see docs for the tiny case when it might be a problem)
Many routines that used to return tuples now return NamedTuples
Many deprecated routines removed — code is simpler to use
Working with multiple corpora now has “only one way to do it” — simplify.
.show(‘midi’) works in IPython.

Much more documentation





[July 18, 2016 12:36 pm] « » [music21]
Despite the author name, this is a guest post from Christopher Witulski; he can be reached at  chris.witulski at gmail.com.  We thank him for sharing this exciting pre-publication work. -- MSC

Last year I learned about music21 and ever since I have been wondering how I can use it to learn more about the Moroccan musical repertoires that I study. Long story short, I ended up building a tool for creating interactive web-based contour visualizations from the command line and I'd like to share it here.

Climbing out of a rabbit hole

I was working through a project and struggling to keep track of things. The paper was an analysis of a genre of Moroccan sung poetry called malhun for the 2016 Analytical Approaches to World Music conference. The performance of each poem can last twenty-ish minutes and contains a number of repetitions of the refrain text. These refrains are short (roughly eight 2/4 measures long) and modulate through repetitive--but different--melodies. I had transcribed over sixty of them in an attempt to understand how they worked, how they changed, and how they were related to each other.

Musicians on stage, with a solo singer in front and the author among five violinists holding his in Western style
Malhun Performance in Fez, Morocco

Having performed this music in Morocco (I'm the lone violinist in the photo who can't quite figure out how to play while holding the instrument upright on my knee), I was constantly struck with this feeling of déjà vu. New melodies felt so similar to old ones, but I could not put my finger on how or why. The problem was simple: I could not keep sixty or seventy different transcriptions in my head at once. Comparing them was getting tricky. I wanted a way to stack them on top of each other, almost as if I could print the transcriptions on a transparency and show them all at once on an overhead projector.

Over the previous months, I had been teaching myself Python in an effort to learn more about music21 and what it could do. It was time to try and build the tool that I needed instead of wishing I could find it.

Visualizing contours

For the presentation, I put together a small library that carried out two main tasks. First, it used music21 to parse my transcriptions, normalize the length of each melody, and build a dataset. Using offsets, frequencies, and distances from the final note of each melody, it turned note objects into a JSON of coordinates. At 1,000 different y values (each corresponding with 1/1,000th of the length of the total melody), it measured an x value for the frequency and one for the "distance from the root," the distance in steps above or below the melody's final pitch.

Visualization of 68 Melodic Contours from Malhun overlaid with one labeled in bold red
Malhun Contour Example

The JSON was passed to another library that I had been recently learning and working with called D3.js. It is written in JavaScript and designed for creating powerful interactive data visualizations. I supplemented my presentation with an online chart of each of my malhun transcriptions: by grouping contour lines within each poem, I was able to easily see the source of my déjà vu. Despite changes in pitch content, range, root motion, and a host of other things, the contours themselves often stayed strikingly consistent throughout the long performances. You can see the visualization and click through the different poems online, though be aware that some parts (like the "Next" button) are artifacts of the paper presentation.

Building a tool

Maybe two weeks ago I decided to try my hand at creating a Python library of my own. I simplified the chart, creating a sort of template, remove the stepwise element of the visualization, and fought my way through learning to upload a project to PyPI. The result is ContourViz... I didn't give much thought to the name, my apologies.

"Three Melodic Contours" -- one is shown in blue.
ContourViz, simple example

The tool takes, as an argument, either a music notation file or a directory with many of them. It parses these files and creates a JSON structure of 1,000 coordinates for D3.js to work with. It then copies a folder called results that includes an index.html file and a folder of JavaScript and CSS files that the generated web page will use into the current directory. Finally, it runs the Python SimpleHTTPServer and opens the new page, parsing the JSON to create the visualization.

You can install ContourViz using the following in your terminal:

pip install contourviz

It runs from the command line, so creating a visualization of multiple melodies, like the one above, is as easy as:

chart-single-contour '/path/to/file.xml'

Working with a directory is similar:

chart-contours '/path/to/directory/full/of/xml/or/mxl/files'

6 Melodic Contours -- more complex chart showing 2 x three overlapping contours from Damlij-Bouzouba
ContourViz, more complex example
I'm still toying with the system and it has a number of issues. For example, I would love for it to parse voices as individual melodies if they are present. Instead, it only works with monophonic lines, meaning that each voice has to be in an individual file if you wanted to visualize voice leaning or other contrapuntal patterns. There are smaller issues: I still need to set up the Y axis to render note names properly.

Please feel free to check out the GitHub repo and suggest any other changes or ways in which it could be more helpful. This is my first go around at building a tool of this sort, so I am eager to hear if it is helpful and how it could be improved. And thank you for allowing me to join the community.



For older stories visit the Prolatio (general items) or music21 (computational musicology) blogs.

Michael Scott Cuthbert (cuthbert [at] mit.edu) is Associate Professor of Music and Homer A. Burnell Career Development Professor at M.I.T.

Cuthbert received his A.B. summa cum laude, A.M. and Ph.D. degrees from Harvard University. He spent 2004-05 at the American Academy as a Rome Prize winner in Medieval Studies, 2009-10 as Fellow at Harvard's Villa I Tatti Center for Italian Renaissance Studies in Florence, and in 2012–13 was a Fellow at the Radcliffe Institute in 2012-13. Prior to coming to MIT, Cuthbert was Visiting Assistant Professor on the faculties of Smith and Mount Holyoke Colleges. His teaching includes early music, music since 1900, computational musicology, and music theory.

Cuthbert has worked extensively on computer-aided musical analysis, fourteenth-century music, and the music of the past forty years. He is creator and principal investigator of the music21 project. He has lectured and published on fragments and palimpsests of the late Middle Ages, set analysis of Sub-Saharan African Rhythm, Minimalism, and the music of John Zorn.

Cuthbert is writing a book on Italian sacred music from the arrival of the Black Death to the end of the Great Schism.

Download what is almost certainly an out-of-date C.V. here (last modified June 2012)

2010
Changing Musical Time in the Renaissance (and Today), for Festschrift Joseph Connors (forthcoming)

Bologna Q15: the making and remaking of a musical manuscript, review for Notes 66.3 (March), pp. 656-60.

2009
Ars Nova: French and Italian Music in the Fourteenth Century, edited volume with John L. Nádas (Music in the Medieval World Reference Series vol. 6). London: Ashgate. Reviewed by Gary Towne, The Medieval Review, February 2010.

"Palimpsests, Sketches, and Extracts: The Organization and Compositions of Seville 5-2-25," L’Ars Nova Italiana del Trecento 7, pp. 57–78.

Der Mensural Codex St. Emmeram: Faksimile der Handschift Clm 14274 der Bayerischen Staatsbibliothek München, review for Notes 65.4 (June), pp. 252–4.

2008
"A New Trecento Source of a French Ballade (Je voy mon cuer)," in Golden Muse: The Loeb Music Library at 50. Harvard Library Bulletin, new series 18, pp. 77–81.

2007
"Esperance and the French Song in Foreign Sources," Studi Musicali 36.1, pp. 1–19.

2006
"Trecento Fragments and Polyphony Beyond the Codex", Ph.D. Dissertation, Harvard University (unpublished).

"Generalized Set Analysis and Sub-Saharan African Rhythm? Evaluating and Expanding the Theories of Willie Anku," Journal of New Music Research (formerly Interface) 35.3, pp. 211–19. [.pdf]

2005
"Zacara’s D’amor Languire and Strategies for Borrowing in the Early Fifteenth-Century Italian Mass," in Antonio Zacara da Teramo e il suo tempo, edited by Francesco Zimei. Lucca: LIM, pp. 337–57 and plates 10–13.

2001
"Free Improvisation: John Zorn and the Construction of Jewish Identity through Music," in Studies in Jewish Musical Traditions, edited by Kay Kaufman Shelemay (Cambridge, Mass.: Harvard College Library). pp. 1-31. [.pdf]

Creative Commons License Unless otherwise mentioned, the writings, compositions and recordings on this site are licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 United States License.

Copyright 2010-11, Michael Scott Cuthbert. Web design by M.S.C.