It never rains but it pours!

Yesterday I posted a correction to a routine in the Sounding Off series of articles. In the process I realised that the analysis of the possible bar structures was incomplete, and that there were in fact four further possibilities, 3 with 8 notes per bar, and 1 with nine notes.

The additions 8n1, 8n2, 8n3 ands 9n1 are shown in the image below (click it to enlarge)
The additions give rise to two further possible bar structures for the 3 bar tune, namely
bars patterns 128 and 119 notes.Bar Analysis

Happily it is easy to modify and update the affected files, which are:
serialrpi.sh, serialr.sh, longplay.sh,makearchive.sh,longplaymakearchive.sh
This is done be replacing the procedures getallowedbars() and getbarlist() with the new versions shown below:

getallowedbars () {
 #read in list of allowed bar patterns for 3 bars of 11 notes total
cat > $allowed3bars << EOFallowed3bars 146 155 236 245 335 344 128 119 EOFallowed3bars pvar "allowed 3 bar lengths" allowed3bars } #------------ end of getallowedbars ------------ getbarlist () {  #generates a file containing the structure of the 28 possible distinct  #bar types  in the structure name n n n x  #first build as a string b="1n1 2. x " b+="2n1 2 4 x 2n2 4. 4. x " b+="3n1 4.. 4 16 x 3n2 4.. 8. 8 x 3n3 4. 4 8 x 3n4 4. 8. 8. x \a 3n5 4 4. 8 x 3n6 4 4 4 x " b+="4n1 2 8 16 16 x 4n2 4.. 8. 16 16 x 4n3 4.. 8 8 16 x 4n4 4. 4 16 16 \ x 4n5 4. 8. 8 16 x 4n6 4 4 8. 16 x 4n7 4 4 8 8 x 4n8 8. 8. 8. 8. x " b+="5n1 2 16 16 16 16 x 5n2 4.. 8 16 16 16 x 5n3 4. 8. 16 16 16 \ x 5n4 4. 8 8 16 16 x 5n5 4 4 8 16 16 x 5n6 4 8. 8 8 16 x 5n7 4 8 8 8 8 x " b+="6n1 4. 8 16 16 16 16 x 6n2 4 4 16 16 16 16 x 6n3 4 8. 8 16 16 16 \ x 6n4 4 8 8 8 16 16 x " b+="8n1 4 8 16 16 16 16 16 16 x 8n2 8. 8. 16 16 16 16 16 16 x \ 8n3 8 8 8 8 16 16 16 16 x 9n1 4 16 16 16 16 16 16 16 16 x" echo $b |sed -e 's/\s\s*/\n/g' > $barlist
#convert string to file with one entry on each line (spaces replaced by LF)
pvar 'list of bar structures' barlist
} #------------ end of getbarlist ------------

or you can view it here

I will leave it as an exercise for the reader to apply these updates. The programs will work without them, but from an analysis point of view these give a more satisfying solution.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s