I've recently managed to produce mid-repeat variation brackets in 
abcm2ps by adapting the octava decoration. I'm finding it useful for 
the occasional Highland pipe tune, and perhaps other will too. The 
decoration is implemented using the %%postscript and %%deco pseudo-
comments.  Having tinkered sufficiently (I hope) to see how it acts in 
various cases and interacts with gracenotes, below are some examples of 
usage. Obviously, this won't play properly anywhere, and as it only 
works in abcm2ps, I have made liberal use of formatting pseudo-comments 
in the examples as well.

To produce bracket decorations with different labels, one need only 
duplicate the %%postscript definition (giving it a new name) and change 
the text displayed. For example, one could copy the %%postscript chunk, 
change (1) to (First time), and then add !first(! and !first)! %%deco 
definitions.

As I've mentioned before, it would be great if we could come up with a 
native abc notation for this sort of thing. So instead of

|: A4 | A4 | !1(!AB c!1)!d | !2(!cd e!2)!f | A4 :| % as below

we could use something like

|: A4 | A4 | [1 AB cd] | [2 cd ef] | A4 :| 

the numeral following the '[' clearly distinguishing it from a chord.

Anyway, here goes ...

%%textfont Courier-New 12
%
% == postscript definitions - must be before any tune ==
%
% -- draw "first time" indication
%%postscript /firsttime {       % usage: len x y firsttime
%%postscript    exch -9 add exch 2 copy 
%%postscript    M 0 10 rmoveto /Times-Roman 16 selectfont (1) show
%%postscript    M 0 6 rlineto currentpoint stroke M
%%postscript     30 add 0 rlineto currentpoint stroke M
%%postscript     0 -6 rlineto stroke
%%postscript } bdef
%
% -- draw "second time" indication
%%postscript /secondtime {      % usage: len x y secondtime
%%postscript    exch -9 add exch 2 copy 
%%postscript    M 0 10 rmoveto /Times-Roman 16 selectfont (2) show
%%postscript    M 0 6 rlineto currentpoint stroke M
%%postscript     30 add 0 rlineto currentpoint stroke M
%%postscript     0 -6 rlineto stroke
%%postscript } bdef
%
% == decoration definitions ==
%
% -- start / stop of firsttime indication
%%deco 1( 5 - 24 0 0
%%deco 1) 5 firsttime 24 0 0
%
% -- start / stop of secondtime indication
%%deco 2( 5 - 24 0 0
%%deco 2) 5 secondtime 24 0 0
%
X:1
T:Mid-repeat variations
C:Ewan Macpherson <[EMAIL PROTECTED]>
M:2/4
L:1/8
K:HP
%%text Basic usage: The symbol for the end of the bracket comes 
%%text *before* the final bracketed note.
%%text |: A4 | A4 | !1(!AB c!1)!d | !2(!cd e!2)!f | A4 :|
|: A4 | A4 | !1(!AB c!1)!d | !2(!cd e!2)!f | A4 :|
%
%%vskip 1cm
%%text To bracket a single note, put both "begin" and "end" codes 
%%text *before*  the note, with a spacer 'y' in between:
%%text |: A4 | A4 | !1(!y!1)!A2 !2(!y!2)!c2 B2 | A4 | A4 :|
|: A4 | A4 | !1(!y!1)!A2 !2(!y!2)!c2 B2 | A4 | A4 :|
%
%%vskip 1cm
%%text If the bracketed section begins with a gracenote, put a spacer 
%%text between the bracket-start and the gracenote.
%%text |: A4 | A4 | !1(!y\{g\}AB c!1)!d | !2(!y\{g\}cd e!2)!f | A4 :|
|: A4 | A4 | !1(!y{g}AB c!1)!d | !2(!y{g}cd e!2)!f | A4 :|
%
%%vskip 1cm
%%text If the bracketed section ends with a gracenote, put the "end" 
%%text code between the gracenote and the main note.
%%text |: A4 | A4 | !1(!AB c\{g\}!1)!d | !2(!cd e\{g\}!2)!f | A4 :|
 |: A4 | A4 | !1(!AB c{g}!1)!d | !2(!cd e{g}!2)!f | A4 :|
%
%%vskip 1cm
%%text To bracket a single note with a gracenote, the order is:
%%text "begin" - spacer - gracenote - "end" - mainnote
%%text |: A4 | A4 | !1(!y\{g\}!1)!B2 !2(!y\{g\}!2)!c2 A2 | A4 :| 
|: A4 | A4 | !1(!y{g}!1)!B2 !2(!y{g}!2)!c2 A2 | A4 :| 

--
Ewan Macpherson
To subscribe/unsubscribe, point your browser to: http://www.tullochgorm.com/lists.html

Reply via email to