NOTES 

Correction! the music editor does not look for notes, but for chords. A single note is just a degenerate chord – but don't let that worry you.

A chord is made of one or more notes, and each note has its pitch. On the other hand, the duration is a property of the chord. Other characteristics which influence the sound heard (in contrast with the written chord) such as volume, timbre, staccato etc., are properties of the voice that plays the chord.

In conclusion, a score may look like:

a,c,e 1/4 d 1/8

consisting of a chord with three pitches a,c,e lasting a quarter, followed by the single pitch d lasting an eighth. In general, the music editor expects such pairs of `pitch(es) duration', separated by blanks. The following sections elaborate on this basic notation.



PITCH

Pitch in midi notation is a small integer, counting the number of semitones from a mythical c five octaves below middle c. In other words, middle c is 60 (5 octaves times 12 semitones) c above it is 72, c below middle c is 48, and all the following are g-s: 43,55,67,79,91 etc. In the compiled score each pitch is a byte, or more precisely a single-byte 7-bit number.

Pitch is specified using the tone name and a digit for the octave:

c5 c#5 d5 d#5 e5 f5

or

c5 db5 d5 eb5 e5 f5

representing

60 61 62 63 64 65

i.e. all the semitones between middle c and f above it, inclusive, using # for sharp (surprise!) and b for flat.

The accidents may appear before or after the octave:

db5 or d5b , f#3 or f3#

but no blanks are allowed in the combination (tone name, accident, octave) . One may also use :

double sharps, ## or x double flats, bb naturals n

The accidents modify one note only! The music editor has no idea of a bar of music or ties, so accidents must be repeated as needed.

Only the tone name must be specified. If the accident is missing, it is taken from the key, e.g. :

key 4b ; a4 b4 c4 d4 e4 f4 g4 a5

is the scale of a flat major , starting with a below middle c. key 4b means exactly what it says: four flats, and there is no conception of major or minor; f minor scale might look:

key 4b ; f5 g5 a5 b5 c5 d5n en5 f6

If the octave is missing, the pitch is chosen to be nearest to the preceding pitch. e.g.:

c5 e means c5 e5 (e above nearer than e below) c5 b means c5 b4 (b below nearer than b above)

and if the notes are six semitones apart, the second is below the first:

c5 f# means c5 f#4 i.e. 60 54

So the two scales shown above could be written as:

key 4b; a4 b c d e f g a f5 g a b c dn en f

It is enough to specify the octave on the first note, and then go to the nearest note with the right name. One may write any digit 0 to 9 for the octave; of course, not all these pitches are audible. There is also a shorthand allowing + and - as an octave, to specify a note above or below the preceding:

c5 g+ = c5 g5 (without + it would have been g4, which is nearer to c5 than g5) c5 d- = c5 d4 c5 d+ = c5 d = c5 d5 (obviously)

Use those freely, especially if you are not 100% sure the interval is a fourth, fifth, or tritone. But don't try ++ to skip more than an octave, it won't work. One more example:

c5,e,g c,g,eb,c

These are two chords, the first a major triad in root position with middle c in the bass, the second a minor triad with middle c in the bass and the root doubled. When chords are written the decision about unspecified octaves is made note by note: e above c5, g above e , c above g, g below c, e flat below g , c below e flat. Each note of a chord must be played by a different voice, so, if voice 2 meets with the line above:

voice 2 plays c5 voice 3 plays e5 simultaneously voice 4 plays g5 simultaneously then voice 2 plays c6 voice 3 plays g5 simultaneously voice 4 plays eb5 simultaneously voice 5 plays c5 simultaneously

Not only this, but voices 3,4,5 remain inactive after doing their part in the chords. They should not have anything to do while the chords are met; after the chords they may be used freely, but must be activated first.

Some more details about chords:

– First of all, they can be strummed (spread, arpeggiated), i.e. the second written note enters a little while after the first, the third note a little while after the second, etc. Spreading is started by the instruction spread; and cancelled by spread 0;

– Secondly, most parameters which influence the actual sound heard (vs. the written note) are copied from the voice that met the chord. In the example above, voices 3,4,5 will have the same volume, duration modifier, transposition, vibrato, etc. as voice 2. The instruments need not be the same, and must be set separately.

– Thirdly, chords are compiled as fake instructions, with variable length to accomodate the variable number of notes in the chord. The duration is also part of the instruction, written as a 7-bit number of variable length.



DURATION

Duration may be expressed straight in jiffies:

c# 35j

or, as is the common usage, as a fraction:

b3b 3/8

The combination `number j' specifies jiffies, and the fractions are what you might expect: whole note 1/1, half note 1/2, etc. The 3/8 written above is a dotted quarter, and triolets might be 1/12, i.e. three to a quarter. You must be able to manipulate fractions to this extent. But, as modern music uses all kinds of crazy subdivisions and ties, there are additional notations to help.

First, you may specify duration as a sum of fractions, e.g. the dotted quarter might be:

b3b 1/4+1/8

a double dotted quarter would be

e 1/4+1/8+1/16

and, actually, anything goes:

fx3 1/3+1/5+1/7

There is also an instruction FIT which fits a group of notes into a duration, so triolets may be written:

fit 1/4 (c 1/8 d 1/8 e 1/8)

In the compiled score, the duration is written as a number of jiffies; it takes one or more bytes, as it is encoded in 7-bit midi notation. The number of jiffies corresponding to a fraction is computed as:

whole * numerator / denominator

where whole is the number of jiffies set by the WHole instruction. All these quantities are integers, and there may be truncation in the division. E.g. :

whole 100 ; c 1/4 d 1/8

will have c lasting 25 jiffies and d lasting 12 jiffies (100*1/8). So two eights do not a quarter make, for this value of whole. This can be fixed using FIT and the related instruction BAR, but it is probably wisest to pick `whole' so it is evenly divisible by whatever is needed. For instance, the default value of whole is 192, which allows sixty-fourth notes and triolets without truncation. In combination with the standard setting of 60 jiffies per second, this produces a rather slow tempo quarter = MM 75.

The duration is actually optional, as are certain parts of the fraction notation. If the duration is omitted, it is taken to be the duration of the previous chord. The default, i.e. the duration before any chord or note has been compiled, is 1/4. A lot of examples appeared in the previous section, where there were written long sequences of pitches, without any durations – all of these are legal, and the chords there will all have the same duration.

In plain fractions, but not in fraction sums, the denominator or numerator may be omitted. An omitted numerator is taken to be one:

c /4 is the same as c 1/4

The slash must be there to identify 4 as a denominator.

If the denominator is missing, it is copied from the previous fraction:

c 3/4 d 1 means c 3/4 d 1/4

One more example:

c 3/4 d 1 e 2 f g meaning: c 3/4 d 1/4 – denominator copied e 2/4 – denominator copied f 2/4 – duration not specified, same as previous duration g 2/4 – duration not specified, same as previous duration

Notice in particular the blanks in ...d 1 e 2... ; if they were omitted, 1 and 2 would be interpreted as octaves, not as durations. This is a case of meaningful blanks, used as separators. On the other hand, one can write c/4 or c#/4 or even c3#/4 to specify various notes lasting one quarter (one is supplied for the missing numerator). Finally, write in full the fractions in sums:

a 1/3+1/6

My parser is not clever enough to supply missing parts there, although it can do arsemetrick and come up with the sum 1/2. Now, what is the `previous denominator' ? 6 or 2 ? Instead of worrying, supply the denominator of the next fraction yourself. But inquiring minds want to know – the denominator is six.