A one-line hack solution to figuring out which individual notes are 
used in a piece of music. Designed mainly to help quickly create a 
handbell 'bells used' chart. This may not be for everyone but with a 
bit of tweaking it will work under Windows (DOS command line). As it 
is, it will work under Linux (and probably any Unix setup) and 
probably under Mac OS X. (Just make sure to strip those ^M end of 
line characters, if present, out of the XML file). 

(cut here)
#!/bin/bash
# Quick hack to list each individual note used in a piece of music in
# XML format created by Finale XML plugin.
# Primarily for easily making a handbell used chart but other
# potential uses exist. (The # is a comment marker).
#--Start here. Could be put on one line
grep -A3 "<pitch>" $1 \
| fmt -p "--" \
| sed s/"<\/pitch>"//g \
| sed s/"<pitch>"//g \
| sed s/"<\/step>"//g \
| sed s/"<step>"//g \
| sed s/"<\/alter>"//g \
| sed s/"<alter>"//g \
| sed s/"<\/octave>"//g \
| sed s/"<octave>"//g \
| fmt -u \
| sort -u
#--end here. 
# DOCUMENTATION and notes:
# Written by James Gilbert, http://www.jamesgilbertmusic.com/
#
# XML created via Finale 2003 and the builtin XML export plugin.
# Script file tested under Linux RH 7.3 using Bash. All other
# programs used are found in a typical Linux/Unix installation and 
# versions for Windows/Dos and other OS are available. You will need:
# - Bash shell (may not work with other shells)
# - grep (to extract the pitches)
# - fmt (to format the text to look nice)
# - sed (to strip out the XML tags)
# - sort (to sort, uniquely, the final results)
#
# How to do it:
# 1) Export Finale to XML using builtin plugin.
# * If using the default bell template shipped with Finale, be sure
#   to delete that measure before doing the export. Then use undo to
#   restore that measure. 
# * THE XML FILE MUST HAVE ^M (ASCII 13) end of line characters
# REMOVED from the file or it will not work under UNIX/Linux. 
# Use dos2unix program to fix. 
# 2) Run program:
#   ./getnotes.sh [XMLfilename] | more 
#   or
#   ./getnotes.sh [XMLfilename] > [output.file]
# 3) The output format will be:
#  letter name, sharp/flat (if any), Octave
#   [A-G]  [-1 for flat, 1 for sharp], Middle C = C4 (so add 
# 1 to octave as the handbell world uses Middle C = C5!)
# 4) Enter the notes from the output.file into the HB used chart in 
#  Finale.
#
# DOS/Windows users:
# Edit this file as needed to adjust for the way DOS does things
# Save as a *.BAT file. Run from a command line prompt as 
# shown above. Mac OSX users should be able to run as is. 
# Future ideas: 
# See if the results can be easily converted to be used by the
# command line plugin in Finale? If so, cut & paste and avoid 
# most manual entry of the bells used chart. 
#
# Sample output:
#A 1 2
#A 2
#A 3
#A 4
#A 5
#B -1 3
#B 5
#C 1 3
#C 3
#C 5
#D 1 3
#E 1 3
#E 1 4
#F 3
#F 4
#G 1 2
#G -1 5
(cut here)-------------
James Gilbert
[EMAIL PROTECTED]
http://www.jamesgilbertmusic.com/




_______________________________________________
Finale mailing list
[EMAIL PROTECTED]
http://mail.shsu.edu/mailman/listinfo/finale

Reply via email to