A third movement (ad lib.) is a canon for piano solo, based on the same motifs. In my opinion it is best
played between the two orchestral movements, but maybe the soloist would like to start the concerto with it.
It may be skipped; think of it as an extended cadenza, not virtuosic but interpretative.
Everything is done by the instruction:
The 2nd voice enters after a random time, adding to unpredictability.
One of the voices usually may play alone at the end of the canon, but for most of the piece
the two voices play together.
The notes get random durations, from 1 to 8 shorties. The total length
in shorties of the motif determines how many times it is repeated: e.g. a motif of 15 shorties is repeated 4 times, to cover 5 times 12 shorties.
There may be up to 12 repetitions, e.g. for motif lengths of 7, 17 or 25 shorties.
It also writes two other "communication files":
Up to now there was no consideration of harmony; the two voices advance in canon, although each voice may have folds. This is why up to 8
midi channels may sound – in principle the 8 channels are the two hands of the piano soloist, playing single notes or chords; these are the 1st
and 2nd voices in the canon.
mixaco adds, for each shorty, an accompaniment chord which contains all the notes in these eight voices (sometimes this is impossible, nothing is added).
The chords are plain triads, sevenths , ninths etc. in major or minor scales, limited to 4 distinct notes. They are also picked at random,
without reference to some global rhythm or tonality. For instance:
A single eighth note C may be accompanied by:
Similar to mixaco.pl, but, as much as possible, it assigns identical accompaniment chord to identical simultaneous shorties in the canon voices.
The resulting accompaniment changes less often, which allows for long arpeggios wehen played by the piano.
If a cadence is found, then the durations of the notes around it are modified, to emphasize it. A few preceding chords are
also reset to belong to the scale of the final cadence; also, there is a suitable rallentando at the coda.
The coda is written to the file cancodascore.txt and the size of the text before coda is written to can0n.txt,
for further use by tontoc.pl.
Because of the cadence, the canon is incomplete – voice 1 does not play the basic strand twice or thrice,
and voice 2 does not play all the basic strand, only 'most of ' that.
Every time a motif starts in the canonic voices, there is a random instrumentation change: the motif may be assigned to
some other instrument , not to the piano. This is done with small probability; the motif, obviously, gets transposed to the range of
that instrument. Currently, I use a few wind instruments and the solo violin.
There are truly random dynamics, written in the score. Every time you say:
The program also writes an intermediate file pasolo.txt, to be used by the other programs
bsolo and csolo
to create a coda to conclude the piece. This file is just a list of shorties in 8 voices.
If a cadence is found, then the durations of the notes around it are modified, to emphasize it. A few preceding chords are
also reset to belong to the scale of the final cadence. The coda is attached to the previous canon, with a suitable rallentando,
and the score is written.
The result is the file
cancodascore.txt, which will serve as coda to both concerto movements.
The table entries are text ready for the score, i.e. mostly notes or groups of notes, and also instructions:
trill (), vvol , ins= , etc. Empty cells are rests,
each lasting one shorty. The cells containing nil
are meant to be ignored completely. For instance, voice0 plays at 383 f5 4/12; this is followed by 3 nil cells,
because the note f lasts four shorties,
so the next note – f#5 1/12 – starts at 387, nothing intervening.
All of the above is basically a memo to myself.
The routine pre2scor converts the table to a score, by reading along each column (i.e. voice or channel). It copies notes and instructions,
sums and outputs rests, and skips nils. This is the file dblscore.txt.
A piano concerto, based on a minimalist canon in augmentation. Dedicated to Alexandra Bageac, as it was
completed on her birthday.
The concerto is in two movements, a canon and its double (in the sense of Bach's Violin Partita in b minor). The movements
share the same material, and end in identical codas. The basic difference is that in the first part the piano plays the canon,
accompanied by the orchestra, while in the second the piano plays chords and arpeggios accompanying the canon,
which now is taken by the orchestra.
perl tri.pl rand_2345 size_20
(all parameters optional).
tri.pl
This runs from Perl, via system:
creating three scores with the corresponding midi files.
perl aminipas.pl @ARGV > a.txt
perl mixaco.pl < minipas.txt > withac.txt
perl twelver.pl > b12.txt
copy parm.txt+canonheader.txt+canonscore.txt+cancodascore.txt $nama
midi $nama
perl solocanon.pl > b1.txt
perl bsolo.pl > b2.txt
copy parm.txt+canonscore.txt+cancodascore.txt $namb
midi $namb
perl prevaco.pl < minipas.txt > tonalac.txt
perl tontoc.pl > c.txt
copy parm.txt+tontohdr.txt+dblscore.txt+cancodascore.txt $namc
midi $namc
perl csolo.pl > c2.txt
will be executed instead. If any other step of tri.pl fails,
$random is increased and tri.pl restarts.
rand_2345 size_20
This means: initialize random generator with 2345, and make 20 motifs.
The parameters are optional; they are also used in naming the score and midi files:
sc2345-20 ,
sc2345-20.mid etc.
The 1st voice plays twice the basic strand, with a random break before the repetition.
The 2nd voice plays the basic strand once, one octave lower in augmentation (twice as slow). The 1st voice plays three times the basic strand, with random breaks before the repetitions.
The 2nd voice plays the basic strand once, one octave lower in augmentation (three times as slow). The 1st voice plays twice the basic strand, with a random break before the repetition; each note twice as long
as specified: 1 shorty becomes 2 shorties.
The 2nd voice plays the basic strand once, one octave lower in augmentation (three times as slow, 1 shorty becomes 3 shorties)
DETAILS
aminipas.pl
This creates the motifs, and produces the two voices in canon. The program writes an intermediate file minipas.txt,
which is used by the programs mixaco and prevaco
to add accompaniment. This file is just a list of shorties in 8 voices.
The shorty is the smallest duration in the piece, either 1/16 or 1/12 (triolet),
and all other durations are multiples of it. For instance, if the shorty is 1/16, a quarter note will be emitted in 4 records in minipas.txt .
mixaco.pl
The program uses as inputs minipas.txt and parm.txt.
Assume the shorty is 1/16, and there is a quarter note sounding C,E in two voices. The 4 jiffies in the accompaniment might be:
The combination canon+accompaniment is written to the file withac.txt.
C,E,G,B♭ C,E,G A,C,E C,E,G,B  or
C,E,G,B♭ C,E,G A,C,E C,E,G
etc...
C,E,G A,C,E,G  or
A,C,E F,A,C  or
C,E,G F,A♭,C
etc...
prevaco.pl
The program uses as inputs minipas.txt and parm.txt.
The combination canon+accompaniment is written to the file tonalac.txt.twelver.pl
As its name implies, it is totally based on 12 shorties groups, or measures.
midi score
different dynamics will be heard when you play score.mid (on the same notes and durations)
solocanon.pl
This reads the motifs from mot.txt, and produces the files nocoda$random-$size and nocoda$random-$size.mid .
As their names implies, there is no coda,
and the voices proceed independently to completion. However, the result may be interesting because there is built in randomness:
every time you run
midi nocoda$random-$size
you get a different nocoda$random-$size.mid with different dynamics and another entry time for voice 2.
bsolo.pl
Here we consider the harmony between the (up to) eight voices, to discover a cadence near the end,
on which to end the piece. This is done by gathering chords and
checking versus a big list of acceptable cadences.
If none is found, bsolo exits and the driver program tri.pl
will call csolo, to supply a coda otherwise.
csolo.pl
This is called only if bsolo fails, i.e. cannot discover a cadence. Then csolo looks for a long sequence of shorties, towards the end,
all belonging to some scale (tonality) . It then supplies a final close in that scale, with the same procedure as above:
The resulting files are canonscore.txt , cancodascore.txt .
tontoc.pl
This name is an abbreviation for "tonal toccata". Actually, the piano plays not a toccata (rapid repeated notes) but
rather arpeggios over a wide range, trills and blocked chords. Well, at least all of them are tonal.
subroutines of twelver.pl
sub compr2scor
This writes everything before the coda. Because of a bug (no, a feature!) it may overlap a little with the coda:
the last notes of this score get repeated in the 1st five chords of the coda. Why not? the piece is not serial.
In all voices, identical notes get slurred together (accross bars, sometimes accross motives). This irregular and busy
series of attacks in the accompaniment produces a rather pleasant effect (i.e. I like it).
sub coda
This sets up the coda instrumentation; all 9 midi channels, or voices, play (the routine codainstru, a really bad piece of code).
Then it writes the coda score,
which consists of precisely 5 chords of equal duration, followed by longer chords
supporting the melodic cadence: LA SI DO or SI DO DO.
subroutines of tontoc.pl
sub pianoscor
The piano parts are developed from 4-notes accompaniment chords, so they take up to 4 voices (in the range 5 to 8).
The routine gathers in a chord all the identical accompaniment over contiguous shorties.
If the chord is long, the piano plays Mannheim rockets on that chord (one hand, or both).
If it is short, the piano plays a blocked chord in one hand, sometimes with a trill in the other.
With a certain probability, both Mannheim rockets and trills are assigned to some other instrument, not the piano.
In any case, there is a variable $FREHAND, set to true if
at least one piano hand is not active.
This is used later in orxcor, to add piano to the purely
orchestral voices.
sub vvol
vvol simply follows each voice, and inserts a
vvol rand/8+32 $dur
instruction every 70 shorties or so. $dur is computed so the
vvols don't overlap, and rand/8+32 results – at play time –
in a value between 32 and 63 (the midi dynamics are 0 to 63, and values below 20 are not audible on my computer)
sub pre2scor
The four routines pianoscor, orxcor, toobusy and vvol create a new table @pretxt, as follows (in this example the
shorty is 1/12, a triolet) :
pretxt
voice 0
voice 1
voice 2
voice 3
voice 4
voice 5
voice 6
voice 7
voice 8
382
e5 1/12 nil ins=BrightAcoustic e3 1/12 g3 1/12 b3 1/12 eb4 1/12
383
f5 4/12 nil c6 3/12 Ab5 3/12 r 3/12 ins=Clarinet tril 7 ( eb4 3/12 f )
384
nil nil nil nil nil nil
385
nil nil nil nil nil nil
386
nil d4 14/12 Bb4 1/12 d5 1/12 f5 1/12
387
f#5 1/12 nil d4 1/12 eb4 1/12 f#4 1/12 Bb4 1/12
388
ins=StringEnsemble2 g3 1/12 nil b5 1/12 d6 1/12 g6 1/12
389
f#3 1/12 nil f#4 1/12 a4 1/12 d5 1/12
390
e3 1/12 nil ins=AcousticGrand b4 1/12 ins=AcousticGrand d5 1/12 ins=AcousticGrand e5 1/12 ins=AcousticGrand g5 1/12
391
f3 4/12 nil d3 1/24 f3 1/24 Bb3 1/24 d4 1/24 f4 1/24 Bb4 1/24 d4 1/24 Bb3 1/24 Bb4 1/24 d5 1/24 f5 1/24 Bb5 1/24 d6 1/24 f6 1/24 Bb6 1/24 d7 1/24