commit 318a7a4

zzo38  ·  2022-11-10 03:48:31 +0000 UTC
parent 6e8a261
Explain audio device in varvara.doc.
1 files changed,  +34, -1
+34, -1
 1@@ -111,7 +111,40 @@ are as follows:
 2 
 3 === Audio ===
 4 
 5-(TODO)
 6+30 = Vector *
 7+32 = Position *
 8+33 = Output
 9+38 = Envelope *
10+3A = Length *
11+3C = Address *
12+3E = Volume
13+3F = Pitch
14+
15+Each such device is one audio channel.
16+
17+The envelope can be zero for no envelope, or can be nonzero for a ADSR
18+envelope where the four nybbles (high to low) are the time of each part
19+of the envelope, in fifteenths of a second. The envelope is as follows:
20+  0% -A- 100% -D- 50% -S- 50% -R- 0%
21+
22+The length is the length of the sample data (in bytes), and the address
23+is the address of the sample data. The sample format is unsigned 8-bits.
24+
25+Volume has the high nybble for the left speaker and low nybble for the
26+right speaker, where fifteen is the maximum volume and zero is silence.
27+
28+Writing to the pitch port will read all parameters and will start a new
29+note playing. The high bit is set to disable looping, or clear to enable
30+looping (until the envelope ends, if there is any). The low 7-bits are a
31+MIDI note number (0x3C for middle C).
32+
33+If the length is greater than 256 bytes, then it is assumed to have a
34+sample rate of 44100 Hz for middle C (if a different note number is
35+specified, then it will be played at a different speed). If the length
36+is less than 256 then it is assumed to be one cycle of a middle C note.
37+
38+Vector is called when a note ends, and the position and output ports are
39+used to read back the status.
40 
41 
42 === MIDI ===