Orchestral piece. In fact, a concerto grosso, with a few soloists (concertino) and accompaniment.
Not quite complete, should end with some coda or cadence.
The instruction:will produce a score named, rnd345 and a playable midi file rnd345.mid .
perl thernd.pl rand_345 size_70 sec_8
- reads the list of all possible 4095 pitch sets, graded by dissonance.
Dissonance is defined in the good old-fashioned way: thirds, triads are consonant, tritones and seventh chords more dissonant, curiosities such as AB♭DEG# very dissonant.
- parses the parameter list:
- selects about SIZE pitch sets, giving preference to consonant ones.
This is done by three methods:
- pick at random a pitch set, add it to the list
- pick at random a segment from the list, replicate it a few times in place
- pick at random a segment from the list, add it a few times at the end of the list
- makes motifs from the pitch sets enlisted above.
A motif consists of a bass and solo. The bass is a chord, which uses 2 to 4 notes of the pitch set, with possible doubling. The solo is a melody which uses notes from the chord, with arbitrary durations.
E.g. : the pitch set AB♭DEG# may becomeHere D 1 A 3 means: D lasting one unit, A lasting three units, etc. Usually, but not always, there are 12 or 24 units in total.
bass chord: B♭,D,B♭,E solo melody: B♭ 1 D 1 A 3 E 2 B♭ 2 D 8 G# 4
Notice that the algorithm, although random, will produce identical motifs from identical pitch sets.
- subdivides the list of motifs into sections.
This just inserts certain marks, indicating that at that point the instrumentation changes, and a crescendo/diminuendo starts.
- creates the score
- Each motif is assigned a duration, 2/4 3/4 4/4 5/4 6/4. This generates difficult subdivisions:E.g., assume one fits B♭ 1 D 1 A 3 E 2 B♭ 2 A 3 D 8 G# 4 in a 3/4 measure.In contrast, the bass always plays quarter notes, which fit neatly into the durations 2/4 3/4 4/4 5/4 6/4. At most, sometimes the program divides 4/4 into 2, and 6/4 into 2 or 3, so there will be a few half notes and dotted half notes.
There are 24 units in the melody, the total duration is 3/4, so the unit lasts 3/4 x 1/24 = 1/32
The melody will be played:
B♭ 1/32 D 1/32 A 3/32 E 1/16 B♭ 1/16 A 3/32 D 1/4 G# 1/8
This can be still notated with the usual subdivisions, but ... what a mess!
And then, try fitting: B♭ 1 D 1 A 3 E 2 in a 3/4 measure.
There are 7 units in the melody, so the unit lasts 3/4 x 1/7 = 3/28 !!
Try to notate this rhythm – one must use septuplets, but how hard is it to play correcly ?!
In fact, the whole piece sounds quite tame, athough the solo melody seldom starts "on the beat", because of the subdivisions.
- Notes are assigned register, i.e. C may be middle C or the open string viola C, etc.
- Random instrument choice and crescendo/diminuendo are inserted at the section starts.
- Finally, the score is written as a MIDI file.