The driver is a .bat file, not perl:
For example:
This is created by pregrbas.pl .
The DOS instructions find ";" and sort are just a kludgy way to extract the needed information, an ordered
list of :
Combines the cycles and some random linear aspects to generate an harmonic ground. That is, notes are added
atop the passacaglia ground, from two sources:
Notes left over between cycles, before the first cycle, or after the last cycle, appear between rests as "free" chords, not subject to the regular harmony specified by NOISE.
Currently:
Dodecaphonic passacaglia – not quite ready.
perl pregrbas.pl %1 %2 %3 %4 %5 %6 %7 %8 %9
type PARM.txt
perl grbas.pl | find ";" > one.txt
sort /R one.txt /O resul.txt
perl pastbl.pl > ucu
perl totable.pl < tbl.txt > cucu
copy headerpas.txt+scoraaa.txt+scorbbb.txt papa
midi papa
Besides, the piece should end with some cadence.
grbas.pl
This constructs the ground bass. The ground matches the rhythmic formula:
1/4 1/2 1/4 1/2 1/4 3/4 2/4
i.e. 4 measures in 3/4 rhythm, 7 notes. The last three notes must form a melodic cadence:
DO SI DO, SI RE DO, RE SI DO, DO RE DO, MI(♭) RE DO, or LA SI DO
It takes all the cyclic joins, finds possible grounds in them, and grades the result.
The output is a list of joins, each followed by a list of:
grade; cycle; matches head to tail;
indices1; notes; indices2
with:
SERIES 2 3 4 5 9 6 0 1 11 8 7 10 10 9 8 7 3 6 0 11 1 4 5 2 10 7 8 11 1 0 6 9 5 4 3 2 2 5 4 1 11 0 6 3 7 8 9 10
CLOSED: matches 3 head to tail
====================================================================================================
analysis for cyc =
2 3 4 5 9 6 0 1 11 8 7 10 11 0 1 5 2 8 9 7 4 3 6 3 4 7 9 8 2 5 1 0 11 10 1 0 9 7 8 2 11 3 4 5 6 10 7 1 2 0 9 8 11 10 7 5 6 0 9 1
60 notes in cycle
====================================================================================================
1060; 2 3 4 5 9 6 0 1 11 8 ... 10 7 5 6 0 9 1; 3; 3 7 11 14 18 22 25; 5 1 10 1 9 6 7; 29 30 33 34 36 44 46
1060; 2 3 4 5 9 6 0 1 11 8 ... 10 7 5 6 0 9 1; 3; 4 7 11 14 18 22 25; 9 1 10 1 9 6 7; 26 30 33 34 36 44 46
1060; 2 3 4 5 9 6 0 1 11 8 ... 10 7 5 6 0 9 1; 3; 4 8 11 14 18 22 25; 9 11 10 1 9 6 7; 26 32 33 34 36 44 46
1029; 2 3 4 5 9 6 0 1 11 8 ... 10 7 5 6 0 9 1; 3; 2 4 6 9 12 14 16; 4 9 0 8 11 1 2; 20 26 31 38 40 47 48
1029; 2 3 4 5 9 6 0 1 11 8 ... 10 7 5 6 0 9 1; 3; 2 4 6 10 12 14 16; 4 9 0 7 11 1 2; 20 26 31 37 40 47 48
CLOSED:; matches 1 head to tail
====================================================================================================
analysis for cyc =
2 3 4 5 9 6 0 1 11 8 7 10 9 8 7 3 6 0 11 1 4 5 2 5 4 1 11 0 6 3 7 8 9 10 7 8 11 1 0 6 9 5 4 3;
44 notes in cycle
====================================================================================================
1825; 2 3 4 5 9 6 0 1 11 8 7 ...10 7 8 11 1 0 6 9 5 4 3; 1; 0 2 5 9 13 16 20; 2 4 6 8 8 6 4; 22 24 28 31 35 39 42
1825; 2 3 4 5 9 6 0 1 11 8 7 ...10 7 8 11 1 0 6 9 5 4 3; 1; 0 2 6 9 13 16 20; 2 4 0 8 8 6 4; 22 24 27 31 35 39 42
1825; 2 3 4 5 9 6 0 1 11 8 7 ...10 7 8 11 1 0 6 9 5 4 3; 1; 2 5 9 11 13 16 20; 4 6 8 10 8 6 4; 24 28 31 33 35 39 42
1825; 22 3 4 5 9 6 0 1 11 8 7 ...10 7 8 11 1 0 6 9 5 4 3; 1; 2 6 9 11 13 16 20; 4 0 8 10 8 6 4; 24 27 31 33 35 39 42
1534; 2 3 4 5 9 6 0 1 11 8 7 ...10 7 8 11 1 0 6 9 5 4 3; 1; 0 2 6 10 14 16 20; 2 4 0 7 7 6 4; 22 24 27 30 34 39 42
.
.
SRAND 123
SER 9 4 6 8 10 0 7 3 11 1 2 5 5 2 1 11 3 7 0 10 8 6 4 9 3 8 6 4 2 0 5 9 1 11 10 7 7 10 11 1 9 5 0 2 4 6 8 3
NOISE PASAC
GROUND6 1
ALL 48
0 3 4 6 2 10 5 7 9 11 1 8
0 5 3 1 11 9 2 6 10 8 7 4
0 7 9 11 1 3 10 6 2 4 5 8
0 9 8 6 10 2 7 5 3 1 11 4
.
.
grade; cycle; matches head to tail;
indices1; notes; indices2
from the row output of grbas.
pastbl.pl
The file format is, basically, chord, duration, etc separated by blanks:
notes[index][0]
=
bass, i.e. passacaglia ground bass
notes[index][1..8]
=
voices (except bass and appoggiatura)
notes[index][9]
=
duration, e.g. 3/8
notes[index][10]
=
appoggiatura, for some high voice e.g. piccolo
notes[index][11]
=
comments, instructions, etc
.
.
3,-2 1/8
3,4 1/8
x,x 0/1 xya99
4, 0,0,9 11,11 1/8 app
4,-6 1/8
4,8 1/8
4,-10 1/8
x,x 1/4 GP`rest
x,6,7,1,10 3/4 non`grbas`chord
x,2,3,4 3/4 non`grbas`chord
x,4,5 3/4 non`grbas`chord
x,x 1/2 GP`rest
.
.
Here the x stand for rests, app shows an appoggiatura, and the numbers are tones. The comma joins these tones into chords;
obviously, an appoggiatura has one duration, but two chords (in addition to the bass). The 1st note in each line is the passacaglia ground bass.
Notes dissonant with the bass are marked as negatives.
The zero duration (0/1) lines are instructions (no notes), and will not result in sound, although the program might respond in various ways,
depending on etc.
In this example, xya99 shows the end of one of the ground basses, identified as xya.
totable.pl
Creates a score from the file tbl.txt.