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 >
Text File  |  1992-12-24  |  14KB  |  343 lines

  1.     SCALE Documentation
  2.     Dick Taylor, Glastonbury Connecticut USA   November 1992
  3.  
  4. WHAT DOES IT DO?
  5.  
  6. The SCALE program plays from one to four simultaneous musical scales
  7. using the Amiga's 4-channel sound system.  The scales can be played over
  8. a six octave range, in several tempos.  For each channel, the scale is
  9. specified as a series of steps, where each step can be ascending or
  10. descending, from 1 to 4 octaves.  All user input (Intuition interface) 
  11. for specifying the scales is made via click-buttons and a tempo slider.
  12.  
  13.  
  14.  
  15. HOW TO USE
  16.  
  17. In WorkBench, double-click the SCALE icon.
  18.  
  19. Or, in CLI/Shell, enter--
  20.  
  21.     scale
  22.  
  23. This presents the user interface screen, initialized with a single scale to
  24. be played:  Starting at middle C, ascend one octave.  Refer to the
  25. on-screen HELP feature, first two screens, for introductory details on this
  26. first scale.  At the lower right screen corner, click "PLAY" to start
  27. playing.  Click "QUIT" to return to the system.  The following material
  28. explains the full details of specifying the scales to be played.
  29.  
  30. If WorkBench icon execution does not work, try CLI/Shell.  There are
  31. several error messages (trouble with Intuition library or Window, for
  32. example) that can appear only when running from CLI/Shell.  Most of the
  33. error messages do appear when run from icon.
  34.  
  35.  
  36.  
  37. MENU
  38.  
  39. There is a single menu named "Project".  You can select --
  40.  
  41. Help    On-line introduction to SCALE.
  42. Load    To load a previously saved scale specification.
  43. Save    To save a scale specification.
  44.     ("Scale Specification" = specs for 4 chan's)
  45. About    Program author
  46. Quit    Return to system
  47.  
  48.  
  49.  
  50. SPECIFYING THE SCALES
  51.  
  52. The four Amiga sound channels are designated 0, 1, 2, 3.  May use any of
  53. these channels, in any combination wanted.  Channels 0, 3 use the left
  54. speaker; channels 1, 2 use the right speaker.  The current scale
  55. specifications are displayed in a table across the top of the screen.
  56.  
  57. Key:  There is one key that applies to all 4 scales.  Controlled by the key
  58. box, near mid-screen below the table.  Click in box to cycle through keys
  59. C D E F G A B C...  Click adjacent box to cycle through _ (= blank), #,
  60. b (= flat).  No # for keys of B, E.  No b for keys of C, F.
  61.  
  62. Channel controls:
  63.     1-  Table boxes Clear, Chan, N (=Note), O (=Octave), T(=Time).
  64.     2-  Below the table, ADR+ Edit controls -- 6 boxes.
  65.  
  66. Select a channel by clicking one of the "Chan" boxes 0-3.  Then clicks
  67. on channel controls apply to that selected channel, until a different
  68. channel is picked.  The currently selected channel is indicated by an
  69. enclosing orange box.
  70.  
  71.     Note -- Click in box to cycle through C D E F G A B C... to pick
  72. the first note of the scale.  The usual scale begins on same note as the
  73. key, but any first note can be used.  More on this choice later.  No sharp
  74. / flat notation used here; a sharp / flat is automatically used as needed
  75. for the selected key.
  76.  
  77.     Octave -- Click in box to cycle through 1 2 3 4 5 6 1...  Octave 1
  78. is very low; octave 6 is very high.  For key of C, with first note C, 
  79. octave 4 starts at middle C.  Please note an AudioTools idiosyncrasy here:
  80. the lowest note of a specified octave is C.  For example, the lowest note
  81. of octave 4 is middle C.  The adjacent lower note, B, is octave 3.  This
  82. can be just a little confusing at times.
  83.  
  84.     Time -- Notation 1/1 chosen to represent the base time, which is
  85. controlled by the Tempo slider (see following).  Notation 1/2 means twice
  86. as fast, or note time values one-half of the base time; 1/4 means four times
  87. as fast, or note time values one-fourth of the base time.  Click in box to
  88. cycle through 1/1, 1/2, 1/4, 1/1...  For normal usage, always keep at least
  89. one channel at the base time of 1/1.
  90.  
  91.     Clear -- Click in box to erase this channel; cleared channels
  92. do not play any scale.
  93.  
  94. ADR+ Edit:  Up to 14 steps may be used to specify the scale components for
  95. each channel.  The double-arrow underline (^^) shows the current edit step.
  96. Click the right arrow box (>) to add a step, or to move edit one step to
  97. the right.  Click the left arrow box (<) to move edit one step to the left.
  98. Choices for each step:
  99.  
  100. Click in box to cycle A, D, R, +, A...
  101.     A -- ascending scale (up)
  102.     D -- descending scale (down)
  103.     R -- rest (don't play)
  104.     + -- repeat from first step
  105.  
  106.     Following A, D, R -- digit 1-4 telling how many sequential octaves
  107. to play, or for R, to rest.  Click box '1-4' to cycle 1, 2, 3, 4, 1...
  108. ASSUMPTION:  Each step after the first continues from the octave position
  109. where the previous step ended.  One exception to this:  The "+" code causes
  110. that channel to repeat from the initial octave position.
  111.  
  112.     Click box "Insert" to add a new ADR+ step at the underline.  The
  113. current step and following are automatically shifted to the right by one
  114. position, and "A1" appears at the inserted step.  No insert if the line is
  115. full.
  116.  
  117.     Click box "Delete" to erase the ADR+ step at the underline.  All
  118. following steps to the right are moved left by one position, thereby filling
  119. in the erased step.  No delete if only a single step remains in position 1.
  120.  
  121. The "Cycle" box is located to the right of the "Key" boxes.  For Cycle
  122. Default = N, the scales play through all steps, and then playing stops. 
  123. When click in box for Y, playing repeats until you click "STOP Play".  Click
  124. in box to alternate Y, N, Y...
  125.  
  126. Tempo Slider:  Slide the pointer in the tempo box to determine the tempo
  127. (note duration) of the base scale(s), which have Time setting of 1/1.
  128. Can set tempo to any value between .50 sec (slowest) -- .10 (fastest). 
  129. The tempo slider can be reset while playing; the new tempo takes effect
  130. after completing the current octave for a base time (1/1) scale.
  131.  
  132. Starting Note:  The first note of a scale is not restricted to the root
  133. note of that scale.  Take the key of C, for example:
  134.  
  135.     Select C for the first note, giving the usual major scale.
  136.  
  137.     Can select the first note to be D, E, F, G, A, B.
  138.         For example, first note A plays the A minor scale.
  139.  
  140.     For 2 scales, first notes C and E play the scales in 3rds.
  141.  
  142.     For 3 scales, first notes C, E, G play the scales in triads.
  143.  
  144. Of course there are many other possible combinations.
  145.  
  146. Timing Footnote:  When the Time setting for all channels is 1/1, the scales
  147. play normally, a smooth flow of notes; notes per octave: 8, 7, 7, 7,...
  148. This doesn't work for Time 1/2, 1/4.  The fix: all octaves play 8 notes, by
  149. repeating the last note of previous octave as first note of next octave.
  150.  
  151.  
  152.  
  153. GETTING STARTED
  154.  
  155. You can use the Menu, Load option, to enter these examples from directory
  156. Start.  Or you can click-enter these if they are not available.
  157.  
  158. We'll use the key of C for these.  Try out the tempo and cycle options.
  159.  
  160. Start1        This is the initial start-up scale.
  161. 0-C-4-1/1-A1  (= channel 0, note C, octave 4, time 1/1, step A1)
  162.            C major scale starting at middle C, ascending 1 octave.
  163.  
  164. Start2
  165. 0-C-3-1/1-A2-D2    C major scale starting 1 octave below middle C,
  166.            ascending 2 octaves, descending 2 octaves.
  167.  
  168. Start3
  169. 0-C-2-1/1-A3-D3    Two hands, parallel octaves, ascending and descending
  170. 1-C-3-1/1-A3-D3    3 octaves.
  171.  
  172. Start4
  173. 0-C-3-1/1-A2-D2    Two hands, interval of a third, ascend/descend 2 octaves
  174. 1-E-3-1/1-A2-D2
  175.  
  176. Start5
  177. 0-C-4-1/1-D2-A2    Counter scales--simultaneous descend/ascend, reverse
  178. 1-C-4-1/1-A2-D2
  179.  
  180. Start6
  181. 0-C-3-1/1-A1-D1    Chan 0 ascend/descend 1 octave, while chan 1 simultan-
  182. 1-C-4-1/2-A2-D2    eously ascend/descend 2 octaves.
  183.  
  184. Start7
  185. 0-C-4-1/1-A1-D1-A1-D1   Chan 0 alone asc/des 1 octave, then joined by 
  186. 1-E-3-1/1-R2-A1-D1      chan 1 playing the interval of a third, one octave
  187.             lower.
  188.  
  189. Start8
  190. 0-C-3-1/1-A2-D2    Three hands, triads, ascend/descend 2 octaves
  191. 1-E-3-1/1-A2-D2
  192. 2-G-3-1/1-A2-D2
  193.  
  194. Start9
  195. To the preceding example add --
  196. 3-C-6-1/4-D1-+     Adds a "counterpoint" effect, a rapidly repeating
  197.            descending scale in a high octave.
  198.  
  199. Start10
  200. 0-C-3-1/1-A1-D1-A1-D1-A1-D1  Chan 0 alone to start, joined by chan 1,
  201. 1-E-4-1/1-R2-A1-D1-A1-D1     and then joined by chan 2.
  202. 2-G-3-1/1-R4-A1-D1
  203.  
  204. Start11
  205. To the preceding example add--
  206. 3-C-5-1/2-A1-D1-+    Giving another "counterpoint" effect (a bit much?)
  207.  
  208.  
  209.  
  210. TIMING 1/2, 1/4 CAVEAT
  211.  
  212. When using time value 1/2, you need to specify pairs of octaves to
  213. be played, because this channel plays 2 octaves to each single octave for a
  214. 1/1 channel.  Here is an example with a problem:
  215.  
  216.    Chan 0, time 1/1, step A1  = ascend 1 octave
  217.    Chan 1, time 1/2, step D1  = descend 1 octave
  218.  
  219. The problem?  Channel 0 will play, but channel 1 will not.  SCALE is
  220. looking for 2 octaves for channel 1.  Since there is no second octave, the
  221. Play flag is set to FALSE, and we don't even get the first octave.  There
  222. are several possible solutions:  Specify 2 octaves, maybe D2 or (D1 A1); or
  223. specify 1 octave and a rest (D1 R1).  Or you could follow D1 with the '+'
  224. code, specifying repeat this channel while the other channel is playing.
  225.  
  226. A similar situation applies to channels with time value 1/4:  either
  227. specify octaves in groups of 4, or follow the last play step with '+'. 
  228.  
  229.  
  230.  
  231. ACKNOWLEDGMENT
  232.  
  233. A.  SCALE uses Rob Peck's AudioTools software package for interfacing
  234. with the Amiga sound system.  AudioTools first appeared in the Jul/Aug 1987
  235. issue of AmigaWorld magazine, and also appears on Fred Fish disk #94.
  236.  
  237. B.  Also uses Anders Bjerin's FileWindow routine for input/output.  This
  238. routine appears on Fred Fish disk #336.  THANK YOU Anders!
  239.  
  240. C.  Thanks to KARL RIESEN of Oberrieden, Switzerland for valuable input on
  241. design of the user inferface.
  242.  
  243.  
  244.  
  245. BACKGROUND
  246.  
  247. It may be appropriate to note that I am a piano player whose training
  248. from the beginning included playing scales.  No doubt this early experience
  249. was influential in my choice of SCALE for a first music-playing program.
  250. I like to think of this program as simulating 4 hands on a piano, each 
  251. playing an independent scale, a feat clearly beyond all of us with only the
  252. normal allotment of two hands!
  253.  
  254. I think we can all agree that musical scales, even of some versatility,
  255. will not achieve any significant ranking by most of us as notable music.
  256. However, I do think that this program provides an interesting means to
  257. explore in some variety the possibilities of 4-handed scales; and that a
  258. number of interesting effects, ranging from pleasing to cacophonous, can
  259. be achieved.
  260.  
  261. Here is a suggestion:  SCALE could be used by a skilled recording
  262. technician to contribute a variety of scale input (varying keys, starting
  263. notes, timing, tempo) to a, well, "composite" composition.  Limitless
  264. possibilities here for creative talent!
  265.  
  266. Writing of this program was a learning exercise for me -- learning to work
  267. with AudioTools, including the intricacies of simultaneous multiple
  268. channels.  I hope to make use of this learning in more music-playing
  269. programs to come.
  270.  
  271.  
  272.  
  273. PROGRAMMING NOTES
  274.  
  275. a. SCALE was compiled with Manx Aztec C v. 5.2A:
  276.     cc -wn scale.c        Main, Display driver
  277.     cc -wn scale2.c        Note-maker & Interface to AudioTools
  278.     cc -wn scale3.c        Help module
  279.     cc -wn FileWindow.c    Anders Bjerin's I/O
  280.     cc -wn atool31.c    Rob Peck's AudioTools v. 3.1
  281.     ln scale.o scale2.o scale3.o FileWindow.o atool31.o -lm -lc
  282.  
  283. b. AudioTools Background
  284.  
  285. I made minor modifications to AudioTools in adapting it for the SCALE
  286. program.  To play a musical tone, the user specifies the Amiga sound
  287. channel to be used, note pitch, duration, timbre (or wave form), volume. 
  288. Pitch range is 8 octaves of 12 notes each, integers 0-95.  Pitch 0 is a
  289. very low C.  Middle C is 36.  Pitch 95 is very high .  Note duration is
  290. specified in units of 1/1000th sec.  For example, duration 500 = .5 sec. 
  291. SCALE uses just one timbre, a sawtooth wave form.  SCALE plays all notes
  292. at volume 50 (AudioTools volume range is 0-64).
  293.  
  294. The program checks whether the machine in use is NTSC (American) or PAL
  295. (European).  The variable "TicksPerSec" is set accordingly:
  296.      NTSC -- 3,579,545     PAL -- 3,546,895
  297. This is used in routine SetCycles, to calculate note duration. 
  298.  
  299. A significant problem during program development:  For the same duration,
  300. low note playing time was slightly less than for high notes.  This caused
  301. simultaneous high/low scales very quickly to become non-synchronized.  
  302. I have made a fix for this:  In AudioTools routine SetCycles, the
  303. calculation of "cycles" is now rounded.  This makes a major improvement in
  304. timing synchronization.
  305.  
  306. c. Timer Device
  307.  
  308. SCALE uses the Timer to keep the sounds synchronized.  Here is the
  309. sequence of events (assume all times 1/1):
  310.  
  311.    A. Calculate, but don't play yet, the pitch/volume for 1 octave of
  312.       notes for each channel.  Save these in an array.
  313.    B. Calculate the total time TT needed to play the octave. 
  314.    C. Start Timer with value TT.
  315.    D. Send the notes from array to AudioTools.  This plays these notes.
  316.    E. While D is playing, calculate and save the next octave of notes.
  317.    F. Wait for the Timer.  When signal received, repeat from C.
  318.  
  319. Exit the C-D-E-F loop when no more to be played.  For times 1/2 and 1/4, we
  320. calculate 2 and 4 octaves respectively in A and E.  There is a small break
  321. in flow of notes between octaves.  I have minimized this break by using
  322. a "Timing Fudge Factor", a small value subtracted from the time value
  323. sent to the Timer.
  324.  
  325.  
  326.  
  327. PUBLIC DOMAIN
  328.  
  329. SCALE is hereby declared to be a public domain program.
  330.  
  331.  
  332.  
  333. CORRESPONDENCE
  334.  
  335. I would like to hear your comments about SCALE, and your SCALE
  336. "compositions" -- just send me a postcard.  I also would like
  337. to hear from users of AudioTools.  Subsequent to Rob Peck's untimely death,
  338. has anybody assumed responsibility for further development of AudioTools?
  339.  
  340.     Dick Taylor    Tel. (203) 633-0100
  341.     99 Valley View Rd.
  342.     Glastonbury CT 06033-3621 USA
  343.