Re: [pygame] controlled midi playback

2008-01-02 Thread [EMAIL PROTECTED]
thanks! it works great! :)

the next step for my project is figuring out the best way to read midi files
but this shouldn't be that hard... i found some specifications and example
code already.

On 1/2/08, Lenard Lindstrom <[EMAIL PROTECTED]> wrote:
>
> Here it is.
>
> Lenard
>
>
> [EMAIL PROTECTED] wrote:
> > thanks, i will keep trying to compile it considering your tips but it
> > would be nice if i could test your pypm.pyd in the meantime!
> >
>
>
>


Re: [pygame] controlled midi playback

2008-01-02 Thread [EMAIL PROTECTED]
thanks, i will keep trying to compile it considering your tips but it would
be nice if i could test your pypm.pyd in the meantime!

On 1/2/08, Lenard Lindstrom <[EMAIL PROTECTED]> wrote:
>
> I guess it is getting late. LIBCMT.LIB is one version of the VC 6.0 C
> library, so apparently isn't present in VC 7.1. I expect uuid.lib is
> still be available. I am not so sure about OLDNAMES.LIB, but then you
> did not mention a LNK1104 for it so I assume it is also available. So
> try replacing line 34 in setup.py with the following two lines:
>
>  libraries = ["portmidi", "winmm", "porttime"],
>  extra_link_args = ["NODEFAULTLIB:LIBCMT"])
>
> If it the linker complains about an invalid argument try adding a
> forward slash "/" before NODEFAULTLIB.
>
> Lenard
>
>
> Lenard Lindstrom wrote:
> > Python 2.5 extensions are compiled on Windows with vctoolkit2003 by
> > default. It is the same compiler used on Python 2.5. When I compile
> > with MinGW I get these warnings:
> >
> > Warning: .drectve `-defaultlib:LIBCMT ' unrecognized
> > Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized
> > Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
> > Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
> > Warning: .drectve `-defaultlib:LIBCMT ' unrecognized
> > Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized
> > Warning: .drectve `-defaultlib:LIBCMT ' unrecognized
> > Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized
> > Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
> > Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
> > Warning: .drectve `-defaultlib:LIBCMT ' unrecognized
> > Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized
> >
> > which appear to be related to the libraries portmidi.lib and
> > porttime.lib. Maybe the VC linker can ignore -defaultlib directives in
> > a library. I find there is a /NODEFAULTLIB:library linker option.
> > Maybe add something like the following to setup.py after libraries =
> > [] for win32:
> >
> >  extra_link_args=["NODEFAULTLIB:LIBCMT",
> > "NODEFAULTLIB:OLDNAMES", "NODEFAULTLIB:uuid.lib"]
> >
> > Or try running vcvars32.bat (is there one for the 2003 toolkit) before
> > executing setup.py.
> >
> > If you wish you may try the pypm.pyd I compiled MinGW. It links to
> > msvcr71.dll, which is the big issue with Python 2.5, and works with my
> > small test program.
> >
> >
> > Lenard
> >
> >
> > [EMAIL PROTECTED] wrote:
> >> that fixed the pyrex problem. i have the .c file now but there is
> >> another problem i ran into.
> >>
> >> i tried to use code::blocks and the vctoolkit2003 to compile the
> >> extension. i get this error message: fatal error LNK1104: cannot open
> >> file 'LIBCMTD.LIB'
> >>
> >> maybe you can give me another tip?
> >>
> >> what compiler did python 2.5 for windows get compiled with? i read
> >> somewhere that it can get messy if you don't use the same compiler
> >> for extensions.
> >>
>
>


Re: [pygame] controlled midi playback

2008-01-01 Thread Lenard Lindstrom
I guess it is getting late. LIBCMT.LIB is one version of the VC 6.0 C 
library, so apparently isn't present in VC 7.1. I expect uuid.lib is 
still be available. I am not so sure about OLDNAMES.LIB, but then you 
did not mention a LNK1104 for it so I assume it is also available. So 
try replacing line 34 in setup.py with the following two lines:


 libraries = ["portmidi", "winmm", "porttime"],
 extra_link_args = ["NODEFAULTLIB:LIBCMT"])

If it the linker complains about an invalid argument try adding a 
forward slash "/" before NODEFAULTLIB.


Lenard


Lenard Lindstrom wrote:
Python 2.5 extensions are compiled on Windows with vctoolkit2003 by 
default. It is the same compiler used on Python 2.5. When I compile 
with MinGW I get these warnings:


Warning: .drectve `-defaultlib:LIBCMT ' unrecognized
Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized
Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
Warning: .drectve `-defaultlib:LIBCMT ' unrecognized
Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized
Warning: .drectve `-defaultlib:LIBCMT ' unrecognized
Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized
Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
Warning: .drectve `-defaultlib:LIBCMT ' unrecognized
Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized

which appear to be related to the libraries portmidi.lib and 
porttime.lib. Maybe the VC linker can ignore -defaultlib directives in 
a library. I find there is a /NODEFAULTLIB:library linker option. 
Maybe add something like the following to setup.py after libraries =  
[] for win32:


 extra_link_args=["NODEFAULTLIB:LIBCMT", 
"NODEFAULTLIB:OLDNAMES", "NODEFAULTLIB:uuid.lib"]


Or try running vcvars32.bat (is there one for the 2003 toolkit) before 
executing setup.py.


If you wish you may try the pypm.pyd I compiled MinGW. It links to 
msvcr71.dll, which is the big issue with Python 2.5, and works with my 
small test program.



Lenard


[EMAIL PROTECTED] wrote:
that fixed the pyrex problem. i have the .c file now but there is 
another problem i ran into.
 
i tried to use code::blocks and the vctoolkit2003 to compile the 
extension. i get this error message: fatal error LNK1104: cannot open 
file 'LIBCMTD.LIB'
 
maybe you can give me another tip?
 
what compiler did python 2.5 for windows get compiled with? i read 
somewhere that it can get messy if you don't use the same compiler 
for extensions.
 




Re: [pygame] controlled midi playback

2008-01-01 Thread Lenard Lindstrom
Python 2.5 extensions are compiled on Windows with vctoolkit2003 by 
default. It is the same compiler used on Python 2.5. When I compile with 
MinGW I get these warnings:


Warning: .drectve `-defaultlib:LIBCMT ' unrecognized
Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized
Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
Warning: .drectve `-defaultlib:LIBCMT ' unrecognized
Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized
Warning: .drectve `-defaultlib:LIBCMT ' unrecognized
Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized
Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
Warning: .drectve `-defaultlib:LIBCMT ' unrecognized
Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized

which appear to be related to the libraries portmidi.lib and 
porttime.lib. Maybe the VC linker can ignore -defaultlib directives in a 
library. I find there is a /NODEFAULTLIB:library linker option. Maybe 
add something like the following to setup.py after libraries =  [] 
for win32:


 extra_link_args=["NODEFAULTLIB:LIBCMT", 
"NODEFAULTLIB:OLDNAMES", "NODEFAULTLIB:uuid.lib"]


Or try running vcvars32.bat (is there one for the 2003 toolkit) before 
executing setup.py.


If you wish you may try the pypm.pyd I compiled MinGW. It links to 
msvcr71.dll, which is the big issue with Python 2.5, and works with my 
small test program.



Lenard


[EMAIL PROTECTED] wrote:
that fixed the pyrex problem. i have the .c file now but there is 
another problem i ran into.
 
i tried to use code::blocks and the vctoolkit2003 to compile the 
extension. i get this error message: fatal error LNK1104: cannot open 
file 'LIBCMTD.LIB'
 
maybe you can give me another tip?
 
what compiler did python 2.5 for windows get compiled with? i read 
somewhere that it can get messy if you don't use the same compiler for 
extensions.
 
On 1/2/08, *Lenard Lindstrom* <[EMAIL PROTECTED] 
> wrote:


Yeah. To make Pyrex compatible with C++ enumerations are no longer
treated as integers, though assignment of an enumeration to an
integer
is still allowd. Not accepting an enumeration as a boolean value
may be
a bug. I would have to check. But then again it makes some sense. Just
edit line 357 to be:


   while(Pm_Poll(self.midi) != pmNoError):


[EMAIL PROTECTED]  wrote:
> awesome! :) thanks a lot...
>
> now i only have to get pyportmidi compiled for python 2.5. i get
this
> pyrex error:
> pypm.pyx:357:21: Type 'PmError' not acceptable as a boolean
>
> do you have an idea what causes this?
>
> On 1/1/08, *Lenard Lindstrom* <[EMAIL PROTECTED]

> >> wrote:
>
> This was something I put together to see if pygame and
PyPortMidi
> would
> get along. They do. It is very simple. You can use the
keyboard or
> the
> mouse to play a four note pipe organ.
>
> Lenard
>
>
> [EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED]>> wrote:
> > thanks!
> >
> > and does anyone know if there are examples somewhere? like
a simple
> > program which allows you to play a midi instrument (best
using the
> > integrated synthesizer on the sound card) with the computer
> keyboard?
> >
> >
> > On 1/1/08, *Lenard Lindstrom* < [EMAIL PROTECTED]

> >
> > 
 >
> > Try http://alumni.media.mit.edu/~harrison/code.html

> < http://alumni.media.mit.edu/%7Eharrison/code.html>
> > 
> >
> > Lenard
> >
> > [EMAIL PROTECTED] 
>
> mailto:[EMAIL PROTECTED]> >> wrote:
> > > thanks!
> > > http://sound.media.mit.edu/~harrison/pyportmidi/

> 
> > < http://sound.media.mit.edu/%7Eharrison/pyportmidi/>
> > > < http://sound.media.mit.edu/%7Eharrison/pyportmidi/>
> > > it sounds like it is what i need but unfortunately
it doesn't
> > seem to
> > > be available anymore...
> > >
> > > On 1/1/08, *Lenard Lindstrom* <[EMAIL 

Re: [pygame] controlled midi playback

2008-01-01 Thread [EMAIL PROTECTED]
that fixed the pyrex problem. i have the .c file now but there is another
problem i ran into.

i tried to use code::blocks and the vctoolkit2003 to compile the extension.
i get this error message: fatal error LNK1104: cannot open file 'LIBCMTD.LIB
'

maybe you can give me another tip?

what compiler did python 2.5 for windows get compiled with? i read somewhere
that it can get messy if you don't use the same compiler for extensions.

On 1/2/08, Lenard Lindstrom <[EMAIL PROTECTED]> wrote:
>
> Yeah. To make Pyrex compatible with C++ enumerations are no longer
> treated as integers, though assignment of an enumeration to an integer
> is still allowd. Not accepting an enumeration as a boolean value may be
> a bug. I would have to check. But then again it makes some sense. Just
> edit line 357 to be:
>
>
>while(Pm_Poll(self.midi) != pmNoError):
>
>
> [EMAIL PROTECTED] wrote:
> > awesome! :) thanks a lot...
> >
> > now i only have to get pyportmidi compiled for python 2.5. i get this
> > pyrex error:
> > pypm.pyx:357:21: Type 'PmError' not acceptable as a boolean
> >
> > do you have an idea what causes this?
> >
> > On 1/1/08, *Lenard Lindstrom* <[EMAIL PROTECTED]
> > > wrote:
> >
> > This was something I put together to see if pygame and PyPortMidi
> > would
> > get along. They do. It is very simple. You can use the keyboard or
> > the
> > mouse to play a four note pipe organ.
> >
> > Lenard
> >
> >
> > [EMAIL PROTECTED]  wrote:
> > > thanks!
> > >
> > > and does anyone know if there are examples somewhere? like a
> simple
> > > program which allows you to play a midi instrument (best using the
> > > integrated synthesizer on the sound card) with the computer
> > keyboard?
> > >
> > >
> > > On 1/1/08, *Lenard Lindstrom* < [EMAIL PROTECTED]
> > 
> > > >> wrote:
> > >
> > > Try http://alumni.media.mit.edu/~harrison/code.html
> > 
> > > 
> > >
> > > Lenard
> > >
> > > [EMAIL PROTECTED] 
> > > wrote:
> > > > thanks!
> > > > http://sound.media.mit.edu/~harrison/pyportmidi/
> > 
> > > 
> > > > < http://sound.media.mit.edu/%7Eharrison/pyportmidi/>
> > > > it sounds like it is what i need but unfortunately it
> doesn't
> > > seem to
> > > > be available anymore...
> > > >
> > > > On 1/1/08, *Lenard Lindstrom* <[EMAIL PROTECTED]
> > 
> > > >
> > > > mailto:[EMAIL PROTECTED]>
> >  > > >
> > > > [EMAIL PROTECTED] 
> > mailto:[EMAIL PROTECTED]>>
> > > 
> > >>
> wrote:
> > > > > hi,
> > > > >
> > > > > i have a midi song (not polyphonic) and want to play
> > back
> > > one note
> > > > > after another triggered by key presses. what would
> > be the best
> > > > way to
> > > > > do this? i guess i can't directly do this with
> > pygame but
> > > i need
> > > > some
> > > > > midi library? does anyone know which one would be
> > suited
> > > for that
> > > > > (ideally it should work in linux and windows)? has
> > anyone
> > > tried to
> > > > > do something similar?
> > > > Check out the Python music page:
> > > >
> > > > http://wiki.python.org/moin/PythonInMusic
> > > >  > >
> > > >
> > > > Of the various midi packages PyPortMidi is still
> > available.
> > > >
> > >
> > >
> >
> >
> >
>
>


Re: [pygame] controlled midi playback

2008-01-01 Thread Lenard Lindstrom
Yeah. To make Pyrex compatible with C++ enumerations are no longer 
treated as integers, though assignment of an enumeration to an integer 
is still allowd. Not accepting an enumeration as a boolean value may be 
a bug. I would have to check. But then again it makes some sense. Just 
edit line 357 to be:



   while(Pm_Poll(self.midi) != pmNoError):


[EMAIL PROTECTED] wrote:

awesome! :) thanks a lot...
 
now i only have to get pyportmidi compiled for python 2.5. i get this 
pyrex error:

pypm.pyx:357:21: Type 'PmError' not acceptable as a boolean
 
do you have an idea what causes this?
 
On 1/1/08, *Lenard Lindstrom* <[EMAIL PROTECTED] 
> wrote:


This was something I put together to see if pygame and PyPortMidi
would
get along. They do. It is very simple. You can use the keyboard or
the
mouse to play a four note pipe organ.

Lenard


[EMAIL PROTECTED]  wrote:
> thanks!
>
> and does anyone know if there are examples somewhere? like a simple
> program which allows you to play a midi instrument (best using the
> integrated synthesizer on the sound card) with the computer
keyboard?
>
>
> On 1/1/08, *Lenard Lindstrom* < [EMAIL PROTECTED]

> >> wrote:
>
> Try http://alumni.media.mit.edu/~harrison/code.html

> 
>
> Lenard
>
> [EMAIL PROTECTED] 
> wrote:
> > thanks!
> > http://sound.media.mit.edu/~harrison/pyportmidi/

> 
> > < http://sound.media.mit.edu/%7Eharrison/pyportmidi/>
> > it sounds like it is what i need but unfortunately it doesn't
> seem to
> > be available anymore...
> >
> > On 1/1/08, *Lenard Lindstrom* <[EMAIL PROTECTED]

> >
> > mailto:[EMAIL PROTECTED]>
 >
> > [EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED]>>
> 
>> wrote:
> > > hi,
> > >
> > > i have a midi song (not polyphonic) and want to play
back
> one note
> > > after another triggered by key presses. what would
be the best
> > way to
> > > do this? i guess i can't directly do this with
pygame but
> i need
> > some
> > > midi library? does anyone know which one would be
suited
> for that
> > > (ideally it should work in linux and windows)? has
anyone
> tried to
> > > do something similar?
> > Check out the Python music page:
> >
> > http://wiki.python.org/moin/PythonInMusic
> > >
> >
> > Of the various midi packages PyPortMidi is still
available.
> >
>
>







Re: [pygame] controlled midi playback

2008-01-01 Thread [EMAIL PROTECTED]
awesome! :) thanks a lot...

now i only have to get pyportmidi compiled for python 2.5. i get this pyrex
error:
pypm.pyx:357:21: Type 'PmError' not acceptable as a boolean

do you have an idea what causes this?

On 1/1/08, Lenard Lindstrom <[EMAIL PROTECTED]> wrote:
>
> This was something I put together to see if pygame and PyPortMidi would
> get along. They do. It is very simple. You can use the keyboard or the
> mouse to play a four note pipe organ.
>
> Lenard
>
>
> [EMAIL PROTECTED] wrote:
> > thanks!
> >
> > and does anyone know if there are examples somewhere? like a simple
> > program which allows you to play a midi instrument (best using the
> > integrated synthesizer on the sound card) with the computer keyboard?
> >
> >
> > On 1/1/08, *Lenard Lindstrom* <[EMAIL PROTECTED]
> > > wrote:
> >
> > Try http://alumni.media.mit.edu/~harrison/code.html
> > 
> >
> > Lenard
> >
> > [EMAIL PROTECTED]  wrote:
> > > thanks!
> > > http://sound.media.mit.edu/~harrison/pyportmidi/
> > 
> > > 
> > > it sounds like it is what i need but unfortunately it doesn't
> > seem to
> > > be available anymore...
> > >
> > > On 1/1/08, *Lenard Lindstrom* <[EMAIL PROTECTED]
> > 
> > > >> wrote:
> > >
> > > [EMAIL PROTECTED] 
> > > wrote:
> > > > hi,
> > > >
> > > > i have a midi song (not polyphonic) and want to play back
> > one note
> > > > after another triggered by key presses. what would be the
> best
> > > way to
> > > > do this? i guess i can't directly do this with pygame but
> > i need
> > > some
> > > > midi library? does anyone know which one would be suited
> > for that
> > > > (ideally it should work in linux and windows)? has anyone
> > tried to
> > > > do something similar?
> > > Check out the Python music page:
> > >
> > > http://wiki.python.org/moin/PythonInMusic
> > > 
> > >
> > > Of the various midi packages PyPortMidi is still available.
> > >
> >
> >
>
>
>


Re: [pygame] controlled midi playback

2008-01-01 Thread [EMAIL PROTECTED]
thanks!

and does anyone know if there are examples somewhere? like a simple program
which allows you to play a midi instrument (best using the integrated
synthesizer on the sound card) with the computer keyboard?


On 1/1/08, Lenard Lindstrom <[EMAIL PROTECTED]> wrote:
>
> Try http://alumni.media.mit.edu/~harrison/code.html
>
> Lenard
>
> [EMAIL PROTECTED] wrote:
> > thanks!
> > http://sound.media.mit.edu/~harrison/pyportmidi/
> > 
> > it sounds like it is what i need but unfortunately it doesn't seem to
> > be available anymore...
> >
> > On 1/1/08, *Lenard Lindstrom* <[EMAIL PROTECTED]
> > > wrote:
> >
> > [EMAIL PROTECTED]  wrote:
> > > hi,
> > >
> > > i have a midi song (not polyphonic) and want to play back one note
> > > after another triggered by key presses. what would be the best
> > way to
> > > do this? i guess i can't directly do this with pygame but i need
> > some
> > > midi library? does anyone know which one would be suited for that
> > > (ideally it should work in linux and windows)? has anyone tried to
> > > do something similar?
> > Check out the Python music page:
> >
> > http://wiki.python.org/moin/PythonInMusic
> > 
> >
> > Of the various midi packages PyPortMidi is still available.
> >
>
>


Re: [pygame] controlled midi playback

2008-01-01 Thread Lenard Lindstrom

Try http://alumni.media.mit.edu/~harrison/code.html

Lenard

[EMAIL PROTECTED] wrote:

thanks!
http://sound.media.mit.edu/~harrison/pyportmidi/ 

it sounds like it is what i need but unfortunately it doesn't seem to 
be available anymore...
 
On 1/1/08, *Lenard Lindstrom* <[EMAIL PROTECTED] 
> wrote:


[EMAIL PROTECTED]  wrote:
> hi,
>
> i have a midi song (not polyphonic) and want to play back one note
> after another triggered by key presses. what would be the best
way to
> do this? i guess i can't directly do this with pygame but i need
some
> midi library? does anyone know which one would be suited for that
> (ideally it should work in linux and windows)? has anyone tried to
> do something similar?
Check out the Python music page:

http://wiki.python.org/moin/PythonInMusic


Of the various midi packages PyPortMidi is still available.





Re: [pygame] controlled midi playback

2008-01-01 Thread [EMAIL PROTECTED]
thanks!
http://sound.media.mit.edu/~harrison/pyportmidi/
it sounds like it is what i need but unfortunately it doesn't seem to be
available anymore...

On 1/1/08, Lenard Lindstrom <[EMAIL PROTECTED]> wrote:
>
> [EMAIL PROTECTED] wrote:
> > hi,
> >
> > i have a midi song (not polyphonic) and want to play back one note
> > after another triggered by key presses. what would be the best way to
> > do this? i guess i can't directly do this with pygame but i need some
> > midi library? does anyone know which one would be suited for that
> > (ideally it should work in linux and windows)? has anyone tried to
> > do something similar?
> Check out the Python music page:
>
> http://wiki.python.org/moin/PythonInMusic
>
> Of the various midi packages PyPortMidi is still available.
>
> --
> Lenard Lindstrom
> <[EMAIL PROTECTED]>
>
>


Re: [pygame] controlled midi playback

2007-12-31 Thread Lenard Lindstrom

[EMAIL PROTECTED] wrote:

hi,
 
i have a midi song (not polyphonic) and want to play back one note 
after another triggered by key presses. what would be the best way to 
do this? i guess i can't directly do this with pygame but i need some 
midi library? does anyone know which one would be suited for that 
(ideally it should work in linux and windows)? has anyone tried to 
do something similar?

Check out the Python music page:

http://wiki.python.org/moin/PythonInMusic

Of the various midi packages PyPortMidi is still available.

--
Lenard Lindstrom
<[EMAIL PROTECTED]>