This page specify all the device supported by jMax, their configuration parameters and the platforms where they can be used.
On Linux, you may configure jMax to use OSS (Open Sound System) directly for audio and midi i/o. This is legacy code, deriving from the first jMax porting on Linux, but may be usefull in some situation.
TO BE COMPLETED
TO BE COMPLETED
On Linux, Windows and Mac OS X, you may configure jMax to use the portdev and portmidi library for audio and midi i/o. This is a portable library, offering an uniform API bridging the native sound implementation.
On Linux, portaudio can connect to OSS, Alsa and Jack (depending on the version and on the Linux distribution).
On Windows, portaudio can connect to …
On Mac OS X, portaudio connect to the Core Audio and midi system.
In each implementation, portaudio implements a numbered list of virtual device, each of them mapped to a local library or to a specific device of the library. One of the device is designated as the default portdev device, that should be a reasonable device for the platform.
As shipped, jMax is configured to use portaudio for i/o, and to open the default portdev device; in this way, jMax should work in a reasonable configuration out of the box.
You can of course change the configuration and choose your own device.
First step, is to know the devices that are seen by portaudio; there is no configuration tool shipped with portaudio for the moment, just a test program to inspect the configuration, that has been integrated to jMax in SnapShot 175.
So you can use jMax to get some information: open a patch (anyone), and open the help menu; you'll find a Port Audio Info menu item, that will show some information on the configuration, including, for each device, the integer (index) identifying the device.
In Snapshot 175, the ouput is to the jMax Console, and print a list of
the portaudio virtual devices, with their number id, and their
characteristics. The format is somehow raw and technical, and you may
also get a number of errors on a additional error window that can pop
up; you can safely ignore it. Future snapshots will have a more
polished.
Once you have identified the number of the device you want to use, you need to define an i/o configuration, either in your .jmax.xml file, in the installation jmax.xml file or in an additional file to be included if you prefer. Check the documentation of the i/o configuration here.
The jMax portaudio device is somehow peculiar. The current jMax implementation assume half-duplex devices, i.e. describe a real full duplex device as two separate hald duplex jMax devices, and perform two separate open operations on input and on output. This choice derive from the first jMax impleemntation on SGI, and it is not easily changable on the short term.
The portaudio devices are instrinsecally full duplex, and only one operations must be performed to open both devices.
To match the two models, the portaudio jMax device implementation require to specify input and output parameters in both input and output device declarations, so that the first open actually open both input and output; input and output devices are matched using a identifier attribute (deviceName).
En example configuration opening both input and outputs portdev device is the following:
<io-configuration name="myconf"> <device name="portAudioStereoOut" type="portaudio_dac" deviceName="portaudio_default" in_device="1" out_device="1" in_channels="2" out_channels="4"/> <device name="portAudioStereoIn" type="portaudio_adc" deviceName="portaudio_default" in_device="1" out_device="1" in_channels="2" out_channels="4"/> <map> <logical-device type="out~" name="main"/> <device name="portAudioStereoOut" /> </map> <map> <logical-device type="in~" name="main"/> <device name="portAudioStereoIn" /> </map> </io-configuration>
In both declaration, in_device is the portaudio index for the device
to be used for input, and out_device is the portaudio index for the device
to be used for output. If missing, the default device will be used.
The in_channels an out_channels specify the number of channels for input and for
outut. If any of the two is not specified, 0 is assumed, i.e. no input or output is
done on the device.
The argument names for the port audio midi devices are again strange for the opposite reason that the portaudio. Midi devices in jMax are full duplex (why ?), while portmidi devices are either input or output.
No time to fix the midi device issue and to port all the existing devices, so i just hacked a full duplex device that may be only input or output, but the arguments must specify all the options. Also, arguments are somehow inconsistent with the port audio arguments.
In BNF, the argument must be:
arguments ::- [<input spec>] [<output spec>] <input spec> ::- <in idx spec> | <in name spec> | <in default spec> <in idx spec> ::- input_index="<integer>" <in name spec> ::- input_name="<portmidi device name>" <in default spec> ::-> input_default="true" <output spec> ::- <out idx spec> | <out name spec> | <out default spec> <out idx spec> ::- output_index="<integer>" <out name spec> ::- output_name="<portmidi device name>" <out default spec> ::-> output_default="true"
An example of midi configuration is the following
<code xml>
<io-configuration name="myconf">
<device name="portMidiDefault"
type="portmidi"
input_default="true"
output_default="true"
/>
<device name="portMidiOne"
type="portmidi"
input_index="1"
output_index="1"
/>
<map>
<logical-device type="midi"/>
<device name="portMidiDefault" />
</map>
<map>
<logical-device type="midi" port="1"/>
<device name="portMidiOne" />
</map>
</xml>
The above map the portmidi default input and output port to the jMax default midi input and output, and the inputs and outputs of index 1 to the port 1 of the jMax midi system.
Unfortunately, there is no yet a tool to see the list of midi ports on Linux, while there is a tool developped by the portmidi community on Windows and MacOSX. We will soon add a help menu item to show the list of midi ports availables thru portmidi.