SDS specification INTRODUCTION The MIDI SDS was adopted in January 1986 by the MIDI Manufacturers Association and the Japanese MIDI Standards Committee. The SDS defines the standard method for transfer of sound sample data between MIDI-equipped devices. Sample dumps may be accomplished with either an 'open loop' or 'closed loop' system. The open loop method simply involves the straight dump of all sample data from its source to the destination, with no timeouts, packet acknowledgements, or any other form of handshaking, much as in the manner of a sysex bulk dump, usually intiated at the source. The closed loop method allows the use of handshaking messages between the dump source and destination, and usually places the dump process under the control of the slave, to allow it time to process the incoming data as necessary. As with any standard, it can not be assumed that a device adheres to it unless the accompanying documentation specifically indicates it. Even then, it is best to check its conformity with non-critical data. SPEC: SAMPLE DUMP FORMATS DUMP HEADER: F0 7E cc 01 ss ss ee ff ff ff gg gg gg hh hh hh ii ii ii jj F7 where cc = channel number ss ss = sample number (LSB first) ee = sample format (number of significant bits; 8->28) ff ff ff = sample period (1/sample rate) in nanoseconds (LSB first) gg gg gg = sample length, in words hh hh hh = sustain loop start point (word number) (LSB first) ii ii ii = sustain loop end point (word number) (LSB first) jj = loop type (00:forwards only; 01:alternating) DATA PACKET: F0 7E cc 02 kk <120 bytes> mm F7 where cc = channel number kk = running packet count (00->7F) mm = checksum (XOR of 7E, cc, 02, kk <120 bytes>) The total size of a data packet is 127 bytes. This is to avoid overflow of the MIDI input buffer of a device that may want to receive an entire packet before processing it. A data packet consists of its own header, a packet number, 120 bytes of data, a checksum, and an EOX. The packet number begins at 00 and increments with each new packet. It resets to 00 after it reaches 7F, and continues counting. The packet number is used by the receiver to distinguish between a new data packet, or a resend of a previous packet. The packet number is followed by 120 bytes of data, which form 60, 40, or 30 words (MSB first for multiword samples), depending on the length of a single data sample. Each data byte hold seven bits, with the msb in each byte set to 0, in order to conform to the requirements of MIDI data transmission. Information is left justified within the 7-bit bytes, and unused bits are filled with 0. Example: Assume a data point in the memory of a 16-bit sampler, with the value 87E5. In binary, that would be: 1000 0111 1110 0101 and would be encoded as the following MIDI data stream: 01000011 01111001 00100000 The checksum is the running XOR of all the data after the SYSEX byte, up to but not including the checksum itself.