[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] MIDI output on OS X???



hi,

what does this show for you?
    python -m pygame.examples.midi --list

Have you seen the 'Audio Midi Setup' program in OSX?


The "in stat: : No such file or directory" messages are a bug with portmidi, and are fixed in portmidi subversion, but not in a release of portmidi yet.

Not sure why the pitch bend controller message is not working.


You might have more luck with this:
    http://notahat.com/pymidi

If you just care about midi on OSX.  I'm not sure if pyobjc wraps CoreMidi yet.

I found out SDL is in the process of rewriting its OSX midi support for SDL_mixer.



cheers,






On Sat, Oct 10, 2009 at 6:23 AM, Chris Phoenix <cphoenix@xxxxxxxxx> wrote:
OK... with SimpleSynth running, I now get "in stat: : No such file or
directory" printed twice on the pygame.midi.init() call.

If I continue, pygame.midi.get_default_output_id() returns 0, and
pygame.midi.get_count() returns 1.

But then midiOut = pygame.midi.Output(0, latency = 1) gives me this:
PortMidi call failed...
 PortMidi: `Bad pointer'
type ENTER...

Meanwhile, I'm using pygame.mixer to play midi files that I create. I
find that it doesn't play the last note of the tracks, even when
Quicktime does. And neither one seems to pay attention to the Pitch
Bend Range controller message. Any insight into any of this?

Thanks,
Chris

On Fri, Oct 9, 2009 at 6:55 AM, René Dudfield <renesd@xxxxxxxxx> wrote:
> Hi,
>
> Roger from portmedia explains the situation here:
>
> http://lists.create.ucsb.edu/pipermail/media_api/2009-October/000751.html
>
> In short, OSX does not come with midi output on all machines by default.
> You need to install a software synth to use it with CoreMidi.  SDL_mixer
> must be using something else to play midi files.
>
> Fluidsynth, and simplesynth would be two free options for software synths on
> osx.
>
> cu,
>
>
> On Fri, Oct 9, 2009 at 1:07 PM, René Dudfield <renesd@xxxxxxxxx> wrote:
>>
>> Hi,
>>
>> it seems to be able to list output devices that are plugged in.  Like it
>> lists my midi keyboard when plugged in.
>>
>> However it does not seem to list the internal midi hardware on sound
>> cards.
>>
>> pygame.midi uses CoreMIDI through portaudio on OSX.  pygame.music.midi
>> uses a different older API.  So maybe that's the cause of the problems.
>>
>> Will need to look into it some more.  If you can, please ask on the
>> portmedia mailing list at:
>> http://lists.create.ucsb.edu/mailman/listinfo/media_api
>>
>> If you can't post, I'll follow up on it later there.
>>
>>
>> cheers,
>>
>>
>> On Thu, Oct 8, 2009 at 10:20 AM, Chris Phoenix <cphoenix@xxxxxxxxx> wrote:
>>>
>>> I'd like to make a MIDI sound from a Python program. PyGame's midi
>>> module was supposed to do it, but it doesn't seem to have a default
>>> midi output device - or any midi output device!
>>>
>>> pygame.midi.get_default_output_id() returns -1. Half an hour of
>>> googling didn't help. Looking at the unit tests didn't help (there's a
>>> bugfix aimed at this problem, but it seems to just bypass the test).
>>>
>>> The mixer module can indeed read a midi file and make a sound come out
>>> the speakers, but I'd rather drive the midi directly instead of
>>> writing mini-files and playing them...
>>>
>>> What should I pass in to pygame.midi.Output() on 10.5? Or what should
>>> I do to create the midi device so that
>>> pygame.midi.get_default_output_id() will tell me something other than
>>> -1?
>>>
>>> Thanks...
>>>
>>> Chris
>>>
>>> --
>>> Chris Phoenix
>>> cphoenix@xxxxxxxxx
>>> 650-776-5195
>>>
>>> Director of Research
>>> Center for Responsible Nanotechnology
>>> http://CRNano.org
>>
>
>



--
Chris Phoenix
cphoenix@xxxxxxxxx
650-776-5195

Director of Research
Center for Responsible Nanotechnology
http://CRNano.org