AVR (Audio Visual Research) sound format
----------------------------------------
version 1.0


- Atari ST/STE format
- developped by 2-BIT systems (Microdeal)
- source : ST mag #42, pages 26, by Sebastien Mougey
- 0xnnnn are hexadecimal values



offset	type	length	name		comments
--------------------------------------------------------------------------------
0	char	4	ID		format ID == "2BIT"
4	char	8	name		sample name (unused space filled with 0)
12	short	1	mono/stereo	0=mono, -1 (0xffff)=stereo
					With stereo, samples are alternated,
					the first voice is the left :
					(LRLRLRLRLRLRLRLRLR...)
14	short	1	resolution	8, 12 or 16 (bits)
16	short	1	signed or not	0=unsigned, -1 (0xffff)=signed
18	short	1	loop or not	0=no loop, -1 (0xffff)=loop on
20	short	1	MIDI note	0xffnn, where 0<=nn<=127
					0xffff means "no MIDI note defined"
22	byte	1	Replay speed	Frequence in the Replay software
					0=5.485 Khz, 1=8.084 Khz, 2=10.971 Khz,
					3=16.168 Khz, 4=21.942 Khz, 5=32.336 Khz
					6=43.885 Khz, 7=47.261 Khz
					-1 (0xff)=no defined Frequence
23	byte	3	sample rate	in Hertz
26	long	1	size		in bytes (2*bytes in stereo)
30	long	1	loop begin	0 for no loop
34	long	1	loop size	equal to 'size' for no loop
38	byte	26	reserved	filled with 0
64	byte	64	user data
128	bytes	?	sample data	(12 bits samples are coded on 16 bits :
					0000 xxxx xxxx xxxx)
-------------------------------------------------------------------------------


Example:
--------

0	"2BIT"
4	"lovebeat"
12	0x0000			mono
14	0x0010			16 bits
16	0xffff			signed
18	0xffff			loop on
20	0xffff			no MIDI note
22	0xf0			Replay freq
23	0x007441		freq = 29.761 Khz
26	0x00012624		size = 75300 samples
30	0x000001d1		loop begin = 465
34	0x000119f0		loop end = 72176
38	0000 00000000 "AVR by P. Segerdahl "
64	Converted with "Zero-X"  written by Peter Segerdahl, 1994 Sweden
128	0x0000 0x0001 0xfff6 0xfff7
...
0x24CC0 0xFFB3 0xFFE7 0x0087 0x0065



file size = 128 bytes header + 75300*16 bits = 0x24cc8 bytes
