XEROX KEYBOARDTOOL 2 4 1 KeyboardTool 1 4 By: Matt Lindenfelser (Lindenfelser.pasa@Xerox.com) The Keyboard Tool provides an convenient method for composing and modifying tunes playable by the PlayTune function. While this tool is too simple to be considered a real composer's assistant, it is powerful and convenient enough to have a little fun with. Using the Keyboard Tool Load the file KEYBOARDTOOL.DCOM and type the command: (KEYBOARD ). should be the name of a PLAYTUNE-formatted list, i.e., a list of dotted pairs of the form (Frequency . Duration) or (NIL . Duration). If is not given, you will be starting with a clean slate. In either case, the keyboard window should pop up on the screen. Description There are four modes in which you can use the Keyboard Tool: PianoMouse, PianoKeys, OrganMouse, and OrganKeys. In all modes, the Keyboard Tool creates a window containing three octaves of keys. Each time one of these keys is pressed, a cursor in the form of a musical note will jump to proper note in the window. The window's title bar changes to indicate the mode you are in and other information about Keyboard's state (current octave, etc.) The blank window attached to the top of Keyboard's window is the Score Window. When the score maintenace functions are enabled (see Score On below), the program displays notes as they are played. The representation of notes follows the Mesa Play package format rather closely, with the exception that rests are represented by R's instead of percent signs. Various prompts also appear in the Score Window in the course of Keyboard's execution. In the Keys modes, notes are played by pressing buttons on the keyboard and only one octave is active at a time. The keys corresponding to the active octave are as follows: wo;Gu^[mo.[n7ovmo{ǜW???????????????????????????????????????????????????????????????????<<s;=s 99s9999s99s;=s<<s??????~~``````````````````````````````````````a0 ` `q8`` `y<<``i4,```m6l`3`g3``c1``c1``a0 8``a0 p`3 ``0 `q@``@``````````p<<~~?? Additional active keys are: : moves down an octave : moves up an octave In the Mouse modes, all three octaves are active at once and may be played by pressing the left mouse button over the desired key. The left and right shift keys function in a manner similar to the Keys modes. In all, there are eight octaves which can be used to compose melodies with the Keyboard Tool, ranging from two octaves below, to five octaves above middle C. Piano Mode Piano mode is the more useful of the two modes. It allows you to store and play back the tune you are composing. Several keys (in addition to the active keys above) are active in piano mode: : changes the "style" of notes played (Slurred when pressed and Distinct when released.) <1, 2> : changes the beat of notes played. 1 doubles the duration, 2 halves the duration. Legal beats range from 1/64 notes to whole notes. : plays a rest in the current beat and style. : erases the last note played. , : used for producing dotted notes. Holding one of them down while a note is played produces a single-dotted note, and holding both down results in a double-dotted note (represented in the Score Window as a note followed by one or two plus signs (+), respectively. : halves the duration of the note which is played while it is pressed. Thus, if the current beat is 1/4, playing a note while pressing <-> will result in an eighth note. The title bar of Piano Mode's window contains the following information: Octave: the octave in which the last note was played. Octave 0 is the middle octave. Style: the current style of notes being played: either Slurred or Distinct. Beat: the current beat of notes being played: ranges from 1/64 to 1/1. Play Mode: indicates whether Keyboard is in Mouse or Keys mode. Score: indicates whether score maintenance functions are on or off. Length: the length (in notes) of the current tune. Length includes rests. #: the position in the tune of the last note played by Playback. Position of the first note is 1. There is a menu associated with Piano mode (it pops up when the Middle mouse button is hit) which allows you change the beat and the tempo of the notes you are playing and manipulate the melody you are composing. Its items are: Beat: allows you to select the duration of notes. Options range from 1/64 to whole notes. The cursor changes to match the current beat. Edit: lets you specify a note in the current tune to edit. This is very useful for adding or changing notes in the middle of the tune, especially if it's a long one. The section selected replaces the parent tune in the score window and stays there until Quit is selected. The edited section then returns to its place in the parent tune. Subitems Starting with... and Ending with... allow you to specify multi-note sections of the parent tune to edit. Reset: resets the current tune to its state at the beginning of the edit session. Equivalent to WIPEOUT! when the initial tune was no tune at all. Load: lets you load a tune into Keyboard to be edited. The tune may be a list of dotted pairs (playable by Playtune) or a string of characters in the Mesa Play package format with R's substituting for percent signs. The loaded tune is appended to the tune currently being edited. Save: saves the tune currently being edited in a list for which you supply a name. Playback: allows you to play back your melody. Choosing Playback plays back the entire melody; subitems Last and First play back the last or first N notes played by the user. You are prompted for N in the Prompt Window. Playback may be aborted by hitting the left mouse button. The # item in the title bar is updated after Playback is done. Accelerate: doubles the speed of the tune. Subitem Faster does the same thing and subitem Slower halves the speed. Tunes with very fast or very slow notes may become "warped" by this process, since there is a limit to the range of beats allowed in Keyboard. WIPEOUT!: erases the current melody. Subitems Last and First erase the last or first N notes of the current melody. Organ: switches you into Organ mode. The tune in progress will not be affected by this item or by any action performed in Organ mode (short of killing the program.) Mouse or Keys Mode: switches you between Mouse and Keys modes. Score Off or Score On: switches score maintenace functions on or off. Print Score: prints the score of the current tune. Subitems Last and First print the last or first N notes of the score of the current melody. Quit: gets you out of the current edit session. If the current tune is not the result of the Edit command, Keyboard Tool asks you if you want to save your new tune and then gets you out of Keyboard completely. Your tune, a list of cons cells, will be bound to the name you supply after the program run and may be played using PLAYTUNE. Organ Mode Organ mode cannot be used to build the lists of notes that comprise tunes, but it is more flexible than piano mode in one sense; you are not restricted to one small set of styles or beats in organ mode. Notes play continuously when held down, much as they do on real organs. Organ mode's menu is accordingly simple: the Piano item switches you to piano mode, the Mouse or Keys Mode item switches you between Mouse and Keys modes, and the Quit item works the same as its Piano mode counterpart. It also pops up when the Middle mouse button is hit. Notes Keyboard pretty much monopolizes the processor. While this makes it a bad neighbor for other processes, it greatly improves the program's response time. I put a 500 ms block in each of the modes as the Right mouse button action to offer other processes a brief shot at the processor. Owing (I believe) to the limits of the hardware, only monophonic music is possible through the Play package. Thus, chords and other polyphonic devices are impracticeable on the 1100's. Play Documentation (not completely applicable) Input to Play is a string, either given in the tool window or taken from the current selection, interpreted as follows: A letter from "A" through "G" specifies a note. If the letter is followed by "#" then the corresponding sharp-note is played (meaningful only for C, D, F, G, and A). All notes are eighth-notes, but upper-case letters cause tones that are "held" the full time while lower-case notes last for 3/64 seconds less and followed by a 3/64 rest. C is the bottom of the octave; B is above C. When ">" is encountered, all subsequent notes are an octave higher; a "<" lowers all subsequent notes by an octave. Going up more than 3 octaves is not permitted (additional ">"s are ignored), and notes near the top of the highest octave may not be struck accurately. A "/" in the string halves the note durations, down to a minimum of 64th-notes; a "*" doubles the durations up to a maximum of full-notes. A lower-case 1/16th-note would actually be a 64th-note followed by a 3/64 rest, which may or may not be what you want; a lower-case 32nd-note vanishes completely! To halve and double the amount of implicit rest "stolen" from lower-case notes, use "_" and "^", respectively. Use "%" to get an explicit rest (as distinct from the implicit ones after lower-case notes). The rest is the same length as a note, i.e., initially an eighth-rest, and changed via "/" and "*". A "+" causes the preceding note to be held for an extra 50%. Thus a quarter-note followed by a "+" becomes a 3/8-note, etc. A "-" causes the preceding note's duration to be halved. This is effectively a shorthand for bracketing the note with "/" and "*". A left parenthesis causes subsequent notes and explicit rests to be at 2/3 normal duration, until a right parenthesis is reached. Three notes enclosed in parentheses yield a "triplet". If you think you know exactly what tempo you want, use "@" to give the note duration and/or "," for the lower-case implicit rest, where and are strings of digits representing milliseconds. The values will be constrained to the usual limits (e.g., will be forced between 8 and 1024 ms). Subsequent "*", "_", etc., have their usual effects.(LIST ((PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC ) STARTINGPAGE# 1) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC )) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 528 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))) (PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC )) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC )) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 528 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))) (PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC )) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC )) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 528 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL)))))(x (H ( ((8(8D PAGEHEADING RUNNINGHEADMODERN MODERN MODERN MODERNLOGO  HRULE.GETFNMODERN  HRULE.GETFNMODERN  HRULE.GETFNMODERN   HRULE.GETFNMODERN  HRULE.GETFNMODERN 5g  BMOBJ.GETFN3    +  )I 2 #!IOGC 7?DbZG]+Ob (!(8 - 1 2E[ .& 9jxT;f6#z