Music21

Latest version: v9.1.0

Safety actively analyzes 629959 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 8

7.3

* opFrac speedup by mscuthbert in https://github.com/cuthbertLab/music21/pull/1278
* Fix MIDI in Google Colab Notebooks (v8) by mscuthbert in https://github.com/cuthbertLab/music21/pull/1281
* Use more classes in getElementsByClass by mscuthbert in https://github.com/cuthbertLab/music21/pull/1283
* Improve graphing docs and options by mscuthbert in https://github.com/cuthbertLab/music21/pull/1285
* Accidentals never and if-absolutely-necessary by mscuthbert in https://github.com/cuthbertLab/music21/pull/1148
* Add typing to key.py by mscuthbert in https://github.com/cuthbertLab/music21/pull/1289
* makeRests(inPlace=True) returns None for scores by jacobtylerwalls in https://github.com/cuthbertLab/music21/pull/1288
* StreamCore is now a Music21Object; Iterator improvements by mscuthbert in https://github.com/cuthbertLab/music21/pull/1295
* Avoid `<forward>` tags from expressions out of measure bounds by jacobtylerwalls in https://github.com/cuthbertLab/music21/pull/1261
* Avoid writing empty `<movement-title />` and `<creator />` tags when title and author have no defaults by jacobtylerwalls in https://github.com/cuthbertLab/music21/pull/1248
* harmonicFunction. maps between RN figures and function labels by MarkGotham in https://github.com/cuthbertLab/music21/pull/1130
* Make cautionaryPitchClass=True work with chords by jacobtylerwalls in https://github.com/cuthbertLab/music21/pull/1299
* Export Unpitched to MIDI by jacobtylerwalls in https://github.com/cuthbertLab/music21/pull/1315
* Fix `getPitches(direction=DESCENDING)` returning ascending scales by jacobtylerwalls in https://github.com/cuthbertLab/music21/pull/1311
* Make `Key` instances compare equal regardless of tonic octave by jacobtylerwalls in https://github.com/cuthbertLab/music21/pull/1316
* optimize opFrac by mscuthbert in https://github.com/cuthbertLab/music21/pull/1322
* Fix midmeasure clef export regression involving voices by jacobtylerwalls in https://github.com/cuthbertLab/music21/pull/1330
* Fix a bug in musicxml/partStaffExporter.py where a clef-octave-change… by gregchapman-dev in https://github.com/cuthbertLab/music21/pull/1334
* [Musicxml export] Preserve whitespace in TextBox by jacobtylerwalls in https://github.com/cuthbertLab/music21/pull/1331
* Fix bug in Capella parsing. by mscuthbert in https://github.com/cuthbertLab/music21/pull/1342
* Patch duration linked bugs by mscuthbert in https://github.com/cuthbertLab/music21/pull/1341
* deprecate gcd in favor of C math by mscuthbert in https://github.com/cuthbertLab/music21/pull/1343
* makeTies within makeNotation; getTimeSignatures recurse by mscuthbert in https://github.com/cuthbertLab/music21/pull/1346
* First docs and improvements to trees by mscuthbert in https://github.com/cuthbertLab/music21/pull/1312
* Fix shiftElements docs by jacobtylerwalls in https://github.com/cuthbertLab/music21/pull/1326
* SixthMinor carries to secondary dominants mscuthbert in https://github.com/cuthbertLab/music21/pull/1354
* Add makeNotation routines for completing or consolidating tuplets by jacobtylerwalls in https://github.com/cuthbertLab/music21/pull/1242
* Demonstrate ties in `splitElementsToCompleteTuplets` doctest by jacobtylerwalls in https://github.com/cuthbertLab/music21/pull/1362
* MusicXML export: Make rests before making notation by jacobtylerwalls in https://github.com/cuthbertLab/music21/pull/1361
* Validate figures provided to `RomanNumeral()` by jacobtylerwalls in https://github.com/cuthbertLab/music21/pull/1340
* Clear cache when adding notes w/o sort by mscuthbert in https://github.com/cuthbertLab/music21/pull/1357
* match d43, d65, etc. by malcolmsailor in https://github.com/cuthbertLab/music21/pull/1363
* Use requests lib. for URL getting by mscuthbert in https://github.com/cuthbertLab/music21/pull/1367
* Allow iterables of qualified class names in `Stream.__getitem__` searches by jacobtylerwalls in https://github.com/cuthbertLab/music21/pull/1359
* Fix problem with add7 by mscuthbert in https://github.com/cuthbertLab/music21/pull/1373
* Add `makeNotation` argument to test utility by jacobtylerwalls in https://github.com/cuthbertLab/music21/pull/1376
* Prevent too large `<backup>` values in PartStaffExporter by jacobtylerwalls in https://github.com/cuthbertLab/music21/pull/1375
* Prevent zero-duration ChordSymbols from matching stripTies algorithm by jacobtylerwalls in https://github.com/cuthbertLab/music21/pull/1381
* fixed up romanText repeats by malcolmsailor in https://github.com/cuthbertLab/music21/pull/1378
* Remove *arguments where not used by mscuthbert in https://github.com/cuthbertLab/music21/pull/1394
* Standardize DatePrimitive -> Date interaction by mscuthbert in https://github.com/cuthbertLab/music21/pull/1395
* Emphasize Pitches in Interval classes by mscuthbert in https://github.com/cuthbertLab/music21/pull/1396
* Fix issue 1335: voice numbers written in MusicXML must be unique… by gregchapman-dev in https://github.com/cuthbertLab/music21/pull/1336
* Parse double flats in RomanText by malcolmsailor in https://github.com/cuthbertLab/music21/pull/1405
* Fix (and test) writing of multi-measure RepeatBrackets to MusicXML. by gregchapman-dev in https://github.com/cuthbertLab/music21/pull/1401
* romanText write to file-like objects by malcolmsailor in https://github.com/cuthbertLab/music21/pull/1416
* Closing too many states should be a TNException by mscuthbert in https://github.com/cuthbertLab/music21/pull/1421
* Fix loss of forward repeat marks when exporting PartStaffs by jacobtylerwalls in https://github.com/cuthbertLab/music21/pull/1420
* Add typing for contextSites, yieldSites by mscuthbert in https://github.com/cuthbertLab/music21/pull/1423
* Get rid of imp / load_source() by mscuthbert in https://github.com/cuthbertLab/music21/pull/1424
* Remove tons of unnecessary imports in doctests by mscuthbert in https://github.com/cuthbertLab/music21/pull/1425
* Clarify copyright entities by mscuthbert in https://github.com/cuthbertLab/music21/pull/1430
* Use hatch for building by mscuthbert in https://github.com/cuthbertLab/music21/pull/1429

Significant Improvements and bugs Fixed from 7.1 to 7.3.3

* Fix improper call to locale library in multiprocess test text output by jacobtylerwalls
* Fix `stripTies()` crash in certain scenario with matchByPitch=False by jacobtylerwalls
* Support multiple figures in single lyric (e.g "64") in `figuredBassFromStream()` by jacobtylerwalls
* Add safety and more characters to `figuredBassFromStream()` by jacobtylerwalls
* Fix accentSequence for 3/8 by jacobtylerwalls
* Use matchByPitch=True in MIDI export by jacobtylerwalls
* Cleanup chord.tables by mscuthbert
* Prevent some superfluous naturals when updating accidental displayStatus by jacobtylerwalls
* MusicXML import: Stop duplicating MetronomeMarks in multi-staff parts by jacobtylerwalls
* Clear previous result of attachIntervalsBetweenStreams() by jacobtylerwalls
* Documentation and improvements to tree by mscuthbert
* Export style attributes from chord members by jacobtylerwalls
* Fix zero-duration chords and coreInsert crash in reduceChordsOld by jacobtylerwalls
* Braille: export bowing symbols by jacobtylerwalls
* Import/export unpitched percussion instruments <--> MusicXML by jacobtylerwalls
* Explict imports in init.py; support 3.10 by mscuthbert
* Replace bèmol with bemol in Spanish translation of flat by yaph
* Fix dissonance score for compound intervals by jacobtylerwalls
* Fix parsing of add, alter, omit, and subtract in chord symbol figures by jacobtylerwalls
* Respect Accidental.displayType option 'never' by jacobtylerwalls
* Clean up temporary attributes set by braille translator by jacobtylerwalls
* allow classes in getSpannerSites by mscuthbert
* Small style upgrades and beams by mscuthbert
* Fix accidental status overriding for initial diatonic naturals by jacobtylerwalls
* Fix accidental display after note intervenes between identical chromatic pitches by jacobtylerwalls
* MIDI import: create Unpitched and PercussionChord instances by jacobtylerwalls
* Fix chord symbol duration realization edge case by jacobtylerwalls
* Speed up MIDI enum membership tests by jacobtylerwalls
* Fix numbering of crescendos and diminuendos in musicXML export by jacobtylerwalls
* Don't choke on conductor tracks lacking meters by jacobtylerwalls
* Avoid exporting superfluous meters and keys in staff groups by jacobtylerwalls
* Realize NoChords as rests if writeAsChord = True by jacobtylerwalls
* Improve ChordSymbol construction from keywords by jacobtylerwalls
* Fix export of chord symbols with realized durations by jacobtylerwalls
* Make GarageBand default MIDI player on MacOS by jacobtylerwalls
* Represent inexpressible gaps as `<forward>` tags by jacobtylerwalls
* Make all import warnings MusicXMLWarning by jacobtylerwalls
* Clearing bracketedAlterations in RomanNumeral.figure.setter. by jacobtylerwalls
* Make full scores containing piano parts exportable to braille by jacobtylerwalls
* Fix MIDI export of meter changes by jacobtylerwalls
* Import ottava objects from musicXML (as non-transposing) by jacobtylerwalls
* Improvements to single measure extraction to musicxml by jacobtylerwalls
* Export music in voices to braille by jacobtylerwalls
* Fix next(activeSiteOnly=True) finding things in other streams by jacobtylerwalls
* Import non-default instrument transpositions (musicxml) by jacobtylerwalls
* Surface `__eq__()` and `__getitem__()` in doc builds by jacobtylerwalls
* Set sixthMinor and seventhMinor to CAUTIONARY in romanNumeralFromChord() by jacobtylerwalls
* Distinguish which figures imply a bass note by jacobtylerwalls
* Implement N53 (root position Neapolitan) 1210 by MarkGotham
* Only set a default TempoText style if there is no style already set. by gregchapman-dev
* Clarify enharmonic equivalents for common sevenths and ninths (commonName) by jacobtylerwalls
* Raise instead of writing invalid musicxml duration types by jacobtylerwalls
* Force MEI parser to create unique elements by jacobtylerwalls
* expandRepeats() partname (Fixes 1165) by kir12
* getAllNamesForInstrument (completes 1064) by MarkGotham
* [musicxml import] Prevent loss of inner tuplet's type by jacobtylerwalls
* [musicxml import] Catch BarException from presence of "times" attribute on start repeats by gregchapman-dev
* Stop storing id(x) as .id by mscuthbert
* Audit exceptions in duration module by jacobtylerwalls

New Contributors
* gregchapman-dev (Greg Chapman)
* yaph (Ramiro Gómez)
* kir12 (Brian Lee)
* malcolmsailor

As always, thanks to the Seaver Institute and the National Endowment for the Humanities for supporting music21. And MIT, SHASS/Music and Theater Arts.

**Full Changelog**: https://github.com/cuthbertLab/music21/compare/v7.1.0...v8.1.0

7.3.0

Not secure

7.1.0

Not secure
Version 7 (technically 7.1.0) of music21, a toolkit for computational musicology, music theory, composition, etc. is released! A substantial revision and set of improvements for music21 that will make it easier to analyze, explore, and compose music. As with all new major version releases, there are some incompatibilities with earlier versions that should make developers test their own software before upgrading.

Big improvements:

Why type:

`myScore.recurse().getElementsByClass(note.Note)`

When you can now type:

`myScore[note.Note]`

Or if you want to find the first Key object in the piece, don't type:

`walkure.flat.getElementsByClass(key.Key)[0]`

...which will walk through the entire score, even though you just want something at the beginning. You can instead do:

`walkure[key.Key].first()`

in a millionth of the time. Streams and StreamIterators get the .first() and .last() methods, though only .first() is currently a major speedup. When we figure out how to walk an iterator quickly backwards, though, one day, .last() will also magically become faster.

Making a stream from notes could take a lot of space:


c = note.Note('C')
d = note.Note('D')
m = stream.Measure()
m.append(c)
m.append(d)
p = stream.Part()
p.append(m)


So why not:


c = note.Note('C')
d = note.Note('D')
p = stream.Part(stream.Measure([c, d]))


now if a list of elements are passed into the stream constructor, they are appended one after another, not all inserted at position 0.

If a stream is passed to another Stream's constructor it is put into the Stream itself, not its elements. This was a common mistake in v6 and earlier:


c = note.Note('C')
m = stream.Measure(c)
p = stream.Part(m)
sc = stream.Score(p)


Before, since Streams are list-like, the only thing in the Score would have been the single note C with no parts or measures at all!

In v7, the code above will create a perfectly well-formed score (well, except the lack of TimeSignature, etc., but music21 can figure that out for you.

Oh, and if you put multiple Measures into a Part constructor, they're all appended as they should be. Put put multiple Parts into a Score constructor or multiple Voices into a Measure constructor and they're all at offset 0, like they should be. Smart is better than inflexible.

Because of this change, there's now much more incentive to create proper Part, Measure, etc. objects than just making everything a general Stream.

Streams can now retrieve a single element with recursive search by id:

`sc['myId']`

or easily iterate over all elements recursively by group:

`for n in sc['.myGroup']: ...`

If it looks like CSS querySelectors, it's for a reason. And we're just getting started with showing the power of these elements.

Stream.flat has become Stream.flatten() -- why? (a) it's a verb, and should be a verb. (b) it takes a long time to generate and alters the .sites on the contained notes, so it shouldn't be a property, which implies that it's fast and has no side-effects. (c) it is now no longer shorter and faster to type than Stream.recurse() which is what you want to do 90% of the time anyhow. Stream.flat will stick around for at least 2 more versions, becoming deprecated in v8 or 9 and removed in v9 or 10. I know it's our version of "print(a)" replacing "print a" and it'll take some time to get used to. But it was a mistaken choice in 2008 and it's just as much of a mistake in 2021.

(For .semiFlat, just use Stream.flatten(retainContainers=True) which is much clearer)

New Core Developer: Jacob!

Jacob Tyler Walls has joined the commit/core development group of music21 and can now review your pull requests etc. He has made MAJOR contributions to v7 and it would not be out without him! Please send him your thanks when you use music21. Because he's on the core team now, I won't single out his contributions separately from my own (for the most part. When it's big, I'll say so).

Other substantial improvements

* I hope you're editing your own files in a modern IDE like PyCharm or VSCode. We've added tons of typing information to help you find bugs before you run.
* Significant improvement in MIDI Quantization. We still recommend converting MIDI to MusicXML (or Humdrum/MEI/etc.) in a dedicated MIDI processor, but many more MIDI files will work "out of the box" in music21 v7.
* Go ahead and parse a large piano score from musicxml. But don't go get your customary cup of coffee. Jacob made it very fast now! Lots of speedups!
* PercussionChords or chords containing a mixture of Note and Unpitched objects are now supported! We're getting much closer to equal support for percussion as for pitched music!
* Multiple instruments can be in a part now and manipulated and exported to musicxml. This works simultaneously in voices, successively (broken before in musicxml), or overridden on a single note basis with n.storedInstrument.
* Full support for Python 3.9. Python 3.10 also seems to work with m21v7, but is not officially supported. Official support will come during the v.7 lifecycle unless it requires backward incompatible changes (unlikely). In keeping with music21 policy to support the last three versions of Python, version 7 will be the last version of music21 to support Python 3.7.
* The representation of many music21 objects has changed and become standardized to give a lot more information (what type of rest is it? What octave is the note in?) This should help with debugging and shouldn't affect anyone unless you are parsing repr() for information. (Don't do that). If you are creating your own Music21Object subclasses define _reprInternal() to return just internal information beyond the class name to get it right.
* Braille output respects lineLength configurations. Slurs work better too in braille.
MIDI import comes with measures already made for you!
* roman.romanNumeralFromChord() recognizes a bunch more chords including all augmented sixth chords in all inversions (except German7 which I can't figure out). And RomanNumeral now takes "It" alone to mean It+6, and same for the others -- it puts them in their most common inversions. To get root-position Aug6 chords, spell out their figures explicitly: It53, Ger7, Fr7, etc.
* Ornaments now realize with their key contexts. Trills are great.
* MIDI input now preserves channel and program numbers for MIDI output.
* Chris Reyes has contributed a formal grammar for TinyNotation which helped us find lots of bugs. Thanks!
* Write compressed musicxml directly by passing in a filename ending in .mxl.
* getContextByClass has configuration options that when called on a Stream let them look inside themselves for their own context.
* Beaming improvements in pickups and incomplete final measures.
* MusicXML and MIDI files that give a part name like "flute" but no instrument or program code will get a Flute object in music21. It's the least we can do. And if a score sets a MIDI-0 instrument but no part name and only a single staff, it's probably a default value and not a piano, so we just give a generic Instrument object.

Incompatible Changes that might affect casual users:

* Python 3.6 is no longer supported. Stay with 6.7.1 if you need that.
* The default extension for musicxml is now .musicxml and not .xml
* MIDI import comes with measures already made
* Stream.iter is now Stream.iter() -- the old format will work for one more version. (Most people just do "for el in s" anyhow, so not a big deal.
* findGaps() now returns Rest objects at the same place as the old Music21Objects. Makes it easier to add them back to the Stream to fill gaps.
* See above about if you're parsing repr() that representations have changed.
* n.pitch.accidental = 'sharp' is no longer allowed. Do n.pitch.accidental = pitch.Accidental('sharp') -- this is so that querying n.pitch.accidental afterwards returns the same object.
* Stream.sorted has become Stream.sorted(), but you probably should never call this anyhow, since all streams are always sorted unless you set .autoSort to False.
* stripTies() removes retainContainers parameter. They're always retained. Just call .flatten() after stripTies to remove them. MatchByPitch is also True by default now.
* Before running WindowedAnalysis on a Score, flatten it. (This came from the makeMeasures change)
* See the changes to instantiating a Stream with a list of elements above.
* note.SpacerRest() is gone. Use a normalRest with .style.hideObjectOnPrint set to True.
* ComposerPopularityFeature is gone. It was a fun routine that added the popularity of the composer by googling her or him and returning the log10 of the number of search results. But Google changed their API so it was no longer working. Too bad. (It's not working in v6 either)
* Dynamics, etc. now use "placement" instead of "positionPlacement"
* Now that Percussion chords are being used and unpitched objects will appear more often, do not assume that the only things in ".notes" are Notes and Chords. So if you want to call ".pitch" on the object, check that it is a Note, instead of checking that it is not a Chord.

Other improvements and fixes

*Add TempoChangeSpanner with subclasses RitardandoSpanner and AccelerandoSpanner. How these were missed is beyond me!
* ABC supports more chord formats including better durations (thanks Marian Schultz)
* Stream.splitAtDurations() now works and can efficiently remove all "complex" durations.
* A number of places where "coreElementsChanged()" weren't being called now are.
* NotRest objects all get .pitches attribute, which might be empty. Version 8 will add this to Rest objects as well, which will of course always be empty.
* Lots of docs typos fixed (thanks Meekohi)
* Plaintext (non-Regexp) lyric searching had bugs that are fixed
* Piano Scores can now have independent key signatures in each hand imported and exported to musicxml properly. Go play "The Alcotts" now. :-)
* Cross-staff spanners in piano scores import much better.
* Lots of special strings and ints have become Enums. Expect more in the future.
* MakeMeasures can be run on a score without losing its part information.
* Running Score.measures(24, 26) etc. will only get spanners relevant to that measure range, not every darn slur in the score!
* Speedups now that the minimum Python version 3.7 has dictionaries that preserve insertion order.
* Bold + Italic text exports to musicxml properly.
* Added common.misc.unique which gets a unique list from an iterator while preserving order (unlike set)
* Meter has been split into four modules to make it easier for someone to figure out how TimeSignatures work without needing to read about AccentSequences first. TimeSignatures are much faster to generate.
* Lots more docs in the duration module.
* Decent beams in output of a score w/o explicit time signatures
* When you mistype a path into converter, now you'll get a FileNotFoundError rather than music21 trying to parse the path name as a type of notation.
* simplifyEnharmonics on a Chord can now be given a keyContext to figure out a better way of reducing accidentals (thanks gulnazaki!)
* ChordSymbol objects transpose properly to a new ChordSymbol that reflects its current bass/root etc.
* Chord.isTranspositionallySymmetrical -- can the chord be transposed up some number of semitones between 1 and 11 and get the same pitch classes? Also has a requireIntervallicEvenness which checks if it is a tritone-dyad, augmented triad, diminished-seventh chord, wholetone scale, etc. for which inversion cannot be determined by ear.
* hyphen-to-camelCase is now way faster, so is elementOffset() -- this would be a "so-what" except that together with an improvement to duration creation they speed up MusicXML parsing by almost 40%.
Spanner.getSpannedElementIds is sped up. Again a so what? Well, it's 75% faster MusicXML output for scores with spanners such as slurs, etc.
* Duration.expressionIsInferred attribute. Think that a QL of 0.5 is always an eighth note? Well, if it's between 0.333 and 0.16666 it might be a dotted-eighth triplet. When a note is set with a quarter length, expressionIsInferred is True, and music21 is allowed to renotate it to fit the context. A note with duration 2.5 might be quarter + dotted quarter in 5/8 as 2+3 but might be the opposite in 3+2 5/8. Not fully implemented, but something for the future.
* Lots of little speedups all around.
* Full measure rests now work in 9/8 and some other meters where there is no way of expressing a note of that length, but we can for rests with a Whole Note.
* Improvements to NeoRiemannian operations on MIDI-generated notes. Thanks ax-le.
* Dynamics, wedges, coda, segno, and tempo markings retain their positions on musicxml import/export. And thanks to Gesellkammer metronome marks also know if they're above or below the staff.
* makeTies() works better when a note inside a voice is tied to a note outside of a voice. No unnecessary voices made.
* TAB staves always have notes that are stem down. (Thanks Louis Bigo)
* DataSet.write() now tells you the filepath that was written. (Duh!)
* Add Chord.hasAnyEnharmonicSpelledPitches() -- C4 E4 G4 B4 returns True
* isItalianAugmentedSixth etc. gains a permitAnyInversion=False keyword which can be set to True to find unusual inversions of augmented 6th chords. Oh, and they're much simpler and faster (if it matters)
* Mordents etc. return GenericIntervals when realized so that they can take into account key signatures.
* Finding the root of a chord is much, much faster. That's something that's needed for lots of analytical methods.
* i7 and iv7 are now minor seventh chords when in a Major key. So C-Eb-G-Bb. To get a minor-major chord, spell it as i[add7]. Tonic minor-major chords in third inversion in major currently have no representation. I think that that's a very rare case that this is an improvement for everyone.
* FrontAlteration symbols are fixed for Neapolitan and AugmentedSixth roman numerals.
* Add common.classTools.tempAttribute and saveAttributes context-managers for temporarily setting an attribute to something else and restoring it afterwards. (just a helper)
* Stream.duration is much better about detecting non-standard ways of altering containing note durations. Thanks Greg Chapman for finding the bug.
* MusicXML can import measures containing only ChordSymbols (empty leadsheets)
* converter.parse() with a URL can now also take forceSource=True to redownload a file from the net.
* Scores generated by .template() now export repeats properly.
* makeTies() takes a classFilterList now.
* makeRests puts rests properly in measures. So you can do. s = stream.Stream(); s.append(meter.TimeSignature('4/4')); s.insert(9, note.Note()); call makeRests() and get two full bars of rests, a quarter rest, and then your note and rests afterwards!
* MusicXML input now handles notes that have different durations than the typical modern length implied by their shape (handy for contemporary music and the baroque).
* TimeSignatures of 3.0/4.0 are now identified as an error before they're parsed into something weird. (Thanks Luke Poeppel)
* Gracenote and appogiature display improvements.
* Crashes in feature extraction should be less rare as more common edge cases are handled.
* GraceNotes no longer interfere with beaming.
* .melodicIntervals() works with Chords now too.
* Lilypond output fixes and improvements. With Lilypond now having a native Mac-64bit app, it is no longer under threat of being removed from music21.
* Various write/show routines now work in multi-user Unix environments where users do not have write access to the normal temp folder. (Thanks tanchihpin0517)
* Improvements to TwelveToneRow.areCombinatorial() (Thanks Mark Gotham)
* KeySignature objects can now run asKey(tonic='A') and will try to find what mode has this key signature with that tonic.
* Substantial improvements in Stream.findConsecutiveNotes() including with and without voices.
* advanced users who need a very fast output of a Score which has already been asserted to be well-formed can call .write(makeNotation=False), which will not create any beams, tuplets, etc. Unless you are a power user who needs the extra speed for processing thousands of files, and who can run a debugger to see what is wrong, don't use this. It's going to crash on you. But for those who do need it, the speedup is tremendous.
* Transposing instruments set to .atWrittenPitch now display at written not sounding pitch in musicxml output.
* Add Electric Piano and Choir instruments.
* Music21 via pip will always be installed with the correct requirements (thanks James Owers)
* Very long notes can now be shown via .show() and will be broken up into multiple measures.
* Add Chord.inversionText to easily get "First inversion" "Root position" etc. For unusual augmented sixth chord inversions, we add this text to the common name.
* Smarter decisions on when to rearticulate an accidental after a key change.
* Successful writing to MuseScore PNG/PDF will not fill your console with junk.

Deprecated methods/etc. that you were warned about that have been removed:

* Chord.findRoot() [dep. since 2018] is gone. Just use Chord.root()
* Editorial.misc['anyKey'] is gone. Just use Editorial.anyKey instead.
* humdrum.parseFile() and humdrum.parseData() are gone. [Dep. since v6] Just call converter.parse('myFile.krn') instead. These functions stuck around for way too long since they appear in the original music21 publications, but time changes.
* interval.convertSpecifier() is gone. [dep v6] use interval.parseSpecifier() instead, which returns a interval.Specifier enum instead.
* Roman.scaleOffset is removed. Use the identical .frontAlterationTransposeInterval instead.

Incompatible changes that will only bite real music21 fanatics:

* setElementOffset has addElement and setActiveSite removed as options
* Environment.launch() no longer raises CalledProcessError
* Duration.updateQuarterLength() is gone/private. QuarterLengths should always automatically match the type/dots/tuplet, etc. unless "unlinked".
* Harmony.addChordStepModification() sets default for updatePitches to True.
* Roman.followsKeyChange is now Roman.editorial.followsKeyChange
* makeAccidentals inPlace defaults to False.
* `Stream.__init__` is mostly in Stream.base now.
* We've taken advantage of Python 3.7's module level` __dir__` to remove things you don't want to see from dir(module)
* A number of string/int returns have become StrEnums or IntEnums which can compare to their old values (i.e., OffsetSpecial.AT_END == 'highestTime'), but if you're doing isinstance checking then it's not going to work. Relatedly getOffsetBySite(returnString=True) becomes getOffsetBySite(returnSpecial=True)
* Stream.quantize() has recurse=False by default, matching other music21 methods.
* StripTies() inPlace=True now returns None like other inPlace=True methods.
* Meter split into 4 modules.
* test/stream.py is now stream/tests.py
* duration.durationTupleFromQuarterLength and durationTupleFromTypeDots are gone -- just create a Duration object with a given quarterLength or type and dots instead. (made private on Duration)
* setDefaultBeatPartitions moves forceCompound to a keyword only attribute.
* default for key.KeySignature() is now no-sharps or flats rather than None (non-standard key signature).
* Style objects are ProtoM21Objects.
* Spanner.replaceSpannedElement() only takes Elements not memory locations.
* hasAnyRepeatedDiatonicNote removes the useless testRoot keyword.
* Realizing a mordent or trill or turn will give a different (now correct) result in a key context.
* See the change to "It" to mean "It6" etc.
* See changes to i7 and iv7 in Major.
* makeRests puts rests properly in measures.
* Many music21 specific exceptions have been replaced by very similar general Python exceptions. Grabbing an element that doesn't exist from a stream, like s[123999] raises an IndexError not a StreamException, for instance.
* Ambitus.getPitchRanges() is removed. Just do stream.analyze('ambitus')
* .mx is no longer an abbreviation for musicxml.
* Now that isinstance() is very fast on Python, we use that a lot internally. This will only bite people who are loading modules from two different installations of music21 somehow (like using a package that includes its own version of music21). Otherwise just enjoy the speed.
* Chord now inherits from ChordBase to support having the same features on PercussionChord
* Stream.extendDurationsAndGetBoundaries is gone -- did too many things at once.

New Deprecations

* Stream.variants. Call Stream[variant.Variant] or Stream.getElementsByClass(variant.Variant) instead.
* Score.flattenParts(). Basically unused. Iterate over sc.parts and call .flatten() on each of them.
* common.Iterator. You haven't been using Python 2.6 for years, so you don't need it.
* Duration.fill(). Was just a test function and we don't put them on objects any more.
* TimeSignature.loadRatio(). Create a new TimeSignature or set .ratioString = '4/4' or .load()
* TimeSignature.beatDuration returns NaN rather than raising an exception if beats are unequal.
* common.almostEquals. Since Python 3.4, Math.isclose() is better.
* Spanner.getSpannedElementById(). Of course you never used this.
* Stream.makeChords(). Use chordify() instead.
* Stream.getKeySignatures(). Use getElementsByClass(key.KeySignature)
* Stream.getClefs(). use getElementsByClass(clef.Clef) or getContextByClass(clef.Clef) or bestClef() depending on what you want.
* VoiceleadingQuartet.color. Use .style.color instead.
* Note that isClassOrSubclass was slated to be deprecated in v7, but it was found to be too useful to remove completely. Nonetheless, we prefer isinstance(n, note.Note) instead.


This was a HUGE amount of work since v6.7 released in February. Super proud of the community for making it possible. If you're on a version older than 6.7, here are the biggest things you're missing:

- 6.7 -- Composite lyrics: multiple syllables on one note
- 6.5 -- PartStaff round-tripping to musicxml, RomanText output, better lyric searching
- 6.3 -- Compatibility with macOS Big Sur and Python 3.8
- 6 -- Type-hinting, no external modules bundled, interval fixes
- 5.7 -- big bug squashing. Chorale metadata. Chord.notes tools
- 5.5 -- Chord.commonName improvements. Volpiano. Cad64
- 5.3 -- ABC parsing improvements. containerInHierarchy. Py 3.7 support
- 5 -- Chordify massive speedups. MusicXML style preservation. Multiprocessing AI/ML
- 4 -- Graphing rewrite. Local Corpora. Style objects. TinyNotation subclassing. Direct PDF generation
- ...and the list goes on.

Thanks always to the Seaver Institute, MIT, and the National Endowment for the Humanities for supporting music21.

6.7.1

Not secure

6.7

* Important bug fix: if you’ve had trouble loading `music21` with an “importlib” error, this is fixed.
* Composite lyrics changes to the implementation in 6.5: multiple syllables on one note in a single verse (like in Italian, “Il bian*****co e***** dolce cigno”) now are imported to MusicXML property, stored in a Lyric.components object, and export to MusicXML properly.
* Lyrics searching finds all lyrics in all verses (and composite lyrics too)
* More major improvements to piano staff imports (thanks to Jacob Tyler Walls = JTW)
* RomanNumeral.isMixture() shows whether a chord is borrowed from the other mode (Mark Gotham)
* Several improvements in chord symbols (JTW + Alexandre Papadopoulos)
* More improvements to finding instrument names from MIDI (JTW)
* Duration marks in chords in ABC import properly (Marian Schultz)
* Documentation improvements.
* MusicXML parse failures now more often give the part and measure context (JTW)
* Substantial bug fixes in Stream.setElementOffset. Adds a new Stream.coreSetElementOffset for the dangerous but super fast version, and makes the original version safer. (JTW)
* Bug fixes in MEI articulations (heinzer) and accidentals (JTW)
* Bug fixes in external tools in windows including spaces (JTW)
* Channels handle better in MIDI (bearpelican)
* Humdrum files with positioned rests no longer crash (Phil Kirlin)
* OctaveRepeatingScale and CyclicalScale now usable as abstract classes (JTW)
* Articulations and expressions musicxml does not support are exported as <other-technical> (JTW)
* Better support for .musicxml as a file name within compressed .mxl files.
* Beaming in pickup measures is fixed.
* Stem directions can now be set automatically to coincide with beam groups. This is very useful if you are creating your own notation from scratch (as in VexFlow output; m21j gets the same routines)
* Spanner endHeight and startHeight are processed correctly (JTW)
* NoChord objects (in Chord Symbols) now retain their text (like “N.C.”) in more situations (JTW)
* All NotRest objects get a .pitches function – a small thing, but will be helpful in the future.

6.7 is likely the last release in version 6. We begin work on version 7 today! This means that most deprecated functions will be removed, to speed up the system and help build new things.

* Version 7 will **require Python 3.7** as a minimum version. Python 3.6 will be end-of-life by November, and v.7 will last for at least into 2022. music21 will continue to support all Python versions that are actively maintained during the expected life of the version. v3.7-3.9 will be supported, and when 3.10 comes out, the next minor version of `music21` will support it.

But dropping Py3.6 means some great changes:

* Many things that are NamedTuples will become dataclasses. (all but sortTuple). This will make working with a lot of data much better.
* Many many string options (such as notehead and beam types) will become Enums. This will help with avoiding making coding mistakes that are hard to detect. Where this has already happened (like in VoiceLeadingQuartet.MotionType) life has already become better. They will be StringEnums, and have a transition period, so code that checks for Beam.type == “start” or Lyric.syllabic == “begin” will still work (but I can never remember which is start and which is begin. Hence the point!)
* Substantial changes to Unpitched to make percussion support work.
* Some OrderedDicts (yuk!) will become normal dictionaries, now that insertion order is guaranteed to be preserved.
* Whatever else has been annoying me but I haven't been able to fix by committing to keep major versions backwards compatible.
* For simplifying the life of beginner users, `__getattr__` and `__dir__` will be defined for certain key modules (like Note) so that all the typing and internal information isn't exposed.
* I'm hoping that getElementsByClass will be able to specify its return type, at least when called with a class. For people using Typing in Python, this will be a major improvement.

Deprecated functions gone ASAP:
* Chord.findRoot() -- just use chord.root() instead
* interval.convertSpecifier – use parseSpecifier instead
* formats.findFormat (and many others in the formats module etc.)
* humdrum.parseData, humdrum.parseFile (just use converter.parse)
* Editorial.misc (just stick it on editorial)
* Duration.updateQuarterLength (not needed)

New deprecations
* SpacerRest will become deprecated – just use a normal Rest with hideObjectOnPrint = True
* Setting a pitch.accidental to a number or string will be deprecated – create an Accidental object first
* setElementOffset deprecates two keywords: addElement and setActiveSite
* isClassOrSubclass to be deprecated, use Class in .classSet – WAY faster
* getClefs to be deprecated – use recurse().getElementsByClass(‘Clef’)
* getKeySignatures to be deprecated -- use recurse().getElementsByClass(‘KeySignature’)
* Stream.makeChords() to be deprecated – Chordify is the way to go.
* Stream.extendDurationsAndGetBoundaries – was meant to be deprecated in 6 and gone in 7. It gets a one version reprieve.
* stripTies.retainContainers to be deprecated – will always be True. Just call .flat afterwards to not get this.
* Stream.iter.variants to be deprecated. Just use .getElementsByClass(‘Variant’)
* tree.toStream.chordified() to be deprecated. It’s the internal guts of Chordify now
* VoiceLeading.color to be deprecated – set .style.color on notes like any other object

Weird changes of properties to methods:
* `Stream.iter()` will be the encouraged new form instead of `Stream.iter`
* `Stream.sorted()` will be encouraged new form instead of `Stream.sorted`
* (This might not happen, but...) `Stream.flat()` encouraged for `Stream.flat` -- similarly for `.semiFlat`
* Other properties where it is possible to encourage method calling will also get this change.

These methods were disguised as properties early on in `music21` and it was a bad mistake, leading to lots of problems with introspection. Migration will go like this: v7 -- new forms are allowed and documentation is updated to encourage it. v8 -- all mention of old forms will be removed from the system and where possible using the old form will send a DeprecationWarning. v9 -- old forms are removed.

Version 7 might take until the summer or beyond. (Hence there may be bug-fix versions of v6.7 along the way). So for now, enjoy what’s out there and look forward to the future. Master branch will move to v7 but will remain as stable as possible.

Thanks to the community for great support and as always to the Seaver Institute, National Endowment for the Humanities, and MIT for support of `music21`.

6.7.0

Not secure

Page 2 of 8

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.