Midi Hexadecimal Values
-
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
-
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
-
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
-
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