Debian Codegraph @

demos/programs/piano/README

raw
1 /* $XConsortium: README /main/3 1996/07/15 14:07:33 drk $ */
2
3 Piano V2
4 ---------
5
6 The Piano demo shows how one might write a MIDI (MOTIF INTERFACE to
7 DUMB INSTRUMENTS) application. Both a staff, for writing music, and
8 keyboard are provided. Piano is a musical demo that allows multiple
9 voices to be played by connecting to other displays. It also provides
10 the capability to save and restore voices.
11
12 When running the program, you can either play the keyboard directly by
13 'tickling the ivories' using Button1, or you can enter notes by
14 pressing Button 1 on the staff and depositing the active note
15 specified by the cursor. To change the active note, select another
16 note or rest in the pallet at the bottom. The selected note will be
17 displayed as the new mouse cursor.
18
19 Though the note selection is limited, it is possible to play sharps as
20 well as naturals. The interface isn't advanced enough to handle
21 flats. Note that E# will play as F and B# will play as C.
22
23 The staff will automatically resize larger as notes are added past the
24 right side of the staff. To see these notes, scroll the score window
25 as needed.
26
27 If you wish to delete a note in the staff, press Button2 over the
28 note. The note will disappear and the notes to the right will shift
29 over.
30
31 Pressing Button3 over the staff will display a popup menu associated
32 with this staff. It contains the following items:
33
34 Add Voice - This function is used to connect another
35 display to a new staff. After selecting this
36 command, you will be prompted for the display
37 to connect. Any music written in the new staff
38 will play to this display. Note that pressing
39 the right mouse button on the new staff will show
40 the name of the display in the menu's title.
41 In addition, this menu's commands will relate
42 to this staff.
43 The new staff will be added to the bottom of the
44 score and it may be necessary to scroll down to
45 make it visible.
46 Remove Voice - Removes a staff and voice from the score. There
47 is no undo for this command - all music written
48 in this staff will be deleted.
49 Clear Voice - Removes all notes in a staff. This will not
50 effect the display connection.
51 Play Voice - Plays the notes in the selected staff. If the
52 resource, useKeyboard, is set to True, which is
53 the default, the keyboard will play along.
54 Play All - Plays all voices in the score together.
55 Save Voice - Saves the selected voice to a file. A
56 FileSelectionDialog will be displayed to prompt
57 for the name of the file in which to save the
58 voice. The display connection information is
59 not saved.
60 Load Voice - Loads a voice from a file. This will append
61 to any existing notes in the voice.
62
63
64 Piano also supports the following resources:
65
66 baseDuration - sets the duration of a quarter note. (msec)
67 Default value = 200
68 baseFrequency - sets the frequency of bottom note. (Hz)
69 Default value = 246.9413
70 useKeyboard - specifies if keyboard should play along.
71 Default value = True
72 wkeyCount - number of white keys on the keyboard.
73 Default value = 28
74 keyHeight - initial height in pixels of the white keys.
75 Default value = 160
76 keyWidth - initial width in pixels of the white keys.
77 Default value = 20
78
79
80
81 Two voices are included with the demo, Inv8_part1.piano and Inv8_part2.piano.
82 These are the two voices of Bach's Invention #8. Try loading these into two
83 voices connected to different displays and play them together.
84
85
86
87 PROBLEMS
88 ========
89
90 - So far, changing the pitches doesn't seem to work on SUN, DEC PMAX3100,
91 and SGI Personal Iris. On the RS6000 and HP700 things should work fine.
92 If XBell() doesn't work correctly on your system change the PlayNote()
93 function as needed.
94
95 -----
96
97 Enjoy,
98 Andrew deBlois