Difference between revisions of "Sonic & Knuckles Collection/Technical information/Music and sound effects"
From Sonic Retro
Ccawley2011 (talk | contribs) |
Ccawley2011 (talk | contribs) |
||
Line 12: | Line 12: | ||
===Format=== | ===Format=== | ||
Music tracks are stored in the DLL as "CMP" [[wikipedia:Resource (Windows)|resources]]. These can be converted to and from standard [[MIDI]] files using [[SKC-Midi]]. | Music tracks are stored in the DLL as "CMP" [[wikipedia:Resource (Windows)|resources]]. These can be converted to and from standard [[MIDI]] files using [[SKC-Midi]]. | ||
+ | |||
+ | '''''TODO: Compression''''' | ||
+ | |||
+ | Once decompressed, tracks are stored using the following format: | ||
+ | |||
+ | {|class="prettytable" style="width:auto;" | ||
+ | !Offset||Type||Description | ||
+ | |- | ||
+ | | 0 | ||
+ | | 4 bytes | ||
+ | | [[sega:MIDI#Time_Division|Time Division]]. | ||
+ | |- | ||
+ | | 4 | ||
+ | | 4 bytes | ||
+ | | Number of events. | ||
+ | |- | ||
+ | | 8 | ||
+ | | 4 bytes | ||
+ | | Unknown. | ||
+ | |- | ||
+ | | 12 | ||
+ | | 4 bytes | ||
+ | | Unknown. | ||
+ | |- | ||
+ | | 16 | ||
+ | | 8 * (number of events) bytes | ||
+ | | Array of MIDI events (8 bytes each) | ||
+ | {| class="prettytable" style="width:auto;" | ||
+ | ! Offset || Type || Description | ||
+ | |- | ||
+ | | 0 || 4 bytes || [[sega:MIDI#Delta-Times|Event delta time]]. | ||
+ | |- | ||
+ | | 4 || 3 bytes || Event data. The purpose depends on the event type. | ||
+ | |- | ||
+ | | 7 || 1 byte || Event type. Can be one of the following values: | ||
+ | |- | ||
+ | | || $00 || [[sega:MIDI#MIDI_Channel_Events|MIDI Channel Event]]. The event data contains the numeric value and parameters. | ||
+ | |- | ||
+ | | || $01 || [[sega:MIDI#Set_Tempo|Tempo Event]]. The event data contains the sequence tempo in terms of microseconds per quarter-note. | ||
+ | |- | ||
+ | | || $02 || Loop Start/End. The event data is unused. | ||
+ | |} | ||
+ | |} | ||
+ | |||
==Sound effects== | ==Sound effects== | ||
Line 17: | Line 61: | ||
The file format consists of a 32-bit integer containing the number of sound effects, followed by an array of 32-bit integers containing the length of each sound effect in bytes. After this is the sound data as raw [[PCM]] for each sound effect stored sequentially until the end of the file. | The file format consists of a 32-bit integer containing the number of sound effects, followed by an array of 32-bit integers containing the length of each sound effect in bytes. After this is the sound data as raw [[PCM]] for each sound effect stored sequentially until the end of the file. | ||
+ | |||
==References== | ==References== |
Revision as of 09:27, 30 May 2021
SCHG: Sonic the Hedgehog 3 & Knuckles |
---|
Main Article |
Art Editing |
Editing Art |
Object Editing |
Editing Objects |
Level Editing |
Editing Levels |
Music Editing |
Editing Music |
RAM Editing |
Editing RAM |
Sonic & Knuckles Collection |
Sonic & Knuckles Collection |
Note: All data is little endian unless stated otherwise.
Music
Music playback is handled by the external DLL MIDIOUT.DLL.
DLL exports
This short section needs expansion. You can help Sonic Retro by adding to it. |
Format
Music tracks are stored in the DLL as "CMP" resources. These can be converted to and from standard MIDI files using SKC-Midi.
TODO: Compression
Once decompressed, tracks are stored using the following format:
Offset | Type | Description | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 4 bytes | Time Division. | |||||||||||||||||||||
4 | 4 bytes | Number of events. | |||||||||||||||||||||
8 | 4 bytes | Unknown. | |||||||||||||||||||||
12 | 4 bytes | Unknown. | |||||||||||||||||||||
16 | 8 * (number of events) bytes | Array of MIDI events (8 bytes each)
|
Sound effects
Sound effects are stored in the SONIC3K.DS2 file, in 8-bit unsigned Mono at 22kHz. This can be edited using SKCsnd.
The file format consists of a 32-bit integer containing the number of sound effects, followed by an array of 32-bit integers containing the length of each sound effect in bytes. After this is the sound data as raw PCM for each sound effect stored sequentially until the end of the file.
References
Sonic & Knuckles Collection | |
---|---|
Main page | Hidden content | Magazine articles | Video coverage | Reception | Technical information
|