Showing posts with label braille. Show all posts
Showing posts with label braille. Show all posts

Wednesday, August 3, 2016

music21 v. 3 beta-3.0.6 released

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





Thursday, September 29, 2011

BMT: The All-Purpose Braille Music Transcriber

I'm continuing my quest to develop an all-purpose Braille music transcriber in music21. This is a funding proposal submitted to the Undergraduate Research Opportunities Program (UROP) at MIT for the fall 2011 term. Hopefully by December we'll be able to transcribe chords into Braille!

Reading and writing over the centuries has mostly relied on a person's ability to see. It was not until the 1800s that Louis Braille invented a system of raised dots that allowed the visually-impaired to read by substituting the sense of touch. In similar fashion, the blind have been deprived of playing and singing from musical scores for most of history, since reading and writing music on a staff also relies on the ability of sight. Fortunately, Braille also developed a system to represent written music as raised dots.

Braille music notation is noticeably different from the standard musical notation of representing notes on a staff, as shown below.


Happy Birthday" in Braille Music


⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠩⠼⠉⠲⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠼⠁⠀⠐⠑⠄⠵⠫⠱⠀⠳⠟⠀⠑⠄⠵⠫⠱⠀⠪⠗⠀⠑⠄⠵⠨⠱⠺⠀⠓⠄⠷⠻⠫
⠨⠙⠄⠽⠺⠳⠀⠪⠗⠣⠅


Braille music notation is not only different from standard musical notation, but also just as complex and difficult to master. Not only do blind persons need special training in reading Braille music notation, but those sighted persons seeking to transcribe music into Braille need extensive training in how the two notations correspond and where they differ.

This raises the question: what happens the day when a visually-impaired yet excellent singer wants to sing in the MIT Concert Choir? Assuming he or she is able to read Braille music notation, there needs to be a way of providing him or her with the translated repertoire.

One way of doing so is to invoke the services of a transcriber. However, because of the complexities explained beforehand, there are very few transcribers available to do this. Another solution is to use transcription software available on the open market. The problem is that said software tends to be very expensive. But what if there existed free software that could do the same? And that is exactly what the Braille music transcriber, BMT, I have been developing is.

I started developing BMT in July 2011 under a direct funding UROP as part of the music21 project, a project in MIT Music and Theater Arts which aims to develop software useful for musical analysis. Using knowledge borrowed from my years of training in both music and computer science, borrowing from code already written for music21, and consulting very closely with a certified Braille transcription manual[1], I have come up with a rudimentary transcriber.

Right now, BMT is capable of translating melodies such as the example presented beforehand––melodies containing musical elements including, but not limited to, notes, rests, bar lines, key signatures, and time signatures. Each of the musical elements corresponds to a Braille character or series of characters. Some more complex elements supported include fingering, slurs, changes of key or time signatures, and beaming. In short, most of the concepts in twelve of the first sixteen chapters of the transcription manual have been implemented, with more than 100 examples found within those chapters being transcribed correctly.

However, there is functionality that I aim to add during this UROP. The most notable of these is support for chords, or set of notes played or sung at once. Not only are chords omnipresent in keyboard music, but also harmonies of instruments in pieces with multiple parts played or sung in unison can always be boiled down to chords. Hence, chords are used as a method of instruction in musical composition classes not only at MIT but also at universities across the world. Implementing chords would be a big step towards being able to translate an introductory composition text such as Marjorie Merryman's The Music Theory Handbook[2] which is used at MIT. Chords and related concepts are covered over five chapters, approximately 100 pages, and are a leap beyond single melodies because one needs to deal with the vertical aspect and the horizontal aspect of the transcription simultaneously.

Another concept to implement is musical repeats, bar lines at the beginning and ending of sections which are meant to be repeated for a given piece of music. This is a relatively simple concept in print, but the manual spends three chapters covering it, approximately 100 pages.

Other important concepts to add include division of long measures whose transcription would fall at the end of a Braille line limited to forty characters in length, as well as increased support for musical expressions and special note modifiers such as ornaments. In fine, the first sixteen chapters comprise only 150 pages of a 500+ page manual––there is much to be done before BMT can "become an official Braille music transcriber."

With a completed BMT, all the editable musical scores available online will become available to visually-impaired musicians. As alpha code, the music21 project also benefits, because every example needs to be translated into music21 objects before being transcribed into Braille, uncovering plenty of bugs and resulting in many new features being implemented or improved upon. I also believe that new coding techniques developed will carry over towards my musical improvisation software whose further development is currently on hiatus.[3] But most of all, I believe that this project will continue to give me more of the engineering confidence which I have been seeking over the course of my time at MIT.

[1] Introduction to Braille Music Transcription, Second Edition 2005, by Mary Turner De Garmo, revised and edited by Lawrence R. Smith, Music Braille Transcriber.

[2] Marjorie Merryman. The Music Theory Handbook. Schirmer, 1996.

[3] Jose Cabal-Ugaz. "fbRealizer: A 21st-Century Approach to a Centuries-Old Musical System." UROP Summer Proposal, 2011.