The fields in the message line can contain different kinds of information. A list of possible types follows:
<serial> <flags> <command> ...Serial is the serial number of the message, flags are the protocol flags and command is the command. After these the rest of the line may contain additional parameters for the command.
<serial> <error> ...where serial is the serial number of the command message this message is a reply to. Error is the error code which is 0 or OK when the operation succeeded and an appropiate error code otherwise (the exact error codes will be specified in the documentation at a later stage). Rest of the line may contain additional parameters depending on the type of command we are replying to.
<serial> <flags> LFIL <filename> [<opts>]* <serial> <flags> LNUL <length> # <filename> = <string> # <length> = <int> # <opts> = CHANNELS=<int>|LITTLE_ENDIAN|BIG_ENDIANLFIL loads a file sample whose filename is filename. If optional options (opts) are given the file is assumed to be raw data. Then the CHANNELS option tells how many channels there are in the file and LITTLE_ENDIAN and BIG_ENDIAN tell which byteorder the sample uses. Without one of these the byteorder is assumed to be the same as the byteorder of the machine the player is running on.
LNUL loads a null sample of length sample frames.
Successfull loads reply with a message of type:
<serial> 0 <sid> <length> <channels> # <length> = <int> # <channels> = <int>where sid is the sample ID of the new sample. Also the length of the sample in sample frames and the number of channels are returned. In case of an error the reply's error field contains an appropiate error code and the rest of the line may contain text describing the reason of the failure.
<serial> <flags> KILL <sid>where sid is the sample ID of the sample to be unloaded.
<serial> <flags> STRT <sid>+ <serial> <flags> PLAY <sid>+ <serial> <flags> STOP <sid>+where sid is the sample ID.
The STRT command starts playing the sample(s) and returns immediately. Multiple sample IDs are allowed.
STOP stops the sample. If the sample was not playing it has no effect. Multiple sample IDs are allowed.
PLAY plays the sample(s) and returns after the sample has been played. Multiple sample IDs are allowed but the reply is sent when the first sample has been played. Also in the reply message the time when the sample ended is returned as the parameter.
<serial> <flags> SVOL <sid> <volume>+ # <volume> = <chanmask>:<number> # <chanmask> = [0-3]+|'*'In the SVOL command the chanmask controls which channels are affected. The mask '03' would select channels 0 and 3. All channels can be selected by using '*' (asterisk) as the mask. Number is the multiplier that is used as the volume level (it is a scaling factor that is not in dB). Multiple volumes can appear, for example for setting a different volume level for each channel.
Examples: The command<serial> <flags> SVOL 17 *:0.1would set the volume of all channels of sample 17 to 0.1 (-20dB). The following command would set the volume of channels 0 and 2 to 0.1 and the volume of channel 1 to 0.2:<serial> <flags> SVOL 17 02:0.1 1:0.2
<serial> <flags> SOUT <sid> <connection>+ # <connection> = <chanmask>:<outpmask>:<number> # <chanmask> = [0-3]+|'*' # <outpmask> = [0-3]+|'*'The format of the connection is similar to the volume in the volume control except that there is also the outputs mask. It tells to which output channel to connect to.
Examples: The command<serial> <flags> SOUT 17 *:0:0.5would connect all channels of the sample to output channel 0 with weight 0.5 each. If the sample were a stereo sample and the output were one channel (mono) output then the output would be (L + R) / 2 (where L is the left channel of the sample and R the right).To switch the left and right channels in the sample:
<serial> <flags> SVOL 17 *:*:0 0:1:1 1:0:1The first connection disconnects the sample from all outputs. The second routes left channel's (channel 0) output to the right (channel 1) output channel. The third does similarly for right channel (channel 1) of sample.
<serial> <flags> SPTR <sid> <pointer>+ <serial> <flags> MPTR <sid> <pointer>+ <serial> <flags> SIPT <sid> <pointer>+ # <pointer> = <chanmask>:<int> # <chanmask> = [0-3]+|'*'The format of the pointer is similar to the volume in the volume control except that the number is an integer number. The channel mask is the same as with the volume.
SPTR (set pointer) sets the pointer to a value. MPTR (move pointer) adds a value to the current sample pointer. Setting the sample pointer to a negative value is allowed in which case the sample outputs silence until the pointer reaches zero and then begins outputting the sample data.
The SIPT (set initial pointer) command is used to set the 'initial pointer' of a channel. When the sample is stopped or ends the sample pointer is reset from this value. It can be used to set a delay before the sample starts (using a negative value for this pointer) or to start it from some point in the sample. When the sample is set to loop, the sample pointer is reset to 0 when the end of sample is reached regardless of the value of the initial pointer.
<serial> <flags> LOOP <sid> <int>The number is either 0 or 1 (0 for false, no loop or 1 for true, loop).
Example:<serial> <flags> LOOP 10 1Sets sample 10 to be a looping sample.
<serial> <flags> SOPV <volume>+ # <volume> = <chanmask>:<number> # <chanmask> = [0-3]+|'*'The SOPV (set output volume) is very similar to the sample volume control, except that there is no sample involved and the channel mask selects output channels instead of sample's channels. This command would be used to set the output to the 'most comfortable listening level' at the beginning of the test.
<serial> <flags> QUITAfter receiving a QUIT command the player doesn't accept any more commands and after it has sent all outbound messages, it closes the connection and terminated the player (unloads all samples, etc.).