home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frozen Fish 1: Amiga
/
FrozenFish-Apr94.iso
/
bbs
/
alib
/
d7xx
/
d787
/
scale.lha
/
Scale
/
scale.doc
< prev
next >
Wrap
Text File
|
1992-12-24
|
14KB
|
343 lines
SCALE Documentation
Dick Taylor, Glastonbury Connecticut USA November 1992
WHAT DOES IT DO?
The SCALE program plays from one to four simultaneous musical scales
using the Amiga's 4-channel sound system. The scales can be played over
a six octave range, in several tempos. For each channel, the scale is
specified as a series of steps, where each step can be ascending or
descending, from 1 to 4 octaves. All user input (Intuition interface)
for specifying the scales is made via click-buttons and a tempo slider.
HOW TO USE
In WorkBench, double-click the SCALE icon.
Or, in CLI/Shell, enter--
scale
This presents the user interface screen, initialized with a single scale to
be played: Starting at middle C, ascend one octave. Refer to the
on-screen HELP feature, first two screens, for introductory details on this
first scale. At the lower right screen corner, click "PLAY" to start
playing. Click "QUIT" to return to the system. The following material
explains the full details of specifying the scales to be played.
If WorkBench icon execution does not work, try CLI/Shell. There are
several error messages (trouble with Intuition library or Window, for
example) that can appear only when running from CLI/Shell. Most of the
error messages do appear when run from icon.
MENU
There is a single menu named "Project". You can select --
Help On-line introduction to SCALE.
Load To load a previously saved scale specification.
Save To save a scale specification.
("Scale Specification" = specs for 4 chan's)
About Program author
Quit Return to system
SPECIFYING THE SCALES
The four Amiga sound channels are designated 0, 1, 2, 3. May use any of
these channels, in any combination wanted. Channels 0, 3 use the left
speaker; channels 1, 2 use the right speaker. The current scale
specifications are displayed in a table across the top of the screen.
Key: There is one key that applies to all 4 scales. Controlled by the key
box, near mid-screen below the table. Click in box to cycle through keys
C D E F G A B C... Click adjacent box to cycle through _ (= blank), #,
b (= flat). No # for keys of B, E. No b for keys of C, F.
Channel controls:
1- Table boxes Clear, Chan, N (=Note), O (=Octave), T(=Time).
2- Below the table, ADR+ Edit controls -- 6 boxes.
Select a channel by clicking one of the "Chan" boxes 0-3. Then clicks
on channel controls apply to that selected channel, until a different
channel is picked. The currently selected channel is indicated by an
enclosing orange box.
Note -- Click in box to cycle through C D E F G A B C... to pick
the first note of the scale. The usual scale begins on same note as the
key, but any first note can be used. More on this choice later. No sharp
/ flat notation used here; a sharp / flat is automatically used as needed
for the selected key.
Octave -- Click in box to cycle through 1 2 3 4 5 6 1... Octave 1
is very low; octave 6 is very high. For key of C, with first note C,
octave 4 starts at middle C. Please note an AudioTools idiosyncrasy here:
the lowest note of a specified octave is C. For example, the lowest note
of octave 4 is middle C. The adjacent lower note, B, is octave 3. This
can be just a little confusing at times.
Time -- Notation 1/1 chosen to represent the base time, which is
controlled by the Tempo slider (see following). Notation 1/2 means twice
as fast, or note time values one-half of the base time; 1/4 means four times
as fast, or note time values one-fourth of the base time. Click in box to
cycle through 1/1, 1/2, 1/4, 1/1... For normal usage, always keep at least
one channel at the base time of 1/1.
Clear -- Click in box to erase this channel; cleared channels
do not play any scale.
ADR+ Edit: Up to 14 steps may be used to specify the scale components for
each channel. The double-arrow underline (^^) shows the current edit step.
Click the right arrow box (>) to add a step, or to move edit one step to
the right. Click the left arrow box (<) to move edit one step to the left.
Choices for each step:
Click in box to cycle A, D, R, +, A...
A -- ascending scale (up)
D -- descending scale (down)
R -- rest (don't play)
+ -- repeat from first step
Following A, D, R -- digit 1-4 telling how many sequential octaves
to play, or for R, to rest. Click box '1-4' to cycle 1, 2, 3, 4, 1...
ASSUMPTION: Each step after the first continues from the octave position
where the previous step ended. One exception to this: The "+" code causes
that channel to repeat from the initial octave position.
Click box "Insert" to add a new ADR+ step at the underline. The
current step and following are automatically shifted to the right by one
position, and "A1" appears at the inserted step. No insert if the line is
full.
Click box "Delete" to erase the ADR+ step at the underline. All
following steps to the right are moved left by one position, thereby filling
in the erased step. No delete if only a single step remains in position 1.
The "Cycle" box is located to the right of the "Key" boxes. For Cycle
Default = N, the scales play through all steps, and then playing stops.
When click in box for Y, playing repeats until you click "STOP Play". Click
in box to alternate Y, N, Y...
Tempo Slider: Slide the pointer in the tempo box to determine the tempo
(note duration) of the base scale(s), which have Time setting of 1/1.
Can set tempo to any value between .50 sec (slowest) -- .10 (fastest).
The tempo slider can be reset while playing; the new tempo takes effect
after completing the current octave for a base time (1/1) scale.
Starting Note: The first note of a scale is not restricted to the root
note of that scale. Take the key of C, for example:
Select C for the first note, giving the usual major scale.
Can select the first note to be D, E, F, G, A, B.
For example, first note A plays the A minor scale.
For 2 scales, first notes C and E play the scales in 3rds.
For 3 scales, first notes C, E, G play the scales in triads.
Of course there are many other possible combinations.
Timing Footnote: When the Time setting for all channels is 1/1, the scales
play normally, a smooth flow of notes; notes per octave: 8, 7, 7, 7,...
This doesn't work for Time 1/2, 1/4. The fix: all octaves play 8 notes, by
repeating the last note of previous octave as first note of next octave.
GETTING STARTED
You can use the Menu, Load option, to enter these examples from directory
Start. Or you can click-enter these if they are not available.
We'll use the key of C for these. Try out the tempo and cycle options.
Start1 This is the initial start-up scale.
0-C-4-1/1-A1 (= channel 0, note C, octave 4, time 1/1, step A1)
C major scale starting at middle C, ascending 1 octave.
Start2
0-C-3-1/1-A2-D2 C major scale starting 1 octave below middle C,
ascending 2 octaves, descending 2 octaves.
Start3
0-C-2-1/1-A3-D3 Two hands, parallel octaves, ascending and descending
1-C-3-1/1-A3-D3 3 octaves.
Start4
0-C-3-1/1-A2-D2 Two hands, interval of a third, ascend/descend 2 octaves
1-E-3-1/1-A2-D2
Start5
0-C-4-1/1-D2-A2 Counter scales--simultaneous descend/ascend, reverse
1-C-4-1/1-A2-D2
Start6
0-C-3-1/1-A1-D1 Chan 0 ascend/descend 1 octave, while chan 1 simultan-
1-C-4-1/2-A2-D2 eously ascend/descend 2 octaves.
Start7
0-C-4-1/1-A1-D1-A1-D1 Chan 0 alone asc/des 1 octave, then joined by
1-E-3-1/1-R2-A1-D1 chan 1 playing the interval of a third, one octave
lower.
Start8
0-C-3-1/1-A2-D2 Three hands, triads, ascend/descend 2 octaves
1-E-3-1/1-A2-D2
2-G-3-1/1-A2-D2
Start9
To the preceding example add --
3-C-6-1/4-D1-+ Adds a "counterpoint" effect, a rapidly repeating
descending scale in a high octave.
Start10
0-C-3-1/1-A1-D1-A1-D1-A1-D1 Chan 0 alone to start, joined by chan 1,
1-E-4-1/1-R2-A1-D1-A1-D1 and then joined by chan 2.
2-G-3-1/1-R4-A1-D1
Start11
To the preceding example add--
3-C-5-1/2-A1-D1-+ Giving another "counterpoint" effect (a bit much?)
TIMING 1/2, 1/4 CAVEAT
When using time value 1/2, you need to specify pairs of octaves to
be played, because this channel plays 2 octaves to each single octave for a
1/1 channel. Here is an example with a problem:
Chan 0, time 1/1, step A1 = ascend 1 octave
Chan 1, time 1/2, step D1 = descend 1 octave
The problem? Channel 0 will play, but channel 1 will not. SCALE is
looking for 2 octaves for channel 1. Since there is no second octave, the
Play flag is set to FALSE, and we don't even get the first octave. There
are several possible solutions: Specify 2 octaves, maybe D2 or (D1 A1); or
specify 1 octave and a rest (D1 R1). Or you could follow D1 with the '+'
code, specifying repeat this channel while the other channel is playing.
A similar situation applies to channels with time value 1/4: either
specify octaves in groups of 4, or follow the last play step with '+'.
ACKNOWLEDGMENT
A. SCALE uses Rob Peck's AudioTools software package for interfacing
with the Amiga sound system. AudioTools first appeared in the Jul/Aug 1987
issue of AmigaWorld magazine, and also appears on Fred Fish disk #94.
B. Also uses Anders Bjerin's FileWindow routine for input/output. This
routine appears on Fred Fish disk #336. THANK YOU Anders!
C. Thanks to KARL RIESEN of Oberrieden, Switzerland for valuable input on
design of the user inferface.
BACKGROUND
It may be appropriate to note that I am a piano player whose training
from the beginning included playing scales. No doubt this early experience
was influential in my choice of SCALE for a first music-playing program.
I like to think of this program as simulating 4 hands on a piano, each
playing an independent scale, a feat clearly beyond all of us with only the
normal allotment of two hands!
I think we can all agree that musical scales, even of some versatility,
will not achieve any significant ranking by most of us as notable music.
However, I do think that this program provides an interesting means to
explore in some variety the possibilities of 4-handed scales; and that a
number of interesting effects, ranging from pleasing to cacophonous, can
be achieved.
Here is a suggestion: SCALE could be used by a skilled recording
technician to contribute a variety of scale input (varying keys, starting
notes, timing, tempo) to a, well, "composite" composition. Limitless
possibilities here for creative talent!
Writing of this program was a learning exercise for me -- learning to work
with AudioTools, including the intricacies of simultaneous multiple
channels. I hope to make use of this learning in more music-playing
programs to come.
PROGRAMMING NOTES
a. SCALE was compiled with Manx Aztec C v. 5.2A:
cc -wn scale.c Main, Display driver
cc -wn scale2.c Note-maker & Interface to AudioTools
cc -wn scale3.c Help module
cc -wn FileWindow.c Anders Bjerin's I/O
cc -wn atool31.c Rob Peck's AudioTools v. 3.1
ln scale.o scale2.o scale3.o FileWindow.o atool31.o -lm -lc
b. AudioTools Background
I made minor modifications to AudioTools in adapting it for the SCALE
program. To play a musical tone, the user specifies the Amiga sound
channel to be used, note pitch, duration, timbre (or wave form), volume.
Pitch range is 8 octaves of 12 notes each, integers 0-95. Pitch 0 is a
very low C. Middle C is 36. Pitch 95 is very high . Note duration is
specified in units of 1/1000th sec. For example, duration 500 = .5 sec.
SCALE uses just one timbre, a sawtooth wave form. SCALE plays all notes
at volume 50 (AudioTools volume range is 0-64).
The program checks whether the machine in use is NTSC (American) or PAL
(European). The variable "TicksPerSec" is set accordingly:
NTSC -- 3,579,545 PAL -- 3,546,895
This is used in routine SetCycles, to calculate note duration.
A significant problem during program development: For the same duration,
low note playing time was slightly less than for high notes. This caused
simultaneous high/low scales very quickly to become non-synchronized.
I have made a fix for this: In AudioTools routine SetCycles, the
calculation of "cycles" is now rounded. This makes a major improvement in
timing synchronization.
c. Timer Device
SCALE uses the Timer to keep the sounds synchronized. Here is the
sequence of events (assume all times 1/1):
A. Calculate, but don't play yet, the pitch/volume for 1 octave of
notes for each channel. Save these in an array.
B. Calculate the total time TT needed to play the octave.
C. Start Timer with value TT.
D. Send the notes from array to AudioTools. This plays these notes.
E. While D is playing, calculate and save the next octave of notes.
F. Wait for the Timer. When signal received, repeat from C.
Exit the C-D-E-F loop when no more to be played. For times 1/2 and 1/4, we
calculate 2 and 4 octaves respectively in A and E. There is a small break
in flow of notes between octaves. I have minimized this break by using
a "Timing Fudge Factor", a small value subtracted from the time value
sent to the Timer.
PUBLIC DOMAIN
SCALE is hereby declared to be a public domain program.
CORRESPONDENCE
I would like to hear your comments about SCALE, and your SCALE
"compositions" -- just send me a postcard. I also would like
to hear from users of AudioTools. Subsequent to Rob Peck's untimely death,
has anybody assumed responsibility for further development of AudioTools?
Dick Taylor Tel. (203) 633-0100
99 Valley View Rd.
Glastonbury CT 06033-3621 USA