python - Invalid MIDI message Data when I'm trying to send Control Change Messages -


i'm using pygame.midi library send midi messages (control change messages, not notes). idea send output (from python program) input of program.

>>> import time >>> import pygame.midi midi >>> midiout = midi.output(3) >>> midi.init() >>> midiout = midi.output(3) >>> midiout.write_short(0x74,124,0) portmidi call failed...   portmidi: `invalid midi message data' type enter... 

as can see, i'm sending 0x74,124,0. i'm taking numbers rakarrack (the application want control) implementation chart: http://rakarrack.sourceforge.net/midiic.html

what doing wrong?

midi status bytes (the first byte of message) must have high (0x80) bit set. linked chart bit confusing, i'm guessing 0x74 data byte , must preceded proper status byte.

>>> import pygame.midi midi >>> midi.init() >>> midiout = midi.output(0) >>> midiout.write_short(0xb0, 0x74, 124) 

some basic midi documentation: http://www.midi.org/techspecs/midimessages.php

control change 0xbn, n channel number, 0xb0 control change message channel 0.


Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -