--- web/trunk/www.linuxsampler.org/api/draft-linuxsampler-protocol.xml 2005/05/24 03:18:31 574 +++ web/trunk/www.linuxsampler.org/api/draft-linuxsampler-protocol.xml 2005/05/24 03:26:22 575 @@ -13,7 +13,7 @@ - + LinuxSampler Control Protocol + The frontend's LSCP minor version is less or equal than + the sampler's LSCP minor version. + + + + Compatibility can only be claimed if both rules are true. + The frontend can use the + "GET SERVER INFO" command to + get the version of the LSCP specification the sampler complies with. + + +
LinuxSampler is a so called software sampler application capable to playback audio samples from a computer's Random @@ -124,7 +161,7 @@ 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 - engine will be assigned an own instance of one of the available + 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 @@ -154,7 +191,8 @@ methods will be described next.
- This simple communication method is based on TCP. The + This simple communication method is based on + TCP. 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 @@ -425,7 +463,7 @@
-
+
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" @@ -683,7 +721,7 @@ DEPENDS - - comma separated list of paramters this 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 @@ -796,7 +834,9 @@ Where <audio-output-driver> should be replaced by the desired audio - output system and <param-list> by an optional list of driver + output system as returned by the + "LIST 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 @@ -1017,7 +1057,10 @@ Where <device-id> should be replaced by the numerical ID of the - audio output device, <key> by the name of the parameter to change + audio output device as given by the + "CREATE AUDIO_OUTPUT_DEVICE" + or "LIST AUDIO_OUTPUT_DEVICES" + command, <key> by the name of the parameter to change and <value> by the new value for this parameter. Possible Answers: @@ -1058,8 +1101,10 @@ GET AUDIO_OUTPUT_CHANNEL INFO <device-id> <audio-chan> - Where <device-id> is the numerical ID of the audio output device - and <audio-chan> the audio channel number. + Where <device-id> is the numerical ID of the audio output device as given by the + "CREATE AUDIO_OUTPUT_DEVICE" + or "LIST AUDIO_OUTPUT_DEVICES" + command and <audio-chan> the audio channel number. Possible Answers: @@ -1158,8 +1203,9 @@ - Where <dev-id> is the numerical ID of the audio output device as returned - by the "LIST AUDIO_OUTPUT_DEVICES" + Where <dev-id> is the numerical ID of the audio output device as returned by the + "CREATE AUDIO_OUTPUT_DEVICE" + or "LIST AUDIO_OUTPUT_DEVICES" command, <chan> the audio channel number and <param> a specific channel parameter name for which information should be obtained (as returned by the @@ -1261,8 +1307,10 @@ SET AUDIO_OUTPUT_CHANNEL_PARAMETER <dev-id> <chn> <key>=<value> - Where <dev-id> should be replaced by the numerical ID of the audio - device, <chn> by the audio channel number, <key> by the name of the + Where <dev-id> should be replaced by the numerical ID of the audio output device as returned by the + "CREATE AUDIO_OUTPUT_DEVICE" + or "LIST AUDIO_OUTPUT_DEVICES" + 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: @@ -1386,7 +1434,9 @@ GET MIDI_INPUT_DRIVER INFO <midi-input-driver> - Where <midi-input-driver> is the name of the MIDI input driver. + Where <midi-input-driver> is the name of the MIDI input driver as returned + by the + "LIST AVAILABLE_MIDI_INPUT_DRIVERS" command. Possible Answers: @@ -1441,7 +1491,7 @@ - Where <midi-t> is the name of the MIDI input driver as returned + Where <midit> is the name of the MIDI input driver as returned by the "LIST AVAILABLE_MIDI_INPUT_DRIVERS" command, <param> a specific parameter name for which information should be obtained (as returned by the @@ -1514,7 +1564,7 @@ DEPENDS - - comma separated list of paramters this 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 @@ -1596,7 +1646,9 @@ - Where <midi-input-driver> should be replaced by the desired MIDI input system and <param-list> by an + Where <midi-input-driver> should be replaced by the desired MIDI input system as returned + by the + "LIST 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 @@ -1643,7 +1695,10 @@ DESTROY MIDI_INPUT_DEVICE <device-id> - Where <device-id> should be replaced by the device's numerical ID. + Where <device-id> should be replaced by the device's numerical ID as returned by the + "CREATE MIDI_INPUT_DEVICE" + or "LIST MIDI_INPUT_DEVICES" + command. Possible Answers: @@ -1735,7 +1790,10 @@ GET MIDI_INPUT_DEVICE INFO <device-id> - Where <device-id> is the numerical ID of the MIDI input device. + Where <device-id> is the numerical ID of the MIDI input device as returned by the + "CREATE MIDI_INPUT_DEVICE" + or "LIST MIDI_INPUT_DEVICES" + command. Possible Answers: @@ -1800,7 +1858,10 @@ Where <device-id> should be replaced by the numerical ID of the - MIDI input device, <key> by the name of the parameter to change and + MIDI input device as returned by the + "CREATE MIDI_INPUT_DEVICE" + or "LIST MIDI_INPUT_DEVICES" + command, <key> by the name of the parameter to change and <value> by the new value for this parameter. Possible Answers: @@ -1841,8 +1902,10 @@ GET MIDI_INPUT_PORT INFO <device-id> <midi-port> - Where <device-id> is the numerical ID of the MIDI input device - and <midi-port> the MIDI input port number. + Where <device-id> is the numerical ID of the MIDI input device as returned by the + "CREATE MIDI_INPUT_DEVICE" + or "LIST MIDI_INPUT_DEVICES" + command and <midi-port> the MIDI input port number. Possible Answers: @@ -1884,9 +1947,10 @@ - Where <dev-id> is the numerical ID of the MIDI input device as returned - by the - "LIST MIDI_INPUT_DEVICES" command, <port> the MIDI port number and + Where <dev-id> is the numerical ID of the MIDI input device as returned by the + "CREATE MIDI_INPUT_DEVICE" + or "LIST MIDI_INPUT_DEVICES" + 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" command). @@ -1989,7 +2053,10 @@ Where <device-id> should be replaced by the numerical ID of the - MIDI device, <port> by the MIDI port number, <key> by the name of + MIDI device as returned by the + "CREATE MIDI_INPUT_DEVICE" + or "LIST MIDI_INPUT_DEVICES" + command, <port> by the MIDI port number, <key> by the name of the parameter to change and <value> by the new value for this parameter. @@ -2025,8 +2092,9 @@
- The following commands describe how to add and remove sampler channels, deploy - sampler engines, load instruments and connect sampler channels to MIDI and audio devices. + The following commands describe how to add and remove sampler channels, associate a + sampler channel with a sampler engine, load instruments and connect sampler channels to + MIDI and audio devices.
An instrument file can be loaded and assigned to a sampler channel by one of the following commands: @@ -2086,7 +2154,7 @@
- A sample engine can be deployed and assigned to a specific sampler + A sampler engine type can be associated to a specific sampler channel by the following command: @@ -2096,10 +2164,18 @@ Where <engine-name> is an engine name as obtained by the - "LIST AVAILABLE_ENGINES" command and <sampler-channel> the sampler channel the - deployed engine should be assigned to. Even if the respective - sampler channel has already a deployed engine with that engine - name, a new engine instance will be assigned to the sampler channel. + "LIST AVAILABLE_ENGINES" command and <sampler-channel> + the sampler channel as returned by the + "ADD CHANNEL" or + "LIST CHANNELS" command where + the engine type should be assigned to. This command should be issued + after adding a new sampler channel and before any other control + commands on the new sampler channel. It can also be used to change + the engine type of a sampler channel. This command has (currently) no + way to define or force if a new engine instance should be created and + assigned to the given sampler channel or if an already existing + instance of that engine type, shared with other sampler channels, + should be used. Possible Answers: @@ -2205,8 +2281,8 @@ in case a new sampler channel could be added, where <sampler-channel> reflects the channel number of the new - created sampler channel which should the be used to set up - the sampler channel by sending subsequent intialization + created sampler channel which should be used to set up + the sampler channel by sending subsequent initialization commands @@ -2241,9 +2317,12 @@ - This will decrement the sampler channel count by one and also - decrement the channel numbers of all subsequent sampler channels by - one. + Where <sampler-channel> should be replaced by the + number of the sampler channel as given by the + "ADD CHANNEL" + or "LIST CHANNELS" + command. The channel numbers of all subsequent sampler channels + remain the same. Possible Answers: @@ -2308,16 +2387,17 @@ Possible Answers: - LinuxSampler will answer by sending a comma separated character - string of the engines' names. Engine names can consist of lower and - upper cases, digits and underlines ("_" character). + LinuxSampler will answer by sending a comma separated list + of the engines' names encapsulated into apostrophes ('). + Engine names can consist of lower and upper cases, + digits and underlines ("_" character). Example: C: "LIST AVAILABLE_ENGINES" - S: "GigEngine,AkaiEngine,DLSEngine,JoesCustomEngine" + S: "'GigEngine','AkaiEngine','DLSEngine','JoesCustomEngine'"
@@ -2380,7 +2460,9 @@ GET CHANNEL INFO <sampler-channel> - Where <sampler-channel> is the sampler channel number the front-end is interested in. + Where <sampler-channel> is the sampler channel number the front-end is interested in + as returned by the "ADD CHANNEL" + or "LIST CHANNELS" command. Possible Answers: @@ -2394,8 +2476,8 @@ ENGINE_NAME - - name of the engine that is deployed on the sampler - channel, "NONE" if there's no engine deployed yet for + name of the engine that is associated with the sampler + channel, "NONE" if there's no engine associated yet for this sampler channel @@ -2509,7 +2591,9 @@ GET CHANNEL VOICE_COUNT <sampler-channel> - Where <sampler-channel> is the sampler channel number the front-end is interested in. + Where <sampler-channel> is the sampler channel number the front-end is interested in + as returned by the "ADD CHANNEL" + or "LIST CHANNELS" command. Possible Answers: @@ -2534,7 +2618,9 @@ GET CHANNEL STREAM_COUNT <sampler-channel> - Where <sampler-channel> is the sampler channel number the front-end is interested in. + Where <sampler-channel> is the sampler channel number the front-end is interested in + as returned by the "ADD CHANNEL" + or "LIST CHANNELS" command. Possible Answers: @@ -2568,7 +2654,9 @@ to get the fill state in percent, where <sampler-channel> is the - sampler channel number the front-end is interested in. + sampler channel number the front-end is interested in + as returned by the "ADD CHANNEL" + or "LIST CHANNELS" command. Possible Answers: @@ -2612,9 +2700,13 @@ SET CHANNEL AUDIO_OUTPUT_DEVICE <sampler-channel> <audio-device-id> - Where <audio-device-id> is the numerical ID of the audio output - device and <sampler-channel> is the respective sampler channel - number. + Where <sampler-channel> is the respective sampler channel + number as returned by the "ADD CHANNEL" + or "LIST CHANNELS" command and + <audio-device-id> is the numerical ID of the audio output device as given by the + "CREATE AUDIO_OUTPUT_DEVICE" + or "LIST AUDIO_OUTPUT_DEVICES" + command. Possible Answers: @@ -2697,7 +2789,9 @@ SET CHANNEL AUDIO_OUTPUT_CHANNEL <sampler-chan> <audio-out> <audio-in> - Where <sampler-chan> is the sampler channel number, <audio-out> is the + Where <sampler-chan> is the sampler channel number + as returned by the "ADD CHANNEL" + or "LIST CHANNELS" command, <audio-out> is the numerical ID of the sampler channel's audio output channel which should be rerouted and <audio-in> is the numerical ID of the audio channel of the selected audio output device where <audio-out> should be routed to. @@ -2740,8 +2834,12 @@ SET CHANNEL MIDI_INPUT_DEVICE <sampler-channel> <midi-device-id> - Where <sampler-channel> is the sampler channel number and <midi-device-id> is the - the numerical ID of the MIDI input device. + Where <sampler-channel> is the sampler channel number + as returned by the "ADD CHANNEL" + or "LIST CHANNELS" command + and <midi-device-id> is the numerical ID of the MIDI input device as returned by the + "CREATE MIDI_INPUT_DEVICE" + or "LIST MIDI_INPUT_DEVICES" command. Possible Answers: @@ -2845,7 +2943,7 @@ "ERR:<error-code>:<error-message>" - - in case it failed, providing an appropriate error code and error messag + in case it failed, providing an appropriate error code and error message @@ -3153,13 +3251,420 @@
+ +
+ The client can ask for general informations about the LinuxSampler + instance by sending the following command: + + + GET SERVER INFO + + + 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 information category. At the + moment the following categories are defined: + + + + DESCRIPTION - + + arbitrary textual description about the sampler + + + VERSION - + + version of the sampler + + + PROTOCOL_VERSION - + + version of the LSCP specification the sampler + complies with (see for details) + + + + + + + The mentioned fields above don't have to be in particular order. + Other fields might be added in future. +
- TODO: will soon automatically included from src/network/lscp.y, - meanwhile have a look at that file to get the exact definition of - the command syntax. + The grammar of the control protocol as descibed in + is defined below using Backus-Naur Form (BNF as described in ) + where applicable. + + + + +input = + + line LF + + / line CR LF + + + +line = + + /* epsilon (empty line ignored) */ + + / comment + + / command + + / error + + + +comment = + + '#' + + / comment '#' + + / comment SP + + / comment number + + / comment string + + + +command = + + ADD SP CHANNEL + + / GET SP get_instruction + + / CREATE SP create_instruction + + / DESTROY SP destroy_instruction + + / LIST SP list_instruction + + / LOAD SP load_instruction + + / REMOVE SP CHANNEL SP sampler_channel + + / SET SP set_instruction + + / SUBSCRIBE SP subscribe_event + + / UNSUBSCRIBE SP unsubscribe_event + + / SELECT SP text + + / RESET SP CHANNEL SP sampler_channel + + / RESET + + / QUIT + + + +subscribe_event = + + CHANNEL_COUNT + + / VOICE_COUNT + + / STREAM_COUNT + + / BUFFER_FILL + + / CHANNEL_INFO + + / MISCELLANEOUS + + + +unsubscribe_event = + + CHANNEL_COUNT + + / VOICE_COUNT + + / STREAM_COUNT + + / BUFFER_FILL + + / CHANNEL_INFO + + / MISCELLANEOUS + + + +get_instruction = + + AVAILABLE_ENGINES + + / AVAILABLE_MIDI_INPUT_DRIVERS + + / MIDI_INPUT_DRIVER SP INFO SP string + + / MIDI_INPUT_DRIVER_PARAMETER SP INFO SP string SP string + + / MIDI_INPUT_DRIVER_PARAMETER SP INFO SP string SP string SP key_val_list + + / AVAILABLE_AUDIO_OUTPUT_DRIVERS + + / AUDIO_OUTPUT_DRIVER SP INFO SP string + + / AUDIO_OUTPUT_DRIVER_PARAMETER SP INFO SP string SP string + + / AUDIO_OUTPUT_DRIVER_PARAMETER SP INFO SP string SP string SP key_val_list + + / AUDIO_OUTPUT_DEVICES + + / MIDI_INPUT_DEVICES + + / AUDIO_OUTPUT_DEVICE SP INFO SP number + + / MIDI_INPUT_DEVICE SP INFO SP number + + / MIDI_INPUT_PORT SP INFO SP number SP number + + / MIDI_INPUT_PORT_PARAMETER SP INFO SP number SP number SP string + + / AUDIO_OUTPUT_CHANNEL SP INFO SP number SP number + + / AUDIO_OUTPUT_CHANNEL_PARAMETER SP INFO SP number SP number SP string + + / CHANNELS + + / CHANNEL SP INFO SP sampler_channel + + / CHANNEL SP BUFFER_FILL SP buffer_size_type SP sampler_channel + + / CHANNEL SP STREAM_COUNT SP sampler_channel + + / CHANNEL SP VOICE_COUNT SP sampler_channel + + / ENGINE SP INFO SP engine_name + + / SERVER SP INFO + + + +set_instruction = + + AUDIO_OUTPUT_DEVICE_PARAMETER SP number SP string '=' param_val_list + + / AUDIO_OUTPUT_CHANNEL_PARAMETER SP number SP number SP string '=' param_val_list + + / MIDI_INPUT_DEVICE_PARAMETER SP number SP string '=' param_val_list + + / MIDI_INPUT_PORT_PARAMETER SP number SP number SP string '=' param_val_list + + / CHANNEL SP set_chan_instruction + + / ECHO SP boolean + + + +create_instruction = + + AUDIO_OUTPUT_DEVICE SP string SP key_val_list + + / AUDIO_OUTPUT_DEVICE SP string + + / MIDI_INPUT_DEVICE SP string SP key_val_list + + / MIDI_INPUT_DEVICE SP string + + + +destroy_instruction = + + AUDIO_OUTPUT_DEVICE SP number + + / MIDI_INPUT_DEVICE SP number + + + +load_instruction = + + INSTRUMENT SP load_instr_args + + / ENGINE SP load_engine_args + + + +set_chan_instruction = + + AUDIO_OUTPUT_DEVICE SP sampler_channel SP device_index + + / AUDIO_OUTPUT_CHANNEL SP sampler_channel SP audio_channel_index SP audio_channel_index + + / AUDIO_OUTPUT_TYPE SP sampler_channel SP audio_output_type_name + + / MIDI_INPUT SP sampler_channel SP device_index SP midi_input_port_index SP midi_input_channel_index + + / MIDI_INPUT_DEVICE SP sampler_channel SP device_index + + / MIDI_INPUT_PORT SP sampler_channel SP midi_input_port_index + + / MIDI_INPUT_CHANNEL SP sampler_channel SP midi_input_channel_index + + / MIDI_INPUT_TYPE SP sampler_channel SP midi_input_type_name + + / VOLUME SP sampler_channel SP volume_value + + + +key_val_list = + + string '=' param_val_list + + / key_val_list SP string '=' param_val_list + + + +buffer_size_type = + + BYTES + + / PERCENTAGE + + + +list_instruction = + + AUDIO_OUTPUT_DEVICES + + / MIDI_INPUT_DEVICES + + / CHANNELS + + / AVAILABLE_ENGINES + + / AVAILABLE_MIDI_INPUT_DRIVERS + + / AVAILABLE_AUDIO_OUTPUT_DRIVERS + + + +load_instr_args = + + filename SP instrument_index SP sampler_channel + + / NON_MODAL SP filename SP instrument_index SP sampler_channel + + + +load_engine_args = + + engine_name SP sampler_channel + + + +device_index = + + number + + + +audio_channel_index = + + number + + + +audio_output_type_name = + + string + + + +midi_input_port_index = + + number + + + +midi_input_channel_index = + + number + + / ALL + + + +midi_input_type_name = + + string + + + +volume_value = + + dotnum + + / number + + + +sampler_channel = + + number + + + +instrument_index = + + number + + + +engine_name = + + string + + + +filename = + + stringval + + + +param_val_list = + + param_val + + / param_val_list','param_val + + + +param_val = + + string + + / '\'' string '\'' + + / '\"' string '\"' + + / number + + / dotnum + + + + +
@@ -3170,13 +3675,13 @@ back-end changes by issuing the following command: - SUBSCRIBE CHANNELS + SUBSCRIBE CHANNEL_COUNT Server will start sending the following notification messages: - "NOTIFY:CHANNELS:<channels>" + "NOTIFY:CHANNEL_COUNT:<channels>" where <channels> will be replaced by the new number @@ -3244,16 +3749,16 @@
Client may want to be notified when changes were made to sampler channels on the - back-end changes by issuing the following command: + back-end by issuing the following command: - SUBSCRIBE INFO + SUBSCRIBE CHANNEL_INFO Server will start sending the following notification messages: - "NOTIFY:INFO:<sampler-channel>" + "NOTIFY:CHANNEL_INFO:<sampler-channel>" where <sampler-channel> will be replaced by the sampler channel the @@ -3300,6 +3805,7 @@ Rui Nuno Capela Vladimir Senkov Mark Knecht + Grigor Iliev
@@ -3307,7 +3813,41 @@ - &rfc2119; + + + + Key words for use in RFCs to Indicate Requirement Levels + + Harvard University + + + + + + + + TRANSMISSION CONTROL PROTOCOL + + Defense Advanced Research Projects Agency + + + + + + + + Augmented BNF for Syntax Specifications + + Internet Mail Consortium + + + Demon Internet Ltd + + + + + +