I'll make a confession that may shame me in front of my fellow
TurboPascal programmers: I used to enjoy using the Play statement
in GW-BASIC. It provided a pretty sensible way to get a musical
phrase out of a program. Certainly it was easier to use than
TP's Sound command, and much easier to use than the TPW Windows
API calls that deal with musical notes.
Here, then, is WinPlay, a TPW unit that emulates that BASIC
command. It makes it a snap to drop a musical phrase into a TPW
program.
The syntax is simple: just give Play() a string consisting of
note names. Optionally you can specify things like octaves,
tempo, note types (like quarter, sixteenth, etc.), "music" type
(like legato, staccato, and normal), and a few other goodies.
In that Play string:
A..G : are the note names, as if on a keyboard.
P : means pause, or rest.
#,+ : mean sharp the immediately previous note.
- : means flat the immediately previous note.
. : means dot the immediately previous note.
Tnnn : tempo, sets the number of quarter notes in one
minute. Default is T120.
On : octave, sets the current octave, 0 through 6, that the
note names refer to. Default is O4, where C is an
octave above middle C. Pitches in an octave begin at
C and work upwards to B.
Lnn : length, sets the duration of notes that follow. 'n'
usually is a common note type like 8 for eighths, 4
for quarters, 1 for whole notes, etc. It may be any
number. Musician friends will giggle at you if you
program in 15th or 57th notes. 3, 6, and 12 might
commonly be used for triplets, though. Default is L4.
nn : a number following a note name or a pause means 'for
this specific instance only, set a temporary length.'
MS
MN
ML : "music" types of staccato, normal, or legato.
In staccato mode, the pitc
|