by Mogens Lundholm » Fri Jul 10, 2015 12:39 pm
Hello Dr John
What are your needs? Do you want to write your own program or do you just
need to create the data and use your time for further processing?
I made a program that can save all start times for the notes. This of cause done
for my own tests. Here is what my program generates in test mode activated by the
command:
MidiAndMusicXmlPlayer.exe MusicFile.xml -T
The time division index is shown before the colon. After the colon the note
changes are written, separated by space.
0:+C
1:-C +E
2:-E +G
3:-G +C
4:-C
Explanation: +C means start of C-note at time division 0, -C means stop of
C-note at time division 1. Sharp and flat notes are indicated with +/- after
the note, e.g. +C+ (start C-sharp). The data is saved in files for each part.
If you want to you use your time with the further processing, you can use my
program which can be downloaded from programfabriken.com
You may need to have the octave shown, f.x. as +5C and also the value of
divisions. If you are interested, I can change that easily.
Other people has written about this in this forum with the same problem. They
made their own programs and scripts and I think they all did it free and open.
Maybe you can find some help there.
The basic algorithm in my program is explained below - placing all data in an
array suited for conversion to midi. The above data is a dump of the data
in this array.
Kind regards
Mogens
___________________________________________
My basic principle is:
The MusicXML file is divided in parts. The Midi-file is divided in tracks
(format 1). Each part in MusicXML becomes a Midi track.
My program has a state machine, which reads the MusicXML file and saves data
in a array with an element for every time division. This array is called NoteInfo.
Each element in NoteInfo is a record/structure of three sets. One set of notes
to start at this time division (NoteOn), one set of notes to stop at this time
division (NoteOff) and one set for notes to continue (NoteContinue). All notes
has a duration value in time divisions (command <duration>), but can be
tied - then the note is added to the continue-set and prolonged later when the
tied note continues.
The index to the NoteInfo-array is stepped forward with the value of duration
of each note, but the previous index if saved - for chord-notes. The index
may be changed backward and forward by the commands <backup> and <forward>.
(Simplified - a lot of things makes it more complicated but ...)
- Attachments
-
Fire.xml
- (4.17 KB) Downloaded 641 times
-

- TilMusicXML.jpg (5.26 KB) Viewed 7091 times