MIDI extensions (WIN32, Mac)?
Paul Winkler
slinkp23 at yahoo.com
Tue Feb 6 02:54:51 EST 2001
Richard Dobson wrote:
(snip)
> I want to be
> able to at least write MIDI messages to the MIDI OUT port, and hopefully
> to be able to read them from MIDI IN too. Then I could write a simple
> MIDI filter in Python which would, for example, receive live note data
> from MIDI IN, transpose it by some interval, and ouptut the result.
Hi Richard, fancy meeting you here.
I'm afraid I have no idea how to get access to midi devices in Windows
or Mac.
You may want to look at this guy's project:
http://quitte.de/midithing.html
In Linux it's easy to read or write raw midi data:
input = open('/dev/midi00', 'r')
output = open('/dev/midi01', 'w')
while 1:
some_notes = MidiBytes(input.read())
for foo in some_notes:
foo.transpose(5.0)
foo.channel = foo.channel + 1
output.write(some_notes)
output.flush()
Implementing the MidiByte class and guessing what the methods would do
is left as an exercise to the reader. Don't ask me, I just made them
up.
Also I should say that I have not tested output because I don't have
any external synths. I have read midi input from a keyboard and
printed information about it. Didn't get much farther than that - MIDI
isn't a big interest of mine.
Good luck,
PW
................. paul winkler ..................
slinkP arts: music, sound, illustration, design, etc.
web page: http://www.slinkp.com
A member of ARMS: http://www.reacharms.com
More information about the Python-list
mailing list