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 / C++ / MFC
  4. Midi Hexadecimal Values

Midi Hexadecimal Values

Scheduled Pinned Locked Moved C / C++ / MFC
question
4 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.
  • M Offline
    M Offline
    mavgoose
    wrote on last edited by
    #1

    I have programed a application which has a on screen keyboard which plays all the piano notes when the button is pressed but i was wondering is there a way of making the keyboard sound different musical instruments when the keys are pressed? I have used hexadecimal values for the normal piano keys. Any suggestions would be welcome. Mav

    S 1 Reply Last reply
    0
    • M mavgoose

      I have programed a application which has a on screen keyboard which plays all the piano notes when the button is pressed but i was wondering is there a way of making the keyboard sound different musical instruments when the keys are pressed? I have used hexadecimal values for the normal piano keys. Any suggestions would be welcome. Mav

      S Offline
      S Offline
      Steve S
      wrote on last edited by
      #2

      You need to send a program (or patch) change for the channel to select a new instrument. GM says that a piano is program#1, for example. Steve S

      M 1 Reply Last reply
      0
      • S Steve S

        You need to send a program (or patch) change for the channel to select a new instrument. GM says that a piano is program#1, for example. Steve S

        M Offline
        M Offline
        mavgoose
        wrote on last edited by
        #3

        Any Ideas on how to go about doing it? Or where best to look. Mav

        S 1 Reply Last reply
        0
        • M mavgoose

          Any Ideas on how to go about doing it? Or where best to look. Mav

          S Offline
          S Offline
          Steve S
          wrote on last edited by
          #4

          Well, presumably, you're sending NOTE ON/NOTE OFF messages at the moment. 1001nnnn 0kkkkkkk Note On event. 0vvvvvvv 1000nnnn 0kkkkkkk Note Off event. 0vvvvvvv where nnnn is 0-15, being the MIDI channel number. You should be able to change to a different patch by sending 1100nnnn 0ppppppp ppppppp is your patch number, less one; where 1 = Acoustic Piano, 15 is Tubular Bells, 22 is Accordion. Check out this[^]for a list of patches, assuming your MIDI target device is GM compatible. You don't say how you're sending the messages; If you're using midiOutShortMsg, then you need something like: 0x0000CnPP as the data to send, where n is your channel, and PP is your patch (0..126 or 0-7E in hex) Hope that helps. Steve S

          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