Etude



Tonal etude for piano solo. Has a short introduction and coda, which are an elaboration of I,I or I,V or V,I in the piece tonality. The rest consists of melody plus chords, starting and ending in the same tonality, but freely modulating (unprepared changes of key, which I cannot hear anyway). The melody evolves from measure to measure, using my own technique of motif multiplication, and the chords are fitted to it. Most of the time, the melody is in the right hand and the chords in the left (surprise!), but sometimes viceversa. Most of the time the chords are blocked, but often expanded as arpeggios and simple rhythmic figures.

The instruction:

perl  neotod.pl     parameters
will produce a score named, e.g.  gminWDC and a playable midi file  gminWDC.mid.  In more detail, neotod.pl executes:

perl neotoca.pl @ARGV
perl neotocb.pl
copy colophon.txt+sco.txt+befaf.txt  $nam
midi $nam
		



subprograms





Motif multiplication

Each note of the first motif is replaced by the second motif, transposed by that note. For the purpose of this piece, all durations, in the motives and their product, are equal, so they do not get mentioned. For example:
9 12   x   7 11 14 17   =   16 20 23 26 19 23 26 29
9 becomes 9+7 9+11 9+14 9+17 and 12 becomes 12+7 12+11 12+14 12+17.   In this scheme, obviously, 0,12,24... = C, 1,13,25... = C# = D♭, ... etc, and 12 is one octave higher than 0.

Notice that both motifs above belong to C major (the notes are A C and G B D F) but the product is not in C major, because 20 = G#. If the melody is to remain in C major, it will be played

16 19 23 26 19 23 26 29   =   E G B D G B D F
Alternatively, the new key will be set to A minor – one of several possibilities. In this case the melody will appear as:
16 20 23 26 20 23 26 30   =   E G# B D G# B D F#
accompanied by chords of A minor.



The routine analy

This routine examines the data read from inte.txt. The measures start in either C major or C minor, then modulate freely. analy records only the mode (major or minor) and tries to find, at the end of the piece, a measure in the same mode. If found, the tonality of that measure becomes the tonality of the piece, and the etude will end with the last measure in the same tonality. If not, the program exits with an error code, to be recognized and automatically fixed by the driver.

Once the tonality has been established, analy copies the initial measures in c, suitably transposed, and prepends them to the data already in memory. If necessary, it will also transpose and append a few measures at the end of the data, so the final tonality will be heard long enough to become established.

analy then calls the routines af and bef to write the introduction and coda, which further emphasize the piece tonality.



Introduction (routine bef )

This is a straightforward presentation of the piece tonality: either the scale, or two chords: I,I or I,V or I,V7.  Each of I, V or V7 may appear as a simple blocked chord, or a pair of arpeggios, one in each hand. The scale is also played simultaneously in the two hands, in the same direction or in opposite directions. For variety, rests replace some notes in the scales.



Coda (routine af )

An elaboration on the final cadence in the piece tonality: either the scale, or two chords: I,I or V,I or V7,I.  Each of I, V or V7 may appear as a simple blocked chord, or a pair of arpeggios, one in each hand. The scale is also played simultaneously in the two hands, in the same direction or in opposite directions. For variety, rests replace some notes in the scales.

A pair of scales or arpeggios is followed by one final tonic chord.



Intermediate file inte.txt

0: START	0 0 0 0 x 0 0 0 0	=	0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0  
cmin9 4013 8/8 2 4									tonality c minor, two beats subdivided into 4 

 60 1/8 60 1/8 60 1/8 60 1/8 60 1/8 60 1/8 60 1/8 60 1/8				eight eights unison on C=60 	
 53,57,48 4/8  53,57,48 4/8								two chords lasting one quarter each: F,A,C  F,A,C


1: new1st	7 12 x 0 0 0 0	=	7 7 7 7 12 12 12 12 				no more unison
cmin9 4013 8/8 2 4

 67 1/8 67 1/8 67 1/8 67 1/8 72 1/8 72 1/8 72 1/8 72 1/8
 55,58,50 4/8  53,56,48 4/8 


2: miror	7 12 x 0 0 0 0	=	5 5 5 5 0 0 0 0 
cmin9 4013 8/8 2 4

 65 1/8 65 1/8 65 1/8 65 1/8 60 1/8 60 1/8 60 1/8 60 1/8				melody:	F F F	F C	C C C
 50,53,57 3/8  48,53,57 2/8 53,56,48 3/8						bass:	D,F,A	C,F,A	F,Ab,C	aksak rhythm   


3: swap12	7 12 x 0 0 0 0	=	7 12 7 12 7 12 7 12 
cmin9 4013 8/8 2 4

 67 1/8 72 1/8 67 1/8 72 1/8 67 1/8 72 1/8 67 1/8 72 1/8
 48,51,55 4/8  48,51,55 4/8 

 43,47,50,53 4/8  43,47,50,53 4/8 


{	____________ new tonality ebmaj ______________ }	

4: new2nd	7 12 x 0 7 3	=	7 14 10 12 19 15 
ebmaj 1453 8/8 2 4

 74 1/8 70 1/8 72 1/8 79 1/8 75 1/8 67 1/8 74 1/8 70 1/8				melody:		D  Bb  C  G		Eb  G  D  Bb
 46,50,56 4/8  51,55,58,50 4/8								chords:		Bb,D,Ab			Eb,G,Bb,D


{	____________ new tonality cmaj ______________ }	

5: transpo	7 12 x 0 7 3	=	4 11 7 9 4 0					transpose prev. measure 3 semitones down (causes modulation from Eb major to C major)
cmaj 2741 8/8 2 4

 69 1/8 64 1/8 60 1/8 64 1/8 71 1/8 67 1/8 69 1/8 64 1/8
 57,48,52 4/8  43,47,50,53 4/8 
			.
			.



The final score

An example, with lots of commentaries, may be found here.