SmartMusic Finale Garritan MusicXML

getting a note list from MusicXML

Moderator: Michael Good

getting a note list from MusicXML

Postby Jane Singer » Sun Jul 14, 2002 12:23 am

I am writing a program in Java for searching through a set of melodies. The imported data consists of a modified MusicXML file. For each melody, one whole branch is pure MusicXML. Another contains a set of abstractions. The program searches these abstractions, and will display (notate) the melodies that match certain search criteria. In order to display correctly, it has to line up the graphic representation of each abstracted segment with the proper note. To do this, I need to find the nth note in the melody a few times for each incipit.

I am using XPaths (org.apache.xpath.XPathAPI;) which is good for grabbing the notes once I have the root node of a melody. However since the notes are all nested within measures, this is not so elegant: I have to get a nodelist of the measures, than iterate over each measure.

In my original representation, I represented measures by giving each note a relative metric weight. The weight of each first beat is 1, the weights for eighth-notes in 6/8 would be 134256, for 2/4: 1324, etc. I can know where a barline occurs by looking at these values.

I could transform the notation so that I would have a straightforward notelist, however, I would like to keep this branch pure MusicXML. There is an object called NodeIterator, which is an alternative to NodeList. Can this be used? Is there some more elegant way to solve this "problem"?

Thanks for any suggestions. Jane
Jane Singer
Posts: 27
Joined: March, 2014
Reputation: 0

RE: getting a note list from MusicXML

Postby Michael Good » Mon Jul 15, 2002 11:57 am

Hi Jane,

Getting a list of notes from XPath should be just as straightforward as getting a list of measures. You should not have to iterate over the measures, and then over the notes.

If you can send the current XPath (or set of XPaths) that you are using, I'll see if I can send you some simpler / more elegant XPath expressions. Are you using the XML DOM from within Java, or some other programming interface?

Best regards, Michael
Michael Good
VP of MusicXML Technologies
MakeMusic, Inc.
User avatar
Michael Good
Posts: 2197
Joined: March, 2014
Reputation: 0

Who is online

Users browsing this forum: No registered users and 2 guests