Think your blog does not work with IE yahoo version? Or maybe even most
versions of browsers?
Also links are difficult to locate, all text is grey even links, and
they only get underlined when mouse over them.
Your blog below:
wahloft
This is the blog of wahloft and contains information about software
that I develop, my interests in financial investments, digital
photography, music and other things.
Sunday, October 15, 2006
MIDI module for Python
I have written a win32mdi module for Python quite some time back. Since
then, there had been a lack of activity in continuing the development.
Since Python has already gone to version 2.5, I think it is time to
provide some upgrade. Hence, here is the zip file that contains those
things that you need to play music via the MIDI synthesizer on your
computer. For information on how to use this module, please refer to
the old information located here, until I can find time to update
anything that is missing.
If you like the package, please comment on this post. Thanks.
posted by WAHLOFT at 9:26 AM
0 Comments:
Post a Comment
<< Home
About Me
Name:WAHLOFT
View my complete profile
Previous Posts
testing
--------------------------------------------------------------------------------
Here is all text visable on your blog below:
Now what this module zip file needs is a text file that tells what the
difference is between win32mid.pyc and win32mid2.pyc
And some example programs to show how to use either of these modules.
I am most interested right now in the midi command midioutshortmessage
so I can play the sounds through my sampler rather than the not so good
sounding sounds this music is playing.
Could you post some python code on how to send note on message on
channel 1 note number =60 A c note and play it two or three times.
What I need to start writting my own midi program is how to send the
note on message with one of these modules, and then how to do the time
delay while the note plays, and then turn off the note.
I think I could get everything I need from just looking at a demo like
I describe since I have done this before with other languages writting
midi programs, but just do not know how to make use of win32mid or
win32mid2 and pretty new at programming python code.
print 'Output Device capabilities'
print cap.wMid, cap.wPid, cap.vDriverVersion, cap.szPname
print cap.wTechnology, cap.wVoices, cap.wNotes, cap.wChannelMask,
cap.dwSupport
print 'Input Device capabilities'
icap = MIDIINCAPSA()
midiInGetDevCapsA(0,icap)
print icap.wMid, icap.wPid, icap.vDriverVersion, icap.szPname,
icap.dwSupport
hdr = MIDIHDR()
b = chr(0x90)+chr(0x3C)+chr(0x40)
hdr.lpData = b
hdr.dwBufferLength = 3
hdr.dwRecordedLength = 0
hdr.dwFlags = 0
midiOutPrepareHeader(h,hdr)
print 'Sending long message'
midiOutLongMsg(h,hdr)
midiOutUnprepareHeader(h,hdr)
time.sleep(2)
print midiOutClose(h),'Closed'
#for i in range(10):
# print midiOutGetErrorTextA(i), midiInGetErrorTextA(i)
stout = midiStreamOpen(0,0,0)
print midiOutGetErrorTextA(stout[0])
------X8----cut here----------------------
win32midi2 is created for Python 2.5 using the built-in ctypes.
win32midi was
built using swig, for 2.4 and older version.
I'll take your advice to modify my blog to make it easier to nagivate
when I can
spare some time.