On Sunday 06 November 2005 00:55, Hudson Lacerda wrote:
> Hi people,
>
> Maybe some of you yet don't know that I have written some abcm2ps
> extensions, like:

<snipped>

>
> I would be interested in to know who also writes or just uses/wants to
> use abcm2ps extensions (deco/postscript), to exchange ideas.

A while back I used abcm2ps to learn to typeset piobaireachd in ABC (a rather 
pointless task, perhaps, but it was instructive).  It involved quite a lot of 
mucking around with PS and other features unique to abcm2ps.  The example I 
produced is below.  Please note it is not a real tune, if you try and play 
it, the ghost of the MacCrimmons will probably haunt you for all eternity!

Apologies if your mail-reader breaks at 80.

If anyone can figure out how to do any of the things in here a better way I'd 
love to know - the brace marks in particular are just a hack.  One thing I 
haven't done is that sometimes the Cs and Ts are printed upside down when a 
mach movements are written out explicitly.  There is a lot of abuse of Q: 
labels and so forth, again any ways to accomplish the same thing while 
maintaining semantic integrity would be welcome!

Cheers,
Calum

--

%
%
% This file is an attempt to gather in one place the commonest
% features unique to piobaireachd.  It involves a *lot* of postscript,
% for which I make no apologies.  I do apologise for the rudimentary
% nature of some of the routines; in particular, the routine to draw
% phrase-braces is particularly poor, but I can't see a better way at
% the moment.
%
%
% This is what I use to render this file.  If you increase -s any
% more than 558, lines in the multicols start overflowing.  Ugh.
%
% abcm2ps -O= -s 0.558 -f piob-howto.abc
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Formatting stuff, makes it all hang together...
%
%
% Set pagewidth to A4 (or multiple columns get squished...) Americans
% and others may need to change this?
%
%%pagewidth 21cm
%
% Increase title size, as the compression makes normal title size pretty
% weeny.
%
%%titlefont Times-Roman 35
%
% Decrease space before title...yes, it's minus 2.
%
%%titlespace -2cm
%
%%gchordfont Times-Roman % piobaireachd players want classy fonts
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% This routine draws the three GDE-taorluath lines.
%
%%postscript /gde {
%%postscript 1.2 setlinewidth
%%postscript M -3 18 rmoveto
%%postscript 6 0 rlineto -6 -2 rmoveto
%%postscript 6 0 rlineto -6 -2 rmoveto
%%postscript 6 0 rlineto stroke } bdef
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Defines the GDE "decoration".  To use it, just put !gde! in front of
% the note to be gde'ed.  Note that it increases the depth of the staff,
% so braces / line labels will need rejigged.
%
%%deco gde 6 gde 20 0 0
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% This routine draws line labels in front of the staff.
%
% offset is a value in points that specifies the vertical move.  If
% you call before the line, it's about -52; if after, about 28.  These
% values vary if you include things like !gde!, braces, or have text
% that 'belongs' to the line, like the part title (I. Urlar), or other custom
% decorations.  Don't know how to get them steady, though I think it
% could be done.
%
%
%%postscript /prelinetext { % usage (text) offset prelinetext
%%postscript /Times-Roman findfont
%%postscript 14 scalefont
%%postscript setfont
%%postscript -10 exch M flushright
%%postscript } bdef
%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Right justify text (replace 'show' with this)
%
%%postscript /flushright {
%%postscript dup stringwidth
%%postscript -1 mul exch -1 mul exch
%%postscript rmoveto show } def
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Draw braces with set text...this is a mess, but it kinda works.  You
% have to specify your own length, and (relative) x, y co-ords.  230 points is
% about one bar(very very roughly); if there's nothing under the staff, like 
GDE taorluath
% marks, then 45 70 should about start it at the first gracenote.  Hopefully.
%
% A major problem with this is that it doesn't scale - meaning that
% when halfway through a tune and you have to reduce the scaling from 0.7
% to 0.6 (say), the braces won't move.  Sorry.  Fixes welcome.
%
%%postscript /drawbrace {   % usage: len x y (text) drawbrace
%%postscript   /texttodisplay exch def
%%postscript  exch -9 add exch 2 copy
%%postscript  M 2 -2 rmoveto /Times-Roman 12 selectfont texttodisplay show
%%postscript  M 0 10 rlineto currentpoint stroke M
%%postscript  0 add 0 rlineto currentpoint stroke M
%%postscript  0 -10 rlineto stroke
%%postscript } bdef
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Finally, some ABC!
%
X:0
T:Piobaireachd How-To
L:1/8
M:4/4 3/4
K:HP
Q:"I. Urlar"
%
%
{ge4}A{d}c {GdGcG}B2 !turn!B!fermata!e {ge4d}B2 \
| {G} A4 !uppermordent! "^(1)"fe | {fege}f2 e2 {ge4}d{G}<d!trill!d2 \
| {g}e3 {G2dc}d3 :|
%
%%postscript (Line 1st.) 28 prelinetext
%
{ge4}A{d}c {GdGcG}B2 !turn!B!fermata!e {ge4d}B2 \
| {G} A4 !uppermordent! "^(1)"fe | {fege}f2 e2 {ge4}d{G}<d!trill!d2 \
| !gde!A<e !gde!A<d !gde!A{d}<B |
%
%%postscript 260 45 88 (Play twice) drawbrace
%%postscript 70 210 84 (Not 2nd time) drawbrace
%%postscript (2nd.) 28 prelinetext
%%postscript (3rd.) -52 prelinetext
%
{ge4}A{d}c {GdGcG}B2 !turn!B!fermata!e {ge4d}B2 \
| {G} A4 !uppermordent! "^(1)"fe | {fege}f2 e2 {ge4}d{G}<d!trill!d2 \
| e2 d2 A2 |]
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%%vskip 1cm
%
Q:"II. Dithis"
%
%%postscript (Line 1st.) -60 prelinetext
%
{g}A{e}>A {g}c{e}>A {g}e>A {g}c{e}>A | \
a>A {g}f{g}>A {g}e{g}>A {g}A{e}>A | \
{g}A{e}>A {g}B{e}>A {g}c{e}>A {g}A{e}>A | \
a>A {g}f{g}>A {g}d{e}>A {g}d{e}>A :|
%%postscript (2nd.) -40 prelinetext
{g}A{e}>A {g}c{e}>A {g}e>A {g}c{e}>A | \
a>A {g}f{g}>A {g}e{g}>A {g}A{e}>A | \
{g}A{e}>A {g}B{e}>A {g}c{e}>A {g}A{e}>A | \
a>A {g}f{g}>A {g}d{e}>A {g}d{e}>A |
%%postscript (3rd.) -40 prelinetext
{g}A{e}>A {g}c{e}>A {g}e>A {g}c{e}>A | \
a>A {g}f{g}>A {g}e{g}>A {g}A{e}>A | \
{g}A{e}>A {g}B{e}>A {g}c{e}>A {g}A{e}>A | \
a>A {g}f{g}>A {g}d{e}>A {g}d{e}>A |]
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%%vskip 1cm
%
Q:"III. Doubling"
%
%%postscript (Line 1st.) -60 prelinetext
%
{g}A{e}>A {g}c{e}>c {g}e{g}>e {g}c{e}>c | \
a{g}>a {g}f{g}>f {g}e{g}>e {g}A{e}>A | \
{g}A{e}>A {g}B{e}>B {g}c{e}>c {g}A{e}>A | \
a{g}>a f{g}>f {g}d{e}>d {g}d{e}>d :|
%%postscript (2nd.) -40 prelinetext
{g}A{e}>A {g}c{e}>c {g}e{g}>e {g}c{e}>c | \
a{g}>a {g}f{g}>f {g}e{g}>e {g}A{e}>A | \
{g}A{e}>A {g}B{e}>B {g}c{e}>c {g}A{e}>A | \
a{g}>a f{g}>f {g}d{e}>d {g}d{e}>d |
%%postscript (3rd.) -40 prelinetext
{g}A{e}>A {g}c{e}>c {g}e{g}>e {g}c{e}>c | \
a{g}>a {g}f{g}>f {g}e{g}>e {g}A{e}>A | \
{g}A{e}>A {g}B{e}>B {g}c{e}>c {g}A{e}>A | \
a{g}>a f{g}>f {g}d{e}>d {g}d{e}>d |]
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%%multicol start
%%rightmargin 11.5cm
%
%%vskip 1cm
%
Q:"IV. Taorluath & V. Doubling"
A2 c2 e2 c2 | a2 f2 e2 A2 | A2 B2 c2 A2 | "^(2)"a2 f2 d2 d2 :|
%%postscript (Line 1st.) 52 prelinetext
w:T T T T T T T T T T T T T T T T
w:T' T' T' T' T' T' T' T' T' T' T' T' T' T' T' T'
a2 f2 e2 A2 | A2 c2 e2 c2 | A2 B2 c2 A2 | a2 f2 d2 d2 |
w:T T T T T T T T T T T T T T T T
w:T' T' T' T' T' T' T' T' T' T' T' T' T' T' T' T'
%%postscript (2nd.) 52 prelinetext
%%postscript (3rd.) -40 prelinetext
A2 B2 c2 A2 | a2 f2 d2 d2 | a2 f2 e2 A2 | A2 c2 e2 c2 |]
w:T T T T T T T T T T T T T T T T
w:T' T' T' T' T' T' T' T' T' T' T' T' T' T' T' T'
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%%multicol new
%%leftmargin 11cm
%
%%vskip 1cm
%
Q:"VI. Crunluath & VII. Doubling"
A2 c2 e2 c2 | a2 f2 e2 A2 | A2 B2 c2 A2 | a2 f2 \
w:C C C C C C C C C C C C C C
w:C' C' C' C' C' C' C' C' C' C' C' C' C' C'
{ge4}!fermata!da d2 d2 :|
%%postscript (Line 1st.) 52 prelinetext
w:* * C C
w:* * C' C'
%%postscript 34 340 100 (T) drawbrace
%%postscript 14 380 100 (T') drawbrace
a2 "^(3)"f2 e2 A2 | A2 c2 e2 c2 | A2 B2 c2 A2 | a2 f2 d2 d2 |
w:C C C C C C C C C C C C C C C C
w:C' C' C' C' C' C' C' C' C' C' C' C' C' C' C' C'
%%postscript (2nd.) 52 prelinetext
%%postscript (3rd.) -40 prelinetext
A2 B2 c2 A2 | a2 f2 d2 d2 | a2 f2 e2 A2 | A2 c2 e2 c2 |]
w:C C C C C C C C C C C C C C C C
w:C' C' C' C' C' C' C' C' C' C' C' C' C' C' C' C'
%
%%multicol end
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Written/played...
%
%%vskip 2cm
%
%%leftmargin 7.5cm
%
V:1
%%postscript (Written) -40 prelinetext
!uppermordent!f2 | !turn!B2 | !trill!d2||
V:2
%%postscript (Played) -98 prelinetext
{fege}f2 | {GdGcG}B2 | {G2dc}d2 ||
%


------------------------ Yahoo! Groups Sponsor --------------------~--> 
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/mjFolB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/abcusers/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to