NAME
ditty - Play simple melodies via the built-in speaker, or optionally via the sound card.
SYNOPSIS
ditty [-h] [-k|d] [-t tempo] [-f filename] [note] ...
DESCRIPTION
ditty is an easy-to-use (for people who know anything about elementary music principles) utility for playing melodies from the command-line. A soundcard is not required to make use of this program.
OPTIONS
- -v
-
Display current version
- -h
-
Display usage information
- -k
-
Force ditty to use the console (built-in) speaker. This is the default. I have experienced problems using the console speakers in some terminal emulators (not all terminals support this). This option is unavailable if the console sound feature was disabled at compile-time
- -d
-
Tells ditty to use the soundcard (via /dev/dsp) instead of the console speaker. This is useful on terminals which don't support sound controls. This option is unavailable if soundcard support was disabled at compile-time.
- -t tempo
-
Sets the tempo at which the melody shall be played, in beats per minute.
- -f filename
-
Reads notes from filename. This option may be specified multiple times, to play multiple files. Additionally, the -t option may be used before each instance to set the tempo for each file.
FORMAT
ditty plays a melody based on a whitespace-seperated list of notes, supplied either on the command-line as individual arguments, or supplied from a text file via the -f switch. Notes take on the format:
letter-name[sharp/flat][octave][duration]
(The use of brackets indicates an optional component of the note). These all must be specified in lower-case.
- letter-name
-
One of a, b, c, d, e, f, or g (the letters of the musical alphabet). This component is always requried.
- sharp/flat
-
The letter-name may optionally be followed by either a sharp (#) or a flat (b).
- octave
-
A number from 1 to 5, specifying which register the note should be played in. Each octave begins at 'c' and ends on 'b'. For example, the default, although you should specify it for the first note of any melody that is stored in a file, as previous values may have changed the current octave (ditty does not reset the octave or current tempo between songs).
- duration
-
The length of the song using the following notation: w for a whole-note (4 beats), h for a half-note (2 beats), q for a quarter-note (1 beat), e for an eighth-note (1/2 a beat), s for a sixteenth-note (1/4 of a beat), and t for a thirty-second note (1/8 of a beat). Note that this notation system assumes a quarter-note is one beat, so if you are transcribing music written in, for example, 2/2, the tempo might more accurately be said to refer to quarter-notes per minute, rather than beats per minute.
These codes may be combined ad infinitum, to achieve the affect of a 'tie', that is, to add their values together. So, a dotted quarter note could be notated as 'qe'. Note that order doesn't matter, so that could just as easily have been 'eq'.
The duration must be specified on the first note of a melody. After that, ditty assumes that you want the last duration specified until you specify another one.
EXAMPLES
- ditty c3e d e f g a b c4
-
plays a C-Major scale
- ditty -t e4e d# e d# e b3 d4 c a3qe
-
plays the first few notes of Beethoven's Fur Elise
- ditty -f notes.dit
-
plays the notes contained in the file notes.dit
AUTHOR
Copyright (C) 2000 Micah Cowan, all rights reserved. This software is licensed under the GNU General Public License, Version 2.