XEROX MUSICKEYBOARD 2 4 1 MUSIC KEYBOARD 1 4 By: Matt Lindenfelser (Lindenfelser.pasa @ Xerox.ARPA) INTRODUCTION MusicKeyboard provides a 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. MusicKeyboard pretty much monopolizes the processor. While this makes it a bad neighbor for other processes, it improves the program's response time. I put a 500 ms block in as the right mouse button action to offer the user brief opportunities to do things with other processes, but if you want to do any serious work, it's best to make MusicKeyboard inactive, (by invoking the PAUSE menu item or shrinking MusicKeyboard's window), or turn MusicKeyboard off completely (by closing the window or selectingthe QUIT item.) STARTING THE MUSIC KEYBOARD Load the file MUSICKEYBOARD.DCOM and type the command: (STARTKEYBOARD ). should be the name of a PLAYTUNE-formatted list, i.e., a list of dotted pairs of the form (Frequency . Duration) or (NIL . Duration), created by MusicKeyboard or a similar package (like Play). If is NIL, you will be starting with a clean slate. In either case, the keyboard window should pop up on the screen. THE SCORE WINDOW The blank window attached to the top of MusicKeyboard's window is the Score Window. When the score maintenance 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. MODES There are two instrument modes in which you can use MusicKeyboard , Piano and Organ, and two playing modes, Keys and Mouse. These modes may be set using the middle mouse button menu described below. In all modes, MusicKeyboard 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 MusicKeyboard's state (current octave, etc.) Keys Mode In the Keys playing mode, 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: y<mpqm<0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000p00o0O0O0O0G0?O0a0?O0px0?O0x80?@0~0>O0_0? O0_0? O0O0> O0G0O0X800000000?0?0?0?00?00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00~| ~0 0`00  xX0` 0 xX0` 0 `X00d 0 p\0080 8\0`0 @ M080@ O0L0@ O0F`0 G0` 0 G00@0 F00 ~00 00 00 00 00 0pp? Additional active keys are: : moves down an octave : moves up an octave Mouse Mode In the Mouse mode, 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 MusicKeyboard, ranging from two octaves below, to five octaves above the Middle C octave. The Piano Piano mode is the more useful of the two instrument 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. Piano's title bar 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 MusicKeyboard 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. Piano's menu 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: Help: pops up a menu of topics. Selecting one will create a help window about that topic. 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 MusicKeyboard 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. In some cases, when MusicKeyboard can not interpret the tune supplied to it well enough to create a score, it will abort its attempt to do so. Usually, however, the loaded tune will still be playable to some extent. 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 MusicKeyboard. 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. Pause: puts MusicKeyboard into an inactive mode until the mouse is left-buttoned in MusicKeyboard's window. Quit: gets you out of the current edit session. If the current tune is not the result of the Edit command, MusicKeyboard asks you if you want to save your new tune and then gets you out of MusicKeyboard 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 Owing to the limits of the hardware, only monophonic music is possible through the this package. Chords and other polyphonic devices are not possible on 11XX's.(LIST ((PAGE NIL (FOLIOINFO (ARABIC) STARTINGPAGE# 1) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF SLOPE REGULAR WEIGHT MEDIUM) FORMATINFO (ARABIC)) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 444 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))) (PAGE NIL NIL (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF SLOPE REGULAR WEIGHT MEDIUM)) (282 42 72 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 444 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))) (PAGE NIL NIL (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF SLOPE REGULAR WEIGHT MEDIUM)) (282 42 72 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 444 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))))).<~ ~( ( ((8(8D PAGEHEADING RUNNINGHEADMODERN MODERN MODERN MODERN MODERNLOGO HRULE.GETFNMODERN  HRULE.GETFNMODERN  HRULE.GETFNMODERN  HRULE.GETFNMODERN  HRULE.GETFNMODERN 9 q  BMOBJ.GETFN3     )  'I 1 !!IOFB =>Da UZG\+Nb )!(8 . 2 2EdZ .& 9j/z