> Mats Bengtsson <[EMAIL PROTECTED]> writes: > > >>>I see some cases where this would be clearly a win. Few weeks ago, a > >>>singer asked me to change all alto clefs to treble clefs in a > >>>voice+piano reduction score. Just redefining the \clef music function > >>>would have made that really easy and quick. > >>> > >>> > >>> > > A query replace alto -> treble is probably quicker than redefining the > > function, at least if your name is not Nicolas Sceaux. :-) > > This score was really big. > > $ find ?-* -name "*ly" | wc -l > 882 > > $ find ?-* -name "*ly" | xargs cat | wc -l > 31446 >
Why not make a global.ly with: %clefae = { \clef "treble_8" } clefae = { \clef bass } And in the score you do something like Score.01.ly: ... \include "global.ly" \include "Music.01.ly" ... \new Lyrics \lyricsto vspAA \lspAA \new Staff \context Voice = vaeAA { \set Staff.instrument = \markup { "Aeneas" } \set Staff.instr = \markup { "Ae" } { \keyAA \clefae \aeAA } } ... (example from http://aspodata.se/noter/dido_et_aeneas/) It was a quick change to make the tenor part with the bass clef at a request of the singer. This might help you: $ find . -name \*.ly | xargs fgrep -C3 '\clef alto' | less and if all seem straitforward, do this: ------------------------------------------------------ #!/bin/sh from='\\clef alto' to='\\clef treble' qs () { a="$1" shift echo = $a ======================================= grep -C3 "$from" "$a" ( exec < /dev/tty echo -n "substitute (y), edit (e), test (t) or leave as is (n): " read b case "$b" in [tT]* ) sed -e s/"$from"/"$to"/ < "$a" | less;; [yY]* ) mv "$a" "$a.old" sed -e s/"$from"/"$to"/ < "$a.old" > "$a";; [eE]* ) emacs "$a";; esac ) } find . -name \*.ly | xargs grep "$from" | cut -f1 -d: | while read a do qs "$a" done ------------------------------------------------------ Regards, /Karl ----------------------------------------------------------------------- Karl Hammar Aspö Data [EMAIL PROTECTED] Lilla Aspö 2340 Networks S-742 94 Östhammar +46 173 140 57 Computers Sweden +46 70 511 97 84 Consulting ----------------------------------------------------------------------- _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user