Fred editor song format
-----------------------
'mod.wildy', from the editor package

See also 'FRED_68k.txt' and 'FRED_mod.txt'
Feel free to send me feedback : lclevy@club-internet.fr


offset	width	len	comment
----------------------------------------------------------------------------------------------

0	b	12	"Fred Editor "
0x0c	w	1	file version
0x0e	w	1	nb songs
------------------------------------------------
	for each subsongs

0x10	b	nb songs tempo table
------------------------------------------------
	for each subsongs :

	b	256*4	pattern ptr
			(0xb8 means : 0xb8 - 0x80 = jump 56,
			ff = stop)
------------------------------------------------
	for each pattern

	l	1	pattern length
	b	?	pattern data

	always 128 patterns, even empty (0x00000002 0x8480)
------------------------------------------------
	w	1	nb instr

	96 bytes long instruments :

	0x00	b	20	instr name
	0x20	l	1	if instr is sampled : instr index (from 1) else 0
	0x24	w	1	-1=synth, 0=samp
	0x26	w	1 	lenght in words
	0x28	w	1	period ?
	0x2a	b	1	vibrato delay [0-0xff]

	0x2c	b	1	vibrato speed [0-0x1e]
	0x2d	b	1	vibrato amp [0-0x1e]
	0x2e	b	1	env volume [0-0xff]
	0x2f	b	1	attack spd [0-0xff]
	0x30	b	1	attack vol [0-0xff]
	0x31	b	1	decay spd [0-0xA5]
	0x32	b	1	decay vol [0-0xff]
	0x33	b	1	sustain spd [0-0xff]
	0x34	b	1	release spd [0-0xc1]
	0x35	b	1	release vol [0-0xff]
	0x36	b	16	arp values [signed bytes]
	0x46	b	1	arp speed [0x1f-0]
	0x47	b	1	instr type : 0=sample, 1=pulse, 2=blend
	0x48	b	1	pulse rate - [0xff-0x80]
	0x49	b	1	pulse rate + [0x00-0x7f]
	0x4a	b	1	pulse speed [0x10-0]
	0x4b	b	1	pulse pos l [0, pos h[
	0x4c	b	1	pulse pos h ]pos l, 0x10]
	0x4d	b	1	pulse delay [0-0xff]
	0x4e	b	1	pulse synchro : 0xb=ON, 0x9=OFF
	0x4f	b	1	
	0x50	b	1	blend ?
	0x51	b	1	pulse shoot [0-0xff]
	0x52	b	1	blend ?
	0x53	b	1	arp count [1-16]
	0x54	b	1	sample per cycle : 16,32 or 64
	0x5a	w	1
	0x60	end

--------------------------------------------------
	w	1	sampled instr nb
	
	for each sampled instr :
	
	0	w	1	instr index
	2	w 	1	instr sample len
	4	b	len	sample 

--------------------------------------------------

	l	1	0x12345678 : magic value to check the end of file




mod.wildy
---------

000000:  46726564 20456469 746f7220 00000001    Fred Editor ....
000010:  05
11:	0a0a04 05040507 080c0d0e 0f0a0a 82 jump 2   
000020:  00000000 00000000 00000000 00000000
...
000100:  00000000 00000000 00000000 00000000
000110:  80
111:	020303 03030306 06030306 06030382
000120:  00000000 00000000 00000000 00000000
...
000200:  00000000 00000000 00000000 00000000
000210:  80
211:	018000 00000000 00000000 00000000
000220:  00000000 00000000 00000000 00000000
...
000300:  00000000 00000000 00000000 00000000
000310:  80
311:	0a0a10 1110110b 09121314 150a0a82
000320:  00000000 00000000 00000000 00000000
...
000400:  00000000 00000000 00000000 00000000
000410:  80

patt 0
411:	000000 04	830084 80 

patt 1
	000000 5d 830226
000420:  ff830424 ff30ff83 0226ff26 ff830430
000430:  fd22ff83 0226ff83 0424ff2e ff830226
000440:  ff26ff83 0430ff2e ff22ff83 0226ff83
000450:  0424ff30 ff830226 ff26ff83 0430fd22
000460:  ff830226 ff830424 ff2eff83 0226ff26
000470:  ff830430 ff2eff22 ff80

patt 2
	0000 00158300
000480:  84e78301 34ff34eb 34ff34fd 34fd34ff
000490:  34ff80

patt 3
	00 000069 83 03      	instr 3
	18ff  			C-2
	18 ff			C-2
	8301
	34			E-4
0004a0:  ff			1 line blank
	8303
	1a ff			D-2
	1bff			D#2
	83 00			PSE 0
	84
	ff
	83 01
	34			E-4
	ff
	8303
	1c			E-2
	ff
	1d 			F-2
	ff
	830084 ff830134 ff83031e
0004c0:  ff1fff22 ff830134 ff830318 fd18ff83
0004d0:  0134ff83 031aff1b ff830084 ff830134
0004e0:  ff83031c ff1dff83 0084ff83 0134ff83
0004f0:  031eff1f ff22ff83 0134ff83 0318ff80

patt 4
000500:  0000003b 
	8300
	18ff 		C-2, 1 empty line
	18ff
	1bff 		D#2
	1fff		G-2
	22ff		A#2
000510:  84ff		PSE 0
	1fff 		G-2
	84ff		PSE 0
	8102 2100	port
	1f		G-2
	fd		3 lines blank 
	1dff
	18fd		C-2, 3 empty lines
000520:  16ff		A#1
	18ff 
	1aff		D-2
	8101 1b00	D-2 port
	1afd 
	1dff84ff	
000530:  81011a00 18fd16ff 13f784fb 18ff80

patt 5
	00
000540:  000037 83 0084ff18 ff1bff1f ff22ff84
000550:  ff24ff84 ff810221 001ffd1d ff1afd1b
000560:  ff1dff22 ff81021f 001dfd1b ff84ff1a
000570:  ff16ff13 ff18f784 f9800000 00698303
0009d0:  1bff1dff 81012900 28fd27ff 26ff24ff
0009e0:  14ff18ff 1bff8101 220020fd 24ff26ff
0009f0:  27ff8101 260024fd 22ff1dfd 1fff2480
;empty patterns
000a00:  00000002 84800000 00028480 00000002
000a10:  84800000 00028480 00000002 84800000
...
000c40:  00000002 84800000 00028480 00000002
000c50:  84800000 00028480 00000002 84800000
000c60:  00028480 00000002 84800000 00028480
000c70:  00000002 84800000 00028480 

c7c:	000a		;instruments
c7e	                                2843    ..............(C
000c80:  294a4c20 6f66204e 534c0000 00000000    )JL of NSL......
000c90:  00000000 00000000 00000000 00000000    ................
000ca0:  0000ffff 000801ac 1c000204 8a898901    .............
000cb0:  5c130100 00000000 00000000 00000000    \...............
000cc0:  00000000 0201dc64 04010600 0b040056    ......d.......V
000cd0:  00011000 00000000 00000000 0000
cde	                                556e    ..............Un
000ce0:  75736564 00000000 00000000 00000000    used............
000cf0:  00000000 00000000 00000000 00000000    ................
000d00:  00020000 08fd 01ac 00000306 a07fff50    ..........P	;sample, len = 0x8fd*2
000d10:  a0101080 00000000 00000000 00000000    ...............
000d20:  00000000 0200807f 02101e00 0a040000    ...............
000d30:  00012000 00000000 00000000 0000
d3e	                                556e    .. ...........Un
000d40:  75736564 00000000 00000000 00000000    used............
000d50:  00000000 00000000 00000000 00000000    ................
000d60:  00030000 00e5 01ac 00000306 a07fff50    ..........P	;sample, len = 0xe5*2
000d70:  a0101080 00000000 00000000 00000000    ...............
000d80:  00000000 0200807f 02101e00 0a040000    ...............
000d90:  00012000 00000000 00000000 0000556e    .. ...........Un
000da0:  75736564 00000000 00000000 00000000    used............
000db0:  00000000 00000000 00000000 00000000    ................
000dc0:  0000ffff 002001ac 00000306 c99aae51    ... ......Q
000dd0:  40020026 00000000 00000000 00000000    @..&............
000de0:  00000000 0201ae76 0a1b3400 0a040000    ......v..4.....
000df0:  00014000 00000000 00000000 0000556e    ..@...........Un
000e00:  75736564 00310000 00000000 00000000    used.1..........
000e10:  00000000 00000000 00000000 00000000    ................
000e20:  0000ffff 000801ac 00000505 ffffff33    .........3
000e30:  40000200 00000000 00000000 00000000    @...............
000e40:  00000000 0101d709 00010e00 0b040004    ...............
000e50:  00011000 00000000 00000000 0000556e    ..............Un
000e60:  75736564 00000000 00000000 00000000    used............
000e70:  00000000 00000000 00000000 00000000    ................
000e80:  0000ffff 000801ac 0a000000 ae89890b    ............
000e90:  52020100 00000000 00000000 00000000    R...............
000ea0:  00000000 0101dc64 04010600 0b040056    ......d.......V
000eb0:  00011000 00000000 00000000 0000556e    ..............Un
000ec0:  75736564 00000000 00000000 00000000    used............
000ed0:  00000000 00000000 00000000 00000000    ................
000ee0:  0000ffff 000801ac 0a000000 ae89890b    ............
000ef0:  52020100 00040700 00000000 00000000    R...............
000f00:  00000000 0101dc64 04010600 0b040056    ......d.......V
000f10:  00031000 00000000 00000000 0000556e    ..............Un
000f20:  75736564 00000000 00000000 00000000    used............
000f30:  00000000 00000000 00000000 00000000    ................
000f40:  0000ffff 000801ac 0a000000 ae89890b    ............
000f50:  52020100 00050700 00000000 00000000    R...............
000f60:  00000000 0101dc64 04010600 0b040056    ......d.......V
000f70:  00031000 00000000 00000000 0000
                                        556e    ..............Un
000f80:  75736564 00000000 00000000 00000000    used............
000f90:  00000000 00000000 00000000 00000000    ................
000fa0:  0000ffff 000801ac 0a000000 ae89890b    ............
000fb0:  52020100 00050900 00000000 00000000    R...............
000fc0:  00000000 0101dc64 04010600 0b040056    ......d.......V
000fd0:  00031000 00000000 00000000 0000
                                        556e    ..............Un
000fe0:  75736564 00454c45 53530000 00000000    used.ELESS......
000ff0:  00000000 00000000 00000000 00000000    ................
001000:  0000ffff 000801ac 1c000204 40898901    .........@...
001010:  5c130100 00000000 00000000 00000000    \...............
001020:  00000000 0201dc64 04010600 0b040056    ......d.......V
001030:  00011000 00000000 00000000 0000

nb sampled intr                         0002    ................
sample index & length
001040:  0002 11fa

sample data
                  0001e040 000011ba 01ac0000
001050:  0306ff7f ff50a010 10800000 00000000 
001060:  00000000 00000000 00000200 807f0210 
...
002200:  fe080603 09060108 161a0ffe f6f2f600 
002210:  0f191310 1719190a 00060905 060e1009 
002220:  fcfefaf5 f7fc091a 11070a09 f9efeeef   
002230:  f2f7fefd fafb01fc f70001f2 e9ea

                                        0003 		;sample index,
002240:  01ca 0001a6e00000 018a01ac 00000000 		; length & data
002250:  ed7fff50 a0101080 00000000 00000000  
...
0023f0:  706b7878 737f7d7f 7f7f7f7f 7f7f7f7f
002400:  7f7f7f7d 7b787976 72716d6d 
                                    12345678		;magic value
