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 ------------