lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Editing tool: transpose 8ve


From: David Raleigh Arnold
Subject: Editing tool: transpose 8ve
Date: Tue, 25 May 2010 13:00:59 -0400
User-agent: KMail/1.12.4 (Linux/2.6.32-4-686-bigmem; KDE/4.3.4; i686; ; )

Sometimes you want to move some lilypond notes quick. This bash script
does it. It requires sed and xsel. A windows version should be similar.
If for some reason there is a problem, octava-up.sed and ottava-down.sed
may be moved. The '"'"' makes perfect sense, eventually, but it's
gnarly. Regards, daveA

::::::::::::::::::::::::::::::::::::::::::::::::::::::::

#!/bin/bash
# ottava
# sed and xsel must be installed.

if [ "$1" = "up" ]; then
echo "========= $ ottava up: raise selected one octave ========"
xsel | sed -e "
# ottava-up.sed
# must be formatted with extra spaces

# no tabs
s/\t/ /g

# space follows/precedes curly, pointer, to prettify.
s/[{<]/ & /g
s/[}>]/ &/g

# put spaces at begin and end of line, double spaces inside
# to simplify process of note names
s/^ */ /
s/ *$/ /
s/  */  /g

# transpose
s/ \([a-h][sx#fbw!]*[sfb!]*\),/ @address@hidden/g
s/ \([a-h][sx#fbw!]*[sfb!]*\)/ @address@hidden'/g
s/@protect@//g
"
echo "
=============================================="
elif [ "$1" = "down" ]; then
echo "--------- $ ottava down: lower selected one 8ve ------"
xsel | sed -e '
# ottava-down.sed
# must be formatted with extra spaces

# no tabs
s/\t/ /g

# space follows/precedes curly, pointer.
s/[{<]/ & /g
s/[}>]/ &/g

# put spaces at begin and end of line, double spaces
# simplify process.
s/^ */ /g
s/ *$/ /g
s/  */  /g

# transpose
s/ \([a-h][sx#fbw!]*[sfb!]*\)'"'"'/ @address@hidden/g
s/ \([a-h][sx#fbw!]*[sfb!]*\)/ @address@hidden,/g
s/@protect@//g

'
echo "
--------------------------------------------------------"
else
echo "

Select some lilypond data, then: $ ottava [up|down]

(c)2010 David Raleigh Arnold -->GNU. Enjoy.
"
fi

::::::::::::::::::::::::::::::::::::::::::::::::::::::::
-- 
For beginners: very easy guitar music, solos, duets, exercises. Early
intermediate guitar solos. One best scale set for all guitarists.
http://www.openguitar.com/scalescomparison.html ::: plus new and
better chord and arpeggio exercises.  http://www.openguitar.com 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]