SSsq/SShd #478
Illeprih
started this conversation in
Music formats
SSsq/SShd
#478
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, would you be interested in adding support for the PS1 SSsq/SShd format? I have done fairly extensive research into it and was able to achieve playback. Here are my notes on the file strucutres:
SSsq
000h 2 Master Volume
002h 2 Ticks per quarter note
004h 2 Tempo
006h 6 Zero filled
00Ch 4 Magic "SSsq"
010h 10h*10h 10h Channels
110h ... Sequence (This format seems to allow only for one. I've only seen more in a format where the SSsq is embeded inside SShd)
Channels
000h 1 Unknown - always 0?
001h 1 Index/ID
002h 1 Program index (from SShd)
003h 1 SSsq volume
004h 1 Pan
005h 4 Unknown (Probably ADSR settings)
009h 1 Modulation
00Ah 1 Pitch Bend
00Bh 1 Priority
00Ch 1 Breath
00Dh 1 Unknown (Maybe sixteenths?)
00Eh 1 Adjusted volume (When channel is issued change volume command, it applies both the value and the SSsq value, however LoD seem to override SSsq value on load)
00Fh 1 Unknown
SShd
000h 4 SShd size
004h 4 Soundbank size
008h 4 Unknown - zerofilled
00Ch 4 Magic "SShd"
010h 1Ch*4 Ptr table (SShd subfiles)
080h ... Data
SShd subfiles (As they are in LoD, but I suspect it should be the same for other games aswell)
0 - Programs (For regular music, otherwise it's part of the embeded SSsq)
1 - Velocity Table
2 - Breath Controls
3 - Embeded Sequences (for SFX formats)
4 - Embeded SSsq (for SFX formats)
Programs (Subfile 0)
000h 2 Instrument upper bound (count - 1)
002h Count*2 Instrument relative offset (FFFFh if unused, seems kinda stupid, but it does happen)
... ... Upper bound + 1 Instrument
Instrument
000h 1 Type + Tones upper bound (count - 1). (FFh are SFX instruments, 8Xh are instruments, that can play multiple tones on a single command, otherwise 0, second nibble is upper bound of notes AKA count - 1)
001h 1 Volume
002h 1 Pan
003h 1 Unknown/Unused
004h 1 Pitch bend multiplier
005h 1 Breath control index (if there are multiple breath control tables in SShd subfile 2)
006h 1 Starting note (only used for SFX instruments)
007h 1 SFX Tone upper bound
008h Tones*10h Tone data
Tone
000h 1 noteMin
001h 1 noteMax (If a KeyOn is called on a specific program, notes are selected if they are in range)
002h 1 keyRoot (the offset from the note requested is used to pitch bend)
003h 1 sixteenths (flat pitch bend in 1/16 of a semitone) [This can be somewhat easily converted to 64ths for higher playback precision, I guess they felt constrained by the size of lookup tables, however the PSX tables are awfully inefficient]
004h 2 sound bank ptr (*4)
006h 4 ADSR
00Ah 1 Volume override (if used, this value would be << 8 and volume would be | onto the lower bits during volume calculation)
00Bh 1 Volume
00Ch 1 Pan
00Dh 1 Pitch bend multiplier
00Eh 1 Breath control Index
00Fh 1 Flags (1 - high priority, 2 - noise, 10h, pitch bend multi from instrument, 20h - modulation on, 40h - breath control index from instrument, 80h - reverb on
Velocity Table (Subfile 1)
000h 2 Unused, maybe at some point, they wanted to support multiple velocity tables?
002h 80h Volumes for velocity 0-7Fh
Breath controls (Subfile 2)
000h 2 Breath controls upper bound (count - 1)
002h Count*2 Relative offsets
... ... Breath values
Embeded Sequences (Subfile 3)
000h 2 Sequece pack upper bound (count - 1)
002h PackCount2 Sequece pack relative offsets
[
... 2 Sequence upper bound (count - 1)
... SeqCount2 Sequence relative offsets
] * pack count
... ... Sequence Data
Embeded SSsq (Subfile 4)
000h 2 Master volume
002h Eh Rest of the SSsq header, but zerofilled
010h 18h*10h 18h Channels (I currently have no idea how are the ones after 10h supposed to be addressed, when the index is a single nibble)
400h ... Single Instrument with n (Instrument byte 007h) SFX Tones
Beta Was this translation helpful? Give feedback.
All reactions