[Stk] MidiFileIn Format 1 problem

Raphaël Tremblay Lessard chlikaflok@gmail.com
Sat, 7 Apr 2007 10:37:13 -0400


Hello fellow subscribers,

I'm a student at the Université du Québec À Chicoutimi (UQAC) and I'm
currently working on a project about sequencing midi files, and I'm
using the STK library and it's MidiFileIn component to do it.

To explain my problem and my question, let me summarize my project in
a few sentences. I wish to make a game that would open a midi file,
ask the player which track he wants to play on his keyboard, and put
it in a "DDR"-like form. I do hope you know Dance Dance Revolution so
that you understand what I'm trying to make, if not, here's a
screenshot from the PC version of it : ScreenShot. It's basically a
game of hitting the scrolling notes at the right time. I'm trying to
do the same but instead of having only 4 arrows, I intend on making a
full 88-keys visual keyboard with notes scrolling and the player has
to play the right note on his keyboard so that he plays the song
appropriately, with the other tracks accompanying him while playing in
the background.

Now, as I understand it, to do this, I must open Format 1 midi files
with your library, because I need the individual instrument tracks so
I can isolate the instrument that I want to be played by the player,
and have the others play by themselves. But whenever I use the
getNextMidiEvent() method using an std::vector<unsigned char>, I get
the following error when it gets to line 300 of MidiFileIn.cpp :
"Debug assertion failed : Expression : Vector subscript out of range"
and the usual stuff that VS gives when there's an error.

My question is this : Am I using the MidiFileIn class incorrectly? If
not, what's wrong? And is there another way to do it that works?

I'm using Visual Studio 2005 on a Windows XP SP2 Machine.

Thank you at least for your time reading this,
Raphaël Tremblay Lessard
Student in Computer Sciences at the UQAC

P.S. If you need more explanations of what my project is so that you
can visualize the problem, I'd be happy to explain in detail.