| TOC |
|
By submitting this Internet-Draft, each author represents that any applicable patent or other IPR claims of which he or she is aware have been or will be disclosed, and any of which he or she becomes aware will be disclosed, in accordance with Section 6 of BCP 79.
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF), its areas, and its working groups. Note that other groups may also distribute working documents as Internet-Drafts.
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as “work in progress.”
The list of current Internet-Drafts can be accessed at http://www.ietf.org/ietf/1id-abstracts.txt.
The list of Internet-Draft Shadow Directories can be accessed at http://www.ietf.org/shadow.html.
This Internet-Draft will expire on June 7, 2008.
Copyright © The IETF Trust (2007).
The LinuxSampler Control Protocol (LSCP) is an application-level protocol primarily intended for local and remote controlling the LinuxSampler backend application, which is a sophisticated server-like console application essentially playing back audio samples and manipulating the samples in real time to certain extent.
1.
Requirements notation
2.
Versioning of this specification
3.
Introduction
4.
Focus of this protocol
5.
Communication Overview
5.1.
Request/response communication method
5.1.1.
Result format
5.2.
Subscribe/notify communication method
6.
Description for control commands
6.1.
Ignored lines and comments
6.2.
Configuring audio drivers
6.2.1.
Getting amount of available audio output drivers
6.2.2.
Getting all available audio output drivers
6.2.3.
Getting information about a specific audio
output driver
6.2.4.
Getting information about specific audio
output driver parameter
6.2.5.
Creating an audio output device
6.2.6.
Destroying an audio output device
6.2.7.
Getting all created audio output device count
6.2.8.
Getting all created audio output device list
6.2.9.
Getting current settings of an audio output device
6.2.10.
Changing settings of audio output devices
6.2.11.
Getting information about an audio channel
6.2.12.
Getting information about specific audio channel parameter
6.2.13.
Changing settings of audio output channels
6.3.
Configuring MIDI input drivers
6.3.1.
Getting amount of available MIDI input drivers
6.3.2.
Getting all available MIDI input drivers
6.3.3.
Getting information about a specific MIDI input driver
6.3.4.
Getting information about specific MIDI input driver parameter
6.3.5.
Creating a MIDI input device
6.3.6.
Destroying a MIDI input device
6.3.7.
Getting all created MIDI input device count
6.3.8.
Getting all created MIDI input device list
6.3.9.
Getting current settings of a MIDI input device
6.3.10.
Changing settings of MIDI input devices
6.3.11.
Getting information about a MIDI port
6.3.12.
Getting information about specific MIDI port parameter
6.3.13.
Changing settings of MIDI input ports
6.4.
Configuring sampler channels
6.4.1.
Loading an instrument
6.4.2.
Loading a sampler engine
6.4.3.
Getting all created sampler channel count
6.4.4.
Getting all created sampler channel list
6.4.5.
Adding a new sampler channel
6.4.6.
Removing a sampler channel
6.4.7.
Getting amount of available engines
6.4.8.
Getting all available engines
6.4.9.
Getting information about an engine
6.4.10.
Getting sampler channel information
6.4.11.
Current number of active voices
6.4.12.
Current number of active disk streams
6.4.13.
Current fill state of disk stream buffers
6.4.14.
Setting audio output device
6.4.15.
Setting audio output type
6.4.16.
Setting audio output channel
6.4.17.
Setting MIDI input device
6.4.18.
Setting MIDI input type
6.4.19.
Setting MIDI input port
6.4.20.
Setting MIDI input channel
6.4.21.
Setting channel volume
6.4.22.
Muting a sampler channel
6.4.23.
Soloing a sampler channel
6.4.24.
Assigning a MIDI instrument map to a sampler channel
6.4.25.
Adding an effect send to a sampler channel
6.4.26.
Removing an effect send from a sampler channel
6.4.27.
Getting amount of effect sends on a sampler channel
6.4.28.
Listing all effect sends on a sampler channel
6.4.29.
Getting effect send information
6.4.30.
Changing effect send's name
6.4.31.
Altering effect send's audio routing
6.4.32.
Altering effect send's MIDI controller
6.4.33.
Altering effect send's send level
6.4.34.
Resetting a sampler channel
6.5.
Controlling connection
6.5.1.
Register front-end for receiving event messages
6.5.2.
Unregister front-end for not receiving event messages
6.5.3.
Enable or disable echo of commands
6.5.4.
Close client connection
6.6.
Global commands
6.6.1.
Current number of active voices
6.6.2.
Maximum amount of active voices
6.6.3.
Current number of active disk streams
6.6.4.
Reset sampler
6.6.5.
General sampler informations
6.6.6.
Getting global volume attenuation
6.6.7.
Setting global volume attenuation
6.7.
MIDI Instrument Mapping
6.7.1.
Create a new MIDI instrument map
6.7.2.
Delete one particular or all MIDI instrument maps
6.7.3.
Get amount of existing MIDI instrument maps
6.7.4.
Getting all created MIDI instrument maps
6.7.5.
Getting MIDI instrument map information
6.7.6.
Renaming a MIDI instrument map
6.7.7.
Create or replace a MIDI instrument map entry
6.7.8.
Getting ammount of MIDI instrument map entries
6.7.9.
Getting indeces of all entries of a MIDI instrument map
6.7.10.
Remove an entry from the MIDI instrument map
6.7.11.
Get current settings of MIDI instrument map entry
6.7.12.
Clear MIDI instrument map
6.8.
Managing Instruments Database
6.8.1.
Creating a new instrument directory
6.8.2.
Deleting an instrument directory
6.8.3.
Getting amount of instrument directories
6.8.4.
Listing all directories in specific directory
6.8.5.
Getting instrument directory information
6.8.6.
Renaming an instrument directory
6.8.7.
Moving an instrument directory
6.8.8.
Copying instrument directories
6.8.9.
Changing the description of directory
6.8.10.
Finding directories
6.8.11.
Adding instruments to the instruments database
6.8.12.
Removing an instrument
6.8.13.
Getting amount of instruments
6.8.14.
Listing all instruments in specific directory
6.8.15.
Getting instrument information
6.8.16.
Renaming an instrument
6.8.17.
Moving an instrument
6.8.18.
Copying instruments
6.8.19.
Changing the description of instrument
6.8.20.
Finding instruments
6.8.21.
Getting job status information
6.8.22.
Formatting the instruments database
6.9.
Editing Instruments
6.9.1.
Opening an appropriate instrument editor application
6.10.
Managing Files
6.10.1.
Retrieving amount of instruments of a file
6.10.2.
Retrieving all instruments of a file
6.10.3.
Retrieving informations about one instrument in a file
7.
Command Syntax
7.1.
Character Set and Escape Sequences
8.
Events
8.1.
Number of audio output devices changed
8.2.
Audio output device's settings changed
8.3.
Number of MIDI input devices changed
8.4.
MIDI input device's settings changed
8.5.
Number of sampler channels changed
8.6.
Number of active voices changed
8.7.
Number of active disk streams changed
8.8.
Disk stream buffer fill state changed
8.9.
Channel information changed
8.10.
Number of effect sends changed
8.11.
Effect send information changed
8.12.
Total number of active voices changed
8.13.
Total number of active disk streams changed
8.14.
Number of MIDI instrument maps changed
8.15.
MIDI instrument map information changed
8.16.
Number of MIDI instruments changed
8.17.
MIDI instrument information changed
8.18.
Global settings changed
8.19.
Number of database instrument directories changed
8.20.
Database instrument directory information changed
8.21.
Number of database instruments changed
8.22.
Database instrument information changed
8.23.
Database job status information changed
8.24.
Miscellaneous and debugging events
9.
Security Considerations
10.
Acknowledgments
11.
References
§
Author's Address
§
Intellectual Property and Copyright Statements
| TOC |
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC2119] (Bradner, S., “Key words for use in RFCs to Indicate Requirement Levels,” 1997.).
This protocol is always case-sensitive if not explicitly claimed the opposite.
In examples, "C:" and "S:" indicate lines sent by the client (front-end) and server (LinuxSampler) respectively. Lines in examples must be interpreted as every line being CRLF terminated (carriage return character followed by line feed character as defined in the ASCII standard [RFC20] (UCLA, “ASCII format for Network Interchange,” 1969.)), thus the following example:
C: "some line"
"another line"
must actually be interpreted as client sending the following message:
"some line<CR><LF>another line<CR><LF>"
where <CR> symbolizes the carriage return character and <LF> the line feed character as defined in the ASCII standard.
Due to technical reasons, messages can arbitrary be fragmented, means the following example:
S: "abcd"
could also happen to be sent in three messages like in the following sequence scenario:
where again <CR> and <LF> symbolize the carriage return and line feed characters respectively.
| TOC |
LSCP will certainly be extended and enhanced by-and-by. Each official release of the LSCP specification will be tagged with a unique version tuple. The version tuple consists at least of a major and minor version number like:
"1.2"
In this example the major version number would be "1" and the minor version number would be "2". Note that the version tuple might also have more than two elements. The major version number defines a group of backward compatible versions. That means a frontend is compatible to the connected sampler if and only if the LSCP versions to which each of the two parties complies to, match both of the following rules:
Compatibility:
Compatibility can only be claimed if both rules are true. The frontend can use the "GET SERVER INFO" (General sampler informations) command to get the version of the LSCP specification the sampler complies with.
| TOC |
LinuxSampler is a so called software sampler application capable to playback audio samples from a computer's Random Access Memory (RAM) as well as directly streaming it from disk. LinuxSampler is designed to be modular. It provides several so called "sampler engines" where each engine is specialized for a certain purpose. LinuxSampler has virtual channels which will be referred in this document as "sampler channels". The channels are in such way virtual as they can be connected to an arbitrary MIDI input method and arbitrary MIDI channel (e.g. sampler channel 17 could be connected to an ALSA sequencer device 64:0 and listening to MIDI channel 1 there). Each sampler channel will be associated with an instance of one of the available sampler engines (e.g. GigEngine, DLSEngine). The audio output of each sampler channel can be routed to an arbitrary audio output method (ALSA / JACK) and an arbitrary audio output channel there.
| TOC |
Main focus of this protocol is to provide a way to configure a running LinuxSampler instance and to retrieve information about it. The focus of this protocol is not to provide a way to control synthesis parameters or even to trigger or release notes. Or in other words; the focus are those functionalities which are not covered by MIDI or which may at most be handled via MIDI System Exclusive Messages.
| TOC |
There are two distinct methods of communication between a running instance of LinuxSampler and one or more control applications, so called "front-ends": a simple request/response communication method used by the clients to give commands to the server as well as to inquire about server's status and a subscribe/notify communication method used by the client to subscribe to and receive notifications of certain events as they happen on the server. The latter needs more effort to be implemented in the front-end application. The two communication methods will be described next.
| TOC |
This simple communication method is based on TCP (Defense Advanced Research Projects Agency, “TRANSMISSION CONTROL PROTOCOL,” 1981.) [RFC793]. The front-end application establishes a TCP connection to the LinuxSampler instance on a certain host system. Then the front-end application will send certain ASCII based commands as defined in this document (every command line must be CRLF terminated - see "Conventions used in this document" at the beginning of this document) and the LinuxSampler application will response after a certain process time with an appropriate ASCII based answer, also as defined in this document. So this TCP communication is simply based on query and answer paradigm. That way LinuxSampler is only able to answer on queries from front-ends, but not able to automatically send messages to the client if it's not asked to. The fronted should not reconnect to LinuxSampler for every single command, instead it should keep the connection established and simply resend message(s) for subsequent commands. To keep information in the front-end up-to-date the front-end has to periodically send new requests to get the current information from the LinuxSampler instance. This is often referred to as "polling". While polling is simple to implement and may be OK to use in some cases, there may be disadvantages to polling such as network traffic overhead and information being out of date. It is possible for a client or several clients to open more than one connection to the server at the same time. It is also possible to send more than one request to the server at the same time but if those requests are sent over the same connection server MUST execute them sequentially. Upon executing a request server will produce a result set and send it to the client. Each and every request made by the client MUST result in a result set being sent back to the client. No other data other than a result set may be sent by a server to a client. No result set may be sent to a client without the client sending request to the server first. On any particular connection, result sets MUST be sent in their entirety without being interrupted by other result sets. If several requests got queued up at the server they MUST be processed in the order they were received and result sets MUST be sent back in the same order.
| TOC |
Result set could be one of the following types:
Warning and Error result sets MUST be single line and have the following format:
Where <warning-code> and <error-code> are numeric unique identifiers of the warning or error and <warning-message> and <error-message> are human readable descriptions of the warning or error respectively.
Examples:
C: "LOAD INSTRUMENT '/home/me/Boesendorfer24bit.gig" 0 0
S: "WRN:32:This is a 24 bit patch which is not supported natively yet."
C: "GET AUDIO_OUTPUT_DRIVER_PARAMETER INFO ALSA EAR"
S: "ERR:3456:Audio output driver 'ALSA' does not have a parameter 'EAR'."
C: "GET AUDIO_OUTPUT_DEVICE INFO 123456"
S: "ERR:9:There is no audio output device with index 123456."
Normal result sets could be:
Empty result set is issued when the server only needed to acknowledge the fact that the request was received and it was processed successfully and no additional information is available. This result set has the following format:
"OK"
Example:
C: "SET AUDIO_OUTPUT_DEVICE_PARAMETER 0 CHANNELS=4"
S: "OK"
Single line result sets are command specific. One example of a single line result set is an empty line. Multi-line result sets are command specific and may include one or more lines of information. They MUST always end with the following line:
"."
Example:
C: "GET AUDIO_OUTPUT_DEVICE INFO 0"
S: "DRIVER: ALSA"
"CHANNELS: 2"
"SAMPLERATE: 44100"
"ACTIVE: true"
"FRAGMENTS: 2"
"FRAGMENTSIZE: 128"
"CARD: '0,0'"
"."
In addition to above mentioned formats, warnings and empty result sets MAY be indexed. In this case, they have the following formats respectively:
where <index> is command specific and is used to indicate channel number that the result set was related to or other integer value.
Each line of the result set MUST end with <CRLF>.
Examples:
C: "ADD CHANNEL"
S: "OK[12]"
C: "CREATE AUDIO_OUTPUT_DEVICE ALSA SAMPLERATE=96000"
S: "WRN[0]:32:Sample rate not supported, using 44100 instead."
| TOC |
This more sophisticated communication method is actually only an extension of the simple request/response communication method. The front-end still uses a TCP connection and sends the same commands on the TCP connection. Two extra commands are SUBSCRIBE and UNSUBSCRIBE commands that allow a client to tell the server that it is interested in receiving notifications about certain events as they happen on the server. The SUBSCRIBE command has the following syntax:
SUBSCRIBE <event-id>
where <event-id> will be replaced by the respective event that client wants to subscribe to. Upon receiving such request, server SHOULD respond with OK and start sending EVENT notifications when a given even has occurred to the front-end when an event has occurred. It MAY be possible certain events may be sent before OK response during real time nature of their generation. Event messages have the following format:
NOTIFY:<event-id>:<custom-event-data>
where <event-id> uniquely identifies the event that has occurred and <custom-event-data> is event specific.
Several rules must be followed by the server when generating events:
If the client is not interested in a particular event anymore it MAY issue UNSUBSCRIBE command using the following syntax:
UNSUBSCRIBE <event-id>
where <event-id> will be replace by the respective event that client is no longer interested in receiving. For a list of supported events see Section 8 (Events).
Example: the fill states of disk stream buffers have changed on sampler channel 4 and the LinuxSampler instance will react by sending the following message to all clients who subscribed to this event:
NOTIFY:CHANNEL_BUFFER_FILL:4 [35]62%,[33]80%,[37]98%
Which means there are currently three active streams on sampler channel 4, where the stream with ID "35" is filled by 62%, stream with ID 33 is filled by 80% and stream with ID 37 is filled by 98%.
Clients may choose to open more than one connection to the server and use some connections to receive notifications while using other connections to issue commands to the back-end. This is entirely legal and up to the implementation. This does not change the protocol in any way and no special restrictions exist on the server to allow or disallow this or to track what connections belong to what front-ends. Server will listen on a single port, accept multiple connections and support protocol described in this specification in it's entirety on this single port on each connection that it accepted.
Due to the fact that TCP is used for this communication, dead peers will be detected automatically by the OS TCP stack. While it may take a while to detect dead peers if no traffic is being sent from server to client (TCP keep-alive timer is set to 2 hours on many OSes) it will not be an issue here as when notifications are sent by the server, dead client will be detected quickly.
When connection is closed for any reason server MUST forget all subscriptions that were made on this connection. If client reconnects it MUST resubscribe to all events that it wants to receive.
| TOC |
This chapter will describe the available control commands that can be sent on the TCP connection in detail. Some certain commands (e.g. "GET CHANNEL INFO" (Getting sampler channel information) or "GET ENGINE INFO" (Getting information about an engine)) lead to multiple-line responses. In this case LinuxSampler signals the end of the response by a "." (single dot) line.
| TOC |
White lines, that is lines which only contain space and tabulator characters, and lines that start with a "#" character are ignored, thus it's possible for example to group commands and to place comments in a LSCP script file.
| TOC |
Instances of drivers in LinuxSampler are called devices. You can use multiple audio devices simultaneously, e.g. to output the sound of one sampler channel using the ALSA audio output driver, and on another sampler channel you might want to use the JACK audio output driver. For particular audio output systems it's also possible to create several devices of the same audio output driver, e.g. two separate ALSA audio output devices for using two different sound cards at the same time. This chapter describes all commands to configure LinuxSampler's audio output devices and their parameters.
Instead of defining commands and parameters for each driver individually, all possible parameters, their meanings and possible values have to be obtained at runtime. This makes the protocol a bit abstract, but has the advantage, that front-ends can be written independently of what drivers are currently implemented and what parameters these drivers are actually offering. This means front-ends can even handle drivers which are implemented somewhere in future without modifying the front-end at all.
Note: examples in this chapter showing particular parameters of drivers are not meant as specification of the drivers' parameters. Driver implementations in LinuxSampler might have complete different parameter names and meanings than shown in these examples or might change in future, so these examples are only meant for showing how to retrieve what parameters drivers are offering, how to retrieve their possible values, etc.
| TOC |
Use the following command to get the number of audio output drivers currently available for the LinuxSampler instance:
GET AVAILABLE_AUDIO_OUTPUT_DRIVERS
Possible Answers:
LinuxSampler will answer by sending the number of audio output drivers.
Example:
C: "GET AVAILABLE_AUDIO_OUTPUT_DRIVERS"
S: "2"
| TOC |
Use the following command to list all audio output drivers currently available for the LinuxSampler instance:
LIST AVAILABLE_AUDIO_OUTPUT_DRIVERS
Possible Answers:
LinuxSampler will answer by sending comma separated character strings, each symbolizing an audio output driver.
Example:
C: "LIST AVAILABLE_AUDIO_OUTPUT_DRIVERS"
S: "ALSA,JACK"
| TOC |
Use the following command to get detailed information about a specific audio output driver:
GET AUDIO_OUTPUT_DRIVER INFO <audio-output-driver>
Where <audio-output-driver> is the name of the audio output driver, returned by the "LIST AVAILABLE_AUDIO_OUTPUT_DRIVERS" (Getting all available audio output drivers) command.
Possible Answers:
LinuxSampler will answer by sending a <CRLF> separated list. Each answer line begins with the information category name followed by a colon and then a space character <SP> and finally the info character string to that info category. At the moment the following information categories are defined:
DESCRIPTION -
character string describing the audio output driver
VERSION -
character string reflecting the driver's version
PARAMETERS -
comma separated list of all parameters available for the given audio output driver, at least parameters 'channels', 'samplerate' and 'active' are offered by all audio output drivers
The mentioned fields above don't have to be in particular order.
Example:
C: "GET AUDIO_OUTPUT_DRIVER INFO ALSA"
S: "DESCRIPTION: Advanced Linux Sound Architecture"
"VERSION: 1.0"
"PARAMETERS: DRIVER,CHANNELS,SAMPLERATE,ACTIVE,FRAGMENTS, FRAGMENTSIZE,CARD"
"."
| TOC |
Use the following command to get detailed information about a specific audio output driver parameter:
GET AUDIO_OUTPUT_DRIVER_PARAMETER INFO <audio> <prm> [<deplist>]
Where <audio> is the name of the audio output driver as returned by the "LIST AVAILABLE_AUDIO_OUTPUT_DRIVERS" (Getting all available audio output drivers) command, <prm> a specific parameter name for which information should be obtained (as returned by the "GET AUDIO_OUTPUT_DRIVER INFO" (Getting information about a specific audio output driver) command) and <deplist> is an optional list of parameters on which the sought parameter <prm> depends on, <deplist> is a list of key-value pairs in form of "key1=val1 key2=val2 ...", where character string values are encapsulated into apostrophes ('). Arguments given with <deplist> which are not dependency parameters of <prm> will be ignored, means the front-end application can simply put all parameters into <deplist> with the values already selected by the user.
Possible Answers:
LinuxSampler will answer by sending a <CRLF> separated list. Each answer line begins with the information category name followed by a colon and then a space character <SP> and finally the info character string to that info category. There are information which is always returned, independently of the given driver parameter and there are optional information which is only shown dependently to given driver parameter. At the moment the following information categories are defined:
TYPE -
either "BOOL" for boolean value(s) or "INT" for integer value(s) or "FLOAT" for dotted number(s) or "STRING" for character string(s) (always returned, no matter which driver parameter)
DESCRIPTION -
arbitrary text describing the purpose of the parameter (always returned, no matter which driver parameter)
MANDATORY -
either true or false, defines if this parameter must be given when the device is to be created with the 'CREATE AUDIO_OUTPUT_DEVICE' (Creating an audio output device) command (always returned, no matter which driver parameter)
FIX -
either true or false, if false then this parameter can be changed at any time, once the device is created by the 'CREATE AUDIO_OUTPUT_DEVICE' (Creating an audio output device) command (always returned, no matter which driver parameter)
MULTIPLICITY -
either true or false, defines if this parameter allows only one value or a list of values, where true means multiple values and false only a single value allowed (always returned, no matter which driver parameter)
DEPENDS -
comma separated list of parameters this parameter depends on, means the values for fields 'DEFAULT', 'RANGE_MIN', 'RANGE_MAX' and 'POSSIBILITIES' might depend on these listed parameters, for example assuming that an audio driver (like the ALSA driver) offers parameters 'card' and 'samplerate' then parameter 'samplerate' would depend on 'card' because the possible values for 'samplerate' depends on the sound card which can be chosen by the 'card' parameter (optionally returned, dependent to driver parameter)
DEFAULT -
reflects the default value for this parameter which is used when the device is created and not explicitly given with the 'CREATE AUDIO_OUTPUT_DEVICE' (Creating an audio output device) command, in case of MULTIPLCITY=true, this is a comma separated list, that's why character strings are encapsulated into apostrophes (') (optionally returned, dependent to driver parameter)
RANGE_MIN -
defines lower limit of the allowed value range for this parameter, can be an integer value as well as a dotted number, this parameter is often used in conjunction with RANGE_MAX, but may also appear without (optionally returned, dependent to driver parameter)
RANGE_MAX -
defines upper limit of the allowed value range for this parameter, can be an integer value as well as a dotted number, this parameter is often used in conjunction with RANGE_MIN, but may also appear without (optionally returned, dependent to driver parameter)
POSSIBILITIES -
comma separated list of possible values for this parameter, character strings are encapsulated into apostrophes (optionally returned, dependent to driver parameter)
The mentioned fields above don't have to be in particular order.
Examples:
C: "GET AUDIO_OUTPUT_DRIVER_PARAMETER INFO ALSA CARD"
S: "DESCRIPTION: sound card to be used"
"TYPE: STRING"
"MANDATORY: false"
"FIX: true"
"MULTIPLICITY: false"
"DEFAULT: '0,0'"
"POSSIBILITIES: '0,0','1,0','2,0'"
"."
C: "GET AUDIO_OUTPUT_DRIVER_PARAMETER INFO ALSA SAMPLERATE"
S: "DESCRIPTION: output sample rate in Hz"
"TYPE: INT"
"MANDATORY: false"
"FIX: false"
"MULTIPLICITY: false"
"DEPENDS: card"
"DEFAULT: 44100"
"."
C: "GET AUDIO_OUTPUT_DRIVER_PARAMETER INFO ALSA SAMPLERATE CARD='0,0'"
S: "DESCRIPTION: output sample rate in Hz"
"TYPE: INT"
"MANDATORY: false"
"FIX: false"
"MULTIPLICITY: false"
"DEPENDS: card"
"DEFAULT: 44100"
"RANGE_MIN: 22050"
"RANGE_MAX: 96000"
"."
| TOC |
Use the following command to create a new audio output device for the desired audio output system:
CREATE AUDIO_OUTPUT_DEVICE <audio-output-driver> [<param-list>]
Where <audio-output-driver> should be replaced by the desired audio output system as returned by the "LIST AVAILABLE_AUDIO_OUTPUT_DRIVERS" (Getting all available audio output drivers) command and <param-list> by an optional list of driver specific parameters in form of "key1=val1 key2=val2 ...", where character string values should be encapsulated into apostrophes ('). Note that there might be drivers which require parameter(s) to be given with this command. Use the previously described commands in this chapter to get this information.
Possible Answers:
"OK[<device-id>]" -
in case the device was successfully created, where <device-id> is the numerical ID of the new device
"WRN[<device-id>]:<warning-code>:<warning-message>" -
in case the device was created successfully, where <device-id> is the numerical ID of the new device, but there are noteworthy issue(s) related (e.g. sound card doesn't support given hardware parameters and the driver is using fall-back values), providing an appropriate warning code and warning message
"ERR:<error-code>:<error-message>" -
in case it failed, providing an appropriate error code and error message
Examples:
C: "CREATE AUDIO_OUTPUT_DEVICE ALSA"
S: "OK[0]"
C: "CREATE AUDIO_OUTPUT_DEVICE ALSA CARD='2,0' SAMPLERATE=96000"
S: "OK[1]"
| TOC |
Use the following command to destroy a created output device:
DESTROY AUDIO_OUTPUT_DEVICE <device-id>
Where <device-id> should be replaced by the numerical ID of the audio output device as given by the "CREATE AUDIO_OUTPUT_DEVICE" (Creating an audio output device) or "LIST AUDIO_OUTPUT_DEVICES" (Getting all created audio output device list) command.
Possible Answers:
"OK" -
in case the device was successfully destroyed
"WRN:<warning-code>:<warning-message>" -
in case the device was destroyed successfully, but there are noteworthy issue(s) related (e.g. an audio over ethernet driver was unloaded but the other host might not be informed about this situation), providing an appropriate warning code and warning message
"ERR:<error-code>:<error-message>" -
in case it failed, providing an appropriate error code and error message
Example:
C: "DESTROY AUDIO_OUTPUT_DEVICE 0"
S: "OK"
| TOC |
Use the following command to count all created audio output devices:
GET AUDIO_OUTPUT_DEVICES
Possible Answers:
LinuxSampler will answer by sending the current number of all audio output devices.
Example:
C: "GET AUDIO_OUTPUT_DEVICES"
S: "4"
| TOC |
Use the following command to list all created audio output devices:
LIST AUDIO_OUTPUT_DEVICES
Possible Answers:
LinuxSampler will answer by sending a comma separated list with the numerical IDs of all audio output devices.
Example:
C: "LIST AUDIO_OUTPUT_DEVICES"
S: "0,1,4,5"
| TOC |
Use the following command to get current settings of a specific, created audio output device:
GET AUDIO_OUTPUT_DEVICE INFO <device-id>
Where <device-id> should be replaced by numerical ID of the audio output device as e.g. returned by the "LIST AUDIO_OUTPUT_DEVICES" (Getting all created audio output device list) command.
Possible Answers:
LinuxSampler will answer by sending a <CRLF> separated list. Each answer line begins with the information category name followed by a colon and then a space character <SP> and finally the info character string to that info category. As some parameters might allow multiple values, character strings are encapsulated into apostrophes ('). At the moment the following information categories are defined (independently of device):
DRIVER -
identifier of the used audio output driver, as also returned by the "LIST AVAILABLE_AUDIO_OUTPUT_DRIVERS" (Getting all available audio output drivers) command
CHANNELS -
amount of audio output channels this device currently offers
SAMPLERATE -
playback sample rate the device uses
ACTIVE -
either true or false, if false then the audio device is inactive and doesn't output any sound, nor do the sampler channels connected to this audio device render any audio
The mentioned fields above don't have to be in particular order. The fields above are only those fields which are returned by all audio output devices. Every audio output driver might have its own, additional driver specific parameters (see Section 6.2.3 (Getting information about a specific audio output driver)) which are also returned by this command.
Example:
C: "GET AUDIO_OUTPUT_DEVICE INFO 0"
S: "DRIVER: ALSA"
"CHANNELS: 2"
"SAMPLERATE: 44100"
"ACTIVE: true"
"FRAGMENTS: 2"
"FRAGMENTSIZE: 128"
"CARD: '0,0'"
"."
| TOC |
Use the following command to alter a specific setting of a created audio output device:
SET AUDIO_OUTPUT_DEVICE_PARAMETER <device-id> <key>=<value>
Where <device-id> should be replaced by the numerical ID of the audio output device as given by the "CREATE AUDIO_OUTPUT_DEVICE" (Creating an audio output device) or "LIST AUDIO_OUTPUT_DEVICES" (Getting all created audio output device list) command, <key> by the name of the parameter to change and <value> by the new value for this parameter.
Possible Answers:
"OK" -
in case setting was successfully changed
"WRN:<warning-code>:<warning-message>" -
in case setting was changed successfully, but there are noteworthy issue(s) related, providing an appropriate warning code and warning message
"ERR:<error-code>:<error-message>" -
in case it failed, providing an appropriate error code and error message
Example:
C: "SET AUDIO_OUTPUT_DEVICE_PARAMETER 0 FRAGMENTSIZE=128"
S: "OK"
| TOC |
Use the following command to get information about an audio channel:
GET AUDIO_OUTPUT_CHANNEL INFO <device-id> <audio-chan>
Where <device-id> is the numerical ID of the audio output device as given by the "CREATE AUDIO_OUTPUT_DEVICE" (Creating an audio output device) or "LIST AUDIO_OUTPUT_DEVICES" (Getting all created audio output device list) command and <audio-chan> the audio channel number.
Possible Answers:
LinuxSampler will answer by sending a <CRLF> separated list. Each answer line begins with the information category name followed by a colon and then a space character <SP> and finally the info character string to that info category. At the moment the following information categories are defined:
NAME -
arbitrary character string naming the channel, which doesn't have to be unique (always returned by all audio channels)
IS_MIX_CHANNEL -
either true or false, a mix-channel is not a real, independent audio channel, but a virtual channel which is mixed to another real channel, this mechanism is needed for sampler engines which need more audio channels than the used audio system might be able to offer (always returned by all audio channels)
MIX_CHANNEL_DESTINATION -
numerical ID (positive integer including 0) which reflects the real audio channel (of the same audio output device) this mix channel refers to, means where the audio signal actually will be routed / added to (only returned in case the audio channel is mix channel)
The mentioned fields above don't have to be in particular order. The fields above are only those fields which are generally returned for the described cases by all audio channels regardless of the audio driver. Every audio channel might have its own, additional driver and channel specific parameters.
Examples:
C: "GET AUDIO_OUTPUT_CHANNEL INFO 0 0"
S: "NAME: studio monitor left"
"IS_MIX_CHANNEL: false"
"."
C: "GET AUDIO_OUTPUT_CHANNEL INFO 0 1"
S: "NAME: studio monitor right"
"IS_MIX_CHANNEL: false"
"."
C: "GET AUDIO_OUTPUT_CHANNEL INFO 0 2"
S: "NAME: studio monitor left"
"IS_MIX_CHANNEL: true"
"MIX_CHANNEL_DESTINATION: 1"
"."
C: "GET AUDIO_OUTPUT_CHANNEL INFO 1 0"
S: "NAME: 'ardour (left)'"
"IS_MIX_CHANNEL: false"
"JACK_BINDINGS: 'ardour:0'"
"."
| TOC |
Use the following command to get detailed information about specific audio channel parameter:
GET AUDIO_OUTPUT_CHANNEL_PARAMETER INFO <dev-id> <chan> <param>
Where <dev-id> is the numerical ID of the audio output device as returned by the "CREATE AUDIO_OUTPUT_DEVICE" (Creating an audio output device) or "LIST AUDIO_OUTPUT_DEVICES" (Getting all created audio output device list) command, <chan> the audio channel number and <param> a specific channel parameter name for which information should be obtained (as returned by the "GET AUDIO_OUTPUT_CHANNEL INFO" (Getting information about an audio channel) command).
Possible Answers:
LinuxSampler will answer by sending a <CRLF> separated list. Each answer line begins with the information category name followed by a colon and then a space character <SP> and finally the info character string to that info category. There are information which is always returned, independently of the given channel parameter and there is optional information which is only shown dependently to the given audio channel. At the moment the following information categories are defined:
TYPE -
either "BOOL" for boolean value(s) or "INT" for integer value(s) or "FLOAT" for dotted number(s) or "STRING" for character string(s) (always returned)
DESCRIPTION -
arbitrary text describing the purpose of the parameter (always returned)
FIX -
either true or false, if true then this parameter is read only, thus cannot be altered (always returned)
MULTIPLICITY -
either true or false, defines if this parameter allows only one value or a list of values, where true means multiple values and false only a single value allowed (always returned)
RANGE_MIN -
defines lower limit of the allowed value range for this parameter, can be an integer value as well as a dotted number, usually used in conjunction with 'RANGE_MAX', but may also appear without (optionally returned, dependent to driver and channel parameter)
RANGE_MAX -
defines upper limit of the allowed value range for this parameter, can be an integer value as well as a dotted number, usually used in conjunction with 'RANGE_MIN', but may also appear without (optionally returned, dependent to driver and channel parameter)
POSSIBILITIES -
comma separated list of possible values for this parameter, character strings are encapsulated into apostrophes (optionally returned, dependent to driver and channel parameter)
The mentioned fields above don't have to be in particular order.
Example:
C: "GET AUDIO_OUTPUT_CHANNEL_PARAMETER INFO 1 0 JACK_BINDINGS"
S: "DESCRIPTION: bindings to other JACK clients"
"TYPE: STRING"
"FIX: false"
"MULTIPLICITY: true"
"POSSIBILITIES: 'PCM:0','PCM:1','ardour:0','ardour:1'"
"."
| TOC |
Use the following command to alter a specific setting of an audio output channel:
SET AUDIO_OUTPUT_CHANNEL_PARAMETER <dev-id> <chn> <key>=<value>
Where <dev-id> should be replaced by the numerical ID of the audio output device as returned by the "CREATE AUDIO_OUTPUT_DEVICE" (Creating an audio output device) or "LIST AUDIO_OUTPUT_DEVICES" (Getting all created audio output device list) command, <chn> by the audio channel number, <key> by the name of the parameter to change and <value> by the new value for this parameter.
Possible Answers:
"OK" -
in case setting was successfully changed
"WRN:<warning-code>:<warning-message>" -
in case setting was changed successfully, but there are noteworthy issue(s) related, providing an appropriate warning code and warning message
"ERR:<error-code>:<error-message>" -
in case it failed, providing an appropriate error code and error message
Example:
C: "SET AUDIO_OUTPUT_CHANNEL PARAMETER 0 0 JACK_BINDINGS='PCM:0'"
S: "OK"
C: "SET AUDIO_OUTPUT_CHANNEL PARAMETER 0 0 NAME='monitor left'"
S: "OK"
| TOC |
Instances of drivers in LinuxSampler are called devices. You can use multiple MIDI devices simultaneously, e.g. to use MIDI over ethernet as MIDI input on one sampler channel and ALSA as MIDI input on another sampler channel. For particular MIDI input systems it's also possible to create several devices of the same MIDI input type. This chapter describes all commands to configure LinuxSampler's MIDI input devices and their parameters.
Instead of defining commands and parameters for each driver individually, all possible parameters, their meanings and possible values have to be obtained at runtime. This makes the protocol a bit abstract, but has the advantage, that front-ends can be written independently of what drivers are currently implemented and what parameters these drivers are actually offering. This means front-ends can even handle drivers which are implemented somewhere in future without modifying the front-end at all.
Commands for configuring MIDI input devices are pretty much the same as the commands for configuring audio output drivers, already described in the last chapter.
Note: examples in this chapter showing particular parameters of drivers are not meant as specification of the drivers' parameters. Driver implementations in LinuxSampler might have complete different parameter names and meanings than shown in these examples or might change in future, so these examples are only meant for showing how to retrieve what parameters drivers are offering, how to retrieve their possible values, etc.
| TOC |
Use the following command to get the number of MIDI input drivers currently available for the LinuxSampler instance:
GET AVAILABLE_MIDI_INPUT_DRIVERS
Possible Answers:
LinuxSampler will answer by sending the number of available MIDI input drivers.
Example:
C: "GET AVAILABLE_MIDI_INPUT_DRIVERS"
S: "2"
| TOC |
Use the following command to list all MIDI input drivers currently available for the LinuxSampler instance:
LIST AVAILABLE_MIDI_INPUT_DRIVERS
Possible Answers:
LinuxSampler will answer by sending comma separated character strings, each symbolizing a MIDI input driver.
Example:
C: "LIST AVAILABLE_MIDI_INPUT_DRIVERS"
S: "ALSA,JACK"
| TOC |
Use the following command to get detailed information about a specific MIDI input driver:
GET MIDI_INPUT_DRIVER INFO <midi-input-driver>
Where <midi-input-driver> is the name of the MIDI input driver as returned by the "LIST AVAILABLE_MIDI_INPUT_DRIVERS" (Getting all available MIDI input drivers) command.
Possible Answers:
LinuxSampler will answer by sending a <CRLF> separated list. Each answer line begins with the information category name followed by a colon and then a space character <SP> and finally the info character string to that info category. At the moment the following information categories are defined:
DESCRIPTION -
arbitrary description text about the MIDI input driver
VERSION -
arbitrary character string regarding the driver's version
PARAMETERS -
comma separated list of all parameters available for the given MIDI input driver
The mentioned fields above don't have to be in particular order.
Example:
C: "GET MIDI_INPUT_DRIVER INFO ALSA"
S: "DESCRIPTION: Advanced Linux Sound Architecture"
"VERSION: 1.0"
"PARAMETERS: DRIVER,ACTIVE"
"."
| TOC |
Use the following command to get detailed information about a specific parameter of a specific MIDI input driver:
GET MIDI_INPUT_DRIVER_PARAMETER INFO <midit> <param> [<deplist>]
Where <midit> is the name of the MIDI input driver as returned by the "LIST AVAILABLE_MIDI_INPUT_DRIVERS" (Getting all available MIDI input drivers) command, <param> a specific parameter name for which information should be obtained (as returned by the "GET MIDI_INPUT_DRIVER INFO" (Getting information about a specific MIDI input driver) command) and <deplist> is an optional list of parameters on which the sought parameter <param> depends on, <deplist> is a key-value pair list in form of "key1=val1 key2=val2 ...", where character string values are encapsulated into apostrophes ('). Arguments given with <deplist> which are not dependency parameters of <param> will be ignored, means the front-end application can simply put all parameters in <deplist> with the values selected by the user.
Possible Answers:
LinuxSampler will answer by sending a <CRLF> separated list. Each answer line begins with the information category name followed by a colon and then a space character <SP> and finally the info character string to that info category. There is information which is always returned, independent of the given driver parameter and there is optional information which is only shown dependent to given driver parameter. At the moment the following information categories are defined:
TYPE -
either "BOOL" for boolean value(s) or "INT" for integer value(s) or "FLOAT" for dotted number(s) or "STRING" for character string(s) (always returned, no matter which driver parameter)
DESCRIPTION -
arbitrary text describing the purpose of the parameter (always returned, no matter which driver parameter)
MANDATORY -
either true or false, defines if this parameter must be given when the device is to be created with the 'CREATE MIDI_INPUT_DEVICE' (Creating a MIDI input device) command (always returned, no matter which driver parameter)
FIX -
either true or false, if false then this parameter can be changed at any time, once the device is created by the 'CREATE MIDI_INPUT_DEVICE' (Creating a MIDI input device) command (always returned, no matter which driver parameter)
MULTIPLICITY -
either true or false, defines if this parameter allows only one value or a list of values, where true means multiple values and false only a single value allowed (always returned, no matter which driver parameter)
DEPENDS -
comma separated list of parameters this parameter depends on, means the values for fields 'DEFAULT', 'RANGE_MIN', 'RANGE_MAX' and 'POSSIBILITIES' might depend on these listed parameters, for example assuming that an audio driver (like the ALSA driver) offers parameters 'card' and 'samplerate' then parameter 'samplerate' would depend on 'card' because the possible values for 'samplerate' depends on the sound card which can be chosen by the 'card' parameter (optionally returned, dependent to driver parameter)
DEFAULT -
reflects the default value for this parameter which is used when the device is created and not explicitly given with the 'CREATE MIDI_INPUT_DEVICE' (Creating a MIDI input device) command, in case of MULTIPLCITY=true, this is a comma separated list, that's why character strings are encapsulated into apostrophes (') (optionally returned, dependent to driver parameter)
RANGE_MIN -
defines lower limit of the allowed value range for this parameter, can be an integer value as well as a dotted number, this parameter is often used in conjunction with RANGE_MAX, but may also appear without (optionally returned, dependent to driver parameter)
RANGE_MAX -
defines upper limit of the allowed value range for this parameter, can be an integer value as well as a dotted number, this parameter is often used in conjunction with RANGE_MIN, but may also appear without (optionally returned, dependent to driver parameter)
POSSIBILITIES -
comma separated list of possible values for this parameter, character strings are encapsulated into apostrophes (optionally returned, dependent to driver parameter)
The mentioned fields above don't have to be in particular order.
Example:
C: "GET MIDI_INPUT_DRIVER_PARAMETER INFO ALSA ACTIVE"
S: "DESCRIPTION: Whether device is enabled"
"TYPE: BOOL"
"MANDATORY: false"
"FIX: false"
"MULTIPLICITY: false"
"DEFAULT: true"
"."
| TOC |
Use the following command to create a new MIDI input device for the desired MIDI input system:
CREATE MIDI_INPUT_DEVICE <midi-input-driver> [<param-list>]
Where <midi-input-driver> should be replaced by the desired MIDI input system as returned by the "LIST AVAILABLE_MIDI_INPUT_DRIVERS" (Getting all available MIDI input drivers) command and <param-list> by an optional list of driver specific parameters in form of "key1=val1 key2=val2 ...", where character string values should be encapsulated into apostrophes ('). Note that there might be drivers which require parameter(s) to be given with this command. Use the previously described commands in this chapter to get that information.
Possible Answers:
"OK[<device-id>]" -
in case the device was successfully created, where <device-id> is the numerical ID of the new device
"WRN[<device-id>]:<warning-code>:<warning-message>" -
in case the driver was loaded successfully, where <device-id> is the numerical ID of the new device, but there are noteworthy issue(s) related, providing an appropriate warning code and warning message
"ERR:<error-code>:<error-message>" -
in case it failed, providing an appropriate error code and error message
Example:
C: "CREATE MIDI_INPUT_DEVICE ALSA"
S: "OK[0]"
| TOC |
Use the following command to destroy a created MIDI input device:
DESTROY MIDI_INPUT_DEVICE <device-id>
Where <device-id> should be replaced by the device's numerical ID as returned by the "CREATE MIDI_INPUT_DEVICE" (Creating a MIDI input device) or "LIST MIDI_INPUT_DEVICES" (Getting all created MIDI input device list) command.
Possible Answers:
"OK" -
in case the device was successfully destroyed
"WRN:<warning-code>:<warning-message>" -
in case the device was destroyed, but there are noteworthy issue(s) related, providing an appropriate warning code and warning message
"ERR:<error-code>:<error-message>" -
in case it failed, providing an appropriate error code and error message
Example:
C: "DESTROY MIDI_INPUT_DEVICE 0"
S: "OK"
| TOC |
Use the following command to count all created MIDI input devices:
GET MIDI_INPUT_DEVICES
Possible Answers:
LinuxSampler will answer by sending the current number of all MIDI input devices.
Example:
C: "GET MIDI_INPUT_DEVICES"
S: "3"
| TOC |
Use the following command to list all created MIDI input devices:
LIST MIDI_INPUT_DEVICES
Possible Answers:
LinuxSampler will answer by sending a comma separated list with the numerical Ids of all created MIDI input devices.
Examples:
C: "LIST MIDI_INPUT_DEVICES"
S: "0,1,2"
C: "LIST MIDI_INPUT_DEVICES"
S: "1,3"
| TOC |
Use the following command to get current settings of a specific, created MIDI input device:
GET MIDI_INPUT_DEVICE INFO <device-id>
Where <device-id> is the numerical ID of the MIDI input device as returned by the "CREATE MIDI_INPUT_DEVICE" (Creating a MIDI input device) or "LIST MIDI_INPUT_DEVICES" (Getting all created MIDI input device list) command.
Possible Answers:
LinuxSampler will answer by sending a <CRLF> separated list. Each answer line begins with the information category name followed by a colon and then a space character <SP> and finally the info character string to that info category. As some parameters might allow multiple values, character strings are encapsulated into apostrophes ('). At the moment the following information categories are defined (independent of driver):
DRIVER -
identifier of the used MIDI input driver, as e.g. returned by the "LIST AVAILABLE_MIDI_INPUT_DRIVERS" (Getting all available MIDI input drivers) command
ACTIVE -
either true or false, if false then the MIDI device is inactive and doesn't listen to any incoming MIDI events and thus doesn't forward them to connected sampler channels
The mentioned fields above don't have to be in particular order. The fields above are only those fields which are returned by all MIDI input devices. Every MIDI input driver might have its own, additional driver specific parameters (see "GET MIDI_INPUT_DRIVER INFO" (Getting information about a specific MIDI input driver) command) which are also returned by this command.
Example:
C: "GET MIDI_INPUT_DEVICE INFO 0"
S: "DRIVER: ALSA"
"ACTIVE: true"
"."
| TOC |
Use the following command to alter a specific setting of a created MIDI input device:
SET MIDI_INPUT_DEVICE_PARAMETER <device-id> <key>=<value>
Where <device-id> should be replaced by the numerical ID of the MIDI input device as returned by the "CREATE MIDI_INPUT_DEVICE" (Creating a MIDI input device) or "LIST MIDI_INPUT_DEVICES" (Getting all created MIDI input device list) command, <key> by the name of the parameter to change and <value> by the new value for this parameter.
Possible Answers:
"OK" -
in case setting was successfully changed
"WRN:<warning-code>:<warning-message>" -
in case setting was changed successfully, but there are noteworthy issue(s) related, providing an appropriate warning code and warning message
"ERR:<error-code>:<error-message>" -
in case it failed, providing an appropriate error code and error message
Example:
C: "SET MIDI_INPUT_DEVICE_PARAMETER 0 ACTIVE=false"
S: "OK"
| TOC |
Use the following command to get information about a MIDI port:
GET MIDI_INPUT_PORT INFO <device-id> <midi-port>
Where <device-id> is the numerical ID of the MIDI input device as returned by the "CREATE MIDI_INPUT_DEVICE" (Creating a MIDI input device) or "LIST MIDI_INPUT_DEVICES" (Getting all created MIDI input device list) command and <midi-port> the MIDI input port number.
Possible Answers:
LinuxSampler will answer by sending a <CRLF> separated list. Each answer line begins with the information category name followed by a colon and then a space character <SP> and finally the info character string to that info category. At the moment the following information categories are defined:
NAME -
arbitrary character string naming the port
The field above is only the one which is returned by all MIDI ports regardless of the MIDI driver and port. Every MIDI port might have its own, additional driver and port specific parameters.
Example:
C: "GET MIDI_INPUT_PORT INFO 0 0"
S: "NAME: 'Masterkeyboard'"
"ALSA_SEQ_BINDINGS: '64:0'"
"."
| TOC |
Use the following command to get detailed information about specific MIDI port parameter:
GET MIDI_INPUT_PORT_PARAMETER INFO <dev-id> <port> <param>
Where <dev-id> is the numerical ID of the MIDI input device as returned by the "CREATE MIDI_INPUT_DEVICE" (Creating a MIDI input device) or "LIST MIDI_INPUT_DEVICES" (Getting all created MIDI input device list) command, <port> the MIDI port number and <param> a specific port parameter name for which information should be obtained (as returned by the "GET MIDI_INPUT_PORT INFO" (Getting information about a MIDI port) command).
Possible Answers:
LinuxSampler will answer by sending a <CRLF> separated list. Each answer line begins with the information category name followed by a colon and then a space character <SP> and finally the info character string to that info category. There is information which is always returned, independently of the given channel parameter and there is optional informa