CSC 471 Final Project - GLozart

by James Delos Reyes





Figure 1: ScreenShot from GLozart


Introduction

GLozart is a program written in openGL that graphically simulates hands playing a piano. GLozart can read in any standard MusicXML file that has a piano. The piano is a full-88 keyboard and can be rotated for the user to see the hands simulation from different angles. GLozart is a useful tool for piano players from beginning to advanced to visually see optimized finger positions which is often not specified in sheet music.

Why MusicXML and not Midi?

GLozart gathers musical information from a MusicXML format file. MusicXML was developed by Recordare (http://www.musicxml.org ) as a bridge to translate modern Western musical notation of the 17th century between various notation applications. Today, it is used by over 50 different comercial products. This includes leading programs for score-writing such as Finale and Sibelius.

MIDI, of course, is the industry-standard format to translate music between different music applications such as synthesizers. The difference between MIDI and MusicXML is crucial, however. MIDI specializes specifically with music. MusicXML specializes specifically with music notation. Since standard notation is often verbose and unnecessary, MIDI ignores notation almost all together. This is the greatest advantage of reading in MusicXML over MIDI files even though they are not necessarily competitors. For parsing a music file, MIDI does not store information about which hand to use while playing the piano (i.e. the left or right). This is a very hard problem to figure out algorithmicly since there are no strong restrictions without notation. Thankfully, MusicXML does specify the staff that each note falls on, thereby solving the problem.




Figure 2: ScreenShot from GLozart performing a Mozart sonata


Finger Algorithm

Although MusicXML resolves which hand to use, there is still ambiguity in which fingers to use. GLozart uses an optimized algorithm for determining fingering positions. The result is a bit over-pretentious, however, since many people can play the same song in different ways. The algorithm chooses fingers purely on the basis of which is closest to the note as opposed to a human who would prioritize different fingers. For example, the pinky is the least used for any instrument simple because it is the weakest finger and hardest to control. Humans usually pick a more comfortable position based on finger strength rather than pure range proximations. Because of this, GLozart often picks finger positions that would be seen as uncomfortable to most people.

A more significant issue although rare occurs when a finger cannot reach a demanding note. In this case, the fingers (controlled by trigonometric parameters) completely disappear. Although it would seem logical to put a constraint on how far the fingers could reach, it would be inacurrate if a finger pressed down on an incorrect note. GLozart allows the fingers to disappear in order that the user recognizes the failure instead of hiding it from the user.

Commands


'p'......................................Play Piece (using glutTimerFunc)
'P'......................................Play Piece (using idleFunc...tempo fixed)
'o'......................................Stop Piece
'+'......................................Increase tempo
'-'........................................Decrease tempo
'w'......................................Increase Scan Length*
's'......................................Decrease Scan Length*
Drag Left Mouse..................Rotate Camera
Drag Right Mouse...............Zoom Camera In/Out

*Scan Length controls the number of note divisions that the parser will scan before determining finger positions. Shorter Scan Lengths result in less usage of the all five fingers per hand. Larger Scan Lengths result in more spread out usage between fingers.


Screenshots




Figure 3: GLozart playing "Im wunderschonen Monat Mai" by Franz Schubert




Figure 4: "Im wunderschonen Monat Mai" from side angle


Sound

Due to time constraints, Sound is not implemented in GLozart Version 1.0. Graphics were the main focus of the initial version.

Limitations

Parsing MusicXML is a worthy task in itself. Due to this fact, version 1.0 of GLozart ignores the following musical notation:

o all articulations (e.g. trills, glissandos, grace notes, etc.)
o all dynamics (e.g. cresandos, fortissimos, etc.)
o repeats or codas
o mutiple clefs (e.g. two G clef's, or an F clef that changes in the middle to G)
o voices that cross over staffs
o chords for one hand that span over an octave
o other musical peculiarities

Also, note that GLozart only reads music that contains at least one "Piano," "Grand Piano," or an "Acoustic Grand Piano" as specified in the partID's of the MusicXML.

Resources

MusicXML is a widely used interchange format for score-writing and other notation programs. It is used in today's top leading notation programs including Finale and Sibelius. There is also a store on their site if you would like to buy MusicXML of some well-known pieces. Try them in GLozart!!!
http://www.musicxml.org

Source Code

Glozart Program. (Note: You need to supply a MusicXML as the first argument)
GLozart.exe

Sample MusicXMLs

"An Chloe K.524" by Wolfang Amadeus Mozart
MozaChloSample.xml
MozaChloSample.pdf

Short exerpt from a Mozart Sonata
MozartPianoSonata.xml
MozartPianoSonata.gif

"(Ellen's Gesang III) Ave Marie" by Franz Schubert
SchbAvMaSample.xml
SchbAvMaSample.pdf

"DichterLiebe, Op. 48, 1. Im wunderschonen Monat Mai" by Robert Schumann
Dichterliebe01.xml
Dichterliebe01.pdf