Working with a strange data type
-
Hey all, I am trying to load and parse a MIDI file in C#. So far, I have been able to read the header and make it to the first track. However, I am now confused. Some values in the file are kept as a variable length format (link to the page I am looking at: MIDI File Format[^]), and I am not sure how to manipulate this. Basically, it shifts bits around like so: C8 (11001000) becomes 8148 (10000001 01001000). The top bit is used to signal that another 7 bits of information follow. So... I guess I need to know how to move the bits back into a format that I can use. Is there a way to handle individual bits in C#?
-
Hey all, I am trying to load and parse a MIDI file in C#. So far, I have been able to read the header and make it to the first track. However, I am now confused. Some values in the file are kept as a variable length format (link to the page I am looking at: MIDI File Format[^]), and I am not sure how to manipulate this. Basically, it shifts bits around like so: C8 (11001000) becomes 8148 (10000001 01001000). The top bit is used to signal that another 7 bits of information follow. So... I guess I need to know how to move the bits back into a format that I can use. Is there a way to handle individual bits in C#?
Maybe this will help. http://www.codeproject.com/csharp/CSBitWiseHelper.asp?df=100&forumid=263394&exp=0&select=1362446[^] http://www.codeproject.com/cs/media/MIDIToolkit.asp[^] http://www.codeproject.com/cs/media/ProjectMIDI.asp[^] -- modified at 20:01 Wednesday 19th September, 2007
-
Maybe this will help. http://www.codeproject.com/csharp/CSBitWiseHelper.asp?df=100&forumid=263394&exp=0&select=1362446[^] http://www.codeproject.com/cs/media/MIDIToolkit.asp[^] http://www.codeproject.com/cs/media/ProjectMIDI.asp[^] -- modified at 20:01 Wednesday 19th September, 2007