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

Re: [pygame] pygame.midi using portmidi?



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 <len-l@xxxxxxxxx> 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 <len-l@xxxxxxxxx> 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
>>> <len-l@xxxxxxxxx>
>>>
>>>
>>>
>
>
> --
> Lenard Lindstrom
> <len-l@xxxxxxxxx>
>
>