dorien
dorien

Reputation: 5397

Finding note onsets in musicXML

I am trying to parse a list of which pitch classes are being played at each division in a musicXML file with java and jSoup. The output should look like this (one line per division):

A C E
A C
A C D
(for instance)

I could fill up this array based on the note durations, given the number of divisions in the piece. But I can't seem to find the start time of the notes. Is there an easy way of parsing that?

The musicXML specification has a duration and a pitch (which I can parse), but I am confused about the start time of the note.

Upvotes: 1

Views: 588

Answers (2)

dorien
dorien

Reputation: 5397

If is included in a note, it starts at the same time as the previous note I believe, see.

The backstep and forward elements keep track of the time.

The parser I've developed is available here. People who are interested are free to use the code/library.

Upvotes: 2

Michael
Michael

Reputation: 743

MusicXML has a timeline with a measure that programs need to keep track of for exact starting time. Note elements move it forward unless there is a chord child element. Forward and backup elements can also move it forward or backward within a measure. If you need precise starting times at a piece-wide level, your program needs to keep track of those too. MIDI has a somewhat similar structure. You may find the MusicXML tutorial helpful at http://www.musicxml.com/tutorial/.

Upvotes: 1

Related Questions