Using BinaryReader to read a midi file. (.net) -


how use binaryreader read midi file (specifications format here)

i'm using vb.net, i'm willing see other code (mostly c#, can convert it). i'm working on large project , comes bit of speedbump.

here current code:

private function convertchararraytostring(byval chars() char) string     dim treturn string = ""     each v char in chars         treturn &= v     next     return treturn end function  private sub button2_click(byval sender system.object, byval e system.eventargs) handles button2.click     midistatus = "reading..."     dim midistream new streamreader(midifile)     dim nbr new binaryreader(midistream.basestream)     midistatus = "validating midi file..."     dim headera string = convertchararraytostring(nbr.readchars(4))     if not headera = "mthd" return     dim headerb() byte = nbr.readbytes(4)     'get track type     midistatus = "reading header data..."     dim tracktype1 integer = nbr.readint16()     dim tracktype2 integer = nbr.readint16()     msgbox(tracktype1 & tracktype2)  end sub 

everything works find when start reading actual header data. i'm absoultly lost how i'm continue. or code examples nice!

write decoding logic in class, not directly in gui.

define struct midi header, use this set it.


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -