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

Re: [pygame] Midi Crashes on Error



Hi Lenard,

On 02.11.2013 02:25, Lenard Lindstrom wrote:
> Just wondering, if the Python level callback is found to be too slow, could a
> C level callback mechanism be provided?

how would you suggest this should be used? From Python or C?

In python-rtmidi this is currently not possible from Python, because
'MidiIn.set_callback' wraps a Python callback function with a C function
implemented in Cython (and you can't access the C++ object directly in
Python, only in the Cython code).

I guess it would be easy to make the C++ method 'RtMidiIn.setCallback'
available directly in Python, but I'm not sure how a pointer to a C
function could be passed by Python then or how such a pointer could be
obtained by Python.

So any ideas about a suitable API for this? And how it would tie into
PyGame's C code?


Chris