lilypond-user
[Top][All Lists]
Advanced

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

Re: lines/graphic notation?


From: Mats Bengtsson
Subject: Re: lines/graphic notation?
Date: Thu, 04 Nov 2004 13:33:12 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040913

You don't need that much competence in postscript.
Look at the following example:
a-\markup { \postscript #"0.1 setlinewidth 2 7 moveto 5 1 rlineto stroke" }

The first thing to know is that you always specify the argument
first and then the command to apply on the argument.
"0.1 setlinewidth" just specifies the line width
"2 7 moveto" moves the "pen" to its starting position, where 2 is the x-coordinate and 7 is the y-coordinate.
"5 1 rlineto stroke" makes the pen draw a straight line from
its starting position to a point 5 units to the right and 1 unit up
(the 'r' in rlineto stands for relative, use lineto if you want
absolute coordinates).
If you have a line with several corners, use several rlineto
before the stroke (which does the actual drawing):
1 1 rlineto 1 -1 rlineto 2 -3 rlineto stroke

Just as for all properties in LilyPond, the unit used for the
coordinates is the spacing between two staff lines.

If you want to do it in a lyrics line, I think it's possible to
specify a syllable like
"\\embeddedps{0.1 setlinewidth 2 7 moveto 5 1 rlineto stroke}"
as long as LilyPond uses TeX to process its output.
However, why not use markups (possibly connected to some invisible
staff if you want it on a separate line, look at the definition of
the Dynamics context in the template for piano with centered dynamics
if you want inspiration).

To answer your original question, a search for
postscript tutorial
in Google, provided for example
http://www.cs.indiana.edu/docproject/programming/postscript/postscript.html

   /Mats


D Josiah Boothby wrote:
I don't think that the attachment worked right. The example can be seen at

http://students.washington.edu/josiah/oscillation1.png

josiah

On Thu, 4 Nov 2004, D Josiah Boothby wrote:

Hello, all,

I'd like to draw a (visually simple) oscillation line over a note. I realize it would probably require a knowledge of postscript... but I don't have any idea where to start with postscript. Ideally, the line would change direction at specific enough points so that they can be aligned in the measure with other things going on.

I've included a Gimp-edited example which gives a basic idea as to what I'm trying to acheive. If at all possible, it would be ideal if I could set it up like a lyric staff:

oscillation = { s4\instruction1 s16\instruction2 s\instruction3 ... }
notes = { bes1 }

...and end up putting them together, as I mentioned above like lyrics.

Any ideas on how I can do this, or where to look to learn postscript?

Thanks,

Josiah



_______________________________________________
lilypond-user mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/lilypond-user

--
=============================================
        Mats Bengtsson
        Signal Processing
        Signals, Sensors and Systems
        Royal Institute of Technology
        SE-100 44  STOCKHOLM
        Sweden
        Phone: (+46) 8 790 8463                         
        Fax:   (+46) 8 790 7260
        Email: address@hidden
        WWW: http://www.s3.kth.se/~mabe
=============================================




reply via email to

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