Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsShowcase → midi prog
midi prog
2007-03-18, 1:44 AM #1
i finally bought me a midi keyboard last week to use with fl studio. although i cant play the keyboard, it still helps to get melodies and timing out. ive made this with it so far
[mp3]http://binarydemons.com/~strike/files/dnbpor.mp3[/mp3]


i decided to write a game, stealing the design from DDR and its variations, but instead to learn how to play the keyboard (VS learning how to stomp your feet :rolleyes: ). essentially you will be able to load midi files and select an instrument you want to fill in for; the midi keyboard playing notes from the selected instrument. the program will also be set up to accept the pc keyboard.

i just finished midi file loading today and got it playing tunez. the tempo is hard coded, though, until i figure out this damnable SMPTE timecode business.. the app is set up to show names of playing instruments.
nothing terribly impressive, but im happy the midi code worked on first try, and u might as well check it out since its a puny download (it IS midi, after all ;) )
http://binarydemons.com/~strike/files/piano.rar

source code (no stealin my true-type bitmap font generation code now..)
http://binarydemons.com/~strike/files/piano.c.txt
[ B A H ]
Bad *** by nature,
Hackers by choice
2007-03-18, 11:17 AM #2
Do the monkey island themesong.
DO IT!
2007-03-18, 11:40 AM #3
whoa, the tempo is off the charts
2007-03-18, 1:38 PM #4
Originally posted by ragna:
whoa, the tempo is off the charts


Code:
	// broken haxx
	timestamp = (unsigned long)(m->time*1000.0f + 0.5f);



that 1000 was a random guess. like i said before, i still need to figure out the midi timecode stuff. they represent the tempo as "microseconds per quarter note", which isnt too hard to figure out, but negative values correspond to some whack frame/subframe scheme that confuses me a little ;)

thats only half of it too.. thats how the timestamps are represented, but the actual song speed is further affected by the tempo and time signature meta events (which i currently ignore).. fun stuff.. :P


edit: its also possible the playback speed could be horrendously skewed if you are running a multi-processor machine. im getting the clocktick count of the processor and dividing by processor frequency in order to get extremely precise timing values; however if windows decides to throw the thread on the other processor the timestamp values will not be relative to each other and the song could potentially skip ahead or behind by a cosmic length of time :D
[ B A H ]
Bad *** by nature,
Hackers by choice
2007-03-20, 7:59 PM #5
UPDATES

added drum view, which is really freakin cool and will be part of the actual game. little symbols light up on drum hits; and they are even sensitive to the velocity of the hit :)

check it out again and at least wait for the drums to kick in :neckbeard:

original links updated but here they are again:

executable
http://binarydemons.com/~strike/files/piano.rar

source
http://binarydemons.com/~strike/files/piano.c.txt
[ B A H ]
Bad *** by nature,
Hackers by choice

↑ Up to the top!