I've been working to wrap up some loose ends in PortMidi. The main one 
is that it is clumsy to select input/output devices, especially if you 
are writing a simple app and don't want to create an elaborate user 
interface just to get some MIDI going.

PortMidi has always had a functions to get default device IDs, but in 
practice, there's rarely a single device that will satisfy all 
applications, so I found myself inventing various schemes to select 
usable devices.

A better solution is to have a "chooser" application where users can 
select default devices and to have the built-in 
Pm_GetDefaultInputDeviceID() and Pm_GetDefaultOutputDeviceID() functions 
look up the values selected by the user. Then small apps are very 
simple, but users get to use a nice graphical interface to choose devices.

This is now working in my OS X implementation, and I plan to port this 
to Win32 and Linux. The interface is written in Java to be more-or-less 
portable. It has pull-down selections to choose input and output 
devices. A light flashes when the selected input port gets a message and 
a "test" button sends a note-on/off to the selected output port. A 
refresh button refreshes the lists so you can plug in a USB device or 
start up a software device while the chooser is running. Finally, you 
can disconnect from the selected ports in case the system will not let 
two applications open the port at the same time.

A summary of changes and design decisions:

default device info is stored according to the Java Preferences class. 
(So whereever Java puts it, PortMidi has to go there to find it, but 
this will not be something users see. This led to some painful coding of 
a binary prefs file parser in C for OS X.)

documentation (portmidi.h) now states that default devices are 
established using Java Preferences. The old stuff about looking for 
environment variables has been removed.

There is a JPortMidi class that is a pretty full API for PortMidi for 
Java programs.

PortTime is now part of PortMidi rather than a separate library. (This 
was already the case for the dynamic link libraries created mainly for 
Common Lisp / Common Music).

Work left to do: more testing, update projects, makefiles, etc. on 
Windows and Linux
Does anyone know how to install a Java application in the Apple 
Preferences window or into Windows Control Panel?





_______________________________________________
media_api mailing list
media_api@create.ucsb.edu
http://lists.create.ucsb.edu/mailman/listinfo/media_api

Reply via email to