Goattracker Tutorial
Goattracker Tutorial
67
---------------------------------------------------------------------------
------------------------------------------------------------------------| This guide is aimed at musicians that want to start creating .sid
|
| chiptunes from scratch using the pc/mac application "goattracker".
|
-------------------------------------------------------------------------
___________________________________________________________________________
__/Contents:
-----------Chapter
Chapter
Chapter
Chapter
Chapter
Chapter
Chapter
Chapter
0
1
2
3
4
5
6
7
_________________________________________________________________________
/
\
Chapter 0 - Getting to know binary and hexadecimal numbering system
If you already know how to think in binary and hex, and know what a
signed hex value is, you can skip to chapter 1.
__________________________________________________________________________
__/BIT & Nybble
--------------Humans daily life is dealing with decimal numbers, which we all know. Since
computers work somewhat different from humans, and only know "charge" (1)
or "no charge" (0) the concept of binary values has been made up.
One single "charge"/"no charge" value is known as bit. If we put together
four of these values, we have a nybble. Binary numbers are indicated by a %
in front. The lowest value a nybble can hold is %0000, the highest would be
%1111. Going through all possible 0 and 1 combinations, we see that there
are 16 different combinations possible.
Binary system is built up on the powers of 2, where the lowest bit
represents a decimal value of 1. So the bits from LSB to MSB are 1
(and 16 32 64 128 when it's two nybbles/a byte).
A bit set to "1" means, we need to add it's decimal value up to the sum to
know the final value of the nybble. Mind that the lowest bit is always
referred to as bit 0. People also use the orientation LSB (least significant
bit = bit 0) and MSB (most significant bit).
MSB
3
8
:
:
:
%1
bit number
dec value
example
bin value
2
4
:
:
:
0
1
2
:
:
:
1
LSB
0
1
:
:
:
0 =
___________________________________________________________________________
__/HEX
-----HEXadecimal means that the number systems has a base of 16 (instead of 10
as we are used from decimal numbering). this was the most logical choice,
since a nybble can hold a value between dec 0-15.
As decimal system only has 10 numerics for numbers, the letters A-F were
incorporated into the system. After the value exceeds 9, it goes from
A to F.
Hex numbers are indicated by a $, for better determination.
Simple conversion table:
-----------------------Dec
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Bin
%0000
%0001
%0010
%0011
%0100
%0101
%0110
%0111
%1000
%1001
%1010
%1011
%1100
%1101
%1110
%1111
Hex
$0
$1
$2
$3
$4
$5
$6
$7
$8
$9
$A
$B
$C
$D
$E
$F
___________________________________________________________________________
__/Byte & % $ conversion
-----------------------A Byte consists of 8 bits and is therefor double the width of a nybble.
People also refer to the nybble containing LSB as low nybble, to the MSB
nybble as high nybble.
The MSB represents the value 128 in decimal. (or 80 in hex system) Largest
value of a byte is 255 in dec / $FF in hex / %11111111 in binary.
MSB
7
128
$80
6
64
$40
5
32
$20
4
16
$10
3
8
$8
2
4
$4
1
2
$2
LSB
0
1
$1
The trick with a byte value is, that it can be treated like two nybbles for
easy binary to hex (and vice versa) conversion.
%10110110
splits up to
%1011 %0110
furthermore
%1011 = $B
and
%0110 = $6
the outcome: %1011 0110 = $B $6 = $B6
the other way around:
$E4
splits up to
$E = %1110
and
$4 = %0100
outcome: $E4 = %11100100
___________________________________________________________________________
Adding bytes as nybbles is also very easy:
$10 %0001 0000
+ $40 %0100 0000
----------------$50 %0101 0000
$20 %0010 0000
+ $40 %0100 0000
----------------$60 %0110 0000
Though it's somewhat harder when adding to higher values, in that case it's
easier to see the byte as "whole" value, not two nybbles.
$7F %0111 1111
+ $01 %0000 0001
----------------$80 %1000 0000
$7F - Low nybble is already at highest value ($F). If this was decimal
system, the highest value would be 9. So if you add 79+1, result is
80. In hex just the same, we increase the high nybble ($7) and set
low nybble to $0 again. $7F + $01 = $80.
Mind: If you're lazy, you can also use the calculator that comes with your
operating system for hex/bin/dec conversion.
___________________________________________________________________________
__/Signed Values
---------------A signed byte is referred to as signed as it's MSB indicates (signs) if the
value is positive or negative. Since there are only 7 bits left for the
actual value, it can range from decimal -128 to +127.
Further, the bits are inverted (flipped) in case the represented value is
negative. Since %0000 0000 represents 0, a signed value of %1111 1111
represents -1. Also an offset of $01 has to be added after inverting the
bits.
Conversion example from positive to negative:
$3E = %0011 1110 (=62)
inverted = %1100 0001
+ offset
%0000 0001
--------------------result
%1100 0010 = $C2 (= -62)
And in case you really don't understand the need for the offset, here is
the proof:
Converting $01 postive to negative:
$01 = %0000 0001
inverted = %1111 1110
+ offset
%0000 0001
--------------------result
%1111 1111 = $FF (= -1)
Therefor signed values $01 to $7F represent 01 to 127,
$FF to $80 represent -01 to -128
Positive Range:
$01=$+01
$02=$+02
$03=$+03
.
.
.
$7D=+$7D
$7E=+$7E
$7F=+$7F
Negative Range:
$FF=$-01
$FE=$-02
$FD=$-03
.
.
.
$82=$-7E
$81=$-7F
$80=$-80
\_________________________________________________________________________/
_________________________________________________________________________
/
\
Chapter 1 - Instrument editor - ADSR - Waveforms & table - Arpeggios
__/ADSR
------stands for:
Attack time
Decay time
Sustain level
Release time
Or in other words:
Attack
- You press a key on the piano, the hammer hits the string, the
string resonates with it's peak value
Decay - The Peak value decays
Sustain - The string sustains at sustain level (Key still pressed)
Release - Release of the piano key and fade out / muting of the string
according to foot pedals
Each of these 4 factors is represented by a nybble value which are set in
instrument editor. $0 = short, $F = long; in case of sustain $F = loud.
Mind: $F on attack is 8 seconds, $F on decay/release is 24 seconds.
As sound passes -through- this ADSR circuit, it is known as gate.
Bit 0 of the waveform register controls this gate. When it is set to 1
(=gate on), the AttackDecay cycle is initiated, after decay time has ended
the sound is held at sustain level. When waveform register bit 0 is set to
0, the release cycle starts.
Diagram for an instrument with fast attack, fast decay and long release:
[Gate bit on]
[Gate bit off]
|
|
A D
|
S
R
/\
/ ------------|
\
|
\
|
\
|
\
Diagram for an instrument with slow attack, fast decay and short release:
[Gate bit on]
[Gate bit off]
|
|
A
D
|
S
R
/\
/ -----------\
/
|
/
|
/
|
___________________________________________________________________________
__/Waveform - Wavetable
----------------------In goattracker instrument editor, the $ number besides "Wavetable Pos"
points to a position in the wavetable, which contains the waveform values
which are written frame by frame into the sid registers.
One frame = one screen update = one value read from table and written to
sid registers. When people speak of 2x or 4x tunes, they mean that the
music routine is called several times per screen update, and thus allows
more waveforms and parameters to be written, which results in more
abilities to create sound.
The "WAVE TBL" contains two columns, the left value is the waveform
register value, the right column is relative/absolute note offset which
we will discuss later.
Hint: Use -Tab- to jump between
pattern/orderlist/instrument/wavetable/songname
For direct jumping between instrument editor and wavetable, use F7.
So bit 0 of the waveform register controls the ADSR gate,
what about the other 7 bits?
bit number
hex value
dec value
MSB
7
$80
noise
6
$40
square
5
$20
saw
4
$10
tri
3
$8
test
2
$4
ring
1
$2
sync
LSB
0
$1
ADSR
Bit 7 selects the "noise" waveform, which is very useful for creating hihat
and snaredrum sounds. It's no "fixed" noise as for example white
noise, It's pitch dependent pseudo random noise defined by a note
value in a pattern or by offset/fixed pitch.
Bit 6 "square" or "pulse" waveform, which can be seen as __---__---__--Mind: you must set pulsetable/pulsewidth,
else you won't hear the pulse waveform (see Chapter 2).
Bit 5 "saw" waveform, which looks like a saw blade /|/|/|.
Bit 4 "triangle" waveform, looks like /\/\/. It has a very soft sound which
can be used for flute like sounds.
Bit 3 "test" or "reset" bit. C64 oscilltors lock up when selecting
waveforms together with noise. This bit is used to unlock it again.
You will never need this bit, as goattracker cares for that by
itself with it's hardrestart routines.
Bit 2 "ringmodulation" - When this bit is set to 1, the oscillator (it must
be triangle waveform!) is ringmodulated with the frequency of the
previous oscillator, no matter what waveform the previous osc. is set
to. Previous oscillator in goattracker terms means, the osc./pattern
left to the modulated voice (the three patterns in the editor
represent the three sid voices). In case ringmod bit on voice 1 is
selected, the previous voice would be voice 3.
The effect is better heard than described. It sounds metallic and can
be used to create bell like sounds.
Bit 1 "sync" - When this bit is set to 1, the fundamental frequency of the
oscillator is hardsynced with the frequency of the previous
oscillator. Technically, the waveform the oscillator plays is
restarted when the previous oscillator amplitude passes 50%.
/\
/ \
/
\
/
\
/
\
/.
.\
/.
.\
/ .
. \
/ .
. \
/ .
. \ / .
. \
/
.
.
\/
.
.
\
.
.
.
.
.
.
.
.
/| . /| /| /| /| /| /| /| /|
/ |/|/ |/ |// |/ |/ |/ |/ |// |
From the stuff we know so far, we will create our first sound:
Open goattracker and jump to Instrument editor [F7].
Edit [Attack/Decay 55]
and [Sustain/Release 55]
Edit [Wavetable Pos 01]
Jump to WAVE TBL [F7].
Edit
[01:21 00] (Sets saw waveform and gatebit)
[02:20 00] (Saw waveform still set, gatebit off)
[03:FF 00] (FF is a jump command for wavetable programming.
FF 00 means - stop wavetable execution)
Now hit [space] to hear a test note of that instrument.
(you can use * and / for octave switching)
Since gatebit is on for just one frame, we cannot really hear the attack.
So we change wavetable position 02 to:
[02:FF 01] (jump to position 01)
And hit [space]
When we jump up to instrument editor now, we can change Attack/Decay and
Sustain values and hit [space] to trigger the note once more to hear the
change. Stop sound by pressing [F4].
00]
00]
00]
01]
Hint: you can use [insert] and [delete] to move wavetable values up/down.
If you move onto the 01 position and press [insert] you will see
goattracker even changes the "Wavetable Pos" according to where you
move the initial value.
___________________________________________________________________________
__/Arpeggios and fixed pitch sounds
----------------------------------As mentioned earlier, the right column in WAVE TBL is used for pitch
offset. This can eighter be relative (=added/substracted from the note
value) or absolute (fixed, no matter what the note pitch is) values.
$00
$60
$80
$81
Arpeggios - Since the sidchip has a somewhat limited polyphony, the concept
of arpeggios (single notes that are played in fast order) is
often used.
If we want to build the guitar typical powerchord by arpeggio, we just need
to count the frets from the initial note to the second (the interval in
half note steps). the third tone is an octave.
In wavetable that would look like:
[01:21
[02:21
[03:21
[04:FF
00]
07] (+7 halftonesteps =a quint)
0C] (+12 halftonesteps =an octave)
01]
Jump to Pattern editor with [F5] and hit space to change to [JAM MODE]
(see lower left of screen) to play the arpeggio with different notes.
Hint: Marking/Painting the "black" piano keys on your QWERTY keyboard makes
composition a lot easier. There are also two layouts to choose from:
the fasttracker and the DMC layout. This tutorial is based on the
(default) fasttracker one.
Hint2: Space (as you've already seen) switches JAM/EDIT mode, so you can
find out some melody without fuxx0ring the pattern up.
Hint3: If you use a Mac, you can also connect a MIDI keyboard and play
notes with that :)
If you want to create your own arpeggio scale, just take the base note and
count the keys.
Trivia: Oldschool musician Ben Daglish didn't use any filters in his songs,
as he knew every chip sounded different and he did not want that
his soundtracks would sound completely different on other machines.
\_________________________________________________________________________/
_________________________________________________________________________
/
\
Chapter 2 - Pulse Waveform - Automation/Modulation
The pulse waveform of the sidchip is somewhat special, as it allows us to
set the relation of the high/low cycle (this is also sometimes called PWM
- pulse width modulation).
Mind: The chip has actually two registers for setting pulsewidth for each
voice, though one of these two registers uses only a nybble value,
which gives us a total range from dec 0-4095, or more familiar:
$000 - $FFF.
A symmetrical square (=pulse) wave would look like this:
high
low
-------------------------
Now if we change the pulse -width-, it would look like this for example:
high
low
Soundwise this changes the harmonics of the wave, so the sound is missing
certain harmonics whilst it emphasizes others, depending on high/low
relation. It's better heard than described, as it's one of the sid chip's
well known distinct sounds.
So lets create an instrument using PWM.
Edit ADSR values in instrument editor to whatever you like, and set
[Wavetable Pos 01]
[Pulsetable Pos 01] (just like with the wavetable,
this points to the PULSETBL position)
Edit WAVE TBL
[01:41 00] (Sets pulse wave and gate on)
[02:FF 00]
As mentioned earlier, we cannot hear anything as we have not set the pulse
high/low relation. So go right to PULSETBL (the pulsetable is executed just
like the wavetable, frame by frame)
Edit
[01:98 00]
[02:FF 00]
and hit [space]. you now hear a symmetric pulse waveform.
01:98 00 means: A value in pulsetable where the most left nybble (in our
case $9) is in range from 8 to F indicates that the
following three nybbles are used to SET the pulsewidth.
So we could also type [01:F8 00],
it would have the same effect.
The second nybble ($8) is the high nybble (MSB) for setting
the pulsewidth, so it influences the pulsewidth the most.
The most right two nybbles are the low byte of the
pulsewidth which allow for finetuning.
edit PULSETBL
[01:9X 00] - try different values for X, hit space to retrigger the sound.
You might have discovered that the sound thins out, the closer you get to
$000 and $FFF. That is because a pulse with width $000 or $FFF is so wide
that it's constant high or low, thus it does not oscillate and it cannot
be heard.
$000 and $FFF are exact opposites, just inverted.
pulsewidth $000
high
low
---------------------------pulsewidth $FFF
high ---------------------------low
Thats why our initial value $800 gives us a symmetrical square wave, as
it's the middle between $000 and $FFF. Going towards $000 from $800 sounds
the same as going towards $FFF from $800, though it's not the same seen
from the physical side.
___________________________________________________________________________
__/Automation/Modulation - Pulsetable
------------------------------------Go to PULSETBL and edit
[01:98 00] (set pulsewidth to $800)
[02:6C 13] (increase pulsewidth with an amount of $13 for $6C frames)
[03:FF 00]
Hit space to hear a pulsewidth fade going from $800 towards $FFF and stop.
The concept of this automation is somewhat odd to use for a musician.
Imagine, the PULSETBL automation is just a table with values, and
goattracker (or later the playroutine) adds these values to the pulsewidth
register, or substracts them.
How?
[02:6C 13] Values in the pulsetable left side that range from $01 to $7F
are used for pulsewidth modulation (=automation).
In our case, $6C $13 means, ADD a value of $13 to the pulsewidth
register for the duration of $6C frames. The right byte ($13) is
a signed value!
If we change $6C to $1F [02:1F 13] we can hear that the pulse
only slightly changes, as $13 is only added for a duration of
$1F frames.
If we change $13 to $01 [02:6C 01], the pulsewidth will fade
slower, as only a value of $01 is added to the register.
__--__--__--__-- (symmetric)
__--__--__--__-- (symmetric)
The jump command [FF] in Pulsetable. If you change [03:FF 02] the
sound will wrap forever. You can also set the width to different
values directly in series using the $8x - $Fx left nybble. And you
can even execute a fast fade, then a slow fade (several automation
commands in series). In that case the starting pulsewidth for a
following commands is always the one where the previous command
stopped changing the register.
And: The right byte (the value that will be added/substracted) is, as told
before, a signed value. So if you want to stop at a certain pulsewidth
and go back reverse, you need to add a negative value (signed) again.
You should really consider reading -chapter 0 - signed values- if you
don't know what this means.
Last words for this chapter: Of course the pulsewidth register will also
wrap around in opposite direction (like every
register). So substracting from $000 will
start over from $FFF.
\_________________________________________________________________________/
_________________________________________________________________________
/
\
Chapter 3 - Usage of Filter - Filtertable
__/Usage of Filter
-----------------Some people call the sid chip a substractive synthesizer. It is
substractive by the means that you can filter/cut off a certain frequency
range of the sound output.
As there are different types of filters, they are differed by the frequency
range they work in. Sid has three different filters, which can be combined
in any way.
Lowpass - It lets low frequencies pass
Bandpass - Lets mid range frequencies pass
Highpass - Guess what that one does?
Also there is ability to set the cutoff frequency register, which defines
at which frequency the selected filter -cuts off-.
So if you select lowpass and set $cutoffvalue, it will let all frequencies
pass that are below $cutoffvalue; so the sound will be somewhat dull.
Bandpass lets frequencies pass that are around $cutoffvalue, so low and
high stuff will not be heard.
Highpass $cutoffvalue will let pass all frequencies above $cutoffvalue, so
no low or midrange sounds can be heard.
Hint: Bandpass is also known as MIDpass.
Furthermore, we have the ability to set a resonance value, which means that
the frequencies in $cutoffvalue range will be emphasized.
___________________________________________________________________________
__/Filtertable
-------------So let's create a sustaining instrument with the knowledge we have gained:
Then edit in instrument editor:
[Filtertable Pos 01]
Jump to FILT TBL.
edit
[01:90 F7] (left nybble $9x - set lowpass, right unused, $Fx set resonance,
$x7 set channel/=oscillator)
[02:00 10] (Set cutoff to $10)
[03:FF 00] (end of line)
press [space] to hear a muted version of the sound you created.
More deep explanation of the byte values:
Bytes that are written in the left column define either filtertype or
!-modulation steps-! (we know them from pulsetable already).
!-Refresh your know-!
When the left byte is in range from $01 to $7F a modulation step will be
executed, $01 to $7F defines the number of frames for modulation and the
right byte defines the speed/amount (signed value again).
Mind: When you try the modulation examples from [chapter 2 - pulse
waveform] here, the value will wrap around as it always does, but the
filter sound will not. So finally understanding signed values should
be essential for letting filter cutoff going up and down again too.
___________________________________________________________________________
In case the left byte in a filtertable row is above $7F ($80 and up), the
whole two bytes in this table step are used for defining the following:
Filter type (left byte)
As we only have 4 values (No filter/LOWpass/MIDpass/HIpass), only the left
nybble bits are used ($8 - $F).
This leaves us following bits to switch the filter type:
%
%
%
%
%
%
%
%
1
1
1
1
1
1
1
1
H
I
:
:
0
0
0
0
1
1
1
1
M
I
D
:
0
0
1
1
0
0
1
1
L
O
W
:
0
1
0
1
0
1
0
1
$8
$9
$A
$B
$C
$D
$E
$F
Right nybble value has no effect, $80 or $81, even $8F - does the same.
___________________________________________________________________________
Right byte left nybble defines resonance ($0x - $Fx), rightmost nybble
lowest three bits select which chan/voices are to be filtered ($x0 -$x7).
%
%
%
%
%
%
%
%
0
0
0
0
0
0
0
0
[ voice ]
3 2 1
: : :
: : :
: : :
0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
$0
$1
$2
$3
$4
$5
$6
$7
Now we can totally figure out our filter table example step 01:
[01 90 F7] (left nybble $9x - set LP, right nybble unused,
$Fx set resonance, $x7 set channel/=oscillator)
___________________________________________________________________________
In case the left nybble of the step is $00,
like in step 02 from the example:
[02:00 10] (Set cutoff to $10) - $00 tells the editor to set filter cutoff
to the right byte value ($10).
___________________________________________________________________________
A simple Filtersweep:
[01:90
[02:00
[03:1F
[04:1F
[05:FF
F7]
80]
FF]
01]
00]
($90
(Set
(For
(For
[very] Mind: In the above examples, filter is always selected for all three
channels. That was done deliberate, because the sound you edit
in instrument editor is always played back on the cannel you
have last edited in pattern editor.
Means: when you entered notes on pattern/channel 1 at last and
jump to instrument editor, you will hear the [space] preview
note also played that channel.
Verdict: When you edit a filter and can't hear it, the channel
you are on in pattern editor and the one you set with the
filter voice bits are not the same.
\_________________________________________________________________________/
_________________________________________________________________________
/
\
Chapter 4 - Vibratos - Speedtable
On the right column of instrument editor we have "Vibrato Param" and
"Vibrato Delay".
[Vibrato Param] points to a position in the [SPEEDTBL].
[Vibrato Delay] defines how many frames the sound will play before vibrato.
But what is a vibrato?
It's a small (or big if you set it to that) up and down vibrating change
in pitch. It gives the sound more live - makes it sound less static.
Violin and guitar players often play vibratos on their instruments by
moving the string a little up an down on the fretboard.
So lets edit an instrument
edit [Vibrato Param 01] (As said, points to the speed table)
edit [Vibrato Delay 01] (Adds the vibrato instantly with no delay.
00 here turns vibrato off!)
jump to speedtable
edit [01:0E 0F] and hit [space] to hear a wide (more useless) vibrato.
edit [01:04 05] for a more subtle vibrato.
Speedtable is somewhat different than the other tables. When we use it for
vibrato (other uses will be discussed in Chapter 5) the left byte ($04 in
the second example) indicates how many frames pitch will be changed before
going into the other direction. The right byte ($05 in second example)
tells the value that is added/substracted from pitch value.
So the smaller the left value is, the faster the vibrato will be. The
bigger the right value is, the wider the pitch change will be. Due to the
concept of counting frames before changing pitch into the other direction,
a change of the left value also changes pitch.
Maximum value for left byte is $F7 (127 frames before direction change),
right byte can go up to $FF. There are no signed values used of course.
Diagram of [01:0E 0F]
/ \
/\
/
\
/ \
/
\
/
\
/
\ /
\
/
\/
\
Diagram of [01:04 05]
/\ /\ /\ /\ /\
/ \/ \/ \/ \/ \/
Mind: The speed table is the only table that doesnt work "like a program"
it does not contain commands that are executed in series. Every linie
in it is a single entry with no follow up. Therefore we also don't
need the $FF command here.
\_________________________________________________________________________/
_________________________________________________________________________
/
\
Chapter 5 - Pattern editing, Pattern commands, Orderlist
__/Pattern editing
-----------------Now that we know how to make an instrument, we can start making a tune.
Mind: +/- Changes - Increases/Decreases instrument number selection.
Up in goattracker window we see:
CHN 1 PAT.00 CHN 2 PATT.01
|
|
|
Current Pattern
|
that is loaded
|
and shown below
|
Sid Voice/
Channel
00 ... 00000
01 ... 00000
02 ... 00000
00 ... 00000
01 ... 00000
02 ... 00000
CHN 3 PATT.02
00 ... 00000
01 ... 00000
02 ... 00000
_________________________________________________________________________
/
\
Chapter 6 - Some essential shortcuts/keys/odd things