midi sample dump standard

index

1) introduction
2) spec: sample dump formats
3) spec: sample dump messages
4) dump procedure: master (dump source)
5) dump procedure: slave (dump destination)
6) sds overview

1) 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.

2) 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.

3) spec: sample dump messages

dump request:

f0 7e cc 03 ss ss f7

where

cc = channel number
ss ss = sample number requested (lsb first)

upon receiving the request, the sampler checks the sample number
to see if it is within legal range. if it is not, the request is
ignored. if it is, the sample dump is started. one packet at a time is
sent, under control of the handshaking messages outlined below.

handshaking messages:

for all below:

cc = channel number
pp = packet number

packet numbers are included in the handshaking messages to
accomodate machines that have the intelligence to re-transmit specific
packets after an entire dump is finished, or if synchronization is
lost.

ack : f0 7e cc 7f pp f7

means last packet was recieved correctly (checksum ok, etc),
please send next one. packet number is packet being acknowledged as
correct.

nak : f0 7e cc 7e pp f7

means last packet not received correctly, please send again.
packet number is packet being rejected.

cancel : f0 7e cc 7d pp f7

means abort dump immediately. packet number is packet on which
abort occurs.

wait : f0 7e cc 7c pp f7

means pause dump indefinitely, until next message is sent. allows
the unit recieving the dump to perform other functions (disk access,
etc), before receiving the remainder of the dump. the next message it
sends (eg ack, abort) will determine if the dump continues or aborts.

4) dump procedure: master (dump source)

once a dump has been requested, either via midi or through the
front panel, the dump header is sent. after sending the header, the
master must time out for at least two seconds, to allow the receiver
to decide if it will accept this sample (has enough memory, etc).
if it receives a cancel, within this time, it should abort
immediately. if it receives an cak, it will start sending packets
immediately. if it receives a wait, it pauses until another message is
received, and then processes that mesage normally. if nothing is
recieved within the timeout, an open loop is assumed, and the dump
starts with the first packet.
after sending each packet, the master should time out for at
least 20 milliseconds and watch its midi in. if an ack is received, it
sends the next packet immediately. if it receives an nak, and the
packet number matches the number of the last packet sent, it resend
that packet if the packet numbers don't match, and the device is
incapable of sending packets out of order, the nak will be ignored.
if a wait is received, the master should watch its midi in port
indefinitely for another ack, nak, or cancel message, which it should
then process normally.
if no messages are received within 20 milliseconds of the
transmission of a packet, the master may assume an open loop
configuration, and send the next packet.
this process continues until there are less than 121 data bytes
to send. the final packet will still consist of 120n bytes, regardless
of how many significant bytes actually remain, and the unused bytes
will be filled with zeroes. the receiver should handshake after
receiving the last packet.

5) dump procedure: slave (dump destination)

when receiving a sample dump, a device should keep a running
checksum during reception. if its checksum matches the checksum in the
data packet, it will send an ack and wait for the next packet. if it
does not match, it will send an nak containing the number of the
packet that caused the error, and wait for the next packet. if, after
sending an nak, the packet number of the next packet doesn't match the
previous packet number (the one that was nak'd), and the unit is not
capable of accepting packets out of order, the error is ignored and
the dump continues as if the checksums had matched.
if a receiver runs out of memory before the dumpo is completed,
it should send a cancel to stop the dump.

6) sds overview

sample dump data format: dump header:

sysex
id: universal non-real time
channel number
sub id: header
sample number (2 bytes, lsb first)
sample format
sample period (3 bytes, lsb first)
sample length (3 bytes, lsb first)
sustain loop start point (3 bytes, lsb first)
sustain loop end point (3 bytes, lsb first)
loop type
eox

sample dump data format: data packet:

sysex
id: universal non-real time
channel number
sub id: data packet
packet number
sample data (120 bytes)
checksum
eox

sample dump messages: dump request:

sysex
id: universal non-real time
channel number
sub id: dump request
sample number (2 bytes, lsb first)
eox

sample dump messages: handshaking flags:

sysex
id: universal non-real time
channel number
sub id: ack or nak or cancel or wait
packet number
eox

返回




月光软件源码下载编程文档电脑教程网站优化网址导航网络文学游戏天地生活休闲写作范文安妮宝贝站内搜索
电脑技术编程开发网络专区谈天说地情感世界游戏元素分类游戏热门游戏体育运动手机专区业余爱好影视沙龙
音乐天地数码广场教育园地科学大观古今纵横谈股论金人文艺术医学保健动漫图酷二手专区地方风情各行各业

月光软件站·版权所有