aboutsummaryrefslogtreecommitdiff
path: root/doc/eef.txt
blob: 57eeb1dcf904b58d35993aa991983c1ac9c170b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
=============================================================================

OVERVIEW

    EEF stands for "Echo Envelope Format" and it's the format in which PSG
    instruments are stored.

FORMAT

    EEF instruments consist of a byte per tick (1/60th of a second). The
    bottom nibble is the volume level (relative to the note's volume),
    ranging from $x0 (loudest) to $xF (quietest).
    
    The upper nibble is a "semitone shift", which is added to the current
    note's semitone. These can be useful for things like vibrato (e.g. for
    whistles) and such. The amount the semitone is shifted is as follows:
    
        $0x ... 0 | $1x ... +1  | $8x ... -1
                  | $2x ... +2  | $9x ... -2
                  | $3x ... +3  | $Ax ... -3
                  | $4x ... +4  | $Bx ... -4
                  | $5x ... +6  | $Cx ... -6
                  | $6x ... +8  | $Dx ... -8
                  | $7x ... +12 | $Ex ... -12
    
    Looping is possible. The start of the loop is marked by a byte with value
    $FE, while the end of the loop is marked by a byte with value $FF. There
    must be at least one tick byte between them or Echo will hang.
    
    To make a non-looping PSG instrument, just put the last volume value
    inside the loop.

=============================================================================

NOTES

    Since PSG instruments are required to use PSG channels and I know many of
    you don't want to mess with them at all, here's a flat PSG instrument
    (i.e. no envelope):
    
        $FE,$00,$FF
    
    There's a flavor of the Set Frequency event that doesn't play nice with
    semitone shifting (in which case it'll just act as if it was always $0x).
    It will work again once a new note starts or the other flavor is used.

=============================================================================