Copyright ©1988,1989,1990
Digidesign, Inc. All Rights Reserved


Sound Designer I File Format

Sound Designer I file format is the original Digidesign sound file format first released in 1985. It is widely used and supported as evidenced by the many CD ROM discs with sound effects stored in this format. It is primarily used to store mono 16 bit short duration (on the order of seconds) audio samples. We recommend that you support this format for short sounds, but that you use Sound Designer II format as a primary format due to its flexibility.

File Type

File Type: 'SFIL'

Resource Fork

The resource fork is not used.

Data Fork

The first 1336 bytes of the data fork contain the sound header (see the Pascal HeaderType record below) followed by the sample data itself. The most important fields are in bold. Default values are given in ( ) within the comment next to a field. Byte offsets are indicated to the left at various offsets. Fields with the comment DO NOT USE are for Sound Designer internal use and should not be changed except when initializing the file. The size of the data types are detailed in Inside Macintosh, Volume 1, page 86.

MarkerType = RECORD
Free: Boolean; {TRUE if this marker is free for use (TRUE/l)}
Position: LongInt; {byte position in file (0)}
Name: STRING[32]; {name of the marker ("Untitled")}
END;

SideType = (leftSide,rightSide);

EditRecord = RECORD
HiAddr: LongInt; {DO NOT USE (0)}
LoAddr: LongInt; {DO NOT USE (0)}
ExtendSide: SideType; {DO NOT USE (0)}
END;

ScaleNames = (time,SampleNumber,HexSampNum,Volts,Percent,dbm,User);
ModeType = (Select,Draw,ZoomSelect);

ZoomType = RECORD
v: Integer;
{vertical scale factor:
positive = magnification
negative = reduction (-256)
}
h: LongInt;
{horizontal scale factor:
positive = magnification
negative = reduction (1)
}
END;

ScaleType = RECORD
VFactor: LongInt;
{scale factor for vertical axis tick units:
positive = magnification
negative = reduction (327)
}
VType: ScaleName; {type of vertical axis tick mark unit (4)}
VString: STRING[32]; {vertial axis tick units string ("%Scale")}
HFactor: LongInt;
{scale factor for horizontal axis tick units:
positive = magnification
negative = reduction (1)
}
HType: ScaleNames; {type of horizontal axis tick mark unit (0)}
HString: STRING[32]; {Horizontal axis tick units string: usec,mec,sec,sample ("sec")}
END;

HeaderType = RECORD
HeaterSize: Integer; {size in bytes of the file header (1336)}
Version: Integer; {DO NOT USE (32)}
Preview: Boolean; {DO NOT USE (0)}
WPtr: WindowPtr; {DO NOT USE (0)}
WPeek: WindowPeek; {DO NOT USE (0)}
HInxPage,HInxLine: LongInt; {DO NOT USE (0)}
VInxPage,VInxLine: LongInt; {DO NOT USE (0)}
HCtlPage,HCtlLine: LongInt; {DO NOT USE (0)}
VCtlPage,VCtlLine: LongInt; {DO NOT USE (0)}
VOffset: LongInt;
{
position of vertical center of window in quantization
units ie -32768 to 32767 (0)
}
HOffset: LongInt;
{
position of left edge of sample window
in #SAMPLES (0)
}
VOffConst: Integer;
Zoom: ZoomType; {see above}
Scale: ScaleType; {see above}
VScrUpdate: Integer; {DO NOT USE (0)}
BufPtr: Ptr; {DO NOT USE (0)}
BufBytes: Size; {DO NOT USE (0)}
BufOffset: LongInt; {DO NOT USE (0)}
WaveRgn: rgnHandle; {DO NOT USE (0)}
ClipArea: rgnHandle; {DO NOT USE (0)}
ScaleArea: rgnHandle; {DO NOT USE (0)}
CtlWidth: Rect; {DO NOT USE (0)}
VScroll: ControlHandle; {DO NOT USE (0)}
HScroll: ControlHandle; {DO NOT USE (0)}
FileSize: Size;
{
2 * number of samples in this file
ie number of bytes of sound data
}
BUName: STRING[64]; {name of edit backup file}
FileName: STRING[64]; {name of this file (Mac Filename)}
BURefNum: Integer; {DO NOT USE (0)}
refNum: Integer; {DO NOT USE (0)}
vRefNum: Integer; {DO NOT USE (0)}
BufChanged: Boolean; {DO NOT USE (0)}
FileChanged: Boolean; {DO NOT USE (0)}
NoBackup: Boolean; {DO NOT USE (0)}
Mode: ModeType; {DO NOT USE (0)}
Edit: EditRecord; {see above}
CursorPos: LongInt; {cursor position relative to window start (0)}
CursorRgn: RgnHandle; {cursor region in which it can be grasped (0)}
MarkerData: ARRAY [0..9] OF MarkerType; {see above}
MarkerOffset: LongInt; {offset to get relative time (0)}
LoopStar: LongInt; {starting byte # of loop (-1)}
LoopEnd: LongInt; {ending byte # of loop (-1)}
ZeroLineOn: Boolean; {(FALSE/0)}
CursorOn: Boolean; {(FALSE/0)}
ScalesOn: Boolean; {(FALSE/0)}
Comment: Str255; {file comment (" ")}
SampRate: LongInt; {sample rate in hertz ie 44100}
SampPeriod: LongInt; {sample period in microseconds}
SampSize: Integer; {number of bits in a sample (16)}
CodeType: STRING[32]; {type of sample data ("Linear" )}
UserStrl: Str255; {for comment or reserved for future}
BufSize: Size; {size of the RAM wave buffer in bytes}
Loop2Start: LongInt; {release loop start in bytes (-1)}
Loop2End: LongInt; {release loop end in bytes (-1)}
LooplType: qignedByte {type of loop: 1 5 forward 2 = forward/backward}
Loop2Type: signedByte; {type of loop: 1 = forward 2 = forward/backward}
User4: Integer; {DO NOT USE (0)}
END;

Header Notes

Integers (2 bytes) and LongInts (4 bytes) are stored in Motorola 68000 format with the most significant bytes stored first, followed by the least significant bytes. For example, to store the hexadecimal value 0123 4567 as a LongInt, we would store in ASCENDING memory locations: 01, 23, 45, 67. Leading zeros must be considered as part of the number.

The total length of the header is 1336 bytes. It is the first thing in the file, so if a file is rewound to an offset of 0 from the beginning of the file, the file position marker will be pointing to the first byte in the header.

If a default value is given for a variable in the header, it MUST be set to that value when creating the header for the first time. All default values for numeric data in the header are given in DECIMAL. A header variable with the comment "DO NOT USE" should be set to its default value when creating a file, and under no circumstances used otherwise.

The notation for strings in the Macintosh is STR[NN] where NN is the length in bytes of the string.
The actual string stored in memory or the header will have one extra byte preceding it. This byte contains the length of the string, NN. For example to store a STR[32] in the header, the first byte will be 32 (decimal), followed by 32 bytes of ASCII representing the string. A string constant is specified above by using quote marks ie (" "). DO NOT include the quote marks as part of the string itself. Note that the string values in the header give the MAXIMUM length of that string variable. If you wish to use a string which is shorter (and you usually will), then the first byte of that string should give the actual number of ASCII characters in the string you wish to use. For example, although FileName is specified as a STR[64], you may wish to use less characters for a filename. If you wish to use "New File" as the filename, you would store the byte 08 (ie the length not including the length byte itself) followed by the ASCII values for the characters in the string "New File". The byte 08 says that there are 8 bytes in the string itself.

End addresses, such as Loop End addresses are the address of the first byte AFTER the last byte IN THE LOOP. They DO NOT refer to the last byte of the loop. Start addresses, however, refer to the first byte of a selection.

There are currently no user bytes available in the header for independent use. This does not preclude the possibility that there will be some date, however at this time you must assume that no bytes in the header may be used for any purpose other than described above. All bytes which are NOT listed above are reserved for use exclusively by Digidesign Inc. until further notice.


[ Up | Author Index ]