/[svn]/web/trunk/www.linuxsampler.org/api/draft-linuxsampler-protocol-11.txt
ViewVC logotype

Contents of /web/trunk/www.linuxsampler.org/api/draft-linuxsampler-protocol-11.txt

Parent Directory Parent Directory | Revision Log Revision Log


Revision 542 - (show annotations) (download)
Sun May 15 15:31:45 2005 UTC (18 years, 11 months ago) by senoner
File MIME type: text/plain
File size: 98441 byte(s)
Initial Revision

1
2
3 LinuxSampler Developers C. Schoenebeck
4 Internet-Draft Interessengemeinschaft Software
5 Expires: November 30, 2004 Engineering e. V.
6 June 2004
7
8
9 LinuxSampler Control Protocol
10 lscp.txt
11
12 Status of this Memo
13
14 This document is an Internet-Draft and is in full conformance with
15 all provisions of Section 10 of RFC2026.
16
17 Internet-Drafts are working documents of the Internet Engineering
18 Task Force (IETF), its areas, and its working groups. Note that other
19 groups may also distribute working documents as Internet-Drafts.
20
21 Internet-Drafts are draft documents valid for a maximum of six months
22 and may be updated, replaced, or obsoleted by other documents at any
23 time. It is inappropriate to use Internet-Drafts as reference
24 material or to cite them other than as "work in progress."
25
26 The list of current Internet-Drafts can be accessed at http://
27 www.ietf.org/ietf/1id-abstracts.txt.
28
29 The list of Internet-Draft Shadow Directories can be accessed at
30 http://www.ietf.org/shadow.html.
31
32 This Internet-Draft will expire on November 30, 2004.
33
34 Copyright Notice
35
36 Copyright (C) The Internet Society (2004). All Rights Reserved.
37
38 Abstract
39
40 The LinuxSampler Control Protocol (LSCP) is an application-level
41 protocol primarily intended for local and remote controlling the
42 LinuxSampler main application, which is a sophisticated console
43 application essentially playing back audio samples and manipulating
44 the samples in real time to certain extent.
45
46
47
48
49
50
51
52
53
54
55 Schoenebeck Expires November 30, 2004 [Page 1]
56
57 Internet-Draft LinuxSampler Control Protocol June 2004
58
59
60 Table of Contents
61
62 1. Requirements notation . . . . . . . . . . . . . . . . . . . 4
63 2. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 5
64 3. Focus of this protocol . . . . . . . . . . . . . . . . . . . 6
65 4. Communication Overview . . . . . . . . . . . . . . . . . . . 7
66 4.1 Request/response communication method . . . . . . . . . . 7
67 4.1.1 Result format . . . . . . . . . . . . . . . . . . . . 8
68 4.2 Subscribe/notify communication method . . . . . . . . . . 9
69 5. Description for control commands . . . . . . . . . . . . . . 11
70 5.1 Ignored lines and comments . . . . . . . . . . . . . . . . 11
71 5.2 Configuring audio drivers . . . . . . . . . . . . . . . . 11
72 5.2.1 Getting all available audio output drivers . . . . . . 11
73 5.2.2 Getting information about a specific audio output
74 driver . . . . . . . . . . . . . . . . . . . . . . . . 12
75 5.2.3 Getting information about specific audio output
76 driver parameter . . . . . . . . . . . . . . . . . . . 13
77 5.2.4 Creating an audio output device . . . . . . . . . . . 15
78 5.2.5 Destroying an audio output device . . . . . . . . . . 16
79 5.2.6 Getting all created audio output device count . . . . 17
80 5.2.7 Getting all created audio output device list . . . . . 17
81 5.2.8 Getting current settings of an audio output device . . 17
82 5.2.9 Changing settings of audio output devices . . . . . . 18
83 5.2.10 Getting information about an audio channel . . . . . 19
84 5.2.11 Getting information about specific audio channel
85 parameter . . . . . . . . . . . . . . . . . . . . . 20
86 5.2.12 Changing settings of audio output channels . . . . . 22
87 5.3 Configuring MIDI input drivers . . . . . . . . . . . . . . 22
88 5.3.1 Getting all available MIDI input drivers . . . . . . . 23
89 5.3.2 Getting information about a specific MIDI input
90 driver . . . . . . . . . . . . . . . . . . . . . . . . 23
91 5.3.3 Getting information about specific MIDI input
92 driver parameter . . . . . . . . . . . . . . . . . . . 24
93 5.3.4 Creating a MIDI input device . . . . . . . . . . . . . 26
94 5.3.5 Destroying a MIDI input device . . . . . . . . . . . . 27
95 5.3.6 Getting all created MIDI input device count . . . . . 27
96 5.3.7 Getting all created MIDI input device list . . . . . . 28
97 5.3.8 Getting current settings of a MIDI input device . . . 28
98 5.3.9 Changing settings of audio output devices . . . . . . 29
99 5.3.10 Getting information about a MIDI port . . . . . . . 30
100 5.3.11 Getting information about specific MIDI port
101 parameter . . . . . . . . . . . . . . . . . . . . . 30
102 5.3.12 Changing settings of MIDI input ports . . . . . . . 32
103 5.4 Configuring sampler channels . . . . . . . . . . . . . . . 32
104 5.4.1 Loading an instrument . . . . . . . . . . . . . . . . 32
105 5.4.2 Loading a sampler engine . . . . . . . . . . . . . . . 33
106 5.4.3 Getting all created sampler channel count . . . . . . 34
107 5.4.4 Getting all created sampler channel list . . . . . . . 34
108
109
110
111 Schoenebeck Expires November 30, 2004 [Page 2]
112
113 Internet-Draft LinuxSampler Control Protocol June 2004
114
115
116 5.4.5 Adding a new sampler channel . . . . . . . . . . . . . 34
117 5.4.6 Removing a sampler channel . . . . . . . . . . . . . . 35
118 5.4.7 Getting all available engines . . . . . . . . . . . . 36
119 5.4.8 Getting information about an engine . . . . . . . . . 36
120 5.4.9 Getting sampler channel information . . . . . . . . . 37
121 5.4.10 Current number of active voices . . . . . . . . . . 38
122 5.4.11 Current number of active disk streams . . . . . . . 39
123 5.4.12 Current fill state of disk stream buffers . . . . . 39
124 5.4.13 Setting audio output device . . . . . . . . . . . . 40
125 5.4.14 Setting audio output type . . . . . . . . . . . . . 41
126 5.4.15 Setting audio output channel . . . . . . . . . . . . 41
127 5.4.16 Setting MIDI input device . . . . . . . . . . . . . 42
128 5.4.17 Setting MIDI input type . . . . . . . . . . . . . . 42
129 5.4.18 Setting MIDI input port . . . . . . . . . . . . . . 43
130 5.4.19 Setting MIDI input channel . . . . . . . . . . . . . 43
131 5.4.20 Setting channel volume . . . . . . . . . . . . . . . 44
132 5.4.21 Resetting a sampler channel . . . . . . . . . . . . 45
133 5.5 Controlling connection . . . . . . . . . . . . . . . . . . 45
134 5.5.1 Register front-end for receiving event messages . . . 45
135 5.5.2 Unregister front-end for not receiving UDP event
136 messages anymore . . . . . . . . . . . . . . . . . . . 46
137 5.5.3 Enable or disable echo of commands . . . . . . . . . . 46
138 5.5.4 Close client connection . . . . . . . . . . . . . . . 47
139 6. Command Syntax . . . . . . . . . . . . . . . . . . . . . . . 48
140 7. Events . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
141 7.1 Number of sampler channels changed . . . . . . . . . . . . 49
142 7.2 Number of active voices changed . . . . . . . . . . . . . 49
143 7.3 Number of active disk streams changed . . . . . . . . . . 49
144 7.4 Disk stream buffer fill state changed . . . . . . . . . . 50
145 7.5 Channel information changed . . . . . . . . . . . . . . . 50
146 7.6 Miscellaneous and debugging events . . . . . . . . . . . . 50
147 8. Security Considerations . . . . . . . . . . . . . . . . . . 52
148 9. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . 53
149 10. References . . . . . . . . . . . . . . . . . . . . . . . . . 53
150 Author's Address . . . . . . . . . . . . . . . . . . . . . . 53
151 Intellectual Property and Copyright Statements . . . . . . . 54
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167 Schoenebeck Expires November 30, 2004 [Page 3]
168
169 Internet-Draft LinuxSampler Control Protocol June 2004
170
171
172 1. Requirements notation
173
174 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
175 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
176 document are to be interpreted as described in [RFC2119].
177
178 This protocol is always case-sensitive if not explicitly claimed the
179 opposite.
180
181 In examples, "C:" and "S:" indicate lines sent by the client
182 (front-end) and server (LinuxSampler) respectively. Lines in examples
183 must be interpreted as every line being CRLF terminated (carriage
184 return character followed by line feed character as defined in the
185 ASCII standard), thus the following example:
186
187 C: "some line"
188 "another line"
189
190 must actually be interpreted as client sending the following message:
191
192 "some line<CR><LF>another line<CR><LF>"
193
194 where <CR> symbolizes the carriage return character and <LF> the line
195 feed character as defined in the ASCII standard.
196
197 Due to technical reasons, messages can arbitrary be fragmented, means
198 the following example:
199
200 S: "abcd"
201
202 could also happen to be sent in three messages like in the following
203 sequence scenario:
204
205 o server sending message "a"
206 o followed by a delay (pause) with arbitrary duration
207 o followed by server sending message "bcd<CR>"
208 o again followed by a delay (pause) with arbitrary duration
209 o followed by server sending the message "<LF>"
210
211 where again <CR> and <LF> symbolize the carriage return and line feed
212 characters respectively.
213
214
215
216
217
218
219
220
221
222
223 Schoenebeck Expires November 30, 2004 [Page 4]
224
225 Internet-Draft LinuxSampler Control Protocol June 2004
226
227
228 2. Introduction
229
230 LinuxSampler is a so called software sampler application capable to
231 playback audio samples from a computer's Random Access Memory (RAM)
232 as well as directly streaming it from disk. LinuxSampler is designed
233 to be modular. It provides several so called "sampler engines" where
234 each engine is specialized for a certain purpose. LinuxSampler has
235 virtual channels which will be referred in this document as "sampler
236 channels". The channels are in such way virtual as they can be
237 connected to an arbitrary MIDI input method and arbitrary MIDI
238 channel (e.g. sampler channel 17 could be connected to an Alsa
239 sequencer device 64:0 and listening to MIDI channel 1 there). Each
240 sampler engine will be assigned an own instance of one of the
241 available sampler engines (e.g. GigEngine, DLSEngine). The audio
242 output of each sampler channel can be routed to an arbitrary audio
243 output method (Alsa / Jack) and an arbitrary audio output channel
244 there.
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279 Schoenebeck Expires November 30, 2004 [Page 5]
280
281 Internet-Draft LinuxSampler Control Protocol June 2004
282
283
284 3. Focus of this protocol
285
286 Main focus of this protocol is to provide a way to configure a
287 running LinuxSampler instance and to retrieve information about it.
288 The focus of this protocol is not to provide a way to control
289 synthesis parameters or even to trigger or release notes. Or in other
290 words; the focus are those functionalities which are not covered by
291 MIDI or which may at most be handled via MIDI System Exclusive
292 Messages.
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335 Schoenebeck Expires November 30, 2004 [Page 6]
336
337 Internet-Draft LinuxSampler Control Protocol June 2004
338
339
340 4. Communication Overview
341
342 There are two distinct methods of communication between a running
343 instance of LinuxSampler and one or more control applications, so
344 called "front-ends": a simple request/response communication method
345 used by the clients to give commands to the server as well as to
346 inquire about server's status and a subscribe/notify communication
347 method used by the client to subscribe to and receive notifications
348 of certain events as they happen on the server. The latter needs more
349 effort to be implemented in the front-end application. The two
350 communication methods will be described next.
351
352 4.1 Request/response communication method
353
354 This simple communication method is based on TCP. The front-end
355 application establishes a TCP connection to the LinuxSampler instance
356 on a certain host system. Then the front-end application will send
357 certain ASCII based commands as defined in this document (every
358 command line must be CRLF terminated - see "Conventions used in this
359 document" at the beginning of this document) and the LinuxSampler
360 application will response after a certain process time with an
361 appropriate ASCII based answer, also as defined in this document. So
362 this TCP communication is simply based on query and answer paradigm.
363 That way LinuxSampler is only able to answer on queries from
364 front-ends, but not able to automatically send messages to the client
365 if it's not asked to. The fronted should not reconnect to
366 LinuxSampler for every single command, instead it should keep the
367 connection established and simply resend message(s) for subsequent
368 commands. To keep information in the front-end up-to-date the
369 front-end has to periodically send new requests to get the current
370 information from the LinuxSampler instance. This is often referred to
371 as "polling". While polling is simple to implement and may be OK to
372 use in some cases, there may be disadvantages to polling such as
373 network traffic overhead and information being out of date. It is
374 possible for a client or several clients to open more than one
375 connection to the server at the same time. It is also possible to
376 send more than one request to the server at the same time but if
377 those requests are sent over the same connection server MUST execute
378 them sequentially. Upon executing a request server will produce a
379 result set and send it to the client. Each and every request made by
380 the client MUST result in a result set being sent back to the client.
381 No other data other than a result set may be sent by a server to a
382 client. No result set may be sent to a client without the client
383 sending request to the server first. On any particular connection,
384 result sets MUST be sent in their entirety without being interrupted
385 by other result sets. If several requests got queued up at the server
386 they MUST be processed in the order they were received and result
387 sets MUST be sent back in the same order.
388
389
390
391 Schoenebeck Expires November 30, 2004 [Page 7]
392
393 Internet-Draft LinuxSampler Control Protocol June 2004
394
395
396 4.1.1 Result format
397
398 Result set could be one of the following types:
399
400 1. Normal
401 2. Warning
402 3. Error
403
404 Warning and Error result sets MUST be single line and have the
405 following format:
406
407 o "WRN:<warning-code>:<warning-message>"
408 o "ERR:<error-code>:<error-message>"
409
410 Where <warning-code> and <error-code> are numeric unique identifiers
411 of the warning or error and <warning-message> and <error-message> are
412 human readable descriptions of the warning or error respectively.
413
414 Normal result sets could be:
415
416 1. Empty
417 2. Single line
418 3. Multi-line
419
420 Empty result set is issued when the server only needed to acknowledge
421 the fact that the request was received and it was processed
422 successfully and no additional information is available. This result
423 set has the following format:
424
425 "OK"
426
427 Single line result sets are command specific. One example of a single
428 line result set is an empty line. Multi-line result sets are command
429 specific and may include one or more lines of information. They MUST
430 always end with the following line:
431
432 "."
433
434 In addition to above mentioned formats, warnings and empty result
435 sets MAY be indexed. In this case, they have the following formats
436 respectively:
437
438 o "WRN[<index>]:<warning-code>:<warning-message>"
439 o "OK[<index>]"
440
441 where <index> is command specific and is used to indicate channel
442 number that the result set was related to or other integer value.
443
444
445
446
447 Schoenebeck Expires November 30, 2004 [Page 8]
448
449 Internet-Draft LinuxSampler Control Protocol June 2004
450
451
452 Each line of the result set MUST end with <CRLF>.
453
454 4.2 Subscribe/notify communication method
455
456 This more sophisticated communication method is actually only an
457 extension of the simple request/response communication method. The
458 front-end still uses a TCP connection and sends the same commands on
459 the TCP connection. Two extra commands are SUBSCRIBE and UNSUBSCRIBE
460 commands that allow a client to tell the server that it is interested
461 in receiving notifications about certain events as they happen on the
462 server. The SUBSCRIBE command has the following syntax:
463
464 SUBSCRIBE <event-id>
465
466 where <event-id> will be replaced by the respective event that client
467 wants to subscribe to. Upon receiving such request, server SHOULD
468 respond with OK and start sending EVENT notifications when a given
469 even has occurred to the front-end when an event has occurred. It MAY
470 be possible certain events may be sent before OK response during real
471 time nature of their generation. Event messages have the following
472 format:
473
474 NOTIFY:<event-id>:<custom-event-data>
475
476 where <event-id> uniquely identifies the event that has occurred and
477 <custom-event-data> is event specific.
478
479 Several rules must be followed by the server when generating events:
480
481 1. Events MUST NOT be sent to any client who has not issued an
482 appropriate SUBSCRIBE command.
483 2. Events MUST only be sent using the same connection that was used
484 to subscribe to them.
485 3. When response is being sent to the client, event MUST be inserted
486 in the stream before or after the response, but NOT in the
487 middle. Same is true about the response. It should never be
488 inserted in the middle of the event message as well as any other
489 response.
490
491 If the client is not interested in a particular event anymore it MAY
492 issue UNSUBSCRIBE command using the following syntax:
493
494 UNSUBSCRIBE <event-id>
495
496 where <event-id> will be replace by the respective event that client
497 is no longer interested in receiving. For a list of supported events
498 see chapter 6.
499
500
501
502
503 Schoenebeck Expires November 30, 2004 [Page 9]
504
505 Internet-Draft LinuxSampler Control Protocol June 2004
506
507
508 Example: the fill states of disk stream buffers have changed on
509 sampler channel 4 and the LinuxSampler instance will react by sending
510 the following message to all clients who subscribed to this event:
511
512 NOTIFY:CHANNEL_BUFFER_FILL:4 [35]62%,[33]80%,[37]98%
513
514 Which means there are currently three active streams on sampler
515 channel 4, where the stream with ID "35" is filled by 62%, stream
516 with ID 33 is filled by 80% and stream with ID 37 is filled by 98%.
517
518 Clients may choose to open more than one connection to the server and
519 use some connections to receive notifications while using other
520 connections to issue commands to the back-end. This is entirely legal
521 and up to the implementation. This does not change the protocol in
522 any way and no special restrictions exist on the server to allow or
523 disallow this or to track what connections belong to what front-ends.
524 Server will listen on a single port, accept multiple connections and
525 support protocol described in this specification in it's entirety on
526 this single port on each connection that it accepted.
527
528 Due to the fact that TCP is used for this communication, dead peers
529 will be detected automatically by the OS TCP stack. While it may take
530 a while to detect dead peers if no traffic is being sent from server
531 to client (TCP keep-alive timer is set to 2 hours on many OSes) it
532 will not be an issue here as when notifications are sent by the
533 server, dead client will be detected quickly.
534
535 When connection is closed for any reason server MUST forget all
536 subscriptions that were made on this connection. If client reconnects
537 it MUST resubscribe to all events that it wants to receive.
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559 Schoenebeck Expires November 30, 2004 [Page 10]
560
561 Internet-Draft LinuxSampler Control Protocol June 2004
562
563
564 5. Description for control commands
565
566 This chapter will describe the available control commands that can be
567 sent on the TCP connection in detail. Some certain commands (e.g.
568 "GET CHANNEL INFO" or "GET ENGINE INFO") lead to multiple-line
569 responses. In this case LinuxSampler signals the end of the response
570 by a "." (single dot) line.
571
572 5.1 Ignored lines and comments
573
574 White lines, that is lines which only contain space and tabulator
575 characters, and lines that start with a "#" character are ignored,
576 thus it's possible for example to group commands and to place
577 comments in a LSCP script file.
578
579 5.2 Configuring audio drivers
580
581 Instances of drivers in LinuxSampler are called devices. You can use
582 multiple audio devices simultaneously, e.g. to output the sound of
583 one sampler channel using the Alsa audio output driver, and on
584 another sampler channel you might want to use the Jack audio output
585 driver. For particular audio output systems it's also possible to
586 create several devices of the same audio output driver, e.g. two
587 separate Alsa audio output devices for using two different sound
588 cards at the same time. This chapter describes all commands to
589 configure LinuxSampler's audio output devices and their parameters.
590
591 Instead of defining commands and parameters for each driver
592 individually, all possible parameters, their meanings and possible
593 values have to be obtained at runtime. This makes the protocol a bit
594 abstract, but has the advantage, that front-ends can be written
595 independently of what drivers are currently implemented and what
596 parameters these drivers are actually offering. This means front-ends
597 can even handle drivers which are implemented somewhere in future
598 without modifying the front-end at all.
599
600 Note: examples in this chapter showing particular parameters of
601 drivers are not meant as specification of the drivers' parameters.
602 Driver implementations in LinuxSampler might have complete different
603 parameter names and meanings than shown in these examples or might
604 change in future, so these examples are only meant for showing how to
605 retrieve what parameters drivers are offering, how to retrieve their
606 possible values, etc.
607
608 5.2.1 Getting all available audio output drivers
609
610 Use the following command to list all audio output drivers currently
611 available for the LinuxSampler instance:
612
613
614
615 Schoenebeck Expires November 30, 2004 [Page 11]
616
617 Internet-Draft LinuxSampler Control Protocol June 2004
618
619
620 GET AVAILABLE_AUDIO_OUTPUT_DRIVERS
621
622 Possible Answers:
623
624 LinuxSampler will answer by sending comma separated character
625 strings, each symbolizing an audio output driver.
626
627 Example:
628
629 C: "GET AVAILABLE_AUDIO_OUTPUT_DRIVERS"
630 S: "Alsa,Jack"
631
632 5.2.2 Getting information about a specific audio output driver
633
634 Use the following command to get detailed information about a
635 specific audio output driver:
636
637 GET AUDIO_OUTPUT_DRIVER INFO <audio-output-driver>
638
639 Where <audio-output-driver> is the name of the audio output driver,
640 returned by the "GET AVAILABLE_AUDIO_OUTPUT_DRIVERS" command.
641
642 Possible Answers:
643
644 LinuxSampler will answer by sending a <CRLF> separated list. Each
645 answer line begins with the information category name followed by
646 a colon and then a space character <SP> and finally the info
647 character string to that info category. At the moment the
648 following information categories are defined:
649
650 DESCRIPTION -
651 character string describing the audio output driver
652 VERSION -
653 character string reflecting the driver's version
654 PARAMETERS -
655 comma separated list of all parameters available for the
656 given audio output driver, at least parameters 'channels',
657 'samplerate' and 'active' are offered by all audio output
658 drivers
659 The mentioned fields above don't have to be in particular order.
660
661 Example:
662
663 C: "GET AUDIO_OUTPUT_DRIVER INFO Alsa"
664 S: "DESCRIPTION: Advanced Linux Sound Architecture"
665 "VERSION: 1.0"
666 "PARAMETERS: driver,channels,samplerate,active,fragments,
667 fragmentsize,card"
668
669
670
671 Schoenebeck Expires November 30, 2004 [Page 12]
672
673 Internet-Draft LinuxSampler Control Protocol June 2004
674
675
676 "."
677
678 5.2.3 Getting information about specific audio output driver parameter
679
680 Use the following command to get detailed information about a
681 specific audio output driver parameter:
682
683 GET AUDIO_OUTPUT_DRIVER_PARAMETER INFO <audio> <prm> [<deplist>]
684
685 Where <audio> is the name of the audio output driver as returned by
686 the "GET AVAILABLE_AUDIO_OUTPUT_DRIVERS" command, <prm> a specific
687 parameter name for which information should be obtained (as returned
688 by the "GET AUDIO_OUTPUT_DRIVER INFO" command) and <deplist> is an
689 optional list of parameters on which the sought parameter <prm>
690 depends on, <deplist> is a list of key-value pairs in form of
691 "key1=val1 key2=val2 ...", where character string values are
692 encapsulated into apostrophes ('). Arguments given with <deplist>
693 which are not dependency parameters of <prm> will be ignored, means
694 the front-end application can simply put all parameters into
695 <deplist> with the values already selected by the user.
696
697 Possible Answers:
698
699 LinuxSampler will answer by sending a &lz;CRLF> separated list.
700 Each answer line begins with the information category name
701 followed by a colon and then a space character <SP> and finally
702 the info character string to that info category. There are
703 information which is always returned, independently of the given
704 driver parameter and there are optional information which is only
705 shown dependently to given driver parameter. At the moment the
706 following information categories are defined:
707
708 TYPE -
709 either "BOOL" for boolean value(s) or "INT" for integer
710 value(s) or "FLOAT" for dotted number(s) or "STRING" for
711 character string(s) (always returned, no matter which driver
712 parameter)
713 DESCRIPTION -
714 arbitrary text describing the purpose of the parameter (always
715 returned, no matter which driver parameter)
716 MANDATORY -
717 either true or false, defines if this parameter must be given
718 when the device is to be created with the 'CREATE
719 AUDIO_OUTPUT_DEVICE' command (always returned, no matter which
720 driver parameter)
721 FIX -
722 either true or false, if false then this parameter can be
723 changed at any time, once the device is created by the 'CREATE
724
725
726
727 Schoenebeck Expires November 30, 2004 [Page 13]
728
729 Internet-Draft LinuxSampler Control Protocol June 2004
730
731
732 AUDIO_OUTPUT_DEVICE' command (always returned, no matter which
733 driver parameter)
734 MULTIPLICITY -
735 either true or false, defines if this parameter allows only one
736 value or a list of values, where true means multiple values and
737 false only a single value allowed (always returned, no matter
738 which driver parameter)
739 DEPENDS -
740 comma separated list of paramters this parameter depends on,
741 means the values for fields 'DEFAULT', 'RANGE_MIN', 'RANGE_MAX'
742 and 'POSSIBILITIES' might depend on these listed parameters,
743 for example assuming that an audio driver (like the Alsa
744 driver) offers parameters 'card' and 'samplerate' then
745 parameter 'samplerate' would depend on 'card' because the
746 possible values for 'samplerate' depends on the sound card
747 which can be chosen by the 'card' parameter (optionally
748 returned, dependent to driver parameter)
749 DEFAULT -
750 reflects the default value for this parameter which is used
751 when the device is created and not explicitly given with the
752 'CREATE AUDIO_OUTPUT_DEVICE' command, in case of
753 MULTIPLCITY=true, this is a comma separated list, that's why
754 character strings are encapsulated into apostrophes (')
755 (optionally returned, dependent to driver parameter)
756 RANGE_MIN -
757 defines lower limit of the allowed value range for this
758 parameter, can be an integer value as well as a dotted number,
759 this parameter is often used in conjunction with RANGE_MAX, but
760 may also appear without (optionally returned, dependent to
761 driver parameter)
762 RANGE_MAX -
763 defines upper limit of the allowed value range for this
764 parameter, can be an integer value as well as a dotted number,
765 this parameter is often used in conjunction with RANGE_MIN, but
766 may also appear without (optionally returned, dependent to
767 driver parameter)
768 POSSIBILITES -
769 comma separated list of possible values for this parameter,
770 character strings are encapsulated into apostrophes (optionally
771 returned, dependent to driver parameter)
772
773 The mentioned fields above don't have to be in particular order.
774
775 Examples:
776
777 C: "GET AUDIO_OUTPUT_DRIVER_PARAMETER INFO Alsa card"
778 S: "DESCRIPTION: sound card to be used"
779
780
781
782
783 Schoenebeck Expires November 30, 2004 [Page 14]
784
785 Internet-Draft LinuxSampler Control Protocol June 2004
786
787
788 "TYPE: STRING"
789 "MANDATORY: false"
790 "FIX: true"
791 "MULTIPLICITY: false"
792 "DEFAULT: '0,0'"
793 "POSSIBILITES: '0,0','1,0','2,0'"
794 "."
795
796 C: "GET AUDIO_OUTPUT_DRIVER_PARAMETER INFO Alsa samplerate"
797 S: "DESCRIPTION: output sample rate in Hz"
798 "TYPE: INT"
799 "MANDATORY: false"
800 "FIX: false"
801 "MULTIPLICITY: false"
802 "DEPENDS: card"
803 "DEFAULT: 44100"
804 "."
805
806 C: "GET AUDIO_OUTPUT_DRIVER_PARAMETER INFO Alsa samplerate
807 card='0,0'"
808 S: "DESCRIPTION: output sample rate in Hz"
809 "TYPE: INT"
810 "MANDATORY: false"
811 "FIX: false"
812 "MULTIPLICITY: false"
813 "DEPENDS: card"
814 "DEFAULT: 44100"
815 "RANGE_MIN: 22050"
816 "RANGE_MAX: 96000"
817 "."
818
819 5.2.4 Creating an audio output device
820
821 Use the following command to create a new audio output device for
822 the desired audio output system:
823
824 CREATE AUDIO_OUTPUT_DEVICE <audio-output-driver> [<param-list>]
825
826 Where <audio-output-driver> should be replaced by the desired audio
827 output system and <param-list> by an optional list of driver specific
828 parameters in form of "key1=val1 key2=val2 ...", where character
829 string values should be encapsulated into apostrophes ('). Note that
830 there might be drivers which require parameter(s) to be given with
831 this command. Use the previously described commands in this chapter
832 to get this information.
833
834 Possible Answers:
835
836
837
838
839 Schoenebeck Expires November 30, 2004 [Page 15]
840
841 Internet-Draft LinuxSampler Control Protocol June 2004
842
843
844 "OK[<device-id>]" -
845 in case the device was successfully created, where <device-id>
846 is the numerical ID of the new device
847 "WRN[<device-id>]:<warning-code>:<warning-message>" -
848 in case the device was created successfully, where <device-id>
849 is the numerical ID of the new device, but there are noteworthy
850 issue(s) related (e.g. sound card doesn't support given
851 hardware parameters and the driver is using fall-back values),
852 providing an appropriate warning code and warning message
853 "ERR:<error-code>:<error-message>" -
854 in case it failed, providing an appropriate error code and
855 error message
856
857 Examples:
858
859 C: "CREATE AUDIO_OUTPUT_DEVICE Alsa"
860 S: "OK[0]"
861
862 C: "CREATE AUDIO_OUTPUT_DEVICE Alsa card='2,0' samplerate=96000"
863 S: "OK[1]"
864
865 5.2.5 Destroying an audio output device
866
867 Use the following command to destroy a created output device:
868
869 DESTROY AUDIO_OUTPUT_DEVICE <device-id>
870
871 Where <device-id> should be replaced by the numerical ID of the audio
872 output device as given by the "CREATE AUDIO_OUTPUT_DEVICE" or "GET
873 AUDIO_OUTPUT_DEVICES" command.
874
875 Possible Answers:
876
877 "OK" -
878 in case the device was successfully destroyed
879 "WRN:<warning-code>:<warning-message>" -
880 in case the device was destroyed successfully, but there are
881 noteworthy issue(s) related (e.g. an audio over ethernet driver
882 was unloaded but the other host might not be informed about
883 this situation), providing an appropriate warning code and
884 warning message
885 "ERR:<error-code>:<error-message>" -
886 in case it failed, providing an appropriate error code and
887 error message
888
889 Example:
890
891
892
893
894
895 Schoenebeck Expires November 30, 2004 [Page 16]
896
897 Internet-Draft LinuxSampler Control Protocol June 2004
898
899
900 C: "DESTROY AUDIO_OUTPUT_DEVICE 0"
901 S: "OK"
902
903 5.2.6 Getting all created audio output device count
904
905 Use the following command to count all created audio output devices:
906
907 GET AUDIO_OUTPUT_DEVICES
908
909 Possible Answers:
910
911 LinuxSampler will answer by sending the current number of all
912 audio output devices.
913
914 Example:
915
916 C: "GET AUDIO_OUTPUT_DEVICES"
917 S: "4"
918
919 5.2.7 Getting all created audio output device list
920
921 Use the following command to list all created audio output devices:
922
923 LIST AUDIO_OUTPUT_DEVICES
924
925 Possible Answers:
926
927 LinuxSampler will answer by sending a comma separated list with
928 the numerical IDs of all audio output devices.
929
930 Example:
931
932 C: "LIST AUDIO_OUTPUT_DEVICES"
933 S: "0,1,4,5"
934
935 5.2.8 Getting current settings of an audio output device
936
937 Use the following command to get current settings of a specific,
938 created audio output device:
939
940 GET AUDIO_OUTPUT_DEVICE INFO <device-id>
941
942 Where <device-id> should be replaced by be numerical ID of the audio
943 output device as e.g. returned by the "GET AUDIO_OUTPUT_DEVICES"
944 command.
945
946 Possible Answers:
947
948
949
950
951 Schoenebeck Expires November 30, 2004 [Page 17]
952
953 Internet-Draft LinuxSampler Control Protocol June 2004
954
955
956 LinuxSampler will answer by sending a <CRLF> separated list. Each
957 answer line begins with the information category name followed by a
958 colon and then a space character <SP> and finally the info character
959 string to that info category. As some parameters might allow multiple
960 values, character strings are encapsulated into apostrophes ('). At
961 the moment the following information categories are defined
962 (independently of device):
963
964 driver -
965 identifier of the used audio output driver, as also returned by
966 the "GET AVAILABLE_AUDIO_OUTPUT_DRIVERS" command
967 channels -
968 amount of audio output channels this device currently offers
969 samplerate -
970 playback sample rate the device uses
971 active -
972 either true or false, if false then the audio device is
973 inactive and doesn't output any sound, nor do the sampler
974 channels connected to this audio device render any audio
975
976 The mentioned fields above don't have to be in particular order. The
977 fields above are only those fields which are returned by all audio
978 output devices. Every audio output driver might have its own,
979 additional driver specific parameters (see "GET AUDIO_OUTPUT_DRIVER
980 INFO" command) which are also returned by this command.
981
982 Example:
983
984 C: "GET AUDIO_OUTPUT_DEVICE INFO 0"
985 S: "driver: Alsa"
986 "channels: 2"
987 "samplerate: 44100"
988 "active: true"
989 "fragments: 2"
990 "fragmentsize: 128"
991 "card: '0,0'"
992 "."
993
994 5.2.9 Changing settings of audio output devices
995
996 Use the following command to alter a specific setting of a created
997 audio output device:
998
999 SET AUDIO_OUTPUT_DEVICE_PARAMETER <device-id> <key>=<value>
1000
1001 Where <device-id> should be replaced by the numerical ID of the audio
1002 output device, <key> by the name of the parameter to change and
1003 <value> by the new value for this parameter.
1004
1005
1006
1007 Schoenebeck Expires November 30, 2004 [Page 18]
1008
1009 Internet-Draft LinuxSampler Control Protocol June 2004
1010
1011
1012 Possible Answers:
1013
1014 "OK" -
1015 in case setting was successfully changed
1016 "WRN:<warning-code>:<warning-message>" -
1017 in case setting was changed successfully, but there are
1018 noteworthy issue(s) related, providing an appropriate warning
1019 code and warning message
1020 "ERR:<error-code>:<error-message>" -
1021 in case it failed, providing an appropriate error code and
1022 error message
1023
1024 Example:
1025
1026 C: "SET AUDIO_OUTPUT_DEVICE_PARAMETER 0 fragmentsize=128"
1027 S: "OK"
1028
1029 5.2.10 Getting information about an audio channel
1030
1031 Use the following command to get information about an audio channel:
1032
1033 GET AUDIO_OUTPUT_CHANNEL INFO <device-id> <audio-chan>
1034
1035 Where <device-id> is the numerical ID of the audio output device and
1036 <audio-chan> the audio channel number.
1037
1038 Possible Answers:
1039
1040 LinuxSampler will answer by sending a <CRLF> separated list. Each
1041 answer line begins with the information category name followed by
1042 a colon and then a space character <SP> and finally the info
1043 character string to that info category. At the moment the
1044 following information categories are defined:
1045
1046 NAME -
1047 arbitrary character string naming the channel, which doesn't
1048 have to be unique (always returned by all audio channels)
1049 IS_MIX_CHANNEL -
1050 either true or false, a mix-channel is not a real,
1051 independent audio channel, but a virtual channel which is
1052 mixed to another real channel, this mechanism is needed for
1053 sampler engines which need more audio channels than the used
1054 audio system might be able to offer (always returned by all
1055 audio channels)
1056 MIX_CHANNEL_DESTINATION -
1057 reflects the real audio channel (of the same audio output
1058 device) this mix channel refers to, means where the audio
1059 signal actually will be routed / added to (only returned in
1060
1061
1062
1063 Schoenebeck Expires November 30, 2004 [Page 19]
1064
1065 Internet-Draft LinuxSampler Control Protocol June 2004
1066
1067
1068 case the audio channel is mix channel)
1069
1070 The mentioned fields above don't have to be in particular order. The
1071 fields above are only those fields which are generally returned for
1072 the described cases by all audio channels regardless of the audio
1073 driver. Every audio channel might have its own, additional driver and
1074 channel specific parameters.
1075
1076 Examples:
1077
1078 C: "GET AUDIO_OUTPUT_CHANNEL INFO 0 0"
1079 S: "NAME: studio monitor left"
1080 "IS_MIX_CHANNEL: false"
1081 "."
1082
1083 C: "GET AUDIO_OUTPUT_CHANNEL INFO 0 1"
1084 S: "NAME: studio monitor right"
1085 "IS_MIX_CHANNEL: false"
1086 "."
1087
1088 C: "GET AUDIO_OUTPUT_CHANNEL INFO 0 2"
1089 S: "NAME: studio monitor left"
1090 "IS_MIX_CHANNEL: true"
1091 "MIX_CHANNEL_DESTINATION: 1"
1092 "."
1093
1094 C: "GET AUDIO_OUTPUT_CHANNEL INFO 1 0"
1095 S: "NAME: 'ardour (left)'"
1096 "IS_MIX_CHANNEL: false"
1097 "jack_bindings: 'ardour:0'"
1098 "."
1099
1100 5.2.11 Getting information about specific audio channel parameter
1101
1102 Use the following command to get detailed information about specific
1103 audio channel parameter:
1104
1105 GET AUDIO_OUTPUT_CHANNEL_PARAMETER INFO <dev-id> <chan> <param>
1106
1107 Where <dev-id> is the numerical ID of the audio output device as
1108 returned by the "GET AUDIO_OUTPUT_DEVICES" command, <chan> the audio
1109 channel number and <param> a specific channel parameter name for
1110 which information should be obtained (as returned by the "GET
1111 AUDIO_OUTPUT_CHANNEL INFO" command).
1112
1113 Possible Answers:
1114
1115
1116
1117
1118
1119 Schoenebeck Expires November 30, 2004 [Page 20]
1120
1121 Internet-Draft LinuxSampler Control Protocol June 2004
1122
1123
1124 LinuxSampler will answer by sending a <CRLF> separated list. Each
1125 answer line begins with the information category name followed by
1126 a colon and then a space character <SP> and finally the info
1127 character string to that info category. There are information
1128 which is always returned, independently of the given channel
1129 parameter and there is optional information which is only shown
1130 dependently to the given audio channel. At the moment the
1131 following information categories are defined:
1132
1133 TYPE -
1134 either "BOOL" for boolean value(s) or "INT" for integer
1135 value(s) or "FLOAT" for dotted number(s) or "STRING" for
1136 character string(s) (always returned)
1137 DESCRIPTION -
1138 arbitrary text describing the purpose of the parameter
1139 (always returned)
1140 FIX -
1141 either true or false, if true then this parameter is read
1142 only, thus cannot be altered (always returned)
1143 MULTIPLICITY -
1144 either true or false, defines if this parameter allows only
1145 one value or a list of values, where true means multiple
1146 values and false only a single value allowed (always
1147 returned)
1148 RANGE_MIN -
1149 defines lower limit of the allowed value range for this
1150 parameter, can be an integer value as well as a dotted
1151 number, usually used in conjunction with 'RANGE_MAX', but
1152 may also appear without (optionally returned, dependent to
1153 driver and channel parameter)
1154 RANGE_MAX -
1155 defines upper limit of the allowed value range for this
1156 parameter, can be an integer value as well as a dotted
1157 number, usually used in conjunction with 'RANGE_MIN', but
1158 may also appear without (optionally returned, dependent to
1159 driver and channel parameter)
1160 POSSIBILITES -
1161 comma separated list of possible values for this parameter,
1162 character strings are encapsulated into apostrophes
1163 (optionally returned, dependent to driver and channel
1164 parameter)
1165 The mentioned fields above don't have to be in particular order.
1166
1167 Example:
1168
1169 C: "GET AUDIO_OUTPUT_CHANNEL_PARAMETER INFO 1 0 jack_bindings"
1170 S: "DESCRIPTION: bindings to other Jack clients"
1171
1172
1173
1174
1175 Schoenebeck Expires November 30, 2004 [Page 21]
1176
1177 Internet-Draft LinuxSampler Control Protocol June 2004
1178
1179
1180 "TYPE: STRING"
1181 "FIX: false"
1182 "MULTIPLICITY: true"
1183 "POSSIBILITES: 'PCM:0','PCM:1','ardour:0','ardour:1'"
1184 "."
1185
1186 5.2.12 Changing settings of audio output channels
1187
1188 Use the following command to alter a specific setting of an audio
1189 output channel:
1190
1191 SET AUDIO_OUTPUT_CHANNEL_PARAMETER <dev-id> <chn> <key>=<value>
1192
1193 Where <dev-id> should be replaced by the numerical ID of the audio
1194 device, <chn> by the audio channel number, <key> by the name of the
1195 parameter to change and <value> by the new value for this parameter.
1196
1197 Possible Answers:
1198
1199 "OK" -
1200 in case setting was successfully changed
1201 "WRN:<warning-code>:<warning-message>" -
1202 in case setting was changed successfully, but there are
1203 noteworthy issue(s) related, providing an appropriate warning
1204 code and warning message
1205 "ERR:<error-code>:<error-message>" -
1206 in case it failed, providing an appropriate error code and
1207 error message
1208
1209 Example:
1210
1211 C: "SET AUDIO_OUTPUT_CHANNEL PARAMETER 0 0 jack_bindings='PCM:0'"
1212 S: "OK"
1213
1214 C: "SET AUDIO_OUTPUT_CHANNEL PARAMETER 0 0 NAME='monitor left'"
1215 S: "OK"
1216
1217 5.3 Configuring MIDI input drivers
1218
1219 Instances of drivers in LinuxSampler are called devices. You can use
1220 multiple MIDI devices simultaneously, e.g. to use MIDI over ethernet
1221 as MIDI input on one sampler channel and Alsa as MIDI input on
1222 another sampler channel. For particular MIDI input systems it's also
1223 possible to create several devices of the same MIDI input type. This
1224 chapter describes all commands to configure LinuxSampler's MIDI input
1225 devices and their parameters.
1226
1227 Instead of defining commands and parameters for each driver
1228
1229
1230
1231 Schoenebeck Expires November 30, 2004 [Page 22]
1232
1233 Internet-Draft LinuxSampler Control Protocol June 2004
1234
1235
1236 individually, all possible parameters, their meanings and possible
1237 values have to be obtained at runtime. This makes the protocol a bit
1238 abstract, but has the advantage, that front-ends can be written
1239 independently of what drivers are currently implemented and what
1240 parameters these drivers are actually offering. This means front-ends
1241 can even handle drivers which are implemented somewhere in future
1242 without modifying the front-end at all.
1243
1244 Commands for configuring MIDI input devices are pretty much the same
1245 as the commands for configuring audio output drivers, already
1246 described in the last chapter.
1247
1248 Note: examples in this chapter showing particular parameters of
1249 drivers are not meant as specification of the drivers' parameters.
1250 Driver implementations in LinuxSampler might have complete different
1251 parameter names and meanings than shown in these examples or might
1252 change in future, so these examples are only meant for showing how to
1253 retrieve what parameters drivers are offering, how to retrieve their
1254 possible values, etc.
1255
1256 5.3.1 Getting all available MIDI input drivers
1257
1258 Use the following command to list all MIDI input drivers currently
1259 available for the LinuxSampler instance:
1260
1261 GET AVAILABLE_MIDI_INPUT_DRIVERS
1262
1263 Possible Answers:
1264
1265 LinuxSampler will answer by sending comma separated character
1266 strings, each symbolizing a MIDI input driver.
1267
1268 Example:
1269
1270 C: "GET AVAILABLE_MIDI_INPUT_DRIVERS"
1271 S: "Alsa,Jack"
1272
1273 5.3.2 Getting information about a specific MIDI input driver
1274
1275 Use the following command to get detailed information about a
1276 specific MIDI input driver:
1277
1278 GET MIDI_INPUT_DRIVER INFO <midi-input-driver>
1279
1280 Where <midi-input-driver> is the name of the MIDI input driver.
1281
1282 Possible Answers:
1283
1284
1285
1286
1287 Schoenebeck Expires November 30, 2004 [Page 23]
1288
1289 Internet-Draft LinuxSampler Control Protocol June 2004
1290
1291
1292 LinuxSampler will answer by sending a <CRLF> separated list. Each
1293 answer line begins with the information category name followed by
1294 a colon and then a space character <SP> and finally the info
1295 character string to that info category. At the moment the
1296 following information categories are defined:
1297
1298 DESCRIPTION -
1299 arbitrary description text about the MIDI input driver
1300 VERSION -
1301 arbitrary character string regarding the driver's version
1302 PARAMETERS -
1303 comma separated list of all parameters available for the
1304 given MIDI input driver
1305 The mentioned fields above don't have to be in particular order.
1306
1307 Example:
1308
1309 C: "GET MIDI_INPUT_DRIVER INFO Alsa"
1310 S: "DESCRIPTION: Advanced Linux Sound Architecture"
1311 "VERSION: 1.0"
1312 "PARAMETERS: driver,active"
1313 "."
1314
1315 5.3.3 Getting information about specific MIDI input driver parameter
1316
1317 Use the following command to get detailed information about a
1318 specific parameter of a specific MIDI input driver:
1319
1320 GET MIDI_INPUT_DRIVER_PARAMETER INFO <midit> <param> [<deplist>]
1321
1322 Where <midi-t> is the name of the MIDI input driver as returned by
1323 the "GET AVAILABLE_MIDI_INPUT_DRIVERS" command, <param> a specific
1324 parameter name for which information should be obtained (as returned
1325 by the "GET MIDI_INPUT_DRIVER INFO" command) and <deplist> is an
1326 optional list of parameters on which the sought parameter <param>
1327 depends on, <deplist> is a key-value pair list in form of "key1=val1
1328 key2=val2 ...", where character string values are encapsulated into
1329 apostrophes ('). Arguments given with <deplist> which are not
1330 dependency parameters of <param> will be ignored, means the front-end
1331 application can simply put all parameters in <deplist> with the
1332 values selected by the user.
1333
1334 Possible Answers:
1335
1336 LinuxSampler will answer by sending a <CRLF> separated list. Each
1337 answer line begins with the information category name followed by a
1338 colon and then a space character <SP> and finally the info character
1339 string to that info category. There is information which is always
1340
1341
1342
1343 Schoenebeck Expires November 30, 2004 [Page 24]
1344
1345 Internet-Draft LinuxSampler Control Protocol June 2004
1346
1347
1348 returned, independent of the given driver parameter and there is
1349 optional information which is only shown dependent to given driver
1350 parameter. At the moment the following information categories are
1351 defined:
1352
1353 TYPE -
1354 either "BOOL" for boolean value(s) or "INT" for integer
1355 value(s) or "FLOAT" for dotted number(s) or "STRING" for
1356 character string(s) (always returned, no matter which driver
1357 parameter)
1358 DESCRIPTION -
1359 arbitrary text describing the purpose of the parameter (always
1360 returned, no matter which driver parameter)
1361 MANDATORY -
1362 either true or false, defines if this parameter must be given
1363 when the device is to be created with the 'CREATE
1364 MIDI_INPUT_DEVICE' command (always returned, no matter which
1365 driver parameter)
1366 FIX -
1367 either true or false, if false then this parameter can be
1368 changed at any time, once the device is created by the 'CREATE
1369 MIDI_INPUT_DEVICE' command (always returned, no matter which
1370 driver parameter)
1371 MULTIPLICITY -
1372 either true or false, defines if this parameter allows only one
1373 value or a list of values, where true means multiple values and
1374 false only a single value allowed (always returned, no matter
1375 which driver parameter)
1376 DEPENDS -
1377 comma separated list of paramters this parameter depends on,
1378 means the values for fields 'DEFAULT', 'RANGE_MIN', 'RANGE_MAX'
1379 and 'POSSIBILITIES' might depend on these listed parameters,
1380 for example assuming that an audio driver (like the Alsa
1381 driver) offers parameters 'card' and 'samplerate' then
1382 parameter 'samplerate' would depend on 'card' because the
1383 possible values for 'samplerate' depends on the sound card
1384 which can be chosen by the 'card' parameter (optionally
1385 returned, dependent to driver parameter)
1386 DEFAULT -
1387 reflects the default value for this parameter which is used
1388 when the device is created and not explicitly given with the
1389 'CREATE MIDI_INPUT_DEVICE' command, in case of
1390 MULTIPLCITY=true, this is a comma separated list, that's why
1391 character strings are encapsulated into apostrophes (')
1392 (optionally returned, dependent to driver parameter)
1393 RANGE_MIN -
1394 defines lower limit of the allowed value range for this
1395 parameter, can be an integer value as well as a dotted number,
1396
1397
1398
1399 Schoenebeck Expires November 30, 2004 [Page 25]
1400
1401 Internet-Draft LinuxSampler Control Protocol June 2004
1402
1403
1404 this parameter is often used in conjunction with RANGE_MAX, but
1405 may also appear without (optionally returned, dependent to
1406 driver parameter)
1407 RANGE_MAX -
1408 defines upper limit of the allowed value range for this
1409 parameter, can be an integer value as well as a dotted number,
1410 this parameter is often used in conjunction with RANGE_MIN, but
1411 may also appear without (optionally returned, dependent to
1412 driver parameter)
1413 POSSIBILITES -
1414 comma separated list of possible values for this parameter,
1415 character strings are encapsulated into apostrophes (optionally
1416 returned, dependent to driver parameter)
1417
1418 The mentioned fields above don't have to be in particular order.
1419
1420 Example:
1421
1422 C: "GET MIDI_INPUT_DRIVER_PARAMETER INFO Alsa active"
1423 S: "DESCRIPTION: Whether device is enabled"
1424 "TYPE: BOOL"
1425 "MANDATORY: false"
1426 "FIX: false"
1427 "MULTIPLICITY: false"
1428 "DEFAULT: true"
1429 "."
1430
1431 5.3.4 Creating a MIDI input device
1432
1433 Use the following command to create a new MIDI input device for the
1434 desired MIDI input system:
1435
1436 CREATE MIDI_INPUT_DEVICE <midi-input-driver> [<param-list>]
1437
1438 Where <midi-input-driver> should be replaced by the desired MIDI
1439 input system and <param-list> by an optional list of driver specific
1440 parameters in form of "key1=val1 key2=val2 ...", where character
1441 string values should be encapsulated into apostrophes ('). Note that
1442 there might be drivers which require parameter(s) to be given with
1443 this command. Use the previously described commands in this chapter
1444 to get that information.
1445
1446 Possible Answers:
1447
1448 "OK[<device-id>]" -
1449 in case the device was successfully created, where <device-id>
1450 is the numerical ID of the new device
1451
1452
1453
1454
1455 Schoenebeck Expires November 30, 2004 [Page 26]
1456
1457 Internet-Draft LinuxSampler Control Protocol June 2004
1458
1459
1460 "WRN[<device-id>]:<warning-code>:<warning-message>" -
1461 in case the driver was loaded successfully, where <device-id>
1462 is the numerical ID of the new device, but there are noteworthy
1463 issue(s) related, providing an appropriate warning code and
1464 warning message
1465 "ERR:<error-code>:<error-message>" -
1466 in case it failed, providing an appropriate error code and
1467 error message
1468
1469 Example:
1470
1471 C: "CREATE MIDI_INPUT_DEVICE Alsa"
1472 S: "OK[0]"
1473
1474 5.3.5 Destroying a MIDI input device
1475
1476 Use the following command to destroy a created MIDI input device:
1477
1478 DESTROY MIDI_INPUT_DEVICE <device-id>
1479
1480 Where <device-id> should be replaced by the device's numerical ID.
1481
1482 Possible Answers:
1483
1484 "OK" -
1485 in case the device was successfully destroyed
1486 "WRN:<warning-code>:<warning-message>" -
1487 in case the device was destroyed, but there are noteworthy
1488 issue(s) related, providing an appropriate warning code and
1489 warning message
1490 "ERR:<error-code>:<error-message>" -
1491 in case it failed, providing an appropriate error code and
1492 error message
1493
1494 Example:
1495
1496 C: "DESTROY MIDI_INPUT_DEVICE 0"
1497 S: "OK"
1498
1499 5.3.6 Getting all created MIDI input device count
1500
1501 Use the following command to count all created MIDI input devices:
1502
1503 GET MIDI_INPUT_DEVICES
1504
1505 Possible Answers:
1506
1507
1508
1509
1510
1511 Schoenebeck Expires November 30, 2004 [Page 27]
1512
1513 Internet-Draft LinuxSampler Control Protocol June 2004
1514
1515
1516 LinuxSampler will answer by sending the current number of all MIDI
1517 input devices.
1518
1519 Example:
1520
1521 C: "GET MIDI_INPUT_DEVICES"
1522 S: "3"
1523
1524 5.3.7 Getting all created MIDI input device list
1525
1526 Use the following command to list all created MIDI input devices:
1527
1528 LIST MIDI_INPUT_DEVICES
1529
1530 Possible Answers:
1531
1532 LinuxSampler will answer by sending a comma separated list with
1533 the numerical Ids of all created MIDI input devices.
1534
1535 Examples:
1536
1537 C: "LIST MIDI_INPUT_DEVICES"
1538 S: "0,1,2"
1539
1540 C: "LIST MIDI_INPUT_DEVICES"
1541 S: "1,3"
1542
1543 5.3.8 Getting current settings of a MIDI input device
1544
1545 Use the following command to get current settings of a specific,
1546 created MIDI input device:
1547
1548 GET MIDI_INPUT_DEVICE INFO <device-id>
1549
1550 Where <device-id> is the numerical ID of the MIDI input device.
1551
1552 Possible Answers:
1553
1554 LinuxSampler will answer by sending a <CRLF> separated list. Each
1555 answer line begins with the information category name followed by
1556 a colon and then a space character <SP> and finally the info
1557 character string to that info category. As some parameters might
1558 allow multiple values, character strings are encapsulated into
1559 apostrophes ('). At the moment the following information
1560 categories are defined (independent of driver):
1561
1562 DRIVER -
1563
1564
1565
1566
1567 Schoenebeck Expires November 30, 2004 [Page 28]
1568
1569 Internet-Draft LinuxSampler Control Protocol June 2004
1570
1571
1572 identifier of the used MIDI input driver, as e.g. returned
1573 by the "GET AVAILABLE_MIDI_INPUT_DRIVERS" command
1574 ACTIVE -
1575 either true or false, if false then the MIDI device is
1576 inactive and doesn't listen to any incoming MIDI events and
1577 thus doesn't forward them to connected sampler channels
1578
1579 The mentioned fields above don't have to be in particular order. The
1580 fields above are only those fields which are returned by all MIDI
1581 input devices. Every MIDI input driver might have its own, additional
1582 driver specific parameters (see "GET MIDI_INPUT_DRIVER INFO" command)
1583 which are also returned by this command.
1584
1585 Example:
1586
1587 C: "GET MIDI_INPUT_DEVICE INFO 0"
1588 S: "driver: Alsa"
1589 "active: true"
1590 "."
1591
1592 5.3.9 Changing settings of audio output devices
1593
1594 Use the following command to alter a specific setting of a created
1595 MIDI input device:
1596
1597 SET MIDI_INPUT_DEVICE_PARAMETER <device-id> <key>=<value>
1598
1599 Where <device-id> should be replaced by the numerical ID of the MIDI
1600 input device, <key> by the name of the parameter to change and
1601 <value> by the new value for this parameter.
1602
1603 Possible Answers:
1604
1605 "OK" -
1606 in case setting was successfully changed
1607 "WRN:<warning-code>:<warning-message>" -
1608 in case setting was changed successfully, but there are
1609 noteworthy issue(s) related, providing an appropriate warning
1610 code and warning message
1611 "ERR:<error-code>:<error-message>" -
1612 in case it failed, providing an appropriate error code and
1613 error message
1614
1615 Example:
1616
1617 C: "SET MIDI_INPUT_DEVICE PARAMETER 0 ACTIVE=false"
1618 S: "OK"
1619
1620
1621
1622
1623 Schoenebeck Expires November 30, 2004 [Page 29]
1624
1625 Internet-Draft LinuxSampler Control Protocol June 2004
1626
1627
1628 5.3.10 Getting information about a MIDI port
1629
1630 Use the following command to get information about a MIDI port:
1631
1632 GET MIDI_INPUT_PORT INFO <device-id> <midi-port>
1633
1634 Where <device-id> is the numerical ID of the MIDI input device and
1635 <midi-port> the MIDI input port number.
1636
1637 Possible Answers:
1638
1639 LinuxSampler will answer by sending a <CRLF> separated list. Each
1640 answer line begins with the information category name followed by
1641 a colon and then a space character <SP> and finally the info
1642 character string to that info category. At the moment the
1643 following information categories are defined:
1644 NAME -
1645 arbitrary character string naming the port
1646
1647 The field above is only the one which is returned by all MIDI ports
1648 regardless of the MIDI driver and port. Every MIDI port might have
1649 its own, additional driver and port specific parameters.
1650
1651 Example:
1652
1653 C: "GET MIDI_INPUT_PORT INFO 0 0"
1654 S: "name: 'Masterkeyboard'"
1655 "alsa_seq_bindings: '64:0'"
1656 "."
1657
1658 5.3.11 Getting information about specific MIDI port parameter
1659
1660 Use the following command to get detailed information about specific
1661 MIDI port parameter:
1662
1663 GET MIDI_INPUT_PORT_PARAMETER INFO <dev-id> <port> <param>
1664
1665 Where <dev-id> is the numerical ID of the MIDI input device as
1666 returned by the "GET MIDI_INPUT_DEVICES" command, <port> the MIDI
1667 port number and <param> a specific port parameter name for which
1668 information should be obtained (as returned by the "GET
1669 MIDI_INPUT_PORT INFO" command).
1670
1671 Possible Answers:
1672
1673 LinuxSampler will answer by sending a <CRLF> separated list. Each
1674 answer line begins with the information category name followed by
1675 a colon and then a space character <SP> and finally the info
1676
1677
1678
1679 Schoenebeck Expires November 30, 2004 [Page 30]
1680
1681 Internet-Draft LinuxSampler Control Protocol June 2004
1682
1683
1684 character string to that info category. There is information which
1685 is always returned, independently of the given channel parameter
1686 and there is optional information which are only shown dependently
1687 to the given MIDI port. At the moment the following information
1688 categories are defined:
1689 TYPE -
1690 either "BOOL" for boolean value(s) or "INT" for integer
1691 value(s) or "FLOAT" for dotted number(s) or "STRING" for
1692 character string(s) (always returned)
1693 DESCRIPTION -
1694 arbitrary text describing the purpose of the parameter (always
1695 returned)
1696 FIX -
1697 either true or false, if true then this parameter is read only,
1698 thus cannot be altered (always returned)
1699 MULTIPLICITY -
1700 either true or false, defines if this parameter allows only one
1701 value or a list of values, where true means multiple values and
1702 false only a single value allowed (always returned)
1703 RANGE_MIN -
1704 defines lower limit of the allowed value range for this
1705 parameter, can be an integer value as well as a dotted number,
1706 this parameter is usually used in conjunction with 'RANGE_MAX'
1707 but may also appear without (optionally returned, dependent to
1708 driver and port parameter)
1709 RANGE_MAX -
1710 defines upper limit of the allowed value range for this
1711 parameter, can be an integer value as well as a dotted number,
1712 this parameter is usually used in conjunction with 'RANGE_MIN'
1713 but may also appear without (optionally returned, dependent to
1714 driver and port parameter)
1715 POSSIBILITES -
1716 comma separated list of possible values for this parameter,
1717 character strings are encapsulated into apostrophes (optionally
1718 returned, dependent to device and port parameter)
1719
1720 The mentioned fields above don't have to be in particular order.
1721
1722 Example:
1723
1724 C: "GET MIDI_INPUT_PORT_PARAMETER INFO 0 0 alsa_seq_bindings"
1725 S: "DESCRIPTION: bindings to other Alsa sequencer clients"
1726 "TYPE: STRING"
1727 "FIX: false"
1728 "MULTIPLICITY: true"
1729 "POSSIBILITES: '64:0','68:0','68:1'"
1730 "."
1731
1732
1733
1734
1735 Schoenebeck Expires November 30, 2004 [Page 31]
1736
1737 Internet-Draft LinuxSampler Control Protocol June 2004
1738
1739
1740 5.3.12 Changing settings of MIDI input ports
1741
1742 Use the following command to alter a specific setting of a MIDI input
1743 port:
1744
1745 SET MIDI_INPUT_PORT PARAMETER <device-id> <port> <key>=<value>
1746
1747 Where <device-id> should be replaced by the numerical ID of the MIDI
1748 device, <port> by the MIDI port number, <key> by the name of the
1749 parameter to change and <value> by the new value for this parameter.
1750
1751 Possible Answers:
1752
1753 "OK" -
1754 in case setting was successfully changed
1755 "WRN:<warning-code>:<warning-message>" -
1756 in case setting was changed successfully, but there are
1757 noteworthy issue(s) related, providing an appropriate warning
1758 code and warning message
1759 "ERR:<error-code>:<error-message>" -
1760 in case it failed, providing an appropriate error code and
1761 error message
1762
1763 Example:
1764
1765
1766
1767 5.4 Configuring sampler channels
1768
1769 The following commands describe how to add and remove sampler
1770 channels, deploy sampler engines, load instruments and connect
1771 sampler channels to MIDI and audio devices.
1772
1773 5.4.1 Loading an instrument
1774
1775 An instrument file can be loaded and assigned to a sampler channel by
1776 one of the following commands:
1777
1778 LOAD INSTRUMENT [NON_MODAL] '<filename>' <instr-index>
1779 <sampler-channel>
1780
1781 Where <filename> is the name of the instrument file on the
1782 LinuxSampler instance's host system, <instr-index> the index of the
1783 instrument in the instrument file and <sampler-channel> is the number
1784 of the sampler channel the instrument should be assigned to. Each
1785 sampler channel can only have one instrument.
1786
1787 The difference between regular and NON_MODAL versions of the command
1788
1789
1790
1791 Schoenebeck Expires November 30, 2004 [Page 32]
1792
1793 Internet-Draft LinuxSampler Control Protocol June 2004
1794
1795
1796 is that the regular command returns OK only after the instrument has
1797 been fully loaded and the channel is ready to be used while NON_MODAL
1798 version returns immediately and a background process is launched to
1799 load the instrument on the channel. GET CHANNEL INFO command can be
1800 used to obtain loading progress from INSTRUMENT_STATUS field. LOAD
1801 command will perform sanity checks such as making sure that the file
1802 could be read and it is of a proper format and SHOULD return ERR and
1803 SHOULD not launch the background process should any errors be
1804 detected at that point.
1805
1806 Possible Answers:
1807
1808 "OK" -
1809 in case the instrument was successfully loaded
1810 "WRN:<warning-code>:<warning-message>" -
1811 in case the instrument was loaded successfully, but there are
1812 noteworthy issue(s) related (e.g. Engine doesn't support one or
1813 more patch parameters provided by the loaded instrument file),
1814 providing an appropriate warning code and warning message
1815 "ERR:<error-code>:<error-message>" -
1816 in case it failed, providing an appropriate error code and
1817 error message
1818
1819 Example:
1820
1821
1822
1823 5.4.2 Loading a sampler engine
1824
1825 A sample engine can be deployed and assigned to a specific sampler
1826 channel by the following command:
1827
1828 LOAD ENGINE <engine-name> <sampler-channel>
1829
1830 Where <engine-name> is usually the C++ class name of the engine
1831 implementation and <sampler-channel> the sampler channel the deployed
1832 engine should be assigned to. Even if the respective sampler channel
1833 has already a deployed engine with that engine name, a new engine
1834 instance will be assigned to the sampler channel.
1835
1836 Possible Answers:
1837
1838 "OK" -
1839 in case the engine was successfully deployed
1840 "WRN:<warning-code>:<warning-message>" -
1841 in case the engine was deployed successfully, but there are
1842 noteworthy issue(s) related, providing an appropriate warning
1843 code and warning message
1844
1845
1846
1847 Schoenebeck Expires November 30, 2004 [Page 33]
1848
1849 Internet-Draft LinuxSampler Control Protocol June 2004
1850
1851
1852 "ERR:<error-code>:<error-message>" -
1853 in case it failed, providing an appropriate error code and
1854 error message
1855
1856 Example:
1857
1858
1859
1860 5.4.3 Getting all created sampler channel count
1861
1862 The number of sampler channels can change on runtime. To get the
1863 current amount of sampler channels, the front-end can send the
1864 following command:
1865
1866 GET CHANNELS
1867
1868 Possible Answers:
1869
1870 LinuxSampler will answer by returning the current number of
1871 sampler channels.
1872
1873 Example:
1874
1875 C: "GET CHANNELS"
1876 S: "12"
1877
1878 5.4.4 Getting all created sampler channel list
1879
1880 The number of sampler channels can change on runtime. To get the
1881 current list of sampler channels, the front-end can send the
1882 following command:
1883
1884 LIST CHANNELS
1885
1886 Possible Answers:
1887
1888 LinuxSampler will answer by returning a comma separated list with
1889 all sampler channels numerical IDs.
1890
1891 Example:
1892
1893 C: "LIST CHANNELS"
1894 S: "0,1,2,3,4,5,6,9,10,11,15,20"
1895
1896 5.4.5 Adding a new sampler channel
1897
1898 A new sampler channel can be added to the end of the sampler channel
1899 list by sending the following command:
1900
1901
1902
1903 Schoenebeck Expires November 30, 2004 [Page 34]
1904
1905 Internet-Draft LinuxSampler Control Protocol June 2004
1906
1907
1908 ADD CHANNEL
1909
1910 This will increment the sampler channel count by one and the new
1911 sampler channel will be appended to the end of the sampler channel
1912 list. The front-end should send the respective, related commands
1913 right after to e.g. load an engine, load an instrument and setting
1914 input, output method and eventually other commands to initialize the
1915 new channel. The front-end should use the sampler channel returned by
1916 the answer of this command to perform the previously recommended
1917 commands, to avoid race conditions e.g. with other front-ends that
1918 might also have sent an "ADD CHANNEL" command.
1919
1920 Possible Answers:
1921
1922 "OK[<sampler-channel>]" -
1923 in case a new sampler channel could be added, where
1924 <sampler-channel> reflects the channel number of the new
1925 created sampler channel which should the be used to set up the
1926 sampler channel by sending subsequent intialization commands
1927 "WRN:<warning-code>:<warning-message>" -
1928 in case a new channel was added successfully, but there are
1929 noteworthy issue(s) related, providing an appropriate warning
1930 code and warning message
1931 "ERR:<error-code>:<error-message>" -
1932 in case it failed, providing an appropriate error code and
1933 error message
1934
1935 Example:
1936
1937
1938
1939 5.4.6 Removing a sampler channel
1940
1941 A sampler channel can be removed by sending the following command:
1942
1943 REMOVE CHANNEL <sampler-channel>
1944
1945 This will decrement the sampler channel count by one and also
1946 decrement the channel numbers of all subsequent sampler channels by
1947 one.
1948
1949 Possible Answers:
1950
1951 "OK" -
1952 in case the given sampler channel could be removed
1953 "WRN:<warning-code>:<warning-message>" -
1954 in case the given channel was removed, but there are noteworthy
1955 issue(s) related, providing an appropriate warning code and
1956
1957
1958
1959 Schoenebeck Expires November 30, 2004 [Page 35]
1960
1961 Internet-Draft LinuxSampler Control Protocol June 2004
1962
1963
1964 warning message
1965 "ERR:<error-code>:<error-message>" -
1966 in case it failed, providing an appropriate error code and
1967 error message
1968
1969 Example:
1970
1971
1972
1973 5.4.7 Getting all available engines
1974
1975 The front-end can ask for all available engines by sending the
1976 following command:
1977
1978 GET AVAILABLE_ENGINES
1979
1980 Possible Answers:
1981
1982 LinuxSampler will answer by sending a comma separated character
1983 string of the engines' C++ class names.
1984
1985 Example:
1986
1987 C: "GET AVAILABLE_ENGINES"
1988 S: "GigEngine,AkaiEngine,DLSEngine,JoesCustomEngine"
1989
1990 5.4.8 Getting information about an engine
1991
1992 The front-end can ask for information about a specific engine by
1993 sending the following command:
1994
1995 GET ENGINE INFO <engine-name>
1996
1997 Where <engine-name> is usually the C++ class name of the engine
1998 implementation.
1999
2000 Possible Answers:
2001
2002 LinuxSampler will answer by sending <> separated list. Each answer
2003 line begins with the information category name followed by a colon
2004 and then a space character <SP> and finally the info character
2005 string to that info category. At the moment the following
2006 categories are defined:
2007
2008 DESCRIPTION -
2009 arbitrary description text about the engine
2010 VERSION -
2011
2012
2013
2014
2015 Schoenebeck Expires November 30, 2004 [Page 36]
2016
2017 Internet-Draft LinuxSampler Control Protocol June 2004
2018
2019
2020 arbitrary character string regarding the engine's version
2021
2022 The mentioned fields above don't have to be in particular order.
2023
2024 Example:
2025
2026 C: "GET ENGINE INFO JoesCustomEngine"
2027 S: "DESCRIPTION: this is Joe's custom sampler engine"
2028 "VERSION: testing-1.0"
2029 "."
2030
2031 5.4.9 Getting sampler channel information
2032
2033 The front-end can ask for the current settings of a sampler channel
2034 by sending the following command:
2035
2036 GET CHANNEL INFO <sampler-channel>
2037
2038 Where <sampler-channel> is the sampler channel number the front-end
2039 is interested in.
2040
2041 Possible Answers:
2042
2043 LinuxSampler will answer by sending a <CRLF> separated list. Each
2044 answer line begins with the settings category name followed by a
2045 colon and then a space character <SP> and finally the info
2046 character string to that setting category. At the moment the
2047 following categories are defined:
2048
2049 ENGINE_NAME -
2050 name of the engine that is deployed on the sampler channel,
2051 "NONE" if there's no engine deployed yet for this sampler
2052 channel
2053 AUDIO_OUTPUT_DEVICE -
2054 numerical ID of the audio output device which is currently
2055 connected to this sampler channel to output the audio
2056 signal, "NONE" if there's no device connected to this
2057 sampler channel
2058 AUDIO_OUTPUT_CHANNELS -
2059 number of output channels the sampler channel offers
2060 (dependent to used sampler engine and loaded instrument)
2061 AUDIO_OUTPUT_ROUTING -
2062 comma separated list which reflects to which audio channel
2063 of the selected audio output device each sampler output
2064 channel is routed to, e.g. "0,3" would mean the engine's
2065 output channel 0 is routed to channel 0 of the audio output
2066 device and the engine's output channel 1 is routed to the
2067 channel 3 of the audio output device
2068
2069
2070
2071 Schoenebeck Expires November 30, 2004 [Page 37]
2072
2073 Internet-Draft LinuxSampler Control Protocol June 2004
2074
2075
2076 INSTRUMENT_FILE -
2077 the file name of the loaded instrument, "NONE" if there's no
2078 instrument yet loaded for this sampler channel
2079 INSTRUMENT_NR -
2080 the instrument index number of the loaded instrument
2081 INSTRUMENT_STATUS -
2082 integer values 0 to 100 indicating loading progress
2083 percentage for the instrument. Negative value indicates a
2084 loading exception. Value of 100 indicates that the
2085 instrument is fully loaded.
2086 MIDI_INPUT_DEVICE -
2087 numerical ID of the MIDI input device which is currently
2088 connected to this sampler channel to deliver MIDI input
2089 commands, "NONE" if there's no device connected to this
2090 sampler channel
2091 MIDI_INPUT_PORT -
2092 port number of the MIDI input device
2093 MIDI_INPUT_CHANNEL -
2094 the MIDI input channel number this sampler channel should
2095 listen to or "ALL" to listen on all MIDI channels
2096 VOLUME -
2097 optionally dotted number for the channel volume factor
2098 (where a value < 1.0 means attenuation and a value > 1.0
2099 means amplification)
2100
2101 The mentioned fields above don't have to be in particular order.
2102
2103 Example:
2104
2105 C: "GET CHANNEL INFO 34"
2106 S: "ENGINE_NAME: GigEngine"
2107 "VOLUME: 1.0"
2108 "AUDIO_OUTPUT_DEVICE: 0"
2109 "AUDIO_OUTPUT_CHANNELS: 2"
2110 "AUDIO_OUTPUT_ROUTING: 0,1"
2111 "INSTRUMENT_FILE: /home/joe/FazioliPiano.gig"
2112 "INSTRUMENT_NR: 0"
2113 "INSTRUMENT_STATUS: 100"
2114 "MIDI_INPUT_DEVICE: 0"
2115 "MIDI_INPUT_PORT: 0"
2116 "MIDI_INPUT_CHANNEL: 5"
2117 "."
2118
2119 5.4.10 Current number of active voices
2120
2121 The front-end can ask for the current number of active voices on a
2122 sampler channel by sending the following command:
2123
2124
2125
2126
2127 Schoenebeck Expires November 30, 2004 [Page 38]
2128
2129 Internet-Draft LinuxSampler Control Protocol June 2004
2130
2131
2132 GET CHANNEL VOICE_COUNT <sampler-channel>
2133
2134 Where <sampler-channel> is the sampler channel number the front-end
2135 is interested in.
2136
2137 Possible Answers:
2138
2139 LinuxSampler will answer by returning the number of active voices
2140 on that channel.
2141
2142 Example:
2143
2144
2145
2146 5.4.11 Current number of active disk streams
2147
2148 The front-end can ask for the current number of active disk streams
2149 on a sampler channel by sending the following command:
2150
2151 GET CHANNEL STREAM_COUNT <sampler-channel>
2152
2153 Where <sampler-channel> is the sampler channel number the front-end
2154 is interested in.
2155
2156 Possible Answers:
2157
2158 LinuxSampler will answer by returning the number of active disk
2159 streams on that channel in case the engine supports disk
2160 streaming, if the engine doesn't support disk streaming it will
2161 return "NA" for not available.
2162
2163 Example:
2164
2165
2166
2167 5.4.12 Current fill state of disk stream buffers
2168
2169 The front-end can ask for the current fill state of all disk streams
2170 on a sampler channel by sending the following command:
2171
2172 GET CHANNEL BUFFER_FILL BYTES <sampler-channel>
2173
2174 to get the fill state in bytes or
2175
2176 GET CHANNEL BUFFER_FILL PERCENTAGE <sampler-channel>
2177
2178 to get the fill state in percent, where <sampler-channel> is the
2179 sampler channel number the front-end is interested in.
2180
2181
2182
2183 Schoenebeck Expires November 30, 2004 [Page 39]
2184
2185 Internet-Draft LinuxSampler Control Protocol June 2004
2186
2187
2188 Possible Answers:
2189
2190 LinuxSampler will either answer by returning a comma separated
2191 string with the fill state of all disk stream buffers on that
2192 channel or an empty line if there are no active disk streams or
2193 "NA" for *not available* in case the engine which is deployed
2194 doesn't support disk streaming. Each entry in the answer list will
2195 begin with the stream's ID in brackets followed by the numerical
2196 representation of the fill size (either in bytes or percentage).
2197 Note: due to efficiency reasons the fill states in the response
2198 are not in particular order, thus the front-end has to sort them
2199 by itself if necessary.
2200
2201 Examples:
2202
2203 C: "GET CHANNEL BUFFER_FILL BYTES 4"
2204 S: "[115]420500,[116]510300,[75]110000,[120]230700"
2205 C: "GET CHANNEL BUFFER_FILL PERCENTAGE 4"
2206 S: "[115]90%,[116]98%,[75]40%,[120]62%"
2207 C: "GET CHANNEL BUFFER_FILL PERCENTAGE 4"
2208 S: ""
2209
2210 5.4.13 Setting audio output device
2211
2212 The front-end can set the audio output device on a specific sampler
2213 channel by sending the following command:
2214
2215 SET CHANNEL AUDIO_OUTPUT_DEVICE <sampler-channel>
2216 <audio-device-id>
2217
2218 Where <audio-device-id> is the numerical ID of the audio output
2219 device and <sampler-channel> is the respective sampler channel
2220 number.
2221
2222 Possible Answers:
2223
2224 "OK" -
2225 on success
2226 "WRN:<warning-code>:<warning-message>" -
2227 if audio output device was set, but there are noteworthy
2228 issue(s) related, providing an appropriate warning code and
2229 warning message
2230 "ERR:<error-code>:<error-message>" -
2231 in case it failed, providing an appropriate error code and
2232 error message
2233
2234 Examples:
2235
2236
2237
2238
2239 Schoenebeck Expires November 30, 2004 [Page 40]
2240
2241 Internet-Draft LinuxSampler Control Protocol June 2004
2242
2243
2244
2245
2246 5.4.14 Setting audio output type
2247
2248 DEPRECATED: THIS COMMAND WILL DISAPPEAR SOON!
2249
2250 The front-end can alter the audio output type on a specific sampler
2251 channel by sending the following command:
2252
2253 SET CHANNEL AUDIO_OUTPUT_TYPE <sampler-channel>
2254 <audio-output-type>
2255
2256 Where <audio-output-type> is currently either "Alsa" or "Jack" and
2257 <sampler-channel> is the respective sampler channel number.
2258
2259 Possible Answers:
2260
2261 "OK" -
2262 on success
2263 "WRN:<warning-code>:<warning-message>" -
2264 if audio output type was set, but there are noteworthy issue(s)
2265 related, providing an appropriate warning code and warning
2266 message
2267 "ERR:<error-code>:<error-message>" -
2268 in case it failed, providing an appropriate error code and
2269 error message
2270
2271 Examples:
2272
2273
2274
2275 5.4.15 Setting audio output channel
2276
2277 The front-end can alter the audio output channel on a specific
2278 sampler channel by sending the following command:
2279
2280 SET CHANNEL AUDIO_OUTPUT_CHANNEL <sampler-chan> <audio-out>
2281 <audio-in>
2282
2283 Where <sampler-chan> is the sampler channel, <audio-out> is the
2284 sampler channel's audio output channel which should be rerouted and
2285 <audio-in> the audio channel of the selected audio output device
2286 where <audio-out> should be routed to.
2287
2288 Possible Answers:
2289
2290 "OK" -
2291
2292
2293
2294
2295 Schoenebeck Expires November 30, 2004 [Page 41]
2296
2297 Internet-Draft LinuxSampler Control Protocol June 2004
2298
2299
2300 on success
2301 "WRN:<warning-code>:<warning-message>" -
2302 if audio output channel was set, but there are noteworthy
2303 issue(s) related, providing an appropriate warning code and
2304 warning message
2305 "ERR:<error-code>:<error-message>" -
2306 in case it failed, providing an appropriate error code and
2307 error message
2308
2309 Examples:
2310
2311
2312
2313 5.4.16 Setting MIDI input device
2314
2315 The front-end can set the MIDI input device on a specific sampler
2316 channel by sending the following command:
2317
2318 SET CHANNEL MIDI_INPUT_DEVICE <sampler-channel> <midi-device-id>
2319
2320 Possible Answers:
2321
2322 "OK" -
2323 on success
2324 "WRN:<warning-code>:<warning-message>" -
2325 if MIDI input device was set, but there are noteworthy issue(s)
2326 related, providing an appropriate warning code and warning
2327 message
2328 "ERR:<error-code>:<error-message>" -
2329 in case it failed, providing an appropriate error code and
2330 error message
2331
2332 Examples:
2333
2334
2335
2336 5.4.17 Setting MIDI input type
2337
2338 DEPRECATED: THIS COMMAND WILL DISAPPEAR SOON!
2339
2340 The front-end can alter the MIDI input type on a specific sampler
2341 channel by sending the following command:
2342
2343 SET CHANNEL MIDI_INPUT_TYPE <sampler-channel> <midi-input-type>
2344
2345 Where <midi-input-type> is currently only "Alsa" and
2346 <sampler-channel> is the respective sampler channel number.
2347
2348
2349
2350
2351 Schoenebeck Expires November 30, 2004 [Page 42]
2352
2353 Internet-Draft LinuxSampler Control Protocol June 2004
2354
2355
2356 Possible Answers:
2357
2358 "OK" -
2359 on success
2360 "WRN:<warning-code>:<warning-message>" -
2361 if MIDI input type was set, but there are noteworthy issue(s)
2362 related, providing an appropriate warning code and warning
2363 message
2364 "ERR:<error-code>:<error-message>" -
2365 in case it failed, providing an appropriate error code and
2366 error message
2367
2368 Examples:
2369
2370
2371
2372 5.4.18 Setting MIDI input port
2373
2374 The front-end can alter the input MIDI port on a specific sampler
2375 channel by sending the following command:
2376
2377 SET CHANNEL MIDI_INPUT_PORT <sampler-channel> <midi-input-port>
2378
2379 Where <midi-input-port> is a MIDI input port number of the MIDI input
2380 device connected to the sampler channel given by <sampler-channel>.
2381
2382 Possible Answers:
2383
2384 "OK" -
2385 on success
2386 "WRN:<warning-code>:<warning-message>" -
2387 if MIDI input port was set, but there are noteworthy issue(s)
2388 related, providing an appropriate warning code and warning
2389 message
2390 "ERR:<error-code>:<error-message>" -
2391 in case it failed, providing an appropriate error code and
2392 error messag
2393
2394 Examples:
2395
2396
2397
2398 5.4.19 Setting MIDI input channel
2399
2400 The front-end can alter the MIDI channel a sampler channel should
2401 listen to by sending the following command:
2402
2403
2404
2405
2406
2407 Schoenebeck Expires November 30, 2004 [Page 43]
2408
2409 Internet-Draft LinuxSampler Control Protocol June 2004
2410
2411
2412 SET CHANNEL MIDI_INPUT_CHANNEL <sampler-channel> <midi-input-chan>
2413
2414 Where <midi-input-chan> is the new MIDI input channel where
2415 <sampler-channel> should listen to or "ALL" to listen on all 16 MIDI
2416 channels.
2417
2418 Possible Answers:
2419
2420 "OK" -
2421 on success
2422 "WRN:<warning-code>:<warning-message>" -
2423 if MIDI input channel was set, but there are noteworthy
2424 issue(s) related, providing an appropriate warning code and
2425 warning message
2426 "ERR:<error-code>:<error-message>" -
2427 in case it failed, providing an appropriate error code and
2428 error message
2429
2430 Examples:
2431
2432
2433
2434 5.4.20 Setting channel volume
2435
2436 The front-end can alter the volume of a sampler channel by sending
2437 the following command:
2438
2439 SET CHANNEL VOLUME <sampler-channel> <volume>
2440
2441 Where <volume> is an optionally dotted positive number (a value
2442 smaller than 1.0 means attenuation, whereas a value greater than 1.0
2443 means amplification) and <sampler-channel> defines the sampler
2444 channel where this volume factor should be set.
2445
2446 Possible Answers:
2447
2448 "OK" -
2449 on success
2450 "WRN:<warning-code>:<warning-message>" -
2451 if channel volume was set, but there are noteworthy issue(s)
2452 related, providing an appropriate warning code and warning
2453 message
2454 "ERR:<error-code>:<error-message>" -
2455 in case it failed, providing an appropriate error code and
2456 error message
2457
2458 Examples:
2459
2460
2461
2462
2463 Schoenebeck Expires November 30, 2004 [Page 44]
2464
2465 Internet-Draft LinuxSampler Control Protocol June 2004
2466
2467
2468
2469
2470 5.4.21 Resetting a sampler channel
2471
2472 The front-end can reset a particular sampler channel by sending the
2473 following command:
2474
2475 RESET CHANNEL <sampler-channel>
2476
2477 Where <sampler-channel> defines the sampler channel to be reset. This
2478 will cause the engine on that sampler channel, its voices and
2479 eventually disk streams and all control and status variables to be
2480 reset.
2481
2482 Possible Answers:
2483
2484 "OK" -
2485 on success
2486 "WRN:<warning-code>:<warning-message>" -
2487 if channel was reset, but there are noteworthy issue(s)
2488 related, providing an appropriate warning code and warning
2489 message
2490 "ERR:<error-code>:<error-message>" -
2491 in case it failed, providing an appropriate error code and
2492 error message
2493
2494 Examples:
2495
2496
2497
2498 5.5 Controlling connection
2499
2500 The following commands are used to control the connection to
2501 LinuxSampler.
2502
2503 5.5.1 Register front-end for receiving event messages
2504
2505 The front-end can register itself to the LinuxSampler application to
2506 be informed about noteworthy events by sending this command:
2507
2508 SUBSCRIBE <event-id>
2509
2510 where <event-id> will be replaced by the respective event that client
2511 wants to subscribe to.
2512
2513 Possible Answers:
2514
2515
2516
2517
2518
2519 Schoenebeck Expires November 30, 2004 [Page 45]
2520
2521 Internet-Draft LinuxSampler Control Protocol June 2004
2522
2523
2524 "OK" -
2525 on success
2526 "WRN:<warning-code>:<warning-message>" -
2527 if registration succeeded, but there are noteworthy issue(s)
2528 related, providing an appropriate warning code and warning
2529 message
2530 "ERR:<error-code>:<error-message>" -
2531 in case it failed, providing an appropriate error code and
2532 error message
2533
2534 Examples:
2535
2536
2537
2538 5.5.2 Unregister front-end for not receiving UDP event messages anymore
2539
2540 The front-end can unregister itself if it doesn't want to receive
2541 event messages anymore by sending the following command:
2542
2543 UNSUBSCRIBE <event-id>
2544
2545 Where <event-id> will be replaced by the respective event that client
2546 doesn't want to receive anymore.
2547
2548 Possible Answers:
2549
2550 "OK" -
2551 on success
2552 "WRN:<warning-code>:<warning-message>" -
2553 if unregistration succeeded, but there are noteworthy issue(s)
2554 related, providing an appropriate warning code and warning
2555 message
2556 "ERR:<error-code>:<error-message>" -
2557 in case it failed, providing an appropriate error code and
2558 error message
2559
2560 Examples:
2561
2562
2563
2564 5.5.3 Enable or disable echo of commands
2565
2566 To enable or disable back sending of commands to the client the
2567 following command can be used:
2568
2569 SET ECHO <value>
2570
2571 Where <value> should be replaced either by "1" to enable echo mode or
2572
2573
2574
2575 Schoenebeck Expires November 30, 2004 [Page 46]
2576
2577 Internet-Draft LinuxSampler Control Protocol June 2004
2578
2579
2580 "0" to disable echo mode. When echo mode is enabled, all commands
2581 send to LinuxSampler will be immediately send back and after this
2582 echo the actual response to the command will be returned. Echo mode
2583 will only be altered for the client connection that issued the "SET
2584 ECHO" command, not globally for all client connections.
2585
2586 Possible Answers:
2587
2588 "OK" -
2589 usually
2590 "ERR:<error-code>:<error-message>" -
2591 on syntax error, e.g. non boolean value
2592
2593 Examples:
2594
2595
2596
2597 5.5.4 Close client connection
2598
2599 The client can close its network connection to LinuxSampler by
2600 sending the following command:
2601
2602 QUIT
2603
2604 This is probably more interesting for manual telnet connections to
2605 LinuxSampler than really useful for a front-end implementation.
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631 Schoenebeck Expires November 30, 2004 [Page 47]
2632
2633 Internet-Draft LinuxSampler Control Protocol June 2004
2634
2635
2636 6. Command Syntax
2637
2638 TODO: will soon automatically included from src/network/lscp.y
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687 Schoenebeck Expires November 30, 2004 [Page 48]
2688
2689 Internet-Draft LinuxSampler Control Protocol June 2004
2690
2691
2692 7. Events
2693
2694 This chapter will describe all currently defined events supported by
2695 LinuxSampler.
2696
2697 7.1 Number of sampler channels changed
2698
2699 Client may want to be notified when the total number of channels on
2700 the back-end changes by issuing the following command:
2701
2702 SUBSCRIBE CHANNELS
2703
2704 Server will start sending the following notification messages:
2705
2706 "NOTIFY:CHANNELS:<channels>"
2707
2708 where <channels> will be replaced by the new number of sampler
2709 channels.
2710
2711 7.2 Number of active voices changed
2712
2713 Client may want to be notified when the number of voices on the
2714 back-end changes by issuing the following command:
2715
2716 SUBSCRIBE VOICE_COUNT
2717
2718 Server will start sending the following notification messages:
2719
2720 "NOTIFY:VOICE_COUNT:<sampler-channel> <voices>>
2721
2722 where <sampler-channel> will be replaced by the sampler channel the
2723 voice count change occurred and <voices>> by the new number of active
2724 voices on that channel.
2725
2726 7.3 Number of active disk streams changed
2727
2728 Client may want to be notified when the number of streams on the
2729 back-end changes by issuing the following command: SUBSCRIBE
2730 STREAM_COUNT
2731
2732 SUBSCRIBE STREAM_COUNT
2733
2734 Server will start sending the following notification messages:
2735
2736 "NOTIFY:STREAM_COUNT:<sampler-channel> <streams>"
2737
2738 where <sampler-channel> will be replaced by the sampler channel the
2739 stream count change occurred and <streams> by the new number of
2740
2741
2742
2743 Schoenebeck Expires November 30, 2004 [Page 49]
2744
2745 Internet-Draft LinuxSampler Control Protocol June 2004
2746
2747
2748 active disk streams on that channel.
2749
2750 7.4 Disk stream buffer fill state changed
2751
2752 Client may want to be notified when the number of streams on the
2753 back-end changes by issuing the following command:
2754
2755 SUBSCRIBE BUFFER_FILL
2756
2757 Server will start sending the following notification messages:
2758
2759 "NOTIFY:BUFFER_FILL:<sampler-channel> <fill-data>"
2760
2761 where <sampler-channel> will be replaced by the sampler channel the
2762 buffer fill state change occurred and <fill-data> will be replaced by
2763 the buffer fill data for this channel as described in 4.4.12 as if
2764 the "GET CHANNEL BUFFER_FILL PERCENTAGE" was issued on this channel.
2765
2766 7.5 Channel information changed
2767
2768 Client may want to be notified when changes were made to sampler
2769 channels on the back-end changes by issuing the following command:
2770
2771 SUBSCRIBE INFO
2772
2773 Server will start sending the following notification messages:
2774
2775 "NOTIFY:INFO:<sampler-channel>"
2776
2777 where <sampler-channel> will be replaced by the sampler channel the
2778 channel info change occurred. The front-end will have to send the
2779 respective command to actually get the channel info. Because these
2780 messages will be triggered by LSCP commands issued by other clients
2781 rather than real time events happening on the server, it is believed
2782 that an empty notification message is sufficient here.
2783
2784 7.6 Miscellaneous and debugging events
2785
2786 Client may want to be notified of miscellaneous and debugging events
2787 occurring at the server by issuing the following command:
2788
2789 SUBSCRIBE MISCELLANEOUS
2790
2791 Server will start sending the following notification messages:
2792
2793 "NOTIFY:MISCELLANEOUS:<string>"
2794
2795 where <string> will be replaced by whatever data server wants to send
2796
2797
2798
2799 Schoenebeck Expires November 30, 2004 [Page 50]
2800
2801 Internet-Draft LinuxSampler Control Protocol June 2004
2802
2803
2804 to the client. Client MAY display this data to the user AS IS to
2805 facilitate debugging.
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855 Schoenebeck Expires November 30, 2004 [Page 51]
2856
2857 Internet-Draft LinuxSampler Control Protocol June 2004
2858
2859
2860 8. Security Considerations
2861
2862 As there is so far no method of authentication and authorization
2863 defined and so not required for a client applications to succeed to
2864 connect, running LinuxSampler might be a security risk for the host
2865 system the LinuxSampler instance is running on.
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911 Schoenebeck Expires November 30, 2004 [Page 52]
2912
2913 Internet-Draft LinuxSampler Control Protocol June 2004
2914
2915
2916 9. Acknowledgments
2917
2918 This document has benefited greatly from the comments of the
2919 following people, discussed on the LinuxSampler developer's mailing
2920 list:
2921
2922 Rui Nuno Capela
2923 Vladimir Senkov
2924 Mark Knecht
2925
2926 10 References
2927
2928 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
2929 Requirement Levels", BCP 14, RFC 2119, March 1997.
2930
2931
2932 Author's Address
2933
2934 C. Schoenebeck
2935 Interessengemeinschaft Software Engineering e. V.
2936 Max-Planck-Str. 39
2937 74081 Heilbronn
2938 Germany
2939
2940 EMail: schoenebeck at software minus engineering dot org
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967 Schoenebeck Expires November 30, 2004 [Page 53]
2968
2969 Internet-Draft LinuxSampler Control Protocol June 2004
2970
2971
2972 Intellectual Property Statement
2973
2974 The IETF takes no position regarding the validity or scope of any
2975 intellectual property or other rights that might be claimed to
2976 pertain to the implementation or use of the technology described in
2977 this document or the extent to which any license under such rights
2978 might or might not be available; neither does it represent that it
2979 has made any effort to identify any such rights. Information on the
2980 IETF's procedures with respect to rights in standards-track and
2981 standards-related documentation can be found in BCP-11. Copies of
2982 claims of rights made available for publication and any assurances of
2983 licenses to be made available, or the result of an attempt made to
2984 obtain a general license or permission for the use of such
2985 proprietary rights by implementors or users of this specification can
2986 be obtained from the IETF Secretariat.
2987
2988 The IETF invites any interested party to bring to its attention any
2989 copyrights, patents or patent applications, or other proprietary
2990 rights which may cover technology that may be required to practice
2991 this standard. Please address the information to the IETF Executive
2992 Director.
2993
2994
2995 Full Copyright Statement
2996
2997 Copyright (C) The Internet Society (2004). All Rights Reserved.
2998
2999 This document and translations of it may be copied and furnished to
3000 others, and derivative works that comment on or otherwise explain it
3001 or assist in its implementation may be prepared, copied, published
3002 and distributed, in whole or in part, without restriction of any
3003 kind, provided that the above copyright notice and this paragraph are
3004 included on all such copies and derivative works. However, this
3005 document itself may not be modified in any way, such as by removing
3006 the copyright notice or references to the Internet Society or other
3007 Internet organizations, except as needed for the purpose of
3008 developing Internet standards in which case the procedures for
3009 copyrights defined in the Internet Standards process must be
3010 followed, or as required to translate it into languages other than
3011 English.
3012
3013 The limited permissions granted above are perpetual and will not be
3014 revoked by the Internet Society or its successors or assignees.
3015
3016 This document and the information contained herein is provided on an
3017 "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
3018 TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
3019 BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
3020
3021
3022
3023 Schoenebeck Expires November 30, 2004 [Page 54]
3024
3025 Internet-Draft LinuxSampler Control Protocol June 2004
3026
3027
3028 HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
3029 MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
3030
3031
3032 Acknowledgment
3033
3034 Funding for the RFC Editor function is currently provided by the
3035 Internet Society.
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079 Schoenebeck Expires November 30, 2004 [Page 55]
3080

  ViewVC Help
Powered by ViewVC