The numbers of the connection
blocks: every source, control, destination and transform, the connection blocks that a
device has by default, and the units of lScale. From Tables 1 to 10 and
sections 1.6.5 and 1.14 of Downloadable Sounds Level 2.2, the
dls.h and dls2.h headers printed in it, and Table 1 and 2 of the
Level 1 document. All values are checked by a script against the text of both documents
and the Wine copies of the headers.
Sources and controls
usSource and usControl take the same numbers.
| Value | Name | Meaning | Level |
|---|---|---|---|
| 0x0000 | CONN_SRC_NONE | no source | 1 |
| 0x0001 | CONN_SRC_LFO | the modulator low frequency oscillator | 1 |
| 0x0002 | CONN_SRC_KEYONVELOCITY | note-on velocity | 1 |
| 0x0003 | CONN_SRC_KEYNUMBER | note number | 1 |
| 0x0004 | CONN_SRC_EG1 | envelope generator 1 (volume) | 1 |
| 0x0005 | CONN_SRC_EG2 | envelope generator 2 (modulator) | 1 |
| 0x0006 | CONN_SRC_PITCHWHEEL | pitch wheel | 1 |
| 0x0007 | CONN_SRC_POLYPRESSURE | polyphonic pressure | 2 |
| 0x0008 | CONN_SRC_CHANNELPRESSURE | channel pressure | 2 |
| 0x0009 | CONN_SRC_VIBRATO | the vibrato LFO | 2 |
| 0x000A | CONN_SRC_MONOPRESSURE | MIDI mono pressure: in the dls2.h header, not in Table 9 | 2 |
| 0x0081 | CONN_SRC_CC1 | MIDI controller 1: modulation | 1 |
| 0x0087 | CONN_SRC_CC7 | MIDI controller 7: channel volume | 1 |
| 0x008A | CONN_SRC_CC10 | MIDI controller 10: pan | 1 |
| 0x008B | CONN_SRC_CC11 | MIDI controller 11: expression | 1 |
| 0x00DB | CONN_SRC_CC91 | MIDI controller 91: reverb send | 2 |
| 0x00DD | CONN_SRC_CC93 | MIDI controller 93: chorus send | 2 |
| 0x0100 | CONN_SRC_RPN0 | registered parameter 0: pitch bend range | 1 |
| 0x0101 | CONN_SRC_RPN1 | registered parameter 1: fine tune | 1 |
| 0x0102 | CONN_SRC_RPN2 | registered parameter 2: coarse tune | 1 |
Table 9 of the Level 2.2 text labels CONN_SRC_CC91 “Chorus Send” and
CONN_SRC_CC93 “Reverb Send”, but its Table 3 connections (“CC91 to Reverb
Send”, “CC93 to Chorus Send”) and the dls2.h header comments say reverb and chorus. The numbers agree everywhere;
the explorer uses the Table 3 names. Level 1 lists RPN0 only as a control, and RPN1 and
RPN2 as sources.
Destinations
| Value | Name | Meaning | Unit of lScale | Level |
|---|---|---|---|---|
| 0x0000 | CONN_DST_NONE | no destination | 1 | |
| 0x0001 | CONN_DST_GAIN | gain (CONN_DST_ATTENUATION in Level 1) | gain | 1 |
| 0x0002 | CONN_DST_RESERVED | reserved: do not use | 1 | |
| 0x0003 | CONN_DST_PITCH | pitch | relative pitch | 1 |
| 0x0004 | CONN_DST_PAN | pan | percent | 1 |
| 0x0005 | CONN_DST_KEYNUMBER | key number generator | relative pitch | 2 |
| 0x0010 | CONN_DST_LEFT | left channel send (optional 6-channel output) | percent | 2 |
| 0x0011 | CONN_DST_RIGHT | right channel send | percent | 2 |
| 0x0012 | CONN_DST_CENTER | centre channel send | percent | 2 |
| 0x0013 | CONN_DST_LEFTREAR | left rear channel send | percent | 2 |
| 0x0014 | CONN_DST_RIGHTREAR | right rear channel send | percent | 2 |
| 0x0015 | CONN_DST_LFE_CHANNEL | LFE channel send | percent | 2 |
| 0x0080 | CONN_DST_CHORUS | chorus send | percent | 2 |
| 0x0081 | CONN_DST_REVERB | reverb send | percent | 2 |
| 0x0104 | CONN_DST_LFO_FREQUENCY | modulator LFO frequency | absolute pitch | 1 |
| 0x0105 | CONN_DST_LFO_STARTDELAY | modulator LFO start delay time | absolute time | 1 |
| 0x0114 | CONN_DST_VIB_FREQUENCY | vibrato LFO frequency | absolute pitch | 2 |
| 0x0115 | CONN_DST_VIB_STARTDELAY | vibrato LFO start delay time | absolute time | 2 |
| 0x0206 | CONN_DST_EG1_ATTACKTIME | EG1 attack time | time | 1 |
| 0x0207 | CONN_DST_EG1_DECAYTIME | EG1 decay time | time | 1 |
| 0x0208 | CONN_DST_EG1_RESERVED | EG1 reserved: do not use | 1 | |
| 0x0209 | CONN_DST_EG1_RELEASETIME | EG1 release time | time | 1 |
| 0x020A | CONN_DST_EG1_SUSTAINLEVEL | EG1 sustain level | percent | 1 |
| 0x020B | CONN_DST_EG1_DELAYTIME | EG1 delay time | time | 2 |
| 0x020C | CONN_DST_EG1_HOLDTIME | EG1 hold time | time | 2 |
| 0x020D | CONN_DST_EG1_SHUTDOWNTIME | EG1 shutdown time | time | 2 |
| 0x030A | CONN_DST_EG2_ATTACKTIME | EG2 attack time | time | 1 |
| 0x030B | CONN_DST_EG2_DECAYTIME | EG2 decay time | time | 1 |
| 0x030C | CONN_DST_EG2_RESERVED | EG2 reserved: do not use | 1 | |
| 0x030D | CONN_DST_EG2_RELEASETIME | EG2 release time | time | 1 |
| 0x030E | CONN_DST_EG2_SUSTAINLEVEL | EG2 sustain level | percent | 1 |
| 0x030F | CONN_DST_EG2_DELAYTIME | EG2 delay time | time | 2 |
| 0x0310 | CONN_DST_EG2_HOLDTIME | EG2 hold time | time | 2 |
| 0x0500 | CONN_DST_FILTER_CUTOFF | filter cutoff frequency | absolute pitch | 2 |
| 0x0501 | CONN_DST_FILTER_Q | filter resonance | gain | 2 |
Table 10 of the Level 2.2 text lists CONN_DST_LFE_CHANNEL as
0x0013 and the two rear channels as 0x0014 and
0x0015. The dls2.h header printed in the same document lists
CONN_DST_LEFTREAR 0x0013, CONN_DST_RIGHTREAR
0x0014 and CONN_DST_LFE_CHANNEL 0x0015, as do
Wine’s dls2.h and the table above. Level 1 has no vibrato LFO, hold or
delay envelope stages, filter or sends.
Transforms
| Value | Name | Output for an input in 0 to Range (section 1.6.5.3) |
|---|---|---|
| 0x0000 | CONN_TRN_NONE | linear: Output = Input / Range |
| 0x0001 | CONN_TRN_CONCAVE | for Input > (1.0 − 10−12/5) × MaxValue, 1.0; otherwise −(5/12) × log10(1.0 − Input / MaxValue) |
| 0x0002 | CONN_TRN_CONVEX | for Input < 10−12/5 × MaxValue, 0.0; otherwise 1.0 + (5/12) × log10(Input / MaxValue) |
| 0x0003 | CONN_TRN_SWITCH | 0 for Input < Range / 2, otherwise 1 |
Controllers are normalised to −1 to 1: a MIDI controller has inputs 0 to 127 and range
128, pitch bend 0 to 16,383 and range 16,384. Invert turns input
into MaxValue − input before normalising. Bipolar for a concave or
convex transform: value = 2 × input − MaxValue; output = sgn(value) ×
InputTransform(abs(value)); for linear and switch: value =
InputTransform(input); output = 2 × value − 1. No output transforms are defined:
the output bits must be 0. The Level 2.2 text explains that the concave transform
reproduces the General MIDI volume curve: velocity, controller 7 and controller 11
reach DST_GAIN through an inverted concave transform with
lScale −96 dB, and 40 × log10(127 / Input) dB of attenuation is
96 × (5/12) × log10(127 / Input). The 2.2 revision corrected the concave
and convex equations of 2.1; the 2.1 equation used Range where
MaxValue was meant.
Units
lScale and the 32-bit values of the specification count in these units
(section 1.14; Level 1 section “Data Formats”):
| Unit | Definition |
|---|---|
| Absolute pitch | signed 32-bit; (1200 × log2(f / 440) + 6900) × 65536: 1/65536 cent, with 6900 cents at 440 Hz |
| Relative pitch | signed 32-bit; 1200 × log2(f / F) × 65536 for a reference frequency F: 1/65536 cent |
| Absolute time | signed 32-bit; 1200 × log2(seconds) × 65536 (time cents, 1/65536); the value 0x80000000 is an absolute zero that no other source can change |
| Gain | signed 32-bit; 200 × log10(v / V) × 65536: 1/655360 dB of amplitude, not power; 0x80000000 is infinite attenuation in Level 1 |
| Percent | 0.1% units (Tables 5 and 6). Written in the same 16.16 form as the others: a sustain level of 90% is 900 × 65536 = 58,982,400 (Windows 2000’s W2P.DLS and gm.dls; libInstPatch converts percent = value / (10 × 65536)). Apple’s GS bank, written by Roland’s converter, stores the plain count of tenths (978 for 97.8%), and Apple’s synthesiser plays it that way; the explorer reads a value below 65536 as plain tenths |
| Sample frequency | unsigned 32-bit, in 1/1000 Hz |
For a connection with no source and no control, lScale is the value itself
(a frequency, a time, a level); with a source it is the amount of modulation. For a
filter cutoff the maximum 0x7FFFFFFF means no low-pass filter is wanted.
The explorer shows both the raw number and the value in the destination’s unit.
The routing table and the default connection blocks
Tables 2 to 6 of the Level 2.2 text: every connection a Level 2 device has, with the
flags of its source and control (B: bipolar, I: inverted, the transform) and the default,
minimum and maximum values. A connection that a file does not name has its default. The
output transform of every one is CONN_TRN_NONE. The values were read from
the page images of Tables 5 and 6.
| Connection | Source | Control | Destination | Default | Minimum | Maximum | Units |
|---|---|---|---|---|---|---|---|
| Mod LFO Frequency | NONE | NONE | LFO_FREQUENCY | 5 Hz | 0.1 Hz | 20 Hz | Absolute Pitch |
| Mod LFO Start Delay | NONE | NONE | LFO_STARTDELAY | 10 msecs | 10 msecs | 10 secs | Absolute Time |
| Vib LFO Frequency | NONE | NONE | VIB_FREQUENCY | 5 Hz | 0.1 Hz | 20 Hz | Absolute Pitch |
| Vib LFO Start Delay | NONE | NONE | VIB_STARTDELAY | 10 msecs | 10 msecs | 10 secs | Absolute Time |
| Vol EG Delay Time | NONE | NONE | EG1_DELAYTIME | 0 secs | 0 secs | 40 secs | Absolute Time |
| Vol EG Attack Time | NONE | NONE | EG1_ATTACKTIME | 0 secs | 0 secs | 40 secs | Absolute Time |
| Vol EG Hold Time | NONE | NONE | EG1_HOLDTIME | 0 secs | 0 secs | 40 secs | Absolute Time |
| Vol EG Decay Time | NONE | NONE | EG1_DECAYTIME | 0 secs | 0 secs | 40 secs | Absolute Time |
| Vol EG Sustain Level | NONE | NONE | EG1_SUSTAINLEVEL | 100 % | 0% | 100% | Percent |
| Vol EG Release Time | NONE | NONE | EG1_RELEASETIME | 0 secs | 0 secs | 40 secs | Absolute Time |
| Vol EG Shutdown Time | NONE | NONE | EG1_SHUTDOWNTIME | 15 msecs | 0 secs | 40 secs | Absolute Time |
| Vol EG Velocity to Attack | KEYONVELOCITY | NONE | EG1_ATTACKTIME | 0 Time Cents | 0 Time Cents | 6,000 Time Cents | Relative Time Cents |
| Vol EG Key to Decay | KEYNUMBER | NONE | EG1_DECAYTIME | 0 Time Cents | 0 Time Cents | 6,000 Time Cents | Relative Time Cents |
| Vol EG Key to Hold | KEYNUMBER | NONE | EG1_HOLDTIME | 0 Time Cents | 0 Time Cents | 6,000 Time Cents | Relative Time Cents |
| Mod EG Delay Time | NONE | NONE | EG2_DELAYTIME | 0 secs | 0 secs | 40 secs | Absolute Time |
| Mod EG Attack Time | NONE | NONE | EG2_ATTACKTIME | 0 secs | 0 secs | 40 secs | Absolute Time |
| Mod EG Hold Time | NONE | NONE | EG2_HOLDTIME | 0 secs | 0 secs | 40 secs | Absolute Time |
| Mod EG Decay Time | NONE | NONE | EG2_DECAYTIME | 0 secs | 0 secs | 40 secs | Absolute Time |
| Mod EG Sustain Level | NONE | NONE | EG2_SUSTAINLEVEL | 100% | 0% | 100% | Percent |
| Mod EG Release Time | NONE | NONE | EG2_RELEASETIME | 0 secs | 0 secs | 40 secs | Absolute Time |
| Mod EG Velocity to Attack | KEYONVELOCITY | NONE | EG2_ATTACKTIME | 0 Time Cents | 0 Time Cents | 6,000 Time Cents | Relative Time Cents |
| Mod EG Key to Decay | KEYNUMBER | NONE | EG2_DECAYTIME | 0 Time Cents | 0 Time Cents | 6,000 Time Cents | Relative Time Cents |
| Mod EG Key to Hold | KEYNUMBER | NONE | EG2_HOLDTIME | 0 Time Cents | 0 Time Cents | 6,000 Time Cents | Relative Time Cents |
| MIDI Note to Key | KEYNUMBER | NONE | KEYNUMBER | 12,800 cents | 12,800 cents | 12,800 cents | Relative Pitch |
| RPN2 to Key | RPN2 (bipolar) | NONE | KEYNUMBER | 6,400 cents | 0 cents | 6,400 cents | Relative Pitch |
| Initial Fc | NONE | NONE | FILTER_CUTOFF | 0x7FFFFFFFh | 5535 cents | 11921 cents | Absolute Pitch |
| Initial Q | NONE | NONE | FILTER_Q | 0 dB | 0 dB | 22.5 dB | Relative Gain |
| Mod LFO to Fc | LFO (bipolar) | NONE | FILTER_CUTOFF | 0 cents | −12800 cents | 12800 cents | Relative Pitch |
| Mod LFO CC1 to Fc | LFO (bipolar) | CC1 | FILTER_CUTOFF | 0 cents | −12800 cents | 12800 cents | Relative Pitch |
| Mod LFO Channel Pressure to Fc | LFO (bipolar) | CHANNELPRESSURE | FILTER_CUTOFF | 0 cents | −12800 cents | 12800 cents | Relative Pitch |
| Mod EG to Fc | EG2 | NONE | FILTER_CUTOFF | 0 cents | −12800 cents | 12800 cents | Relative Pitch |
| Velocity to Fc | KEYONVELOCITY | NONE | FILTER_CUTOFF | 0 cents | −12800 cents | 12800 cents | Relative Pitch |
| Key Number to Fc | KEYNUMBER | NONE | FILTER_CUTOFF | 0 cents | −12800 cents | 12800 cents | Relative Pitch |
| Mod LFO to Gain | LFO (bipolar) | NONE | GAIN | 0 dB | 0 dB | 12 dB | Relative Gain |
| Mod LFO CC1 to Gain | LFO (bipolar) | CC1 | GAIN | 0 dB | 0 dB | 12 dB | Relative Gain |
| Mod LFO Channel Pressure to Gain | LFO (bipolar) | CHANNELPRESSURE | GAIN | 0 dB | 0 dB | 12 dB | Relative Gain |
| Velocity to Gain | KEYONVELOCITY (inverted, concave) | NONE | GAIN | −96 dB | 0 dB | −96 dB | Relative Gain |
| MIDI CC7 to Gain | CC7 (inverted, concave) | NONE | GAIN | −96 dB | −96 dB | −96 dB | Relative Gain |
| MIDI CC11 to Gain | CC11 (inverted, concave) | NONE | GAIN | −96 dB | −96 dB | −96 dB | Relative Gain |
| Default Pan | NONE | NONE | PAN | 0% | −50% | 50% | 0.1% units |
| MIDI CC10 to Pan | CC10 (bipolar) | NONE | PAN | 50.8% | −50.8% | 50.8% | 0.1% units |
| CC91 to Reverb Send | CC91 | NONE | REVERB | 100% | 0% | 100% | 0.1% units |
| Default Reverb Send | NONE | NONE | REVERB | 0% | 0% | 100% | 0.1% units |
| CC93 to Chorus Send | CC93 | NONE | CHORUS | 100% | 0% | 100% | 0.1% units |
| Default Chorus Send | NONE | NONE | CHORUS | 0% | 0% | 100% | 0.1% units |
| Tuning | NONE | NONE | PITCH | 0 cents | −1,200 cents | 1,200 cents | Relative Pitch |
| Pitch Wheel RPN0 to Pitch | PITCHWHEEL (bipolar) | RPN0 | PITCH | 12,800 cents | 12,800 cents | 12,800 cents | Relative Pitch |
| Key Number to Pitch | KEYNUMBER | NONE | PITCH | 12,800 cents | 0 cents | 12,800 cents | Relative Pitch |
| RPN1 to Pitch | RPN1 (bipolar) | NONE | PITCH | 100 cents | 0 cents | 100 cents | Relative Pitch |
| Vib LFO to Pitch | VIBRATO (bipolar) | NONE | PITCH | 0 cents | −1,200 cents | 1,200 cents | Relative Pitch |
| Vib LFO CC1 to Pitch | VIBRATO (bipolar) | CC1 | PITCH | 0 cents | −1,200 cents | 1,200 cents | Relative Pitch |
| Vib LFO Channel Pressure to Pitch | VIBRATO (bipolar) | CHANNELPRESSURE | PITCH | 0 cents | −1,200 cents | 1,200 cents | Relative Pitch |
| Mod LFO to Pitch | LFO (bipolar) | NONE | PITCH | 0 cents | −1,200 cents | 1,200 cents | Relative Pitch |
| Mod LFO CC1 to Pitch | LFO (bipolar) | CC1 | PITCH | 0 cents | −1,200 cents | 1,200 cents | Relative Pitch |
| Mod LFO Channel Pressure to Pitch | LFO (bipolar) | CHANNELPRESSURE | PITCH | 0 cents | −1,200 cents | 1,200 cents | Relative Pitch |
| Mod EG to Pitch | EG2 | NONE | PITCH | 0 cents | −1,200 cents | 1,200 cents | Relative Pitch |
The Level 2.1 changes: Mod LFO to Gain (and with CC1 and channel pressure) are bipolar
and not inverted, as most Level 1 devices implemented it; the 2.2 summary of changes
corrects the channel pressure entry and makes Mod EG to Pitch unipolar and not inverted.
The sustain level of both envelopes is a percentage of the envelope peak in 0.1%
steps. The key number generator’s only input is DST_KEYNUMBER and its only
output SRC_KEYNUMBER; connections to it are valid only at the global level
and should not appear in a Level 1 or 2 file except in a proprietary conditional
chunk.
Level 1: the 29 connection blocks
Table 1 of the Level 1 document numbers the blocks of a Level 1 synthesiser; the first 19 are the ones a file defines, and blocks 20 to 29 are inferred by the architecture. All transforms are none except 22, 25 and 27, which are concave. In Level 1 Table 2 the defaults and ranges are: LFO frequency 5 Hz (0.1 to 10 Hz), LFO start delay 0.01 s (0.01 to 10 s), LFO attenuation scale 0 dB (0 to 12 dB), LFO pitch scale 0 cents (±1200), LFO mod wheel to attenuation 0 dB (0 to 12 dB), LFO mod wheel to pitch 0 cents (±1200), envelope attack time 0 s (0 to 20 s), decay time 0 s (0 to 40 s), sustain level 100% (0 to 100%, 0.1% units), release time 0 s (0 to 20 s), velocity to attack 0 s (0 to 20 s), key to decay 0 s (0 to 20 s), EG2 to pitch 0 cents (±1200) and initial pan 0% (±50%).
| Block | Name | Source | Control | Destination | Transform |
|---|---|---|---|---|---|
| 1 | LFO Frequency | NONE | NONE | LFO_FREQUENCY | none |
| 2 | LFO Start Delay | NONE | NONE | LFO_STARTDELAY | none |
| 3 | LFO Attenuation Scale | LFO | NONE | ATTENUATION | none |
| 4 | LFO Pitch Scale | LFO | NONE | PITCH | none |
| 5 | LFO Modw to Attenuation | LFO | CC1 | ATTENUATION | none |
| 6 | LFO Modw to Pitch | LFO | CC1 | PITCH | none |
| 7 | EG1 Attack Time | NONE | NONE | EG1_ATTACKTIME | none |
| 8 | EG1 Decay Time | NONE | NONE | EG1_DECAYTIME | none |
| 9 | EG1 Sustain Level | NONE | NONE | EG1_SUSTAINLEVEL | none |
| 10 | EG1 Release Time | NONE | NONE | EG1_RELEASETIME | none |
| 11 | EG1 Velocity to Attack | KEYONVELOCITY | NONE | EG1_ATTACKTIME | none |
| 12 | EG1 Key to Decay | KEYNUMBER | NONE | EG1_DECAYTIME | none |
| 13 | EG2 Attack Time | NONE | NONE | EG2_ATTACKTIME | none |
| 14 | EG2 Decay Time | NONE | NONE | EG2_DECAYTIME | none |
| 15 | EG2 Sustain Level | NONE | NONE | EG2_SUSTAINLEVEL | none |
| 16 | EG2 Release Time | NONE | NONE | EG2_RELEASETIME | none |
| 17 | EG2 Velocity to Attack | KEYONVELOCITY | NONE | EG2_ATTACKTIME | none |
| 18 | EG2 Key to Decay | KEYNUMBER | NONE | EG2_DECAYTIME | none |
| 19 | Initial Pan | NONE | NONE | PAN | none |
| 20 | EG1 To Attenuation (inferred) | EG1 | NONE | ATTENUATION | none |
| 21 | EG2 To Pitch | EG2 | NONE | PITCH | none |
| 22 | Key On Velocity to Attenuation (inferred) | KEYONVELOCITY | NONE | ATTENUATION | concave |
| 23 | Pitch Wheel to Pitch (inferred) | PITCHWHEEL | RPN0 | PITCH | none |
| 24 | Key Number to Pitch (inferred) | KEYNUMBER | NONE | PITCH | none |
| 25 | MIDI Controller 7 to Atten. (inferred) | CC7 | NONE | ATTENUATION | concave |
| 26 | MIDI Controller 10 to Pan (inferred) | CC10 | NONE | PAN | none |
| 27 | MIDI Controller 11 to Atten. (inferred) | CC11 | NONE | ATTENUATION | concave |
| 28 | RPN1 to Pitch (inferred) | RPN1 | NONE | PITCH | none |
| 29 | RPN2 to Pitch (inferred) | RPN2 | NONE | PITCH | none |
Block 21, EG2 to Pitch, is in the Level 1 table of blocks inferred by the architecture, but the Level 1 coding requirements do not list it among the connections that must not be written, and its scale has a range in Table 2: it is the connection files set for the pitch envelope. The Level 1 text says blocks 20 to 29 are inferred, “10 of which are implicit and have no attached values” (it counts block 21 among them).