Introduction
Digidesign reserves the resource types that begin sd or dd and defines three of them, all with ID 1000. They are the Pascal records of Sound Designer II’s own program, stored as the data of a resource. All numbers are big-endian; Integer is 2 bytes and LongInt is 4. A sample position is a frame number counted from 0.
sdML: the marker list
| Size | Field | Meaning |
|---|---|---|
| 2 | Version | |
| 4 | MarkerOffset | |
| 2 | NumMarkers | How many marker records follow |
Then NumMarkers marker records, each 20 bytes and the text:
| Size | Field | Meaning |
|---|---|---|
| 2 | MarkerType | 1 for a numbered marker, 2 for a text marker |
| 2 | MarkerType | The type again |
| 4 | Position | The frame the marker is at |
| 4 | Text | A pointer in the program’s memory; not to be used |
| 2 | CursorID | 24430 for a numbered marker, 3012 for a text marker |
| 2 | MarkerID | The marker’s number |
| 4 | TextLength | The bytes of text that follow the record |
| TextLength | Text | The marker’s name |
sdLL: the loops
| Size | Field | Meaning |
|---|---|---|
| 2 | Version | |
| 2 | HScale | The horizontal scale of the loop window |
| 2 | VScale | The vertical scale of the loop window |
| 2 | NumLoops | How many loop records follow |
Then NumLoops records of 14 bytes:
| Size | Field | Meaning |
|---|---|---|
| 4 | LoopStart | First frame of the loop |
| 4 | LoopEnd | Last frame of the loop |
| 2 | LoopIndex | 1 to NumLoops |
| 2 | LoopSense | 117 for a forward loop, 118 for backward then forward |
| 2 | Channel | 0 to the number of channels less one |
sdDD: the document data
The record of the document’s window and timing settings, in this order:
| Offset | Size | Field | Meaning |
|---|---|---|---|
| 0 | 2 | Version | |
| 2 | 4 | BufOffset | Not to be used |
| 6 | 4 | MarkerOffset | |
| 10 | 256 | Comment | A Pascal string, Str255 |
| 266 | 2 | HDPlayBufMultiple | Disk playback buffer multiple (8) |
| 268 | 4 | SMPTEStartTime | |
| 272 | 2 | FramesPerSec | SMPTE frame rate (30) |
| 274 | 2 | FilmSize | Film size in millimetres (35) |
| 276 | 4 | StartBarNum | |
| 280 | 4 | StartBeatNum | |
| 284 | 4 | StartFrame | |
| 288 | 4 | Tempo | A Fixed number: the tempo is the value divided by 65536 |
| 292 | 4 | TimeSignature | A Fixed: the high word is the numerator, the low word the denominator |
| 296 | 4 | CursorPos | The cursor’s frame |
| 300 | 1 | CursorOn | A Boolean; one pad byte follows |
| 302 | 2 + 4 | Zoom | The vertical zoom (Integer) then the horizontal zoom (LongInt) |
| 308 | 4 | Scale.VFactor | Vertical scale factor |
| 312 | 1 | Scale.VType | An enumeration; one pad byte follows |
| 314 | 33 | Scale.VString | A STRING[32], such as %Scale |
| 348 | 4 | Scale.HFactor | Horizontal scale factor (10000 on the Sonic Images disc) |
| 352 | 1 | Scale.HType | An enumeration; one pad byte follows |
| 354 | 33 | Scale.HString | A STRING[32], such as secs; one pad byte follows |
| 388 | 4 + 4 | Edit.HiAddr, Edit.LoAddr | The selection’s two ends |
| 396 | 1 | Edit.ExtendSide | An enumeration; one pad byte follows |
| 398 | 4 | VOffset | |
| 402 | 4 | HOffset | |
| 406 | 8 | CtlWidth | A Rect: top, left, bottom, right (four Integers) |
| 414 | 4 | ZoomIndex | A Point: vertical then horizontal (Integers) |
| 418 | 2 | SelectMode | An Integer |
The record is 420 bytes. The document does not state the sizes of enumerated types or the alignment; they follow from Pascal’s rules (one byte for a Boolean or an enumeration, every larger field on an even offset; Inside Macintosh I, page 86) and from the 24 real sdDD resources of the Sonic Images Vol. 2 disc, all 420 bytes, whose strings sit at 314 and 354. The pad bytes hold stale memory, not zeros. The Edit.ExtendSide byte is shown as it is.
The resources the program writes beyond the document
Sound Designer II 2.8.3 also writes sdP2 (playlists, below) and reads the old sdPL. It writes four further resources the Digidesign document does not describe: sdCP, SDOC, ddRL (all ID 1000) and Wsta (IDs 1 to 4). The layouts below were read from the program’s own 68k code: the routines that call Get1Resource, AddResource, ReadPartialResource and WritePartialResource with these four-character codes, and the Toolbox calls that use the values. All numbers are big-endian.
sdCP: the current playlist item
| Offset | Size | Field | Meaning |
|---|---|---|---|
| 0 | 2 | CurrentItem | An Integer: the number the program keeps in field $44 of the playlist item that is current. The reader makes the item with this number current again. The writer sets its local variable only when an item is current; when none is, the Integer is whatever that stack slot held, and all 24 files of the Sonic Images disc hold 20054 ($4E56, the opcode word of a LINK A6 instruction). When the reader finds no item with the stored number, or the file has no sdCP, it makes the last item of the playlist current; with an empty playlist no item is current. |
SDOC: the overview source
| Offset | Size | Field | Meaning |
|---|---|---|---|
| 0 | 2 | OverviewSource | An Integer, the program’s document field $5A, stored as it is. −2 means not yet decided: the reader looks for a ddOV resource 1000 and, when the file has one, sets the value to 0. 0 (or any other value) selects the resource file kept at document field $496 and 1 the file kept at $498 as the place to read ddOV from. All 24 files hold −2 and have no ddOV. |
ddRL: the region list
| Offset | Size | Field | Meaning |
|---|---|---|---|
| 0 | 2 | Version | The writer stores 1; the reader accepts 2 or less |
| 2 | 4 | Header length | 12: the bytes after this field that still belong to the header |
| 6 | 4 | Record size | 56; the reader divides the length after the header by it to count the regions |
| 10 | 4 | Changed | Seconds since 1 January 1904 when the list was last changed: the Toolbox clock (the Time low-memory global at $20C, as GetDateTime returns it), read by a two-instruction routine in CODE 1. The writer stores a fresh value when the document’s changed flag (a long, object field $52, cleared after every save) is not 0, otherwise the value held in field $4E; 0 when never changed |
| 14 | 4 | Next region number | The document’s counter (field $4A): each region added takes the current value as its number, then the counter goes up by one. 1 in all 24 files, which hold no region |
Then one 56-byte record for each region, starting 6 bytes plus the header length (18) from the start. The 24 files hold 18 bytes, which is no region. The writer was also run, instruction by instruction, on synthetic documents with 0 to 5 regions (a 68000 emulator running the program’s own CODE 11 routine): the resource is resized to 18 plus 56 times the region count, the date is stored as described above and each record is exactly the layout below. The name is copied as 32 bytes with the length byte limited to 31; the third value (the one after the two region limits) is the region’s own value moved into the range between them.
| Offset | Size | Field | Meaning |
|---|---|---|---|
| 0 | 4 | Number | The region number (object field $30), taken from the counter above when the region was added. The reader restores it |
| 4 | 4 | First position | Field $24 |
| 8 | 4 | Second position | Field $28 |
| 12 | 4 | Third position | Field $2C; the writer stores the first value if this field is below it, otherwise the second value if the field is above that, otherwise the field itself (checked against the program’s own code, scenario with three regions) |
| 16 | 4 | Time stamp, high | High long of a 64-bit time stamp (object field $34), set when the region is added; the reader does not restore it |
| 20 | 4 | Time stamp, low | Low long (field $38). The 64-bit value is high × 232 plus the low long read as unsigned. It equals the seconds since 1904 of the start of the day on which the region was added (truncated to a whole day) × the sample rate, plus the sound file’s SMPTE start time in samples, plus the region’s first position: the region start as an absolute sample count. The SMPTE start time is a packed hours, minutes, seconds, frames long with a frame-rate type 24, 25, 29.97 drop-frame, 30 or 29.97 non-drop, converted in quarter frames. Derived from the arithmetic in CODE 54 ($183A to $1B20); the reader does not restore it |
| 24 | 32 | Name | A Str31: a length byte and up to 31 characters |
sdP2: a playlist
One resource for each playlist, with an ID the program takes from Unique1ID and the playlist’s name as the resource name. Nothing is padded; every field follows the one before it, so the fields after the name sit at odd offsets. The writer is CODE 31 ($203A), the readers CODE 10 ($4514) and a copy in CODE 67. The length is 53 + 34 × items + 4 + 8 × A + 4 + 8 × B bytes, as below.
| Offset | Size | Field | Meaning |
|---|---|---|---|
| 0 | 2 | Version | The writer stores 2; the reader stops with an alert for more than 2 |
| 2 | 33 | Name | A Str32: a length byte (the reader sets a negative or too large one to 32) and the characters |
| 35 | 4 | SMPTE start time | Four signed bytes: hours, minutes, seconds, frames (field $28). A new playlist gets 01:00:00:00 ($01000000) when one of two program flags is set, otherwise 00:00:00:00. The first flag is the On-Line state, a Boolean the Setup menu’s On-Line command (command 1703, menu 5 item 9 in the mntb table) toggles; the second is set at start-up when the Apple Desktop Bus holds a device whose device handler ID is $3D (the program counts the devices with CountADBs, trap $A077, and reads each with GetIndADB, trap $A078; a device with handler ID $41 sets a neighbouring flag in the same way) |
| 39 | 2 | Field $2C | An Integer; 0 when created and no other routine of the program uses it; the reader limits it to 1 to 16 (preserved unchanged by the program apart from that limit) |
| 41 | 2 | Field $2E | An Integer; 0 when created and no other routine uses it; the reader limits it to 0 to 16 (preserved unchanged apart from that limit) |
| 43 | 4 | Fade-out length | A Fixed number (16.16) of seconds (object field $30), set in the Copy Fade Out dialog, whose field is labelled “secs”; never more than the total duration |
| 47 | 4 | Fade-in length | A Fixed number (16.16) of seconds (field $34), set in the Copy Fade In dialog; never more than the total duration less the fade-out length |
| 51 | 4 | List A count | The fade-out curve (field $38): a count, then points of a Fixed position (a fraction of the fade length; 65536 is 1.0) and a gain from 0 to $7FFFFF (8 bytes each); the program interpolates the gain linearly between points |
| then | 4 | List B count | The fade-in curve (field $3C), the same layout, after the A entries |
| then | 2 | Item count | Followed by that many 34-byte items |
| Offset | Size | Field | Meaning |
|---|---|---|---|
| 0 | 4 | Region number | The number (ddRL region field) of the region the item plays; an item whose region is missing is dropped with an alert |
| 4 | 4 | Gain | Item field $16, a fraction of $7FFFFF, which is unity (0 dB); new items start at $7FFFFF |
| 8 | 4 | In point | Field $22, the sample where playing starts; a new item starts at its region’s start |
| 12 | 4 | Out point | Field $26; a new item starts at its region’s end |
| 16 | 4 | Timeline start | Field $2A, in samples; 0 for a new item |
| 20 | 4 | Timeline end | Field $2E; a new item starts with the region’s length |
| 24 | 4 | Crossfade length | Field $32, in samples |
| 28 | 2 | Crossfade type | Field $36; 0 is a butt splice |
| 30 | 4 | Field $12 | A LongInt: extra length in samples added to the item’s extent; 0 for none |
The writer stores each playlist’s resource ID in its field $44, removes every sdP2 no playlist uses, and writes the ID of the current playlist into sdCP. The reader sets the runtime fields $A and $E of each item (sample rate and channel count) from the document. The fade lengths and curves are copied with the playlist when it is duplicated or swapped for undo; the fields $2C and $2E are cleared at creation and clamped by the reader (see the table).
sdPL: the old playlist resource
The program reads sdPL 1000 when a file has no ddRL region list (CODE 10, $3BDC) and never writes it: CODE 31 removes it when it saves a document. Nothing is padded.
| Offset | Size | Field | Meaning |
|---|---|---|---|
| 0 | 2 | Version | The reader accepts 2 or less |
| 2 | 2 | Region count | Followed by that many 70-byte region records; each region gets a new number from the document counter |
| then | 2 | Playlist count | Followed by the playlists |
Region record (70 bytes): offset 4, 4 bytes, start (field $24); offset 8, 4 bytes, end ($28); offset 16, 32 bytes, name (Str31); offset 50, 1 byte, a flag (field $3C). The other bytes (0 to 3, 12 to 15, 48 and 49, 51 to 69) are not read.
Each playlist: the 33-byte name; for version 1 or more a LongInt (field $28); for version 2 the fields $2C, $2E, $30 and $34 (2, 2, 4 and 4 bytes) and the two lists, each a 4-byte count and 8-byte entries, as in sdP2; then a 2-byte item count and, for each item, a 2-byte word (only its read error is looked at) and a 106-byte record. Item offsets: 40 (byte, field $2); 46 (long, $A); 50 (word, $E); 52 (word, the 1-based region index into the region list above); 56 (long, $12); 64 (long, gain $16; version 1 files have none and the reader uses $7FFFFF); 80, 84, 88, 92 (longs, in point, out point, timeline start and end); 96 (long, crossfade length); 100 (word, crossfade type). The other bytes of the record are not read. After the playlists a word, read when version is 2 and two bytes remain, gives the current playlist (1 is the first; out of range means none).
Wsta: window state
One resource for each window the program remembers: ID 1 the sound document window, 2 the PlayList window, 3 the FFT window and 4 the Loop window. The initial rectangles of the program’s WIND resources 13, 12 and 400 match the rectangles the files hold for the PlayList, FFT and Loop windows. Each is 26 bytes:
| Offset | Size | Field | Meaning |
|---|---|---|---|
| 0 | 8 | UserState | A Rect (top, left, bottom, right): the window’s rectangle. The reader copies it into the userState half of the window’s WStateData when neither rectangle is empty |
| 8 | 8 | StdState | A Rect: the zoom rectangle, copied into the stdState half |
| 16 | 8 | Position and size | Top and left (passed to MoveWindow), then height and width (passed to SizeWindow). For a window that was closed these bytes are leftover memory |
| 24 | 1 | Open | A Boolean: the window was open. The reader shows the PlayList, FFT and Loop windows again when it is set |
| 25 | 1 | Pad | The writer clears it; the reader ignores it |
Sources
- Sound Designer II 2.8.3 (Digidesign), from the updater archive
sd2-283.sit(StuffIt 5, method 15): the 68kCODEresources 10, 11, 13, 30 and 31 and theWINDresources, disassembled with the explorer’s own 68k decoder. Apple, Inside Macintosh (1985), the trap-word table, for the Toolbox calls. Apple, Apple Numerics Manual, second edition (1988), table 22-1: the 68000 environment word, where $6000 selects rounding toward zero, as the time-stamp code sets before converting to a long. - Digidesign, Digidesign Developer Documentation 4.0 (April 1990), pages 33 to 36: the record definitions.
- libsndfile,
src/sd2.c: the marker resource it writes (sdMLID 1000). - Apple, Inside Macintosh I (1985), pages 86 to 87: the size and alignment of Pascal record fields; Apple, MPW Pascal 3.0 Reference (1988), page 57.
- The 24 Sound Designer II files of the OMI Universe of Sounds Sonic Images Vol. 2 (SampleCell) disc image (archive.org, item archive-oldschoolscds): the real
sdDD,sdLLandsdMLrecords.