MakeMusic
SmartMusic Finale Garritan MusicXML

start time of note in musicxml

Moderator: Michael Good

start time of note in musicxml

Postby dorien » Sat Jan 31, 2015 1:45 pm

For a research project I am trying to make a list of which pitch classes are being played at each division in a musicXML file. 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?

Thanks!
dorien
 
Posts: 12
Joined: January, 2015
Reputation: 0

Re: start time of note in musicxml

Postby Mogens Lundholm » Sun Feb 01, 2015 4:53 am

No, there is no easy way.

I am working on a program to play Music Xml. I could make a modofication
and dump the notes to a file.

Somewhere in this forum there was some list of tools to parse Music XML.
Michael described possibilities.
P.t. I have my own state machine.

Note that divisions is not an exact number. Different music programs will
use division differently. E.g. a note sheet in 4/4 having notes of 1/8 with
a single triol has divisions=6 with Finale. This is the lowest number to
make the notes exact. Without the triol you will have divisions=2.
However the music program Sibelius (what I have seem) uses divisions=256,
and therefore the triol will not be exact, but have a little inaccuracy.

I can send you an example if you want. I think you should consider to have
the division number in front of all lines - what do you think?

Kind regards
Mogens
Mogens Lundholm
 
Posts: 60
Joined: March, 2014
Reputation: 0

Re: start time of note in musicxml

Postby Mogens Lundholm » Sun Feb 01, 2015 6:43 am

Couldn't let be to implement this. I added a division number in front because I think you need it. There are three examples having an Music-Xml-file, the corresponding print out (pdf) and the dump from my program (Part1.txt - since the Music Xml has only one part).
1. Some notes from C... . Note the division numbers 0,1,2,3...
2. Some note from C plus a triol. Note that this affects the number of divisions, now 0,3,6,...
3. Your notes comes out on divisions 0,2,4.

Due to a limit of three uploaded files I will add the Music Xml files in another letter. The files generated by my program are:
3.xml-Part1.txt: (Your notes)
0:A C E
2:A C
4:A C D
2.xml-Part1.txt: (C.. plus triol)
0:C
3:D
6:E
9:F
12:G
15:A
18:B
21:C
24:C
26:B
28:A
2.xml-Part1.txt:
0:C
1:D
2:E
3:F
4:G
5:A
6:B
7:C
Something to use?

Kind regards
Mogens
Attachments
3.xml.pdf
Your notes
(9.45 KB) Downloaded 445 times
2.xml.pdf
Notes CDEFGAB + triol
(10.23 KB) Downloaded 507 times
1.xml.pdf
Notes CDEFGABC
(9.88 KB) Downloaded 529 times
Mogens Lundholm
 
Posts: 60
Joined: March, 2014
Reputation: 0

Re: start time of note in musicxml

Postby Mogens Lundholm » Sun Feb 01, 2015 6:58 am

The whole thing can be downloaded from

http://www.programfabriken.com/Dorien.zip

With the modified program for you.

Kind regards
Mogens
Mogens Lundholm
 
Posts: 60
Joined: March, 2014
Reputation: 0

Re: start time of note in musicxml

Postby dorien » Sun Feb 01, 2015 9:17 am

Hi,

Thank you so much for your reply and program.

I do want to be able to do it myself in java. I have been using jSoup to parse all the note attributes and I am just confused to know how the start time of the note is indicated. Is it just because the are in sequence? So I should do: previous note + duration = start time next note? In midi there is just a startevent.
dorien
 
Posts: 12
Joined: January, 2015
Reputation: 0

Re: start time of note in musicxml

Postby dorien » Sun Feb 01, 2015 12:28 pm

So I guess if <chord/> is included in a note, it starts at the same time as the previous note?

But what if they start at a slightly offsetted position? They are necessarily a different part then?

http://www.musicxml.com/tutorial/the-mi ... rt/chords/
dorien
 
Posts: 12
Joined: January, 2015
Reputation: 0

Re: start time of note in musicxml

Postby dorien » Sun Feb 01, 2015 3:20 pm

Also added to that. I guess the note needs to be in the same staff and voice. Right?

Sorry for the many questions. I just need my code to be as robust as possible.
dorien
 
Posts: 12
Joined: January, 2015
Reputation: 0

Re: start time of note in musicxml

Postby Mogens Lundholm » Mon Feb 02, 2015 3:33 am

Yes "previous note + duration = start time next note". But not for <chord>.

But note the commands <backup ...> and <forward ...> that are used to
go back and forward. The notes need not to be in order at all. Also
voltas and repeat will change the order of notes. Also the <tie ...> command
affects the notes, i.e. a new note is not a new note but just a continuation.
And transpose changes the notes and so on ....

Mogens
Mogens Lundholm
 
Posts: 60
Joined: March, 2014
Reputation: 0

Re: start time of note in musicxml

Postby Michael Good » Mon Feb 02, 2015 11:04 am

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. Notes within a chord can be in different staves and voices. Forward and backup elements can also move the timeline 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/.
Michael Good
VP of MusicXML Technologies
MakeMusic, Inc.
User avatar
Michael Good
 
Posts: 2197
Joined: March, 2014
Reputation: 0

Re: start time of note in musicxml

Postby dorien » Mon Mar 02, 2015 8:53 am

The resulting java parser that I wrote is available here. It stores the start/end/duration times, pitch, etc of each note in a note object.

http://dorienherremans.com/content/easy-way-parse-musicxml-files-java
dorien
 
Posts: 12
Joined: January, 2015
Reputation: 0

Who is online

Users browsing this forum: Google [Bot] and 2 guests

cron