Python suitable for Midi ?

Chuckk Hubbard badmuthahubbard at gmail.com
Fri Oct 31 06:04:08 EDT 2008


On Tue, Oct 28, 2008 at 7:13 PM, Derek Martin <code at pizzashack.org> wrote:
> On Tue, Oct 28, 2008 at 06:54:57PM +0200, Chuckk Hubbard wrote:
>> The problem I've run into is that I can't set the audio to a higher
>> priority than the GUI (Tkinter).  If I move the mouse over the app, no
>> matter what, I get audio dropouts.  AFAICT this is the same for all
>> Python, regardless of what modules one uses: you can't assign system
>> priorities to different threads.  If you're planning to pipe MIDI to
>> another app for playback, maybe it won't be an issue for you.
>
> FWIW...  You could take your own advice, and devide your application
> in two: one process manages the GUI, and the second is a back-end
> process that plays the MIDI.  Your GUI can even launch the back end,
> which will inherit the priority of the GUI, after which the GUI can
> reduce its own priority (the priority of the back end will not be
> affected by the change)...

Thanks, Derek!  It took me some looking and experimenting, but this is
a great idea.  I see now that os.nice() works for Mac too, and Gabriel
has some suggestions for Windows.  So simple- I was thinking I needed
superuser access to set priority to real-time, but I don't need it to
raise the priority of a running process.  I never would have thought
of that on my own.

-Chuckk


-- 
http://www.badmuthahubbard.com



More information about the Python-list mailing list