*! version 1.0.0 04jul2016

Title

composer -- Write music from Stata

Syntax

Write music from the command line

composer
notelist
using filename
[, options]

Write music from data in memory

composer
varlist
using filename
[, options]

where notelist is a string that takes the form

[duration]note[octave] [, [duration]note[octave], ...]

meaning

duration note length in ticks (default 384)

note note name

octave note octave (default 5)

Main
instrument("intrument list") set instrument

replace overwrite existing file

play play file using shell command

Description

composer writes a midi file containing the notes and note information
specified in the command line or in variables.

Command Line Syntax

notelist is a string of notes with information related to pitch and
length of play. Revist the previous syntax

[duration]note[octave] [, [duration]note[octave], ...]

duration and octave are both optional; when unspecified, they
take the value of 384 for duration and 5 for octave. note is the
only part that is necessary.

Successive notes are separated by commas: C, D, E, F, G

Variable List Syntax

The main difference between command line and variable list syntax is that
the variable list sytax requires duration and octave variables to be
specified. All variables must be specified in order

duration note octave [duration note octave [...] ]

Each set of three variables corresponds with a voice or track, meaning that
multiple notes can be played at the same time. You must use this syntax
if you wish to build chords.

Options

Main

instrument("instrument list") picks the instrument for playback.
For multiple tracks, instruments can be selected in sequence: "Piano
Violin Guitar". For advanced syntax, numbers may also be used "1 41 32"

replace replaces file if it already exists

format plays the file using the shell command. If this does not work
you must play the file by hand.

Reference Tables

Notes and Equivalents

Notes Equivalent

C
C# Db
D
D# Eb
E
F
F# Gb
G
G# Ab
A
A# Bb
B
r * Rest

Instrument Names and Codes

Instrument Numeric Code

Piano 1
Harpsichord 7
Glockenspiel 10
Marimba 13
Xylophone 14
Bells 15
Organ 17
Harmonica 23
Accordion 24
Guitar 25
ElectricGuitar 27
AcousticBass 33
ElectricBass 34
SynthBass 39
Violin 41
Viola 42
Cello 43
Contrabass 44
Strings 45
Pizzicato 46
Harp 47
Timpani 48
ChoirA 53
ChoirO 54
Voice 55
Trumpet 57
Trombone 58
Tuba 59
FrenchHorn 61
Brass 62
Sax 65
Oboe 69
Bassoon 71
Clarinet 72
Flute 74

Remarks

A little music knowledge goes a long way.

Examples

. composer "D, *.5F#, A4, 768D6" using myfile.mid

. composer duration note octave using myfile.mid

. composer d1 n1 o1 d2 n2 o2 using myfile.mid, instrument("Violin Piano")

Author

William M. Matsuoka