improve the new ins format idea

This commit is contained in:
tildearrow 2022-11-17 16:53:25 -05:00
parent 969c8256c1
commit e5bc0c06d8
1 changed files with 64 additions and 35 deletions

View File

@ -4,46 +4,75 @@ the main issue with Furnace instrument files is that they are too big, even if t
the aim of this new format is to greatly reduce the size of a resulting instrument.
# header
```
size | description
-----|------------------------------------
6 | "FURINS" format magic
4 | "FINS" format magic
2 | format version
1 | instrument type
??? | feature bits
4 | instrument length (if wave/sample bits are on)
2 | instrument type
??? | features...
```
the "feature bits" field is a variable length bitfield. bit 7 in a byte indicates "read one more byte".
a feature uses the following format:
the feature bits are:
```
size | description
-----|------------------------------------
2 | feature code
2 | length of block
??? | data...
```
- 0: has wavetables
- 1: has samples
- 2: has name
- 3: FM data
- 4: FM data size (1: 2-op, 0: 4-op)
- 5: FM data includes OPL/OPZ data
- if off, only read an op until ssgEnv.
- if on, read everything else.
- 6: Game Boy data
- 7: (continue in next byte)
- 8: C64 data
- 9: Amiga data
- 10: standard data (macros)
- 11: operator macros
- 12: release points
- 13: op release points
- 14: extended op macros
- 15: (continue in next byte)
- 16: OPL drums mode data
- 17: Amiga sample map data
- 18: Namco 163 data
- 19: extra macros
- 20: FDS data
- 21: OPZ data
- 22: wavetable synth data
- 23: (continue in next byte)
- 24: additional macro modes
- 25: extra C64 data
- 26: MultiPCM data
the following feature codes are recognized:
- `FM`: FM ins data
- `MA`: macro data
- `64`: C64 ins data
- `GB`: Game Boy ins data
- `SM`: sample ins data
- `O1`: operator 1 macros
- `O2`: operator 2 macros
- `O3`: operator 3 macros
- `O4`: operator 4 macros
- `LD`: OPL drums mode data
- `SN`: SNES ins data
- `N1`: Namco 163 ins data
- `FD`: FDS ins data
- `WS`: wavetable synth data
- `SL`: list of samples
- `WL`: list of wavetables
- `MP`: MultiPCM ins data
- `SU`: Sound Unit ins data
- `ES`: ES5506 ins data
# FM data (FM)
```
size | description
-----|------------------------------------
1 | operator count
-----|------------------------------------
| **base data**
| /7 6 5 4 3 2 1 0|
1 | |x| ALG |x| FB |
1 | |FMS2 |AMS| FMS |
1 | |AM2|4| LLPatch |
1 | |KV4|KV3|KV2|KV1|
-----|------------------------------------
| **operator data × opCount**
| /7 6 5 4 3 2 1 0|
1 | |r| D T | MULT |
| \- KSR
1 | |s| T L |
| \- SUS
1 | |R S|v| A R |
| \- VIB
1 | |A|KSL| D R |
| \- AM
1 | |e|x| D2R |
| \- EGT
1 | | S L | R R |
1 | | DVB | SSG |
1 | | DAM | W S |