A scale is any subset of the 12 semitones, containing C and G, and with no more than two successive semitones missing anywhere. It may have different forms when ascending and descending (like the melodic minor). E.g.ascending: C D E F G G# A
two successive semitones missing : A#, Bdescending: C B♭ G E D
two successive semitones missing : A, G# F#, F
This just picks some notes from the scale, and assigns durations 1 to 6 eights to them. The selection stops when thre are at least 6 tones, and the total duration is 6/8 to 12/8, 14/8, 16/8, 18/8 or 20/8.
The time signatures are 6/8 to 12/8; the motif may be one or two complete measures.
There are lists of possible drum patterns for each of the time signatures. These consist of C G and rests, and are mostly aksak , that is combinations of 2 and 3 units. For instance,Except for 6/8, which is either 3+3 / 8 or 2+2+2 / 8 , all patterns contain both 3 and 2.
- 8/8 = 2+3+3 / 8
- 9/8 = 2+2+2+3 / 8
- 12/8 = 2+2+2+3+3 / 8 or 2+3+2+3+2 / 8
Bridges are segments of at least 3 notes from the beginning of the basic motif. E.g., from the motif:C 1/8 B♭ 1/8 D 1/8 E 1/4 F 1/4 A♭ 1/8one may generate bridges:C 1/8 B♭ 1/8 D 1/8
C 1/8 B♭ 1/8 D 1/8 E 1/4
C 1/8 B♭ 1/8 D 1/8 E 1/4 F 1/4
C 1/8 B♭ 1/8 D 1/8 E 1/4 F 1/4 A♭ 1/8
The melody is made by adding new segments to the basic motif. The 1st segment is the motif transposed up by 1 tone; the 2nd segment is the motif transposed up by 2 tones, etc. Besides, the durations in each segment may be doubled, tripled, or left at their original value. The procedure stops when the melody is long enough.E.g.
scale C D D# E F# G G# A# B
BASIC MOTIF
ton: a f f g e not in scale! dur: 1/2 1/4 3/2 1/4 1/4
MELODY
A# 1/2 F# 1/4 F# 3/2 G 1/4 E 1/4 B 1/1 G 1/2 G 3/1 A# 1/2 F# 1/2 Two segments, the 2nd with durations doubled. The transposition is not 1 tone everywhere, because the notes have been changed to fit the scale.
NB ! this melody is never played, only its variations.
In total, there are:
- five variations, called var0 to var4 . var1 is based on var0 , var2 based on var1 , etc.
- the final variation,
- two inversions, inv0 based on var0 and inv1 based on var1 . The inversions cannot be accompanied by bass lines.
- three bass lines, called bas0 to bas2 . These are var0 transposed down by 4, 8 and 9 semitones, but the numbers 4,8,9 match at random bas0 , bas1 , bas2 . The transposition intervals are consonant, but adjusting for scale may change them, and the lines are not quite parallel.
- eight drum patterns
All these are ready, but will be played in random order, with random instrumentation. The random number generator is initialized using current time, so you get a different score every time you build one. These scores will also have distinct names, even if they are based on the same parameter.
There are three drums; each plays, quite independently, a random drum pattern on one of the MIDI instruments: Timpani, Woodblock or Drum.
The instruments and the melodies are chosen at random. The soloist may use the MIDI instruments:
Flute, ChurchOrgan, Fiddle, Oboe, Trumpet, Guitar, Sax, Cello, Clarinet
and if there is an accompaniment (or bass) it uses Guitar.
Initially, the line is transposed by a certain amount. A transposed note may lie outside the prescribed range, in which case it is transposed up or down, as needed, by an octave. It is also possible that the transposed note does not belong to the scale, in which case it is raised by a semitone.
The tests for range and scale are then repeated. Since the ranges are at least 20 semitones wide ( minor 13th ) the repetitions do eventually stop, and all constraints are satisfied.
All the variation preserve total duration, since they must agree with the basses and the rhythm section (drums).
A line may be varied by 2 methods:Both bridging and scale fill may be repeated.
- scale filling
A skip in the line is replaced by a scale segment, starting and ending with the original pitches. The durations start as equal, but will be always adjusted to simple durations.For instance :
- if the scale is: C D E F G A♭ A B♭
- and the melodic gap is F 3/8 B♭ 1/8 , with total duration 4/8 = 1/2
- then the filling is F 1/10 G 1/10 A♭ 1/10 A 1/10 B♭ 1/10 still lasting 1/2
- since 1/10 is not a simple duration that will be replaced by, e.g.
F 3/8 B♭ 1/8 → F 1/12 G 1/12 A♭ 1/12 A 1/8 B♭ 1/8the first 3 notes in a triolet, and the total duration preserved.- bridging
Suppose there is a a gap in the melodic line which rises a perfect fourth, and there is among the bridges one that also rises the same interval (perfect fourth). Then the gap is replaced by the bridge tranposed, so its 1st and last pitches match the original pitches. In addition, the original total duration is subdivided, so it is proportional to the durations in the bridge.
For instance :
- if the scale is: C D E F G A♭ A B♭
- and the melodic gap is F 3/8 A 1/8 , with total duration 4/8 = 1/2, rising a major third
- and there is a bridge C 1/8 B♭ 1/8 D 1/8 E 1/4 which also rises a major third
- then the filling is : F 1/10 E♭ 1/10 G 1/10 A 1/5 still lasting 1/2
- now, E♭ does not belong to the scale, and there are no simple durations, so the variation will be:
F 3/8 A 1/8 → F 1/12 E 1/12 G 1/12 A 1/4
These constraints are implemented by the routines tosc , toscu .
- Each melodic line has a certain range, at least 20 semitones wide, and its modifications cannot go either above or below the range.
- If a note is higher than the preceding note, it must belong to the ascending scale; if it is lower than the preceding note, it must belong to the descending scale.
Of course the ascending and descending scales may be the same.- All notes must belong to the ascending or descending scales.
To invert a melody, find the highest and the lowest note and compute their sum . Then replacenote → sum - note( The numeric values of notes are part of the MIDI encoding:60 = middle CIf you're willing to do the arithmetic, convince yourself that the inversion of :Then:
57 = A below middle C
58 = A# = B♭ below middle C
59 = B below middle C
60 = middle C
61 = C# = D♭ above middle C
62 = D above middle C
etc. )C B♭ D E F A♭ ( B♭ below C, all the others above )is:F# A♭ E D C# B♭Notice how the lowest and highest notes swapped position – obviously. Then all these pitches may change in order to fit the scale.
These are dyadic fractions, 1/2, 1/4, 1/8, 1/16, ... respectively 3/4, 3/8, 5/8, ... 3/16 etc...
plus simple triolets: three equal durations, lasting together 1/2, 1/4, 1/8, 1/16, etc...
Any other durations are converted into simple durations by the routinesdureg, balans, conservedur, neardur, quarters, regv, adspread and subspread.