Re: Postsctipt arrows

2015-03-13 Thread Urs Liska


Am 14. März 2015 07:15:47 MEZ, schrieb Andrew Bernard 
:
>David,
>
>Thanks so much for your postscript solution. It’s exactly what I want.
>Very, very much appreciated. I feel liberated, since I know postscript
>well, I can do almost anything now.
>
>is it worth creating a snippet for LSR on this topic?

Sure.
And since it is a very generic thing with quite some potential I would be happy 
if you could write a tutorial style post on Scores of Beauty. 

Urs

>
>Andrew

>
>
>
>
>
>
>___
>lilypond-user mailing list
>lilypond-user@gnu.org
>https://lists.gnu.org/mailman/listinfo/lilypond-user


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Postsctipt arrows

2015-03-13 Thread Andrew Bernard
David,

Thanks so much for your postscript solution. It’s exactly what I want. Very, 
very much appreciated. I feel liberated, since I know postscript well, I can do 
almost anything now.

is it worth creating a snippet for LSR on this topic?

Andrew


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Postsctipt arrows

2015-03-13 Thread David Nalesnik
On Fri, Mar 13, 2015 at 9:43 PM, David Nalesnik 
wrote:

>
>>
> Spoke too soon:
>
>  \version "2.19.16"
>
> arrowdef = "/arrowdict 14 dict def arrowdict begin
> /mtrx matrix def end
> /arrow
> { arrowdict begin
> /headlength exch def /halfheadthickness exch 2 div def /halfthickness exch
> 2 div def
> /tipy exch def /tipx exch def
> /taily exch def /tailx exch def
> /dx tipx tailx sub def
> /dy tipy taily sub def
> /arrowlength dx dx mul dy dy mul add
> sqrt def
> /angle dy dx atan def
> /base arrowlength headlength sub def
> /savematrix mtrx currentmatrix def
> tailx taily translate angle rotate
> 0 halfthickness neg moveto
> base halfthickness neg lineto base halfheadthickness neg lineto
> arrowlength 0 lineto
> base halfheadthickness lineto base halfthickness lineto
> 0 halfthickness lineto
> closepath
> savematrix setmatrix end
> } def"
>
> myarrow = #(string-append arrowdef " 0 0 20 4 0.3 1.2 1.2 arrow stroke")
>
> {
>   c-\markup { \postscript #myarrow }
> }
>
>
You will probably want to use this in conjunction with \with-dimensions so
the markup affects spacing.  See for example
http://lsr.di.unimi.it/LSR/Snippet?id=435

--David
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Postsctipt arrows

2015-03-13 Thread David Nalesnik
On Fri, Mar 13, 2015 at 9:27 PM, David Nalesnik 
wrote:

>
>
> On Fri, Mar 13, 2015 at 9:24 PM, David Nalesnik 
> wrote:
>
>>
>>
>> On Fri, Mar 13, 2015 at 8:31 PM, Andrew Bernard > > wrote:
>>
>>> Why do I get the feeling nobody is going to answer this? In all
>>> seriousness, I don’t know enough about lilypond to know if this is even
>>> possible or not, which is a dark state of ignorance. If the Scheme gods
>>> could let me know if I am barking up an entirely impossible tree, that may
>>> save me from wandering in the wilderness. The archives seem very silent on
>>> this topic.
>>>
>>
>> Look for the documentation of the \postscript command to get you started:
>> http://lilypond.org/doc/v2.19/Documentation/notation/graphic
>>
>> David
>>
>
> Oh, oops, I see that you referenced that command.  Sorry, don't think I
> can be of much help here.
>
>
Spoke too soon:

 \version "2.19.16"

arrowdef = "/arrowdict 14 dict def arrowdict begin
/mtrx matrix def end
/arrow
{ arrowdict begin
/headlength exch def /halfheadthickness exch 2 div def /halfthickness exch
2 div def
/tipy exch def /tipx exch def
/taily exch def /tailx exch def
/dx tipx tailx sub def
/dy tipy taily sub def
/arrowlength dx dx mul dy dy mul add
sqrt def
/angle dy dx atan def
/base arrowlength headlength sub def
/savematrix mtrx currentmatrix def
tailx taily translate angle rotate
0 halfthickness neg moveto
base halfthickness neg lineto base halfheadthickness neg lineto arrowlength
0 lineto
base halfheadthickness lineto base halfthickness lineto
0 halfthickness lineto
closepath
savematrix setmatrix end
} def"

myarrow = #(string-append arrowdef " 0 0 20 4 0.3 1.2 1.2 arrow stroke")

{
  c-\markup { \postscript #myarrow }
}
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Postsctipt arrows

2015-03-13 Thread David Nalesnik
On Fri, Mar 13, 2015 at 8:31 PM, Andrew Bernard 
wrote:

> Why do I get the feeling nobody is going to answer this? In all
> seriousness, I don’t know enough about lilypond to know if this is even
> possible or not, which is a dark state of ignorance. If the Scheme gods
> could let me know if I am barking up an entirely impossible tree, that may
> save me from wandering in the wilderness. The archives seem very silent on
> this topic.
>

Look for the documentation of the \postscript command to get you started:
http://lilypond.org/doc/v2.19/Documentation/notation/graphic

David
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Postsctipt arrows

2015-03-13 Thread David Nalesnik
On Fri, Mar 13, 2015 at 9:24 PM, David Nalesnik 
wrote:

>
>
> On Fri, Mar 13, 2015 at 8:31 PM, Andrew Bernard 
> wrote:
>
>> Why do I get the feeling nobody is going to answer this? In all
>> seriousness, I don’t know enough about lilypond to know if this is even
>> possible or not, which is a dark state of ignorance. If the Scheme gods
>> could let me know if I am barking up an entirely impossible tree, that may
>> save me from wandering in the wilderness. The archives seem very silent on
>> this topic.
>>
>
> Look for the documentation of the \postscript command to get you started:
> http://lilypond.org/doc/v2.19/Documentation/notation/graphic
>
> David
>

Oh, oops, I see that you referenced that command.  Sorry, don't think I can
be of much help here.

David
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Postsctipt arrows

2015-03-13 Thread Andrew Bernard
Why do I get the feeling nobody is going to answer this? In all seriousness, I 
don’t know enough about lilypond to know if this is even possible or not, which 
is a dark state of ignorance. If the Scheme gods could let me know if I am 
barking up an entirely impossible tree, that may save me from wandering in the 
wilderness. The archives seem very silent on this topic.

Thanks!

Since I discovered lilypond postscript units are staff-spaces and not points, 
and that the postscript coordinate origin is at the reference point of the 
ground in question, a better example of showing an arrow is:

0 0 20 4 0.3 1.2 1.2 arrow

So, in short, I need to understand if it is possible to pass parameters (seven 
in this case) to a postscript procedure in the context of a markup expression.


Andrew



On 13 March 2015 at 16:04:30, Andrew Bernard (andrew.bern...@gmail.com) wrote:

Greetings list,

I want to make many different types of arrows using PostScript. The following 
function from the Adobe Blue Book works very nicely for what I need. It’s quite 
general.

The question is, how do I incorporate something of this level of complexity 
this into a form where it can be invoked with \postscript in a \markup block?

%!PS-Adobe-3.0
/arrowdict 14 dict def arrowdict begin
/mtrx matrix def end
/arrow
{ arrowdict begin
/headlength exch def /halfheadthickness exch 2 div def /halfthickness exch 2 
div def
/tipy exch def /tipx exch def
/taily exch def /tailx exch def
/dx tipx tailx sub def
/dy tipy taily sub def
/arrowlength dx dx mul dy dy mul add
sqrt def
/angle dy dx atan def
/base arrowlength headlength sub def
/savematrix mtrx currentmatrix def
tailx taily translate angle rotate
0 halfthickness neg moveto
base halfthickness neg lineto base halfheadthickness neg lineto arrowlength 0 
lineto
base halfheadthickness lineto base halfthickness lineto
0 halfthickness lineto
closepath
savematrix setmatrix end
} def

An example of use in raw PostScript:

newpath
318 340 72 340 10 30 72 arrow
fill

Andrew




___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Postsctipt arrows

2015-03-12 Thread Andrew Bernard
Greetings list,

I want to make many different types of arrows using PostScript. The following 
function from the Adobe Blue Book works very nicely for what I need. It’s quite 
general.

The question is, how do I incorporate something of this level of complexity 
this into a form where it can be invoked with \postscript in a \markup block?

%!PS-Adobe-3.0
/arrowdict 14 dict def arrowdict begin
/mtrx matrix def end
/arrow
{ arrowdict begin
/headlength exch def /halfheadthickness exch 2 div def /halfthickness exch 2 
div def
/tipy exch def /tipx exch def
/taily exch def /tailx exch def
/dx tipx tailx sub def
/dy tipy taily sub def
/arrowlength dx dx mul dy dy mul add
sqrt def
/angle dy dx atan def
/base arrowlength headlength sub def
/savematrix mtrx currentmatrix def
tailx taily translate angle rotate
0 halfthickness neg moveto
base halfthickness neg lineto base halfheadthickness neg lineto arrowlength 0 
lineto
base halfheadthickness lineto base halfthickness lineto
0 halfthickness lineto
closepath
savematrix setmatrix end
} def

An example of use in raw PostScript:

newpath
318 340 72 340 10 30 72 arrow
fill

Andrew




___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user