Wednesday, April 14, 2010

Implementing a midi player

Hi everybody,

we have arrived at the crucial question: how to implement a midi player? Well,'s not so simple..Why this? Because Karontux won't run on a real-time kernel, so we have to be careful and think that SO scheduler won't give all time our player needs. We didn't think this when we developed the first version of player: in fact when I opened the browser or launched Skype while program was running, music wasn't played with the right tempo. The algorithm structure was similar this:

While currentTick is below tickNum
 Take currentTick message
 Send message to the information manager
 Wait tickTime

Now we are developing another version of player, where we follow the timeline and discard all late messages if these ones are note-on types: types like this are the least important (not consider a note-off, a tempo-change or a program-change message is unacceptable) and about 70-80% of messages in a midi file are note-on. This approach seems resolve our issue, but now is too soon for more details: we are still in developing phase.. :)

::See you next post::

No comments:

Post a Comment