Re: [pygame] pygame.midi using portmidi?

2009-06-01 Thread René Dudfield
hi again,

Concerning midi...  I've added a close() method to Input and Output,
and an abort() method to Output.  close() lets any midi messages you
have sent through get sent, and abort tries to stop the connection
right away.  I've made it so that abort is not called on the
__dealloc__, only close is.

I asked on the port midi mailing list, and apparently Pm_Abort is not
used all that much, and isn't implemented on linux alsa.  So now
people will have to explicitly call abort() if they want it to close
right away... otherwise it might wait around to send off the rest of
the midi messages in the buffer.

Also made it so that after pygame.midi.quit() the class instances
remaining raise a MidiException, rather than calling the portmidi die
code.



cu,


On Sun, May 31, 2009 at 10:18 AM, René Dudfield ren...@gmail.com wrote:
 On Sat, May 30, 2009 at 8:41 PM, Brian Fisher br...@hamsterrepublic.com 
 wrote:
 since you mentioned the build page - power company turned off power to my
 neighborhood for a day, and the mac didn't auto power back on (anybody know
 if you can set a mac to do that?), while my PC seems to have had some part
 of it fried.


 ah, bugger.  I hate it when the magic smoke comes out.  I wish I could
 email you some spare parts from two pcs I have that I don't really
 need any more.

 my old pc used to die after power outages... unplugging the power
 cable from the motherboard and plugging it back in seemed to do the
 trick.  Some sort of weird reset thing happened.


 I found this note about auto start for Macs:
 the Energy Saver preference pane and check the box for RESTART
 AUTOMATICALLY AFTER POWER FAILURE ...



Re: [pygame] pygame.midi using portmidi?

2009-06-01 Thread René Dudfield
Cool.  the build page is back up for windows!  I guess that machine
has risen from the grave.


Now the sysfont tests pass on OSX.  The midi tests pass, all except
for on python2.4 on windows.

I think that 2.4 build still has the debug build of port midi - since
the results are dying.

Rather than the new prebuilts from here:
http://www3.telus.net/len_l/pygame/prebuilt-pygame1.9.0-msvcr71-win32.zip


cu,



On Mon, Jun 1, 2009 at 9:12 PM, René Dudfield ren...@gmail.com wrote:
 hi again,

 Concerning midi...  I've added a close() method to Input and Output,
 and an abort() method to Output.  close() lets any midi messages you
 have sent through get sent, and abort tries to stop the connection
 right away.  I've made it so that abort is not called on the
 __dealloc__, only close is.

 I asked on the port midi mailing list, and apparently Pm_Abort is not
 used all that much, and isn't implemented on linux alsa.  So now
 people will have to explicitly call abort() if they want it to close
 right away... otherwise it might wait around to send off the rest of
 the midi messages in the buffer.

 Also made it so that after pygame.midi.quit() the class instances
 remaining raise a MidiException, rather than calling the portmidi die
 code.



 cu,


 On Sun, May 31, 2009 at 10:18 AM, René Dudfield ren...@gmail.com wrote:
 On Sat, May 30, 2009 at 8:41 PM, Brian Fisher br...@hamsterrepublic.com 
 wrote:
 since you mentioned the build page - power company turned off power to my
 neighborhood for a day, and the mac didn't auto power back on (anybody know
 if you can set a mac to do that?), while my PC seems to have had some part
 of it fried.


 ah, bugger.  I hate it when the magic smoke comes out.  I wish I could
 email you some spare parts from two pcs I have that I don't really
 need any more.

 my old pc used to die after power outages... unplugging the power
 cable from the motherboard and plugging it back in seemed to do the
 trick.  Some sort of weird reset thing happened.


 I found this note about auto start for Macs:
 the Energy Saver preference pane and check the box for RESTART
 AUTOMATICALLY AFTER POWER FAILURE ...




Re: [pygame] pygame.midi using portmidi?

2009-05-30 Thread René Dudfield
hi,

just added the OSX fallback in case fc-list doesn't exist.

Hopefully that should pass those tests on the build page, when it comes back up.


cu,


Re: [pygame] pygame.midi using portmidi?

2009-05-30 Thread Brian Fisher
since you mentioned the build page - power company turned off power to my
neighborhood for a day, and the mac didn't auto power back on (anybody know
if you can set a mac to do that?), while my PC seems to have had some part
of it fried.


On Sat, May 30, 2009 at 12:25 AM, René Dudfield ren...@gmail.com wrote:


 Hopefully that should pass those tests on the build page, when it comes
 back up.




Re: [pygame] pygame.midi using portmidi?

2009-05-30 Thread René Dudfield
On Sat, May 30, 2009 at 8:41 PM, Brian Fisher br...@hamsterrepublic.com wrote:
 since you mentioned the build page - power company turned off power to my
 neighborhood for a day, and the mac didn't auto power back on (anybody know
 if you can set a mac to do that?), while my PC seems to have had some part
 of it fried.


ah, bugger.  I hate it when the magic smoke comes out.  I wish I could
email you some spare parts from two pcs I have that I don't really
need any more.

my old pc used to die after power outages... unplugging the power
cable from the motherboard and plugging it back in seemed to do the
trick.  Some sort of weird reset thing happened.


I found this note about auto start for Macs:
the Energy Saver preference pane and check the box for RESTART
AUTOMATICALLY AFTER POWER FAILURE ...


Re: [pygame] pygame.midi using portmidi?

2009-05-29 Thread Lenard Lindstrom

Hi René,

What happens with pygame.midi.get_count()?

Lenard

René Dudfield wrote:

hello again,

btw the tests pass on an OSX box without midi now.

this seems to print stuff to stderr though...

$ python -m pygame.examples.midi --list
in stat: : No such file or directory
in stat: : No such file or directory
in stat: : No such file or directory
in stat: : No such file or directory


Can't track down where it's printing from.



On Wed, May 27, 2009 at 9:23 AM, René Dudfield ren...@gmail.com 
mailto:ren...@gmail.com wrote:




On Wed, May 27, 2009 at 7:28 AM, Lenard Lindstrom le...@telus.net
mailto:le...@telus.net wrote:


This is amazing. Everything is up to rev 2263. How many unit
tests were disabled to get all the builds to pass?

Lenard



hi,

just the midi, and the test_get_fonts + test_match_fonts sys font
tests. 


I've enabled them again... The Spectacularly Adequate Automated
Pygame Build Page squeezed some recent builds out.


cu,






Re: [pygame] pygame.midi using portmidi?

2009-05-29 Thread René Dudfield
On Sat, May 30, 2009 at 2:54 AM, Lenard Lindstrom le...@telus.net wrote:

 Hi René,

 What happens with pygame.midi.get_count()?

 Lenard

You mean on OSX?  I'll check it out for you when I can... my girl
friend is finishing off her paper this weekend... so I can't use it
again this weekend.

On my ubuntu laptop it does:
 import pygame.midi
 pygame.midi.init()
 pygame.midi.get_count()
2


ps.  I got a default font list from an OSX machine... so I'll add them
like how you've added the xp default fonts to sysfont - when the
fc-list executable isn't found.

pps.  Seems The Spectacularly Adequate Automated Pygame Build Page
(TSAAPBP) has stopped updating.


Re: [pygame] pygame.midi using portmidi?

2009-05-29 Thread Lenard Lindstrom

Hi,

René Dudfield wrote:

On Sat, May 30, 2009 at 2:54 AM, Lenard Lindstrom le...@telus.net wrote:
  

Hi René,

What happens with pygame.midi.get_count()?

Lenard



You mean on OSX?  I'll check it out for you when I can... my girl
friend is finishing off her paper this weekend... so I can't use it
again this weekend.

  
I assumed you already had access to OS X to read the error messages. Or 
did you see them on the build page? I was wondering if the Mac errors 
come from pypm.Inititialize() or pypm.CountDevices(). That would narrow 
down where in portmidi the messages are coming from.



On my ubuntu laptop it does:
  

import pygame.midi
pygame.midi.init()
pygame.midi.get_count()


2


ps.  I got a default font list from an OSX machine... so I'll add them
like how you've added the xp default fonts to sysfont - when the
fc-list executable isn't found.

pps.  Seems The Spectacularly Adequate Automated Pygame Build Page
(TSAAPBP) has stopped updating.
  
Yes, unless the system provides a reliable way to list fonts and their 
attributes that is the only way to go. The font file names themselves 
are unhelpful. Windows XP, for instance, has several conventions for 
labeling a ttf file as regular, bold, italic or bold-italic.


Lenard



Re: [pygame] pygame.midi using portmidi?

2009-05-29 Thread René Dudfield
On Sat, May 30, 2009 at 1:48 PM, Lenard Lindstrom le...@telus.net wrote:
 Hi,

 René Dudfield wrote:

 On Sat, May 30, 2009 at 2:54 AM, Lenard Lindstrom le...@telus.net wrote:


 Hi René,

 What happens with pygame.midi.get_count()?

 Lenard


 You mean on OSX?  I'll check it out for you when I can... my girl
 friend is finishing off her paper this weekend... so I can't use it
 again this weekend.



 I assumed you already had access to OS X to read the error messages. Or did
 you see them on the build page? I was wondering if the Mac errors come from
 pypm.Inititialize() or pypm.CountDevices(). That would narrow down where in
 portmidi the messages are coming from.


yeah, I did before.  I'll check that out next time I have access... good idea.


 Yes, unless the system provides a reliable way to list fonts and their
 attributes that is the only way to go. The font file names themselves are
 unhelpful. Windows XP, for instance, has several conventions for labeling a
 ttf file as regular, bold, italic or bold-italic.


indeed.


Re: [pygame] pygame.midi using portmidi?

2009-05-28 Thread René Dudfield
hello again,

btw the tests pass on an OSX box without midi now.

this seems to print stuff to stderr though...

$ python -m pygame.examples.midi --list
in stat: : No such file or directory
in stat: : No such file or directory
in stat: : No such file or directory
in stat: : No such file or directory


Can't track down where it's printing from.



On Wed, May 27, 2009 at 9:23 AM, René Dudfield ren...@gmail.com wrote:



 On Wed, May 27, 2009 at 7:28 AM, Lenard Lindstrom le...@telus.net wrote:


  This is amazing. Everything is up to rev 2263. How many unit tests were
 disabled to get all the builds to pass?

 Lenard



 hi,

 just the midi, and the test_get_fonts + test_match_fonts sys font tests.

 I've enabled them again... The Spectacularly Adequate Automated Pygame
 Build Page squeezed some recent builds out.


 cu,




Re: [pygame] pygame.midi using portmidi?

2009-05-26 Thread Brian Fisher
On Sun, May 24, 2009 at 9:29 PM, René Dudfield ren...@gmail.com wrote:

  I believe Brian doesn't have portmidi.dll installed.
 

 I definitely don't have any separately installed portmidi shared library on
any machine of mine, but I don't think that one is required on OS X or
Windows for proper operation. I think both build bots are getting at the
portmidi library just fine.

Also, as a rule, I think ever requiring a separately installed and managed
library that's not a standard OS component on Win and Mac is the wrong way
to do things. Those platforms don't have package managers and Kernel
components are quite stable, so therefore is both no good way to manage dll
dependencies and there is no benefit to calling out to a shared separately
managed version of portmidi vs. statically linking/including the version we
tested into pygame, respectively.


I think he does have it installed on at least the windows installs.

 My windows build box has portmidi.dll in the prebuilts dir, so if the setup
for making the installer for pygame picks that dll up properly, then it
should be getting that dll just fine.

from the build output, it looks like the problem is
pygame.midi.get_device_info is returning None - I can tell you my build
machines definitely don't have midi devices (neither physical nor virtual)
configured, and None seems an appropriate return value in such cases. Maybe
it's just the tests are bad for a machine with no midi devices?



 Brian, can you confirm if it's installed on the OSX build bots?

 My OS X machine definitely has the static portmidi library (libportmidi.a)
and header file (portmidi.h) in the right places (/usr/local/lib and
/usr/local/include) because they are getting picked up and built in by
config.py. I built libportmidi.a myself, and I know it's the static lib, not
a linking lib for a dylib or .so or anything like that.



 Also, do you know how to compile portmidi on OSX?  I couldn't get it
 to compile on OSX (if you can't remember I'll try and work it out :).

 Yeah, I just used the xcode project under pm_mac and built the static lib
without any problem - note the makefiles don't work on mac, and I didn't try
a .dylib version (cause I don't see any point to doing so) so it may have
problems building. Once I copied the build products to the right place, they
got picked up fine.


Re: [pygame] pygame.midi using portmidi?

2009-05-26 Thread René Dudfield
hello,



On Tue, May 26, 2009 at 4:48 PM, Brian Fisher br...@hamsterrepublic.comwrote:

 On Sun, May 24, 2009 at 9:29 PM, René Dudfield ren...@gmail.com wrote:

  I believe Brian doesn't have portmidi.dll installed.
 

 I definitely don't have any separately installed portmidi shared library
 on any machine of mine, but I don't think that one is required on OS X or
 Windows for proper operation. I think both build bots are getting at the
 portmidi library just fine.

 Also, as a rule, I think ever requiring a separately installed and managed
 library that's not a standard OS component on Win and Mac is the wrong way
 to do things. Those platforms don't have package managers and Kernel
 components are quite stable, so therefore is both no good way to manage dll
 dependencies and there is no benefit to calling out to a shared separately
 managed version of portmidi vs. statically linking/including the version we
 tested into pygame, respectively.



k




 I think he does have it installed on at least the windows installs.

 My windows build box has portmidi.dll in the prebuilts dir, so if the
 setup for making the installer for pygame picks that dll up properly, then
 it should be getting that dll just fine.


Cool.  I think Lenard has made a new prebuilts one that doesn't printf
debugging info.




 from the build output, it looks like the problem is
 pygame.midi.get_device_info is returning None - I can tell you my build
 machines definitely don't have midi devices (neither physical nor virtual)
 configured, and None seems an appropriate return value in such cases. Maybe
 it's just the tests are bad for a machine with no midi devices?


cool.  I thought as much - since the init/quit tests seemed to pass.

Will fix the tests.  Will likely tag them interactive, or make them skip if
there's no midi devices.

I also didn't want to write output to any midi devices... in-case it woke
you up at 3am with some Electric piano 1 notes or something :)  So will
tag those tests 'interactive'.







 Brian, can you confirm if it's installed on the OSX build bots?

 My OS X machine definitely has the static portmidi library (libportmidi.a)
 and header file (portmidi.h) in the right places (/usr/local/lib and
 /usr/local/include) because they are getting picked up and built in by
 config.py. I built libportmidi.a myself, and I know it's the static lib, not
 a linking lib for a dylib or .so or anything like that.




Cool.




 Also, do you know how to compile portmidi on OSX?  I couldn't get it
 to compile on OSX (if you can't remember I'll try and work it out :).

 Yeah, I just used the xcode project under pm_mac and built the static lib
 without any problem - note the makefiles don't work on mac, and I didn't try
 a .dylib version (cause I don't see any point to doing so) so it may have
 problems building. Once I copied the build products to the right place, they
 got picked up fine.


ah, thanks.  Yeah, I tried to do it the makefile way.


Re: [pygame] pygame.midi using portmidi?

2009-05-26 Thread Lenard Lindstrom

Hello,

René Dudfield wrote:

hello,



On Tue, May 26, 2009 at 4:48 PM, Brian Fisher 
br...@hamsterrepublic.com mailto:br...@hamsterrepublic.com wrote:


On Sun, May 24, 2009 at 9:29 PM, René Dudfield ren...@gmail.com
mailto:ren...@gmail.com wrote:

 I believe Brian doesn't have portmidi.dll installed.


I definitely don't have any separately installed portmidi shared
library on any machine of mine, but I don't think that one is
required on OS X or Windows for proper operation. I think both
build bots are getting at the portmidi library just fine.

Also, as a rule, I think ever requiring a separately installed and
managed library that's not a standard OS component on Win and Mac
is the wrong way to do things. Those platforms don't have package
managers and Kernel components are quite stable, so therefore is
both no good way to manage dll dependencies and there is no
benefit to calling out to a shared separately managed version of
portmidi vs. statically linking/including the version we tested
into pygame, respectively.
 



k
 




I think he does have it installed on at least the windows
installs.

My windows build box has portmidi.dll in the prebuilts dir, so if
the setup for making the installer for pygame picks that dll up
properly, then it should be getting that dll just fine.


Cool.  I think Lenard has made a new prebuilts one that doesn't printf 
debugging info.



I have just uploaded them to my site http://www3.telus.net/len_l/pygame/

md5sums:
43b88f349db9a72c9841b5cad3cb1840 *prebuilt-pygame1.9.0-msvcr71-win32.zip
2e56f320e3c2adde920f4cfe1109d7e7 *prebuilt-pygame1.9.0-msvcr90-win32.zip
e94cf4e4cfbb0be5011092601b16d0f0 *Pygame-1.9.0-deps-src.zip

--
Lenard Lindstrom
le...@telus.net



Re: [pygame] pygame.midi using portmidi?

2009-05-26 Thread Lenard Lindstrom

René Dudfield wrote:




I think he does have it installed on at least the windows
installs.

My windows build box has portmidi.dll in the prebuilts dir, so if
the setup for making the installer for pygame picks that dll up
properly, then it should be getting that dll just fine.


Cool.  I think Lenard has made a new prebuilts one that doesn't printf 
debugging info.


 



from the build output, it looks like the problem is
pygame.midi.get_device_info is returning None - I can tell you my
build machines definitely don't have midi devices (neither
physical nor virtual) configured, and None seems an appropriate
return value in such cases. Maybe it's just the tests are bad for
a machine with no midi devices?


cool.  I thought as much - since the init/quit tests seemed to pass.

Will fix the tests.  Will likely tag them interactive, or make them 
skip if there's no midi devices.


I also didn't want to write output to any midi devices... in-case it 
woke you up at 3am with some Electric piano 1 notes or something :)  
So will tag those tests 'interactive'.



 

Hi,

I see the entire midi_test.py module is tagged interactive. Unit tests 
can be marked interactive on the TestCase and test_* method level as 
well. See font_test.py for class level tags. To mark a method add 
|tags: interactive| to its doc string.



Lenard



Re: [pygame] pygame.midi using portmidi?

2009-05-26 Thread René Dudfield
On Wed, May 27, 2009 at 4:22 AM, Lenard Lindstrom le...@telus.net wrote:

 Hi,

 I see the entire midi_test.py module is tagged interactive. Unit tests
 can be marked interactive on the TestCase and test_* method level as well.
 See font_test.py for class level tags. To mark a method add |tags:
 interactive| to its doc string.


 Lenard


hi,

cool, I'll do that for some of the midi tests.

I just did it temporarily.   The buildbot was about 100 revisions behind
since the last successful build/test, so I thought I'd disable the failing
tests for a bit, so more recent binaries could be generated.



cheers,


Re: [pygame] pygame.midi using portmidi?

2009-05-26 Thread Lenard Lindstrom

René Dudfield wrote:



On Wed, May 27, 2009 at 4:22 AM, Lenard Lindstrom le...@telus.net 
mailto:le...@telus.net wrote:


Hi,

I see the entire midi_test.py module is tagged interactive. Unit
tests can be marked interactive on the TestCase and test_* method
level as well. See font_test.py for class level tags. To mark a
method add |tags: interactive| to its doc string.


Lenard


hi,

cool, I'll do that for some of the midi tests.

I just did it temporarily.   The buildbot was about 100 revisions 
behind since the last successful build/test, so I thought I'd disable 
the failing tests for a bit, so more recent binaries could be generated.




cheers,


This is amazing. Everything is up to rev 2263. How many unit tests were 
disabled to get all the builds to pass?


Lenard



Re: [pygame] pygame.midi using portmidi?

2009-05-26 Thread René Dudfield
On Wed, May 27, 2009 at 7:28 AM, Lenard Lindstrom le...@telus.net wrote:


  This is amazing. Everything is up to rev 2263. How many unit tests were
 disabled to get all the builds to pass?

 Lenard



hi,

just the midi, and the test_get_fonts + test_match_fonts sys font tests.

I've enabled them again... The Spectacularly Adequate Automated Pygame Build
Page squeezed some recent builds out.


cu,


Re: [pygame] pygame.midi using portmidi?

2009-05-25 Thread Lenard Lindstrom

René Dudfield wrote:

On Mon, May 25, 2009 at 9:37 AM, Lenard Lindstrom le...@telus.net wrote:
  

Hello,

I believe Brian doesn't have portmidi.dll installed. I will repackage the
Windows dependencies with a new portmidi that doesn't print debug messages. This
will be the official dependencies for Pygame 1.9.0. The ffmpeg libraries, which
are somewhat large, will be in a separate zip file that can be dropped into the
prebuilt directory for development.

Lenard




Awesome.

I think he does have it installed on at least the windows installs.

Brian, can you confirm if it's installed on the OSX build bots?

Also, do you know how to compile portmidi on OSX?  I couldn't get it
to compile on OSX (if you can't remember I'll try and work it out :).





ps.  I renamed two functions... cause they were very long.  So if
anyone was using the pre-release code, you'll need to update your
code... as I've broken your program!  sorry.
from:
  pygame.midi.get_default_input_device_id
to:
  pygame.midi.get_default_input_id

from:
  pygame.midi.get_default_output_device_id
to:
  pygame.midi.get_default_output_id




cheers,
  

Hi René,

I just tried Cython on pypm.pyx. I needed to make minor changes to get 
it to compile. But the C file it generated works with both Python 2.x 
and 3.x. Should I submit the changes or do you want to compile it 
yourself. I used Cython 0.11.2 at http://www.cython.org/.


Lenard



Re: [pygame] pygame.midi using portmidi?

2009-05-25 Thread René Dudfield
On Mon, May 25, 2009 at 4:35 PM, Lenard Lindstrom le...@telus.net wrote:

 Hi René,

 I just tried Cython on pypm.pyx. I needed to make minor changes to get it to
 compile. But the C file it generated works with both Python 2.x and 3.x.
 Should I submit the changes or do you want to compile it yourself. I used
 Cython 0.11.2 at http://www.cython.org/.

 Lenard



yeah, cool :)  nice one.  commit away!

I've only got basic unittests in at the moment... but hopefully I'll
finish more by the end of the week.


cu,



Re: [pygame] pygame.midi using portmidi?

2009-05-25 Thread Lenard Lindstrom

René Dudfield wrote:

On Mon, May 25, 2009 at 4:35 PM, Lenard Lindstrom le...@telus.net wrote:
  

Hi René,

I just tried Cython on pypm.pyx. I needed to make minor changes to get it to
compile. But the C file it generated works with both Python 2.x and 3.x.
Should I submit the changes or do you want to compile it yourself. I used
Cython 0.11.2 at http://www.cython.org/.

Lenard





yeah, cool :)  nice one.  commit away!

I've only got basic unittests in at the moment... but hopefully I'll
finish more by the end of the week.


cu,
  

Committed and unit tests passing on Debian.



Lenard



Re: [pygame] pygame.midi using portmidi?

2009-05-24 Thread Lenard Lindstrom
Hello,

I believe Brian doesn't have portmidi.dll installed. I will repackage the
Windows dependencies with a new portmidi that doesn't print debug messages. This
will be the official dependencies for Pygame 1.9.0. The ffmpeg libraries, which
are somewhat large, will be in a separate zip file that can be dropped into the
prebuilt directory for development.

Lenard

Quoting René Dudfield ren...@gmail.com:

 hi,
 
 I made some more updates to the docs, and to create_doc_from_py.py
 
 It looks like the midi module is killing the tests on windows...
 http://thorbrian.com/pygame/builds.php
 
 I think portmidi needs to be compiled with debug settings turned off...
 otherwise it prints stuff out.
 
 I think set PM_CHECK_ERRORS to 0.  As well as set DEBUG to 0.  However I
 think DEBUG to 0 also sets PM_CHECK_ERRORS to 0, so probably only DEBUG to 0
 is needed.
 
 Details in README.txt and pm_win/README_win.txt
 
 
 cheers,
 
 
 On Sun, May 24, 2009 at 2:08 PM, Lenard Lindstrom le...@telus.net wrote:
 
  That new program will be useful. Thanks.
 
  Lenard
 
  René Dudfield wrote:
 
  Cool.
 
  I added a new tool to test/util for generating .doc files from .py
 modules
  with doc strings... eg:
  python create_doc_from_py.py pygame.midi  ../../lib/midi.doc
 
  Now pygame.midi also has html docs.
 
  cheers,
 
 
  On Sun, May 24, 2009 at 1:12 PM, Lenard Lindstrom
 le...@telus.netmailto:
  le...@telus.net wrote:
 
 Thanks for the warning. I disabled midi_test.py for Python 3.
 
 Lenard
 
 René Dudfield wrote:
 
 hi again,
 
 there's been a few small updates to the midi stuff.  I added a
 few basic unit tests today.  The pass on linux(ubuntu).
 
 Looks like the midi tests are failing on Mac OSX.
 http://thorbrian.com/pygame/builds.php
 
 Will have to look into failing OSX tests later... my girl
 friend is using her mac this weekend.  Unless someone else can
 look into it.
 
 
 I've also finished the docs... in the midi.py file.  Now I'm
 writing a little script to generate a .doc file version from
 the .py file.
 
 
 cheers,
 
 
 
 
 
 
 
 


-- 
Lenard Lindstrom
le...@telus.net



Re: [pygame] pygame.midi using portmidi?

2009-05-24 Thread René Dudfield
On Mon, May 25, 2009 at 9:37 AM, Lenard Lindstrom le...@telus.net wrote:
 Hello,

 I believe Brian doesn't have portmidi.dll installed. I will repackage the
 Windows dependencies with a new portmidi that doesn't print debug messages. 
 This
 will be the official dependencies for Pygame 1.9.0. The ffmpeg libraries, 
 which
 are somewhat large, will be in a separate zip file that can be dropped into 
 the
 prebuilt directory for development.

 Lenard


Awesome.

I think he does have it installed on at least the windows installs.

Brian, can you confirm if it's installed on the OSX build bots?

Also, do you know how to compile portmidi on OSX?  I couldn't get it
to compile on OSX (if you can't remember I'll try and work it out :).





ps.  I renamed two functions... cause they were very long.  So if
anyone was using the pre-release code, you'll need to update your
code... as I've broken your program!  sorry.
from:
  pygame.midi.get_default_input_device_id
to:
  pygame.midi.get_default_input_id

from:
  pygame.midi.get_default_output_device_id
to:
  pygame.midi.get_default_output_id




cheers,


Re: [pygame] pygame.midi using portmidi?

2009-05-23 Thread René Dudfield
hi again,

there's been a few small updates to the midi stuff.  I added a few basic
unit tests today.  The pass on linux(ubuntu).

Looks like the midi tests are failing on Mac OSX.
http://thorbrian.com/pygame/builds.php

Will have to look into failing OSX tests later... my girl friend is using
her mac this weekend.  Unless someone else can look into it.


I've also finished the docs... in the midi.py file.  Now I'm writing a
little script to generate a .doc file version from the .py file.


cheers,




On Sun, May 17, 2009 at 2:47 PM, Nirav Patel o...@spongezone.net wrote:

 I changed the default channel from 1 to 0 and added the channel arg to
 set_instrument.
 Committed revision 2158.

 Nirav

 On Sat, May 16, 2009 at 9:56 PM, René Dudfield ren...@gmail.com wrote:
  hi,
 
  I added a channel argument to note_on note_off to svn.
  Committed revision 2154.
 
  cheers,
 
 
 
  On Mon, Apr 27, 2009 at 10:58 AM, René Dudfield ren...@gmail.com
 wrote:
 
  hi,
 
  the Channel stuff isn't wrapped yet in midi.py...  See pypm.pyx Channel
 to
  see how Channels work.  The portmidi.h file also has some good docs to
 see
  how it works at the C level.  However that's just used for input.
 
  I think you can change the channel like this:
 
  channel = 1
  note = 65
  velocity = 100
  output.write_short(0x90+channel, note, velocity)
 
  ... I think... will need to check the exact codes.
 
  So, yeah I agree... we should have a channel default with the
  note_on/note_off methods.
 
 
 
  cu,
 
 
 
  On Mon, Apr 27, 2009 at 7:03 AM, Nirav Patel o...@spongezone.net
 wrote:
 
  The --list option goes to print_device_info(), which seems to be
  missing the initialization stuff:
 pygame.init()
 pygame.midi.init()
 
  I'm new to MIDI in general, but I am planning on using this in a
  project I'm working on.  Is there a reason we are using channel 1 on
  MIDI Writes rather than having the channel be an argument of the
  function with a default of 1?
 
  Nirav
 
  On Tue, Jan 13, 2009 at 2:59 PM, Lenard Lindstrom le...@telus.net
  wrote:
   Hi René,
  
   Good stuff. I added a main() function to midi.py, for consistency, as
   well
   as a --list option. As for porttime it is no big problem to repair
 the
   Windows build. Just curious though, why did add a new PORTTIME macro
 to
   Setup.in instead of:
  
   PORTMIDI = -lportmidi -lporttime
  
  
   Lenard
  
   P.S.  Brian, just add the line
  
   PORTTIME =
  
   to prebuilt\Setup_Win.in and the automated Windows builds will
 continue
   to
   work.
  
  
   René Dudfield wrote:
  
   Hi,
  
   I added a get_device_info(device_id) function... to allow seeing
 which
   devices are available.  The midi.py example prints out the available
   devices.
  
   it is also compiling on ubuntu... (ya! I finally got my ubuntu
   partition working again).
  
   Had to link in libporttime... and therefore add it as a dependency,
   which may have broken msys build.
  
   Added allowing to specify an optional device_id  on the cmd line
  eg,
   --input 3
  
  
   cu,
  
  
  
   On Wed, Dec 24, 2008 at 6:10 PM, René Dudfield ren...@gmail.com
   wrote:
  
  
   Hi,
  
   yes, something like that would be good.  There could be a separate
   function running in a background thread to handle all of the input
   midi.  Which I think would just run code similar to what is in the
   example.  Probably something very useful to add.
  
   A piano keyboard example would be a very nice one I think :)
  
   cu,
  
  
  
   On Wed, Dec 24, 2008 at 5:19 PM, Lenard Lindstrom le...@telus.net
 
   wrote:
  
  
   Hi René,
  
   I will look at the new midi.py and flesh out the keyboard example:
   port
   selection, a piano keyboard in the window, more notes, etc. It's
   good
   news
   about the pypm wrapper. One thing I was wondering, is it possible
 to
   hide
   the portmidi event to Pygame event translation, so only Pygame
   events
   are
   visible in the main loop?
  
   Lenard
  
   René Dudfield wrote:
  
  
   hey,
  
   that's cool.  I checked in a new pygame.midi which uses a
 modified
   version of your output class.
  
   I also put an examples/midi.py in there.  It contains an input
   example, and your output example converted to use the pygame.midi
   module.
  
   python midi.py --output
   python midi.py --input
  
  
   Also John Harrison said we could use his pyrex pypm portmidi
   wrapper
   in pygame :)
  
   cu,
  
   On Wed, Dec 24, 2008 at 6:57 AM, Lenard Lindstrom 
 le...@telus.net
   wrote:
  
  
  
   Hi,
  
   I'm reposting my keyboard pyportmidi example. It has been
 changed
   to
   use
   pygame.pypm. The midiport module may be of interest as it
 contains
   an
   output
   class. The keyboard program could go into the examples, with
 some
   improvements. Once midi has been fixed if you want to add
   keyboard.py
   to
   the
   examples, with the needed changes for pygame.midi, I can spruce
 it
   up
   to
   make it more intuitive.
  
   Usage: The q,w,e and r 

Re: [pygame] pygame.midi using portmidi?

2009-05-23 Thread Lenard Lindstrom

Thanks for the warning. I disabled midi_test.py for Python 3.

Lenard

René Dudfield wrote:

hi again,

there's been a few small updates to the midi stuff.  I added a few 
basic unit tests today.  The pass on linux(ubuntu).


Looks like the midi tests are failing on Mac OSX.
http://thorbrian.com/pygame/builds.php

Will have to look into failing OSX tests later... my girl friend is 
using her mac this weekend.  Unless someone else can look into it.



I've also finished the docs... in the midi.py file.  Now I'm writing a 
little script to generate a .doc file version from the .py file.



cheers,







Re: [pygame] pygame.midi using portmidi?

2009-05-23 Thread René Dudfield
Cool.

I added a new tool to test/util for generating .doc files from .py modules
with doc strings... eg:
python create_doc_from_py.py pygame.midi  ../../lib/midi.doc

Now pygame.midi also has html docs.

cheers,


On Sun, May 24, 2009 at 1:12 PM, Lenard Lindstrom le...@telus.net wrote:

 Thanks for the warning. I disabled midi_test.py for Python 3.

 Lenard

 René Dudfield wrote:

 hi again,

 there's been a few small updates to the midi stuff.  I added a few basic
 unit tests today.  The pass on linux(ubuntu).

 Looks like the midi tests are failing on Mac OSX.
 http://thorbrian.com/pygame/builds.php

 Will have to look into failing OSX tests later... my girl friend is using
 her mac this weekend.  Unless someone else can look into it.


 I've also finished the docs... in the midi.py file.  Now I'm writing a
 little script to generate a .doc file version from the .py file.


 cheers,







Re: [pygame] pygame.midi using portmidi?

2009-05-23 Thread Lenard Lindstrom

That new program will be useful. Thanks.

Lenard

René Dudfield wrote:

Cool.

I added a new tool to test/util for generating .doc files from .py 
modules with doc strings... eg:

python create_doc_from_py.py pygame.midi  ../../lib/midi.doc

Now pygame.midi also has html docs.

cheers,


On Sun, May 24, 2009 at 1:12 PM, Lenard Lindstrom le...@telus.net 
mailto:le...@telus.net wrote:


Thanks for the warning. I disabled midi_test.py for Python 3.

Lenard

René Dudfield wrote:

hi again,

there's been a few small updates to the midi stuff.  I added a
few basic unit tests today.  The pass on linux(ubuntu).

Looks like the midi tests are failing on Mac OSX.
http://thorbrian.com/pygame/builds.php

Will have to look into failing OSX tests later... my girl
friend is using her mac this weekend.  Unless someone else can
look into it.


I've also finished the docs... in the midi.py file.  Now I'm
writing a little script to generate a .doc file version from
the .py file.


cheers,









Re: [pygame] pygame.midi using portmidi?

2009-05-23 Thread René Dudfield
hi,

I made some more updates to the docs, and to create_doc_from_py.py

It looks like the midi module is killing the tests on windows...
http://thorbrian.com/pygame/builds.php

I think portmidi needs to be compiled with debug settings turned off...
otherwise it prints stuff out.

I think set PM_CHECK_ERRORS to 0.  As well as set DEBUG to 0.  However I
think DEBUG to 0 also sets PM_CHECK_ERRORS to 0, so probably only DEBUG to 0
is needed.

Details in README.txt and pm_win/README_win.txt


cheers,


On Sun, May 24, 2009 at 2:08 PM, Lenard Lindstrom le...@telus.net wrote:

 That new program will be useful. Thanks.

 Lenard

 René Dudfield wrote:

 Cool.

 I added a new tool to test/util for generating .doc files from .py modules
 with doc strings... eg:
 python create_doc_from_py.py pygame.midi  ../../lib/midi.doc

 Now pygame.midi also has html docs.

 cheers,


 On Sun, May 24, 2009 at 1:12 PM, Lenard Lindstrom le...@telus.netmailto:
 le...@telus.net wrote:

Thanks for the warning. I disabled midi_test.py for Python 3.

Lenard

René Dudfield wrote:

hi again,

there's been a few small updates to the midi stuff.  I added a
few basic unit tests today.  The pass on linux(ubuntu).

Looks like the midi tests are failing on Mac OSX.
http://thorbrian.com/pygame/builds.php

Will have to look into failing OSX tests later... my girl
friend is using her mac this weekend.  Unless someone else can
look into it.


I've also finished the docs... in the midi.py file.  Now I'm
writing a little script to generate a .doc file version from
the .py file.


cheers,









Re: [pygame] pygame.midi using portmidi?

2009-05-16 Thread Nirav Patel
I changed the default channel from 1 to 0 and added the channel arg to
set_instrument.
Committed revision 2158.

Nirav

On Sat, May 16, 2009 at 9:56 PM, René Dudfield ren...@gmail.com wrote:
 hi,

 I added a channel argument to note_on note_off to svn.
 Committed revision 2154.

 cheers,



 On Mon, Apr 27, 2009 at 10:58 AM, René Dudfield ren...@gmail.com wrote:

 hi,

 the Channel stuff isn't wrapped yet in midi.py...  See pypm.pyx Channel to
 see how Channels work.  The portmidi.h file also has some good docs to see
 how it works at the C level.  However that's just used for input.

 I think you can change the channel like this:

 channel = 1
 note = 65
 velocity = 100
 output.write_short(0x90+channel, note, velocity)

 ... I think... will need to check the exact codes.

 So, yeah I agree... we should have a channel default with the
 note_on/note_off methods.



 cu,



 On Mon, Apr 27, 2009 at 7:03 AM, Nirav Patel o...@spongezone.net wrote:

 The --list option goes to print_device_info(), which seems to be
 missing the initialization stuff:
    pygame.init()
    pygame.midi.init()

 I'm new to MIDI in general, but I am planning on using this in a
 project I'm working on.  Is there a reason we are using channel 1 on
 MIDI Writes rather than having the channel be an argument of the
 function with a default of 1?

 Nirav

 On Tue, Jan 13, 2009 at 2:59 PM, Lenard Lindstrom le...@telus.net
 wrote:
  Hi René,
 
  Good stuff. I added a main() function to midi.py, for consistency, as
  well
  as a --list option. As for porttime it is no big problem to repair the
  Windows build. Just curious though, why did add a new PORTTIME macro to
  Setup.in instead of:
 
  PORTMIDI = -lportmidi -lporttime
 
 
  Lenard
 
  P.S.  Brian, just add the line
 
  PORTTIME =
 
  to prebuilt\Setup_Win.in and the automated Windows builds will continue
  to
  work.
 
 
  René Dudfield wrote:
 
  Hi,
 
  I added a get_device_info(device_id) function... to allow seeing which
  devices are available.  The midi.py example prints out the available
  devices.
 
  it is also compiling on ubuntu... (ya! I finally got my ubuntu
  partition working again).
 
  Had to link in libporttime... and therefore add it as a dependency,
  which may have broken msys build.
 
  Added allowing to specify an optional device_id  on the cmd line  eg,
  --input 3
 
 
  cu,
 
 
 
  On Wed, Dec 24, 2008 at 6:10 PM, René Dudfield ren...@gmail.com
  wrote:
 
 
  Hi,
 
  yes, something like that would be good.  There could be a separate
  function running in a background thread to handle all of the input
  midi.  Which I think would just run code similar to what is in the
  example.  Probably something very useful to add.
 
  A piano keyboard example would be a very nice one I think :)
 
  cu,
 
 
 
  On Wed, Dec 24, 2008 at 5:19 PM, Lenard Lindstrom le...@telus.net
  wrote:
 
 
  Hi René,
 
  I will look at the new midi.py and flesh out the keyboard example:
  port
  selection, a piano keyboard in the window, more notes, etc. It's
  good
  news
  about the pypm wrapper. One thing I was wondering, is it possible to
  hide
  the portmidi event to Pygame event translation, so only Pygame
  events
  are
  visible in the main loop?
 
  Lenard
 
  René Dudfield wrote:
 
 
  hey,
 
  that's cool.  I checked in a new pygame.midi which uses a modified
  version of your output class.
 
  I also put an examples/midi.py in there.  It contains an input
  example, and your output example converted to use the pygame.midi
  module.
 
  python midi.py --output
  python midi.py --input
 
 
  Also John Harrison said we could use his pyrex pypm portmidi
  wrapper
  in pygame :)
 
  cu,
 
  On Wed, Dec 24, 2008 at 6:57 AM, Lenard Lindstrom le...@telus.net
  wrote:
 
 
 
  Hi,
 
  I'm reposting my keyboard pyportmidi example. It has been changed
  to
  use
  pygame.pypm. The midiport module may be of interest as it contains
  an
  output
  class. The keyboard program could go into the examples, with some
  improvements. Once midi has been fixed if you want to add
  keyboard.py
  to
  the
  examples, with the needed changes for pygame.midi, I can spruce it
  up
  to
  make it more intuitive.
 
  Usage: The q,w,e and r keys play four notes on the Church Organ
  instrument.
  Also the four notes can be played by clicking horizontally across
  the
  blue
  window. It is very simple for now but could be developed into a
  proper
  keyboard.
 
  Lenard
 
  René Dudfield wrote:
 
 
 
  hi again,
 
  Another note:
 
  Tim Thompson said we could include his patches to pyportmidi, and
  also
  include some of his other midi code...
 
  You'll also find there a python module (nosuch.midiutil) that
  contains higher-level routines for MIDI things, including a MIDI
  file
  reader, simple scheduler, etc.
 
 
 
 
 
  --
  Lenard Lindstrom
  le...@telus.net
 
 
 
 
 
  --
  Lenard Lindstrom
  le...@telus.net
 
 
 
 
 
  --
  Lenard Lindstrom
  le...@telus.net
 
 





Re: [pygame] pygame.midi using portmidi?

2009-04-26 Thread Nirav Patel
The --list option goes to print_device_info(), which seems to be
missing the initialization stuff:
pygame.init()
pygame.midi.init()

I'm new to MIDI in general, but I am planning on using this in a
project I'm working on.  Is there a reason we are using channel 1 on
MIDI Writes rather than having the channel be an argument of the
function with a default of 1?

Nirav

On Tue, Jan 13, 2009 at 2:59 PM, Lenard Lindstrom le...@telus.net wrote:
 Hi René,

 Good stuff. I added a main() function to midi.py, for consistency, as well
 as a --list option. As for porttime it is no big problem to repair the
 Windows build. Just curious though, why did add a new PORTTIME macro to
 Setup.in instead of:

 PORTMIDI = -lportmidi -lporttime


 Lenard

 P.S.  Brian, just add the line

 PORTTIME =

 to prebuilt\Setup_Win.in and the automated Windows builds will continue to
 work.


 René Dudfield wrote:

 Hi,

 I added a get_device_info(device_id) function... to allow seeing which
 devices are available.  The midi.py example prints out the available
 devices.

 it is also compiling on ubuntu... (ya! I finally got my ubuntu
 partition working again).

 Had to link in libporttime... and therefore add it as a dependency,
 which may have broken msys build.

 Added allowing to specify an optional device_id  on the cmd line  eg,
 --input 3


 cu,



 On Wed, Dec 24, 2008 at 6:10 PM, René Dudfield ren...@gmail.com wrote:


 Hi,

 yes, something like that would be good.  There could be a separate
 function running in a background thread to handle all of the input
 midi.  Which I think would just run code similar to what is in the
 example.  Probably something very useful to add.

 A piano keyboard example would be a very nice one I think :)

 cu,



 On Wed, Dec 24, 2008 at 5:19 PM, Lenard Lindstrom le...@telus.net
 wrote:


 Hi René,

 I will look at the new midi.py and flesh out the keyboard example: port
 selection, a piano keyboard in the window, more notes, etc. It's good
 news
 about the pypm wrapper. One thing I was wondering, is it possible to
 hide
 the portmidi event to Pygame event translation, so only Pygame events
 are
 visible in the main loop?

 Lenard

 René Dudfield wrote:


 hey,

 that's cool.  I checked in a new pygame.midi which uses a modified
 version of your output class.

 I also put an examples/midi.py in there.  It contains an input
 example, and your output example converted to use the pygame.midi
 module.

 python midi.py --output
 python midi.py --input


 Also John Harrison said we could use his pyrex pypm portmidi wrapper
 in pygame :)

 cu,

 On Wed, Dec 24, 2008 at 6:57 AM, Lenard Lindstrom le...@telus.net
 wrote:



 Hi,

 I'm reposting my keyboard pyportmidi example. It has been changed to
 use
 pygame.pypm. The midiport module may be of interest as it contains an
 output
 class. The keyboard program could go into the examples, with some
 improvements. Once midi has been fixed if you want to add keyboard.py
 to
 the
 examples, with the needed changes for pygame.midi, I can spruce it up
 to
 make it more intuitive.

 Usage: The q,w,e and r keys play four notes on the Church Organ
 instrument.
 Also the four notes can be played by clicking horizontally across the
 blue
 window. It is very simple for now but could be developed into a proper
 keyboard.

 Lenard

 René Dudfield wrote:



 hi again,

 Another note:

 Tim Thompson said we could include his patches to pyportmidi, and
 also
 include some of his other midi code...

 You'll also find there a python module (nosuch.midiutil) that
 contains higher-level routines for MIDI things, including a MIDI file
 reader, simple scheduler, etc.





 --
 Lenard Lindstrom
 le...@telus.net





 --
 Lenard Lindstrom
 le...@telus.net





 --
 Lenard Lindstrom
 le...@telus.net




Re: [pygame] pygame.midi using portmidi?

2009-04-26 Thread René Dudfield
hi,

the Channel stuff isn't wrapped yet in midi.py...  See pypm.pyx Channel to
see how Channels work.  The portmidi.h file also has some good docs to see
how it works at the C level.  However that's just used for input.

I think you can change the channel like this:

channel = 1
note = 65
velocity = 100
output.write_short(0x90+channel, note, velocity)

... I think... will need to check the exact codes.

So, yeah I agree... we should have a channel default with the
note_on/note_off methods.



cu,



On Mon, Apr 27, 2009 at 7:03 AM, Nirav Patel o...@spongezone.net wrote:

 The --list option goes to print_device_info(), which seems to be
 missing the initialization stuff:
pygame.init()
pygame.midi.init()

 I'm new to MIDI in general, but I am planning on using this in a
 project I'm working on.  Is there a reason we are using channel 1 on
 MIDI Writes rather than having the channel be an argument of the
 function with a default of 1?

 Nirav

 On Tue, Jan 13, 2009 at 2:59 PM, Lenard Lindstrom le...@telus.net wrote:
  Hi René,
 
  Good stuff. I added a main() function to midi.py, for consistency, as
 well
  as a --list option. As for porttime it is no big problem to repair the
  Windows build. Just curious though, why did add a new PORTTIME macro to
  Setup.in instead of:
 
  PORTMIDI = -lportmidi -lporttime
 
 
  Lenard
 
  P.S.  Brian, just add the line
 
  PORTTIME =
 
  to prebuilt\Setup_Win.in and the automated Windows builds will continue
 to
  work.
 
 
  René Dudfield wrote:
 
  Hi,
 
  I added a get_device_info(device_id) function... to allow seeing which
  devices are available.  The midi.py example prints out the available
  devices.
 
  it is also compiling on ubuntu... (ya! I finally got my ubuntu
  partition working again).
 
  Had to link in libporttime... and therefore add it as a dependency,
  which may have broken msys build.
 
  Added allowing to specify an optional device_id  on the cmd line  eg,
  --input 3
 
 
  cu,
 
 
 
  On Wed, Dec 24, 2008 at 6:10 PM, René Dudfield ren...@gmail.com
 wrote:
 
 
  Hi,
 
  yes, something like that would be good.  There could be a separate
  function running in a background thread to handle all of the input
  midi.  Which I think would just run code similar to what is in the
  example.  Probably something very useful to add.
 
  A piano keyboard example would be a very nice one I think :)
 
  cu,
 
 
 
  On Wed, Dec 24, 2008 at 5:19 PM, Lenard Lindstrom le...@telus.net
  wrote:
 
 
  Hi René,
 
  I will look at the new midi.py and flesh out the keyboard example:
 port
  selection, a piano keyboard in the window, more notes, etc. It's good
  news
  about the pypm wrapper. One thing I was wondering, is it possible to
  hide
  the portmidi event to Pygame event translation, so only Pygame events
  are
  visible in the main loop?
 
  Lenard
 
  René Dudfield wrote:
 
 
  hey,
 
  that's cool.  I checked in a new pygame.midi which uses a modified
  version of your output class.
 
  I also put an examples/midi.py in there.  It contains an input
  example, and your output example converted to use the pygame.midi
  module.
 
  python midi.py --output
  python midi.py --input
 
 
  Also John Harrison said we could use his pyrex pypm portmidi wrapper
  in pygame :)
 
  cu,
 
  On Wed, Dec 24, 2008 at 6:57 AM, Lenard Lindstrom le...@telus.net
  wrote:
 
 
 
  Hi,
 
  I'm reposting my keyboard pyportmidi example. It has been changed to
  use
  pygame.pypm. The midiport module may be of interest as it contains
 an
  output
  class. The keyboard program could go into the examples, with some
  improvements. Once midi has been fixed if you want to add
 keyboard.py
  to
  the
  examples, with the needed changes for pygame.midi, I can spruce it
 up
  to
  make it more intuitive.
 
  Usage: The q,w,e and r keys play four notes on the Church Organ
  instrument.
  Also the four notes can be played by clicking horizontally across
 the
  blue
  window. It is very simple for now but could be developed into a
 proper
  keyboard.
 
  Lenard
 
  René Dudfield wrote:
 
 
 
  hi again,
 
  Another note:
 
  Tim Thompson said we could include his patches to pyportmidi, and
  also
  include some of his other midi code...
 
  You'll also find there a python module (nosuch.midiutil) that
  contains higher-level routines for MIDI things, including a MIDI
 file
  reader, simple scheduler, etc.
 
 
 
 
 
  --
  Lenard Lindstrom
  le...@telus.net
 
 
 
 
 
  --
  Lenard Lindstrom
  le...@telus.net
 
 
 
 
 
  --
  Lenard Lindstrom
  le...@telus.net
 
 



Re: [pygame] pygame.midi using portmidi?

2009-01-29 Thread Brian Fisher
So it looks like the midi module was always working fine on the mac's that I
tested on.

What wasn't working was print statements going to the console after
pygame.init is called, but only on one computer. stderr kept going to the
console, but all stdout (which print was going to) got swallowed, making me
thing the midi example was not getting events in the input test

The stdout problem seems to happen with multiple pygame (1.8.1 and 1.9.0)
and python (2.5, 2.6) versions. Both computers are OS X Leopard and have the
exact same versions of SDL stuff. The one that has the stdout going away
problem is an iMac with a Leopard upgrade. the one that keeps stdout working
just fine is a mac mini with a fresh leopard install.

would be nice to be fixed I guess, but I have no idea where I'd start
looking for a cause...


On Mon, Jan 26, 2009 at 1:21 PM, René Dudfield ren...@gmail.com wrote:

 Hi,

 this notes a patch for 10.5sdk
 http://lists.create.ucsb.edu/pipermail/media_api/2009-January/000703.html

 Also found a section on OSX here:
 http://cratel.wichita.edu/cratel/cratel_pyportmidi

 Also, have you tried the .c test programs that come with portmidi?

 cheers,


 On Sun, Jan 25, 2009 at 9:15 PM, Brian Fisher br...@hamsterrepublic.com
 wrote:
  So I got pygame building on mac with portmidi now - although I can't seem
 to
  get the midi.py example to do anything.
 
   the xcode proj for portmidi seems to have the porttime sources
 incorporated
  into it, rather than built as a separate lib, so the porttime dependency
  doesn't exist, which was causing trouble. Also the static libportmidi.a
 lib
  requires linkage to the CoreMidi framework, which was also causing
 trouble.
 
  So I decided to kill 2 birds with one stoney-hack and made PORTTIME
  dependency be a dependency on porttime.
 
  But now when I install the pygame on a machine with a midi keyboard
  attached, and run examples/midi.py with either --output or --list, it
 waits
  a long time, then prints in stat: : No such file or directory 4 times.
 
  looking at portmidi's sources, that error seems to com from it trying to
  read the /PortMidi/PM_RECOMMENDED_INPUT_DEVICE setting from some prefs
  file com.apple.java.util.prefs.plist as part of it's initialization.
 
  It seems really bizarre and rather dumb to me that portmidi would use
 java
  for anything, and I'm starting to wonder if the thing even works on
  Leopard...
 
 
  On Tue, Jan 13, 2009 at 2:49 PM, René Dudfield ren...@gmail.com wrote:
 
  I think with portmidi, compiling it ourselves on mac is the way to go.
   Seemed easy to compile on win/linux... so hopefully it compiles ok on
  mac too.
 
 
 



Re: [pygame] pygame.midi using portmidi?

2009-01-27 Thread Brian Fisher
That patch must be for building with a makefile. It builds fine as is from
the xcode project (seems to be the maintained option)

On a computer without a real midi device, it looks like both the test
program and the midi.py example seem to work with the virtual keyboard. It
looks like what must have been happening is that portmidi couldn't find my
actual physical midi device on another computer... I'll have to look into it
- the piano is only hooked up as an input (not an output), so I suppose that
may be part of the problem...

anyways, I checked in the config changes a while back, so anyone with a
/usr/local/lib/libportmidi.a and /usr/local/include/portmidi.h can build
with portmidi support, and the automated builds for mac have had portmidi
support built into them for a little while now


On Mon, Jan 26, 2009 at 1:21 PM, René Dudfield ren...@gmail.com wrote:

 Hi,

 this notes a patch for 10.5sdk
 http://lists.create.ucsb.edu/pipermail/media_api/2009-January/000703.html

 Also found a section on OSX here:
 http://cratel.wichita.edu/cratel/cratel_pyportmidi

 Also, have you tried the .c test programs that come with portmidi?

 cheers,


 On Sun, Jan 25, 2009 at 9:15 PM, Brian Fisher br...@hamsterrepublic.com
 wrote:
  So I got pygame building on mac with portmidi now - although I can't seem
 to
  get the midi.py example to do anything.
 
   the xcode proj for portmidi seems to have the porttime sources
 incorporated
  into it, rather than built as a separate lib, so the porttime dependency
  doesn't exist, which was causing trouble. Also the static libportmidi.a
 lib
  requires linkage to the CoreMidi framework, which was also causing
 trouble.
 
  So I decided to kill 2 birds with one stoney-hack and made PORTTIME
  dependency be a dependency on porttime.
 
  But now when I install the pygame on a machine with a midi keyboard
  attached, and run examples/midi.py with either --output or --list, it
 waits
  a long time, then prints in stat: : No such file or directory 4 times.
 
  looking at portmidi's sources, that error seems to com from it trying to
  read the /PortMidi/PM_RECOMMENDED_INPUT_DEVICE setting from some prefs
  file com.apple.java.util.prefs.plist as part of it's initialization.
 
  It seems really bizarre and rather dumb to me that portmidi would use
 java
  for anything, and I'm starting to wonder if the thing even works on
  Leopard...
 
 
  On Tue, Jan 13, 2009 at 2:49 PM, René Dudfield ren...@gmail.com wrote:
 
  I think with portmidi, compiling it ourselves on mac is the way to go.
   Seemed easy to compile on win/linux... so hopefully it compiles ok on
  mac too.
 
 
 



Re: [pygame] pygame.midi using portmidi?

2009-01-26 Thread René Dudfield
Hi,

this notes a patch for 10.5sdk
http://lists.create.ucsb.edu/pipermail/media_api/2009-January/000703.html

Also found a section on OSX here:
http://cratel.wichita.edu/cratel/cratel_pyportmidi

Also, have you tried the .c test programs that come with portmidi?

cheers,


On Sun, Jan 25, 2009 at 9:15 PM, Brian Fisher br...@hamsterrepublic.com wrote:
 So I got pygame building on mac with portmidi now - although I can't seem to
 get the midi.py example to do anything.

  the xcode proj for portmidi seems to have the porttime sources incorporated
 into it, rather than built as a separate lib, so the porttime dependency
 doesn't exist, which was causing trouble. Also the static libportmidi.a lib
 requires linkage to the CoreMidi framework, which was also causing trouble.

 So I decided to kill 2 birds with one stoney-hack and made PORTTIME
 dependency be a dependency on porttime.

 But now when I install the pygame on a machine with a midi keyboard
 attached, and run examples/midi.py with either --output or --list, it waits
 a long time, then prints in stat: : No such file or directory 4 times.

 looking at portmidi's sources, that error seems to com from it trying to
 read the /PortMidi/PM_RECOMMENDED_INPUT_DEVICE setting from some prefs
 file com.apple.java.util.prefs.plist as part of it's initialization.

 It seems really bizarre and rather dumb to me that portmidi would use java
 for anything, and I'm starting to wonder if the thing even works on
 Leopard...


 On Tue, Jan 13, 2009 at 2:49 PM, René Dudfield ren...@gmail.com wrote:

 I think with portmidi, compiling it ourselves on mac is the way to go.
  Seemed easy to compile on win/linux... so hopefully it compiles ok on
 mac too.





Re: [pygame] pygame.midi using portmidi?

2009-01-25 Thread Brian Fisher
So I got pygame building on mac with portmidi now - although I can't seem to
get the midi.py example to do anything.

 the xcode proj for portmidi seems to have the porttime sources incorporated
into it, rather than built as a separate lib, so the porttime dependency
doesn't exist, which was causing trouble. Also the static libportmidi.a lib
requires linkage to the CoreMidi framework, which was also causing trouble.

So I decided to kill 2 birds with one stoney-hack and made PORTTIME
dependency be a dependency on porttime.

But now when I install the pygame on a machine with a midi keyboard
attached, and run examples/midi.py with either --output or --list, it waits
a long time, then prints in stat: : No such file or directory 4 times.

looking at portmidi's sources, that error seems to com from it trying to
read the /PortMidi/PM_RECOMMENDED_INPUT_DEVICE setting from some prefs
file com.apple.java.util.prefs.plist as part of it's initialization.

It seems really bizarre and rather dumb to me that portmidi would use java
for anything, and I'm starting to wonder if the thing even works on
Leopard...


On Tue, Jan 13, 2009 at 2:49 PM, René Dudfield ren...@gmail.com wrote:

 I think with portmidi, compiling it ourselves on mac is the way to go.
  Seemed easy to compile on win/linux... so hopefully it compiles ok on
 mac too.




Re: [pygame] pygame.midi using portmidi?

2009-01-13 Thread René Dudfield
Hi,

I added a get_device_info(device_id) function... to allow seeing which
devices are available.  The midi.py example prints out the available
devices.

it is also compiling on ubuntu... (ya! I finally got my ubuntu
partition working again).

Had to link in libporttime... and therefore add it as a dependency,
which may have broken msys build.

Added allowing to specify an optional device_id  on the cmd line  eg, --input 3


cu,



On Wed, Dec 24, 2008 at 6:10 PM, René Dudfield ren...@gmail.com wrote:
 Hi,

 yes, something like that would be good.  There could be a separate
 function running in a background thread to handle all of the input
 midi.  Which I think would just run code similar to what is in the
 example.  Probably something very useful to add.

 A piano keyboard example would be a very nice one I think :)

 cu,



 On Wed, Dec 24, 2008 at 5:19 PM, Lenard Lindstrom le...@telus.net wrote:
 Hi René,

 I will look at the new midi.py and flesh out the keyboard example: port
 selection, a piano keyboard in the window, more notes, etc. It's good news
 about the pypm wrapper. One thing I was wondering, is it possible to hide
 the portmidi event to Pygame event translation, so only Pygame events are
 visible in the main loop?

 Lenard

 René Dudfield wrote:

 hey,

 that's cool.  I checked in a new pygame.midi which uses a modified
 version of your output class.

 I also put an examples/midi.py in there.  It contains an input
 example, and your output example converted to use the pygame.midi
 module.

 python midi.py --output
 python midi.py --input


 Also John Harrison said we could use his pyrex pypm portmidi wrapper
 in pygame :)

 cu,

 On Wed, Dec 24, 2008 at 6:57 AM, Lenard Lindstrom le...@telus.net wrote:


 Hi,

 I'm reposting my keyboard pyportmidi example. It has been changed to use
 pygame.pypm. The midiport module may be of interest as it contains an
 output
 class. The keyboard program could go into the examples, with some
 improvements. Once midi has been fixed if you want to add keyboard.py to
 the
 examples, with the needed changes for pygame.midi, I can spruce it up to
 make it more intuitive.

 Usage: The q,w,e and r keys play four notes on the Church Organ
 instrument.
 Also the four notes can be played by clicking horizontally across the
 blue
 window. It is very simple for now but could be developed into a proper
 keyboard.

 Lenard

 René Dudfield wrote:


 hi again,

 Another note:

 Tim Thompson said we could include his patches to pyportmidi, and also
 include some of his other midi code...

 You'll also find there a python module (nosuch.midiutil) that
 contains higher-level routines for MIDI things, including a MIDI file
 reader, simple scheduler, etc.




 --
 Lenard Lindstrom
 le...@telus.net





 --
 Lenard Lindstrom
 le...@telus.net





Re: [pygame] pygame.midi using portmidi?

2009-01-13 Thread Brian Fisher
I just fixed a missing comma problem with mac os x building, so it seems to
happily build without portmidi, but I'm not sure what the recommended way to
get the portmidi dependencies for OS X are? prebuilts? build yourself from
svn? from a specific version package?

Also, didn't we use to have a page about all the mac os x building
dependencies? (libjpeg, libpng, sdl, etc) where is that?

On Mon, Dec 22, 2008 at 11:48 PM, René Dudfield ren...@gmail.com wrote:

 pygame.midi in svn now, and seems to build ok, and run with the latest
 svn.  I still have a bit of work to do on it... including docs,
 finishing an output class, tests etc.  Also, only tested on windows so
 far.  Still need to make sure it compiles, and works on Mac and linux.




Re: [pygame] pygame.midi using portmidi?

2009-01-13 Thread Lenard Lindstrom

Hi René,

Good stuff. I added a main() function to midi.py, for consistency, as 
well as a --list option. As for porttime it is no big problem to repair 
the Windows build. Just curious though, why did add a new PORTTIME macro 
to Setup.in instead of:


PORTMIDI = -lportmidi -lporttime


Lenard

P.S.  Brian, just add the line

PORTTIME =

to prebuilt\Setup_Win.in and the automated Windows builds will continue 
to work.



René Dudfield wrote:

Hi,

I added a get_device_info(device_id) function... to allow seeing which
devices are available.  The midi.py example prints out the available
devices.

it is also compiling on ubuntu... (ya! I finally got my ubuntu
partition working again).

Had to link in libporttime... and therefore add it as a dependency,
which may have broken msys build.

Added allowing to specify an optional device_id  on the cmd line  eg, --input 3


cu,



On Wed, Dec 24, 2008 at 6:10 PM, René Dudfield ren...@gmail.com wrote:
  

Hi,

yes, something like that would be good.  There could be a separate
function running in a background thread to handle all of the input
midi.  Which I think would just run code similar to what is in the
example.  Probably something very useful to add.

A piano keyboard example would be a very nice one I think :)

cu,



On Wed, Dec 24, 2008 at 5:19 PM, Lenard Lindstrom le...@telus.net wrote:


Hi René,

I will look at the new midi.py and flesh out the keyboard example: port
selection, a piano keyboard in the window, more notes, etc. It's good news
about the pypm wrapper. One thing I was wondering, is it possible to hide
the portmidi event to Pygame event translation, so only Pygame events are
visible in the main loop?

Lenard

René Dudfield wrote:
  

hey,

that's cool.  I checked in a new pygame.midi which uses a modified
version of your output class.

I also put an examples/midi.py in there.  It contains an input
example, and your output example converted to use the pygame.midi
module.

python midi.py --output
python midi.py --input


Also John Harrison said we could use his pyrex pypm portmidi wrapper
in pygame :)

cu,

On Wed, Dec 24, 2008 at 6:57 AM, Lenard Lindstrom le...@telus.net wrote:



Hi,

I'm reposting my keyboard pyportmidi example. It has been changed to use
pygame.pypm. The midiport module may be of interest as it contains an
output
class. The keyboard program could go into the examples, with some
improvements. Once midi has been fixed if you want to add keyboard.py to
the
examples, with the needed changes for pygame.midi, I can spruce it up to
make it more intuitive.

Usage: The q,w,e and r keys play four notes on the Church Organ
instrument.
Also the four notes can be played by clicking horizontally across the
blue
window. It is very simple for now but could be developed into a proper
keyboard.

Lenard

René Dudfield wrote:

  

hi again,

Another note:

Tim Thompson said we could include his patches to pyportmidi, and also
include some of his other midi code...

You'll also find there a python module (nosuch.midiutil) that
contains higher-level routines for MIDI things, including a MIDI file
reader, simple scheduler, etc.





--
Lenard Lindstrom
le...@telus.net



  

--
Lenard Lindstrom
le...@telus.net


  



--
Lenard Lindstrom
le...@telus.net



Re: [pygame] pygame.midi using portmidi?

2009-01-13 Thread René Dudfield
ah cool, thanks for the fix :)


All the compilation pages for different platforms are on the wiki:
http://pygame.org/wiki/index

The mac one is here: http://pygame.org/wiki/MacCompile


I think with portmidi, compiling it ourselves on mac is the way to go.
 Seemed easy to compile on win/linux... so hopefully it compiles ok on
mac too.


cheers,



On Wed, Jan 14, 2009 at 4:48 AM, Brian Fisher br...@hamsterrepublic.com wrote:

 I just fixed a missing comma problem with mac os x building, so it seems to 
 happily build without portmidi, but I'm not sure what the recommended way to 
 get the portmidi dependencies for OS X are? prebuilts? build yourself from 
 svn? from a specific version package?

 Also, didn't we use to have a page about all the mac os x building 
 dependencies? (libjpeg, libpng, sdl, etc) where is that?

 On Mon, Dec 22, 2008 at 11:48 PM, René Dudfield ren...@gmail.com wrote:

 pygame.midi in svn now, and seems to build ok, and run with the latest
 svn.  I still have a bit of work to do on it... including docs,
 finishing an output class, tests etc.  Also, only tested on windows so
 far.  Still need to make sure it compiles, and works on Mac and linux.




Re: [pygame] pygame.midi using portmidi?

2009-01-13 Thread Lenard Lindstrom
Regarding PortTime, the necessary change to the Windows dependency 
builder is committed to SVN. Thanks for the complement on the keyboard 
example. I used POV-Ray to get the 3D effect in the sprite images.


Lenard


René Dudfield wrote:

Hi,

this is because I guess it could be possible that portmidi is
installed, but port time is not... However that's probably a silly
reason... since I think portmidi depends on porttime.

Also, I didn't think to do that :)


ps.  that keyboard in the midi example looks really nice.



On Wed, Jan 14, 2009 at 5:59 AM, Lenard Lindstrom le...@telus.net wrote:
  

Hi René,

Good stuff. I added a main() function to midi.py, for consistency, as well
as a --list option. As for porttime it is no big problem to repair the
Windows build. Just curious though, why did add a new PORTTIME macro to
Setup.in instead of:

PORTMIDI = -lportmidi -lporttime


Lenard

P.S.  Brian, just add the line

PORTTIME =

to prebuilt\Setup_Win.in and the automated Windows builds will continue to
work.


René Dudfield wrote:


Hi,

I added a get_device_info(device_id) function... to allow seeing which
devices are available.  The midi.py example prints out the available
devices.

it is also compiling on ubuntu... (ya! I finally got my ubuntu
partition working again).

Had to link in libporttime... and therefore add it as a dependency,
which may have broken msys build.

Added allowing to specify an optional device_id  on the cmd line  eg,
--input 3


cu,



On Wed, Dec 24, 2008 at 6:10 PM, René Dudfield ren...@gmail.com wrote:

  

Hi,

yes, something like that would be good.  There could be a separate
function running in a background thread to handle all of the input
midi.  Which I think would just run code similar to what is in the
example.  Probably something very useful to add.

A piano keyboard example would be a very nice one I think :)

cu,



On Wed, Dec 24, 2008 at 5:19 PM, Lenard Lindstrom le...@telus.net
wrote:



Hi René,

I will look at the new midi.py and flesh out the keyboard example: port
selection, a piano keyboard in the window, more notes, etc. It's good
news
about the pypm wrapper. One thing I was wondering, is it possible to
hide
the portmidi event to Pygame event translation, so only Pygame events
are
visible in the main loop?

Lenard

René Dudfield wrote:

  

hey,

that's cool.  I checked in a new pygame.midi which uses a modified
version of your output class.

I also put an examples/midi.py in there.  It contains an input
example, and your output example converted to use the pygame.midi
module.

python midi.py --output
python midi.py --input


Also John Harrison said we could use his pyrex pypm portmidi wrapper
in pygame :)

cu,

On Wed, Dec 24, 2008 at 6:57 AM, Lenard Lindstrom le...@telus.net
wrote:




Hi,

I'm reposting my keyboard pyportmidi example. It has been changed to
use
pygame.pypm. The midiport module may be of interest as it contains an
output
class. The keyboard program could go into the examples, with some
improvements. Once midi has been fixed if you want to add keyboard.py
to
the
examples, with the needed changes for pygame.midi, I can spruce it up
to
make it more intuitive.

Usage: The q,w,e and r keys play four notes on the Church Organ
instrument.
Also the four notes can be played by clicking horizontally across the
blue
window. It is very simple for now but could be developed into a proper
keyboard.

Lenard

René Dudfield wrote:


  

hi again,

Another note:

Tim Thompson said we could include his patches to pyportmidi, and
also
include some of his other midi code...

You'll also find there a python module (nosuch.midiutil) that
contains higher-level routines for MIDI things, including a MIDI file
reader, simple scheduler, etc.










--
Lenard Lindstrom
le...@telus.net



Re: [pygame] pygame.midi using portmidi?

2008-12-23 Thread René Dudfield
hi again,

Another note:

Tim Thompson said we could include his patches to pyportmidi, and also
include some of his other midi code...

You'll also find there a python module (nosuch.midiutil) that
contains higher-level routines for MIDI things, including a MIDI file
reader, simple scheduler, etc.


cu!


On Tue, Dec 23, 2008 at 6:48 PM, René Dudfield ren...@gmail.com wrote:
 yeah, good point.

 I've used pyrex to generate a pypm.c file, and included that along
 with the pypm.pyx file.  This way pygame doesn't need pyrex as a
 dependency.

 Might as well use the existing python binding for portmidi.  There's a
 few patches floating around the net... so hopefully I can find them
 and pull them into the pygame version... and then they can hopefully
 flow back into the pyportmidi version.

 I've emailed the author of pyportmidi to ask him if it's ok to include
 it in pygame too.  It should be under the python license (I think),
 but I emailed him just to make sure.

 pygame.midi in svn now, and seems to build ok, and run with the latest
 svn.  I still have a bit of work to do on it... including docs,
 finishing an output class, tests etc.  Also, only tested on windows so
 far.  Still need to make sure it compiles, and works on Mac and linux.


 cheers,



 On Mon, Dec 22, 2008 at 8:53 PM, Toni Alatalo ant...@kyperjokki.fi wrote:
 René Dudfield kirjoitti:

 going to try and use pyportmidi, but decided against it.  since
 pyportmidi is written in pyrex, whereas pygame uses C modules.  Also


 i don't understand the reasoning there, as Pyrex is just a way to write C.
 i.e. something written in Pyrex is a C module.

 otherwise: interesting stuff, thanks for info!

 ~Toni

 On Wed, Dec 17, 2008 at 1:12 PM, Lenard Lindstrom le...@telus.net wrote:


 That looks good. test.exe works for me too, except when it is killed
 prematurely. It still quits, but gives me an error message as well.
 Anyway,
 I will look at adding portmidi to the Windows dependency build process. I
 just need to make sure it is optional.

 Lenard

 René Dudfield wrote:


 cool, I'll try out the midi tests some more on the weekend.  test.exe
 with option 6 seems to work for me.

 yeah, I've used pyportmidi :)  I think a few things need to be redone
 though, but maybe I should just use that, and send them patches (or
 point them to the pygame svn).

 I've already got code to convert midi events into pygame events...
 which is useful if you want to handle midi events in the same way as
 keyboard/mouse/joystick events.  Also did some code to run the midi
 stuff as a background thread, which I think will make it easier for
 people - so they don't need to manage the midi streams themselves.




 --
 Lenard Lindstrom
 le...@telus.net








Re: [pygame] pygame.midi using portmidi?

2008-12-23 Thread Lenard Lindstrom

Hi,

I'm reposting my keyboard pyportmidi example. It has been changed to use 
pygame.pypm. The midiport module may be of interest as it contains an 
output class. The keyboard program could go into the examples, with some 
improvements. Once midi has been fixed if you want to add keyboard.py to 
the examples, with the needed changes for pygame.midi, I can spruce it 
up to make it more intuitive.


Usage: The q,w,e and r keys play four notes on the Church Organ 
instrument. Also the four notes can be played by clicking horizontally 
across the blue window. It is very simple for now but could be developed 
into a proper keyboard.


Lenard

René Dudfield wrote:

hi again,

Another note:

Tim Thompson said we could include his patches to pyportmidi, and also
include some of his other midi code...

You'll also find there a python module (nosuch.midiutil) that
contains higher-level routines for MIDI things, including a MIDI file
reader, simple scheduler, etc.

  


--
Lenard Lindstrom
le...@telus.net



midikeyboard.tar.gz
Description: GNU Zip compressed data


Re: [pygame] pygame.midi using portmidi?

2008-12-23 Thread Lenard Lindstrom

Hi René,

I will look at the new midi.py and flesh out the keyboard example: port 
selection, a piano keyboard in the window, more notes, etc. It's good 
news about the pypm wrapper. One thing I was wondering, is it possible 
to hide the portmidi event to Pygame event translation, so only Pygame 
events are visible in the main loop?


Lenard

René Dudfield wrote:

hey,

that's cool.  I checked in a new pygame.midi which uses a modified
version of your output class.

I also put an examples/midi.py in there.  It contains an input
example, and your output example converted to use the pygame.midi
module.

python midi.py --output
python midi.py --input


Also John Harrison said we could use his pyrex pypm portmidi wrapper
in pygame :)

cu,

On Wed, Dec 24, 2008 at 6:57 AM, Lenard Lindstrom le...@telus.net wrote:
  

Hi,

I'm reposting my keyboard pyportmidi example. It has been changed to use
pygame.pypm. The midiport module may be of interest as it contains an output
class. The keyboard program could go into the examples, with some
improvements. Once midi has been fixed if you want to add keyboard.py to the
examples, with the needed changes for pygame.midi, I can spruce it up to
make it more intuitive.

Usage: The q,w,e and r keys play four notes on the Church Organ instrument.
Also the four notes can be played by clicking horizontally across the blue
window. It is very simple for now but could be developed into a proper
keyboard.

Lenard

René Dudfield wrote:


hi again,

Another note:

Tim Thompson said we could include his patches to pyportmidi, and also
include some of his other midi code...

You'll also find there a python module (nosuch.midiutil) that
contains higher-level routines for MIDI things, including a MIDI file
reader, simple scheduler, etc.


  

--
Lenard Lindstrom
le...@telus.net






--
Lenard Lindstrom
le...@telus.net



Re: [pygame] pygame.midi using portmidi?

2008-12-23 Thread René Dudfield
Hi,

yes, something like that would be good.  There could be a separate
function running in a background thread to handle all of the input
midi.  Which I think would just run code similar to what is in the
example.  Probably something very useful to add.

A piano keyboard example would be a very nice one I think :)

cu,



On Wed, Dec 24, 2008 at 5:19 PM, Lenard Lindstrom le...@telus.net wrote:
 Hi René,

 I will look at the new midi.py and flesh out the keyboard example: port
 selection, a piano keyboard in the window, more notes, etc. It's good news
 about the pypm wrapper. One thing I was wondering, is it possible to hide
 the portmidi event to Pygame event translation, so only Pygame events are
 visible in the main loop?

 Lenard

 René Dudfield wrote:

 hey,

 that's cool.  I checked in a new pygame.midi which uses a modified
 version of your output class.

 I also put an examples/midi.py in there.  It contains an input
 example, and your output example converted to use the pygame.midi
 module.

 python midi.py --output
 python midi.py --input


 Also John Harrison said we could use his pyrex pypm portmidi wrapper
 in pygame :)

 cu,

 On Wed, Dec 24, 2008 at 6:57 AM, Lenard Lindstrom le...@telus.net wrote:


 Hi,

 I'm reposting my keyboard pyportmidi example. It has been changed to use
 pygame.pypm. The midiport module may be of interest as it contains an
 output
 class. The keyboard program could go into the examples, with some
 improvements. Once midi has been fixed if you want to add keyboard.py to
 the
 examples, with the needed changes for pygame.midi, I can spruce it up to
 make it more intuitive.

 Usage: The q,w,e and r keys play four notes on the Church Organ
 instrument.
 Also the four notes can be played by clicking horizontally across the
 blue
 window. It is very simple for now but could be developed into a proper
 keyboard.

 Lenard

 René Dudfield wrote:


 hi again,

 Another note:

 Tim Thompson said we could include his patches to pyportmidi, and also
 include some of his other midi code...

 You'll also find there a python module (nosuch.midiutil) that
 contains higher-level routines for MIDI things, including a MIDI file
 reader, simple scheduler, etc.




 --
 Lenard Lindstrom
 le...@telus.net





 --
 Lenard Lindstrom
 le...@telus.net




Re: [pygame] pygame.midi using portmidi?

2008-12-22 Thread René Dudfield
Hi,

I've added the start of a midi module using portmidi.  It's a python
module at the moment, and uses the pyportmidi wrapper underneath.

It's in lib/midi.py in subversion control, and once it's finished will
be available as pygame.midi

Lenard has also added portmidi to the windows prebuilts, so the
portmidi dlls are available on windows.


I also wrote a little sampler type program to play with the other
week, and it seems to get ok latency with my midi controller.  I
haven't timed the latency, but it seems faster than my qwerty keyboard
input for example.  I converted the midi input events into pygame
events, so it was very simple to use... just like any other pygame
input (mouse, keyboard, joystick etc)


My next step is to write the bindings for portmidi directly... I was
going to try and use pyportmidi, but decided against it.  since
pyportmidi is written in pyrex, whereas pygame uses C modules.  Also
pyportmidi hasn't been updated since 2005, and doesn't seem to have
wide distribution(eg not in debian, or macports).



cheers,


On Wed, Dec 17, 2008 at 1:12 PM, Lenard Lindstrom le...@telus.net wrote:
 That looks good. test.exe works for me too, except when it is killed
 prematurely. It still quits, but gives me an error message as well. Anyway,
 I will look at adding portmidi to the Windows dependency build process. I
 just need to make sure it is optional.

 Lenard

 René Dudfield wrote:

 cool, I'll try out the midi tests some more on the weekend.  test.exe
 with option 6 seems to work for me.

 yeah, I've used pyportmidi :)  I think a few things need to be redone
 though, but maybe I should just use that, and send them patches (or
 point them to the pygame svn).

 I've already got code to convert midi events into pygame events...
 which is useful if you want to handle midi events in the same way as
 keyboard/mouse/joystick events.  Also did some code to run the midi
 stuff as a background thread, which I think will make it easier for
 people - so they don't need to manage the midi streams themselves.



 --
 Lenard Lindstrom
 le...@telus.net




Re: [pygame] pygame.midi using portmidi?

2008-12-22 Thread Toni Alatalo

René Dudfield kirjoitti:

going to try and use pyportmidi, but decided against it.  since
pyportmidi is written in pyrex, whereas pygame uses C modules.  Also
  


i don't understand the reasoning there, as Pyrex is just a way to write 
C. i.e. something written in Pyrex is a C module.


otherwise: interesting stuff, thanks for info!

~Toni

On Wed, Dec 17, 2008 at 1:12 PM, Lenard Lindstrom le...@telus.net wrote:
  

That looks good. test.exe works for me too, except when it is killed
prematurely. It still quits, but gives me an error message as well. Anyway,
I will look at adding portmidi to the Windows dependency build process. I
just need to make sure it is optional.

Lenard

René Dudfield wrote:


cool, I'll try out the midi tests some more on the weekend.  test.exe
with option 6 seems to work for me.

yeah, I've used pyportmidi :)  I think a few things need to be redone
though, but maybe I should just use that, and send them patches (or
point them to the pygame svn).

I've already got code to convert midi events into pygame events...
which is useful if you want to handle midi events in the same way as
keyboard/mouse/joystick events.  Also did some code to run the midi
stuff as a background thread, which I think will make it easier for
people - so they don't need to manage the midi streams themselves.


  

--
Lenard Lindstrom
le...@telus.net







Re: [pygame] pygame.midi using portmidi?

2008-12-22 Thread Lenard Lindstrom

René Dudfield wrote:

Hi,

I've added the start of a midi module using portmidi.  It's a python
module at the moment, and uses the pyportmidi wrapper underneath.

  

[snip]

Lenard has also added portmidi to the windows prebuilts, so the
portmidi dlls are available on windows.


  

The latest Pygame dependencies for Windows can be found at:

http://www3.telus.net/len_l/pygame/

md5sum:
0c9b5c65dbd10b5469d2523cf58b7890 *prebuilt-pygame1.9.0-msvcr71-win32.zip

The Python 2.4/2.5 one is the most recent. The 2.6 prebuilt lacks 
portmidi. I need to confirm a bug fix before I officially release a 
Pygame 1.9.0 build for Python 2.6. I also hope to have numpy ready 
(built but untried).


--
Lenard Lindstrom
le...@telus.net



Re: [pygame] pygame.midi using portmidi?

2008-12-22 Thread René Dudfield
yeah, good point.

I've used pyrex to generate a pypm.c file, and included that along
with the pypm.pyx file.  This way pygame doesn't need pyrex as a
dependency.

Might as well use the existing python binding for portmidi.  There's a
few patches floating around the net... so hopefully I can find them
and pull them into the pygame version... and then they can hopefully
flow back into the pyportmidi version.

I've emailed the author of pyportmidi to ask him if it's ok to include
it in pygame too.  It should be under the python license (I think),
but I emailed him just to make sure.

pygame.midi in svn now, and seems to build ok, and run with the latest
svn.  I still have a bit of work to do on it... including docs,
finishing an output class, tests etc.  Also, only tested on windows so
far.  Still need to make sure it compiles, and works on Mac and linux.


cheers,



On Mon, Dec 22, 2008 at 8:53 PM, Toni Alatalo ant...@kyperjokki.fi wrote:
 René Dudfield kirjoitti:

 going to try and use pyportmidi, but decided against it.  since
 pyportmidi is written in pyrex, whereas pygame uses C modules.  Also


 i don't understand the reasoning there, as Pyrex is just a way to write C.
 i.e. something written in Pyrex is a C module.

 otherwise: interesting stuff, thanks for info!

 ~Toni

 On Wed, Dec 17, 2008 at 1:12 PM, Lenard Lindstrom le...@telus.net wrote:


 That looks good. test.exe works for me too, except when it is killed
 prematurely. It still quits, but gives me an error message as well.
 Anyway,
 I will look at adding portmidi to the Windows dependency build process. I
 just need to make sure it is optional.

 Lenard

 René Dudfield wrote:


 cool, I'll try out the midi tests some more on the weekend.  test.exe
 with option 6 seems to work for me.

 yeah, I've used pyportmidi :)  I think a few things need to be redone
 though, but maybe I should just use that, and send them patches (or
 point them to the pygame svn).

 I've already got code to convert midi events into pygame events...
 which is useful if you want to handle midi events in the same way as
 keyboard/mouse/joystick events.  Also did some code to run the midi
 stuff as a background thread, which I think will make it easier for
 people - so they don't need to manage the midi streams themselves.




 --
 Lenard Lindstrom
 le...@telus.net







Re: [pygame] pygame.midi using portmidi?

2008-12-16 Thread René Dudfield
cool, I'll try out the midi tests some more on the weekend.  test.exe
with option 6 seems to work for me.

yeah, I've used pyportmidi :)  I think a few things need to be redone
though, but maybe I should just use that, and send them patches (or
point them to the pygame svn).

I've already got code to convert midi events into pygame events...
which is useful if you want to handle midi events in the same way as
keyboard/mouse/joystick events.  Also did some code to run the midi
stuff as a background thread, which I think will make it easier for
people - so they don't need to manage the midi streams themselves.

cu,

On Tue, Dec 16, 2008 at 8:48 AM, Lenard Lindstrom le...@telus.net wrote:
 Thanks. You are aware of PyPortMidi, right? And you should play with the
 test programs a bit first. Try test.exe with option 6, then after pressing
 enter to start streaming press enter again before it has finished. I get a
 mini-crash. That is, it prints an abnormal termination message to the
 console. An earlier build brought up a dialog box with a program crash
 report ready for transmission to Microsoft.

 Lenard

 René Dudfield wrote:

 nice one :)

 I'll start adding the midi stuff in then.  I'll put a direct wrapper
 in as _portmidi.dll and the pygame interface in as midi.py


 cheers,


 On Mon, Dec 15, 2008 at 10:17 AM, Lenard Lindstrom le...@telus.net
 wrote:


 I built the library for msvcr71.dll and have the binaries, with test
 programs, on my site: www3.telus.net/len_l/pygame

 494d352168fa01866f4cfe8adb620181 *portmidi-msvcr71-win32.zip

 Lenard


 Lenard Lindstrom wrote:


 Yes, I've played around with midi too. I will give the portmidi a go and
 see if it will link to msvcr71.dll.

 Lenard

 René Dudfield wrote:


 hey,

 I've been messing around with using midi input and output from pygame
 using the portmidi library.

 This should be quite useful for anyone interested in talking to
 various midi controllers, or music equipment that talks midi.

 The portmidi dll is only 13KB on windows, so I think maybe 60KB all up
 once turning it into a python wrapper.  It also appears to be quite
 portable, and is already available in debian/ubuntu/macports/redhat
 etc.  I don't think it supports freebsd, since I don't think freebsd
 has a finished midi driver yet.  portmidi apparently compiles ok with
 mingw too... but I haven't tried it yet, I've just used a precompiled
 version.


 Any objections to including it as an optional part of pygame?  I think
 it'd be very useful for people using pygame for music/multimedia
 projects... or for people wanting to use more advanced controllers for
 whatever reason.






 --
 Lenard Lindstrom
 le...@telus.net




Re: [pygame] pygame.midi using portmidi?

2008-12-16 Thread Lenard Lindstrom
That looks good. test.exe works for me too, except when it is killed 
prematurely. It still quits, but gives me an error message as well. 
Anyway, I will look at adding portmidi to the Windows dependency build 
process. I just need to make sure it is optional.


Lenard

René Dudfield wrote:

cool, I'll try out the midi tests some more on the weekend.  test.exe
with option 6 seems to work for me.

yeah, I've used pyportmidi :)  I think a few things need to be redone
though, but maybe I should just use that, and send them patches (or
point them to the pygame svn).

I've already got code to convert midi events into pygame events...
which is useful if you want to handle midi events in the same way as
keyboard/mouse/joystick events.  Also did some code to run the midi
stuff as a background thread, which I think will make it easier for
people - so they don't need to manage the midi streams themselves.

  

--
Lenard Lindstrom
le...@telus.net



Re: [pygame] pygame.midi using portmidi?

2008-12-15 Thread Lenard Lindstrom
Thanks. You are aware of PyPortMidi, right? And you should play with the 
test programs a bit first. Try test.exe with option 6, then after 
pressing enter to start streaming press enter again before it has 
finished. I get a mini-crash. That is, it prints an abnormal termination 
message to the console. An earlier build brought up a dialog box with a 
program crash report ready for transmission to Microsoft.


Lenard

René Dudfield wrote:

nice one :)

I'll start adding the midi stuff in then.  I'll put a direct wrapper
in as _portmidi.dll and the pygame interface in as midi.py


cheers,


On Mon, Dec 15, 2008 at 10:17 AM, Lenard Lindstrom le...@telus.net wrote:
  

I built the library for msvcr71.dll and have the binaries, with test
programs, on my site: www3.telus.net/len_l/pygame

494d352168fa01866f4cfe8adb620181 *portmidi-msvcr71-win32.zip

Lenard


Lenard Lindstrom wrote:


Yes, I've played around with midi too. I will give the portmidi a go and
see if it will link to msvcr71.dll.

Lenard

René Dudfield wrote:
  

hey,

I've been messing around with using midi input and output from pygame
using the portmidi library.

This should be quite useful for anyone interested in talking to
various midi controllers, or music equipment that talks midi.

The portmidi dll is only 13KB on windows, so I think maybe 60KB all up
once turning it into a python wrapper.  It also appears to be quite
portable, and is already available in debian/ubuntu/macports/redhat
etc.  I don't think it supports freebsd, since I don't think freebsd
has a finished midi driver yet.  portmidi apparently compiles ok with
mingw too... but I haven't tried it yet, I've just used a precompiled
version.


Any objections to including it as an optional part of pygame?  I think
it'd be very useful for people using pygame for music/multimedia
projects... or for people wanting to use more advanced controllers for
whatever reason.








--
Lenard Lindstrom
le...@telus.net



Re: [pygame] pygame.midi using portmidi?

2008-12-14 Thread Lenard Lindstrom
Yes, I've played around with midi too. I will give the portmidi a go and 
see if it will link to msvcr71.dll.


Lenard

René Dudfield wrote:

hey,

I've been messing around with using midi input and output from pygame
using the portmidi library.

This should be quite useful for anyone interested in talking to
various midi controllers, or music equipment that talks midi.

The portmidi dll is only 13KB on windows, so I think maybe 60KB all up
once turning it into a python wrapper.  It also appears to be quite
portable, and is already available in debian/ubuntu/macports/redhat
etc.  I don't think it supports freebsd, since I don't think freebsd
has a finished midi driver yet.  portmidi apparently compiles ok with
mingw too... but I haven't tried it yet, I've just used a precompiled
version.


Any objections to including it as an optional part of pygame?  I think
it'd be very useful for people using pygame for music/multimedia
projects... or for people wanting to use more advanced controllers for
whatever reason.


cu,
  



--
Lenard Lindstrom
le...@telus.net



Re: [pygame] pygame.midi using portmidi?

2008-12-14 Thread Lenard Lindstrom
I built the library for msvcr71.dll and have the binaries, with test 
programs, on my site: www3.telus.net/len_l/pygame


494d352168fa01866f4cfe8adb620181 *portmidi-msvcr71-win32.zip

Lenard


Lenard Lindstrom wrote:


Yes, I've played around with midi too. I will give the portmidi a go 
and see if it will link to msvcr71.dll.


Lenard

René Dudfield wrote:

hey,

I've been messing around with using midi input and output from pygame
using the portmidi library.

This should be quite useful for anyone interested in talking to
various midi controllers, or music equipment that talks midi.

The portmidi dll is only 13KB on windows, so I think maybe 60KB all up
once turning it into a python wrapper.  It also appears to be quite
portable, and is already available in debian/ubuntu/macports/redhat
etc.  I don't think it supports freebsd, since I don't think freebsd
has a finished midi driver yet.  portmidi apparently compiles ok with
mingw too... but I haven't tried it yet, I've just used a precompiled
version.


Any objections to including it as an optional part of pygame?  I think
it'd be very useful for people using pygame for music/multimedia
projects... or for people wanting to use more advanced controllers for
whatever reason.


cu,
  






--
Lenard Lindstrom
le...@telus.net



[pygame] pygame.midi using portmidi?

2008-12-13 Thread René Dudfield
hey,

I've been messing around with using midi input and output from pygame
using the portmidi library.

This should be quite useful for anyone interested in talking to
various midi controllers, or music equipment that talks midi.

The portmidi dll is only 13KB on windows, so I think maybe 60KB all up
once turning it into a python wrapper.  It also appears to be quite
portable, and is already available in debian/ubuntu/macports/redhat
etc.  I don't think it supports freebsd, since I don't think freebsd
has a finished midi driver yet.  portmidi apparently compiles ok with
mingw too... but I haven't tried it yet, I've just used a precompiled
version.


Any objections to including it as an optional part of pygame?  I think
it'd be very useful for people using pygame for music/multimedia
projects... or for people wanting to use more advanced controllers for
whatever reason.


cu,