A data structure for representing all of the contours of a model would normally be a rather complex two-dimensional array
with variable-length rows. Interpreting such an array would involve a lot of searching. For efficiency in playing the
contours, the K150FS requires the breakpoint data to be sorted into a one-dimensional vector of update commands which can
then be interpreted sequentially as time passes. There are four types of commands: Update Slope, Wait, End of Contour, and
End of Note. Note that End of Contour indicates that the partial is no longer needed and thus can be used by some other note.
It should be issued when a partial’s contour has decayed to silence and will remain there. End of Note indicates that no more
commands or arguments are present. The contours not already terminated by End of Contour will continue along whatever
slopes were last specified until the note is actually released. The three contour example above would be encoded into the
update command string listed below.
Command
Argument
Command
Argument
Command
Argument
UPD#1
2400 dB/s
WAIT
30 ms
UPD#1
0 dB/s
UPD#2
2667 dB/s
UPD#2
-184.6 dB/s
WAIT
20 ms
UPD#3
3200 dB/s
WAIT
30 ms
UPD#2
-48 dB/s
WAIT
20 ms
UPD#1
-160 dB/s
WAIT
120 ms
UPD#3
1200 dB/s
WAIT
100 ms
UPD#2
0 dB/s
WAIT
10 ms
UPD#1
-72.7 dB/s
END#3
UPD#2
200 dB/s
UPD#2
-123 dB/s
END-0F-NOTE
WAIT
10 ms
WAIT
50 ms
UPD#1
0 dB/s
UPD#3
-56 dB/s
UPD#3
-240 dB/s
WAIT
60 ms
Encoding of the command string above can be accomplished by allocating one byte for the partial number and command
code combined followed by two bytes for the argument. However, since the K150FS’s internal 68000 processor requires 16-
bit quantities to be at even addresses, the string is split into a command code vector and an argument vector. When a model
is being played, a pointer into each vector is maintained and is incremented to the next element as each element is read. This
makes memory dumps difficult to read but is efficient and compact for the microprocessor. Coding for the command code
bytes is as follows:
CODE
ARGUMENT
COMMAND
MEANING
0
Time
Wait
Wait before executing next command
0
0
End-of-note
No more commands follow
N
Slope
Update
Update partial #N where 1 <= N <= 64
-N
none
End-of-partial
Contour for partial N is complete, can reuse it.
-128
Destination
Loopback
See below
Actually, there is a fifth type of command; Loopback. This is used for looping contours. The command code byte is $80 (-
128). Its two arguments simply specify how many commands and how many arguments (times 2) the corresponding pointers
must be backed up before continuing. Since all of the contours are encoded into one pair of command and argument strings,
the loop affects all partials which have update commands inside the loop.
1.3 ATTACK FUNCTION
As mentioned earlier, the first breakpoint of all contours is at zero amplitude and zero time. The second breakpoint of each
contour is actually specified by a table called the Attack Function. The third and subsequent breakpoints are specified by the
command and argument lists described above in section 1.2. Since an entire contour in delta-time-slope format is relative to
the amplitude of the second breakpoint, its overall amplitude can be shifted up or down simply by altering the amplitude of
the second breakpoint. This is illustrated below.