Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Working with a strange data type

Working with a strange data type

Scheduled Pinned Locked Moved C#
tutorialcsharphtmlcomquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Klazen
    wrote on last edited by
    #1

    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#?

    C 1 Reply Last reply
    0
    • K Klazen

      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#?

      C Offline
      C Offline
      ChrisKo 0
      wrote on last edited by
      #2

      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

      K 1 Reply Last reply
      0
      • C ChrisKo 0

        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

        K Offline
        K Offline
        Klazen
        wrote on last edited by
        #3

        Thanks a bunch for the reply. I tried using the first link, but got confused. The last link seems to be very helpful, almost exactly what I need. Thanks again :D

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups