TEE co.(TM) Music File (TMF) format specification

TMF 0.1 Header (128 bytes):
1.  ID      - 16 - "TEE co.(TM) TMF" - File identifier
2.  Type    - 4  - "MDM "       - Mega Drive Music
3.  Version - 2  - 0001h        - Version; L=minor, H=major, Little Endian
4.  Title   - 32 - "This is the title of the song  "
5.  Author  - 32 - "Author of the song             "
6.  Notes   - 30 - "Put here anything you like..."
7.  Date    - 10 - "01-02-2007" - Date
8.  Speed   - 1  - 00h...FFh    - Song speed (50Hz)
9.  Song l. - 1  - 00h...FFh    - Song lenght (in orders)

Number of patterns on channel n (6 bytes)
10. NoPttrn - 6  - 00h...FFh - Number of patterns

Default instruments (5 bytes)
11. ChInstr - 5  - 00h...7Fh

Default volumes (5 bytes)
12. ChVols  - 5  - 00h...7Fh

Default pans (5 bytes)
13. ChPans  - 5  - 00h...7Fh

Default reverbs (5 bytes) (ignored on MD)
14. ChRevs  - 5  - 00h...7Fh

Absolutely nothing, maybe used for hidden data, expansions...
15. Nothing - 358 - 00h

Order table (1536 bytes max)
16. ChOrder - 256 bytes for each of 7 order tables.
    Each byte represents an entry to channels pattern table

Channel n patterns (Lenght = (NoPttrn(n) * 256) bytes), always starts
after the 2048th byte.

Channel 0 to 4 (FM)
17. NoteData - 4 - 00h...09h, 00h...0Eh, 00h...7Fh, 00h...7Fh
    1st byte - NoNote(00h), Note(01h...0Dh, NoteOff(0Eh)
    2nd byte - Octave(00h...07h)
    3rd byte - Effect code
    4th byte - Effect value
...
Channel 5 (PCM)
17. NoteData - 4 - 00h...7Fh, 00h...7Fh, 00h, 00h
    1st byte - MIDI instrument 1 (00h...7Fh)
    2nd byte - MIDI instrument 2 (00h...7Fh)
    3rd and 4th byte are unused (possible future expansion)


TMF 0.1 is outdated now, MD tracker will load TMF 0.1 files, but these
will get saved to TMF 0.2 (IF you hit the [SAVE] button).


TMF 0.2 He order tables.
    Each byte represents an entry to channels pattern table

Channel n patterns (Lenght = (NoPttrn(n) * 256) bytes), always starts
2h        2048th byte.

Channel 0 to 4 (FM)
17. NoteData - 4 - 00h...09h, 00h...0Eh, 00h...7Fh, 00h...7Fh
    1st byte - NoNote(00h), Note(01h...0Dh, NoteOff(0Eh)
    2nd byte - Octave(00h...07h)
    3rd byte - Effect code
    4th byte - Effect value
...
Cha 1  - 00h...FFh    - Song speed (50Hz)
9.  Song l. - 1  - 00h...FFh    - Song lenght (in orders)

Number of patterns on channel n (7 bytes)
10. NoPttrn - 7  - 00h...FFh - te are unused (possible future expansion)


TMF 0.1 is outdated now, MD tracker will load TMF 0.1 files, but these
will get saved to TMF 0.2 (IF you hit the [SAVE] button).


TMF 0.2 He order tables.
    Each byte represents an entry to channels pat5  - 00h...7Fh

Absolutely nothing, maybe used for hidden data, expansions...
15. Nothing - 101 - 00h

Order table (1792 bFM)
17. NoteData - 4 - 00h...09h, 00h...0Eh, 00h...7Fh, 00h...7Fh
    1st byte - NoNote(00h), Note(01h...0Dh, NoteOff(0Eh)
    2nd byte - Octave(00h...07h)
    3rd byte - Effect code
    4th byte - Effect value
...
Cha 1  - 00h...FFh    - Song speed  - 4 - 00h...09h, 00h...0Eh, 00h...7Fh, 00h...7Fh
    1st byte - NoNote(00h), Note(01h...0Dh),nnel n (7 bytes)
10. NoPttrn - 7  - 00h...FFh - te are unused (possible future expansion)


TMF 0.1 is outdated now, MD tracker will load TMF 0.1 files, but these
will get saved to TMF 0.2 (IF you hit the [SAVE] button).


TMF 0.2 He order tables.
 (00h...7Fh)
    3rd byte - Unused
    4th byte - Unused

Channel 6 to 8 (PSG)
17. 1st byte - PSG channel 0 - MIDI note (2Dh...5Fh)
    2nd byte - PSG channel 0 - Note volume (0h...10h)
    3rd byte - PSG channel 1 - MIDI note (2Dh...5Fh)
    4th byte - PSG channel 1 - Note volume (0h...10h)

    1st byte - PSG channel 2 - MIDI note (2Dh...5Fh)
    2nd byte - PSG channel 2 - Note volume (0h...10h)
    3rd byte - Unused
    4th byte - Unused




MIDI note = ((Octave * 12) + Note) - 1

Effects

*** This field will be completed when the tracker gets beta ***
Feel free to tell me how these should be

00 - NO EFFECT (This will not change)
01 - Set channel volume
02 - Set pan position (on MD, values 00, 3F and FF are accepted)
03 - Volume up by VALUE
04 - Volume down by VALUE
0D - Jump to order pointed out by VALUE
0E - Change instrument
0F - Change speed (based on 50Hz)
10 - Change MIDI bank



TEE co.(TM) YM2612 instrument file format specification.

Each file is 32 bytes long, containing data for straightforward loading
into YM2612 registers. Very little Z80 code reqired to load an instrument.

Each entry except 8 (and 9) are for all four operators.

1. DT/MUL  - 4 - Detune(D6...D4) and multiplicator(D3...D0) value
2. TL      - 4 - Total level (D6...D0)
3. RS/AR   - 4 - Rate scaling(D7, D6) and Attack rate (D4...D0)
4. AM/DR   - 4 - AM enable(D7)(ignored ATM) and Decay rate (D4...D0)
5. SR      - 4 - Sustain rate (D4...D0)
6. SL/RR   - 4 - Sustain level (D7...D4) and Release rate (D3...D0)
7. SSG-EG  - 4 - SSG-EG value (D3...D0)
8. FB/ALGO - 1 - Feedback (D5...D3) and algorithm (D2...D0)
9. STRING  - 3 - "TYI", ignored, for padding and optimization ;)

File extension should be TYI (Tiido's YM2612 Instrument file)
