Re: Microtone accidentals

2007-07-26 Thread Siska Ádám

Thank you again!


As I see, the thing that mostly prevented me from understanding the code 
was that the parameters come before the commands :-)


Bye,
Adam



Siska Ádám
+36 (70) 207-63-85
http://apocalypse.rulez.org/~sadam


Valentin Villenave wrote:

2007/7/26, Siska Ádám <[EMAIL PROTECTED]>:


BTW, could you explain a bit (maybe in a private mail) how actually it
works? I would like to adopt the sign to be able to create the
down-arrowed accidentals too, and to be able to attach them to natural
signs also, but unfortunately I know nothing about postscripting...


Actually, neither do I :)

The basics are quite easy to learn though (I've been playing with it
for only a couple weeks).

Think of a pen on the paper. I've just printed the accidental glyph,
so the postscript object will start on the right of the sign.
Therefore I have to move it to the left:

-1.4 0.5 moveto  %% where -1.4 is the X coordinate of my new origin point

Then I print the first (vertical line), starting from this point and 
going up:


-1.4 2 lineto  %% as you can see, only the Y coordinate has changed

Besides, I use

0.17 setlinewidth

to make a thicker line so it's seamlessly integrated with the glyph.

This was my first line. I could go on with the other lines, but I want
thiner lines now.
So have to create two distincts objects.

I add

stroke  %% to tell the engine to actually draw my first object (the
line); and I'll insert

gsave %% at the beginning of my code , and

grestore %% after my code, to start a whole new object (the arrowhead)

The new object is printed in a similar way:

gsave %% I save the initial state

0.1 setlinewidth %% previously it was 0.17, so this is thiner

-1.7 1.4 moveto %% I move my pen without drawing anything

-1.4 2.18 lineto %% first line, towards the top of the thick line
(notice the -1.4 Y axis)

-1.1 1.4 lineto  %% starting from the end of the previous line, I
directly draw the second (to the right)

stroke %% don't ask me why this is needed

Here ends the PostScipt part.

I included it in a very basic Scheme function I found in the manual:
http://lilypond.org/doc/v2.10/Documentation/user/lilypond/Simple-substitution-functions 



#(define-music-function (parser location note)   (ly:music?)

I create a variable, which will be named "note" (don't ask me how it 
works)

the (ly:music?) is a musical expression (so if you have several notes
to affect, you can encloe them in brackets and each accidental in the
brackets will be modified)

Here's the cool part: you can use Scheme to write genuine lilypond code

#{ \once \override Voice.Accidental #'stencil =
  #ly:text-interface::print

%%The Accidental object is replaced by a Text object (so I can use 
\markup)


   \once \override Voice.Accidental #'text =

%% Here comes the \markup, which include two objects: the glyph...

   \markup {\musicglyph #"accidentals.sharp"

%% ...and the postscript code

\postscript #"gsave 0.17 setlinewidth -1.4 0.5 moveto -1.4 2 lineto
   stroke grestore
gsave 0.1 setlinewidth -1.7 1.4 moveto -1.4 2.18 lineto -1.1 1.4
lineto
   stroke grestore"}

%%And of course, I don't forget to print the note after the accidental

$note #})

I'm really new to this (both Scheme and PostScript), so you see it
isn't very hard to do basic things. It is probably a very dirty code,
but it works.

Regards,
Valentin




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


Re: Microtone accidentals

2007-07-26 Thread Trevor Bača

On 7/26/07, Siska Ádám <[EMAIL PROTECTED]> wrote:

Hello,


after lot of people suggested to me to upgrade to version 2.11, I did
it. I have to admit that the result is much better than in 2.10,
specially with a lot of smart automation on text positioning, which up
to now was done by myself. But I have some serious problems which I
don't know how to solve. These are almost all related to textspanners.

1) If I simply use the method suggested by upgrade-ly for text spanners,
that is:

\override TextSpanner #'bound-details #'left #'text = 
\override TextSpanner #'bound-details #'right #'text = 

I don't get the dashed lines, only the texts (in my particular case,
 was set to #(markup #:italic "restez IV"), and 
to "", but also doesn't work with #(markup #:italic "sul sol") and "", etc.)


Please post the example where the dashes fail to print; dashes work
fine here with 2.11.x. Also, make sure you haven't set TextSpanner
#'dash-fraction = #0, which would remove the dashes as you describe.




2) I'm also getting the bug posted some time ago by Trevor Bača ('Overly
thick results from markup with draw-line'). Is there some workaround
related to this?


I think the developers posted back that that is, in fact, a bug but
has already been fixed in the repository. This means that 2.11.28 will
contain the fix. And, in fact, looking at the downloads page just now,
I see that 2.11.28 is available.

Argh, but trying the example just now shows that the overly thick nib
bug is still present in .28. Can you check and see if .28 still shows
the bug on your end? Maybe if we ask nicely, the fix will show up in
.29 ...




3) If there's a linebreak while a text spanner is active, the
textspanner's end-text gets displayed on the end of the line, and the
textspanner's begin-text gets displayed at the beginning of the new
line. How can I avoid this behaviour and get the one that worked in
2.10? (No duplications of the begin and end texts.) The reason in my
particular case is that the mentioned text-spanner tells the player that
he has to go from ordinary bow to sul ponticello while playing, and he
only has to reach the sul ponticello at the end of the text span. If I
got the sp sign printed on the end of the line, and I get the ord sign
printed at the beginning of the new line again, that would mean that the
player should do this two times (the ord->sp transition).


Ah, for this there's a corresponding group of attributes for what
happens to TextSpanners around line breaks. These attributes can be
found at

 \override TextSpanner #'bound-details #'left-broken

and

 \override TextSpanner #'bound-details #'right-broken

which you can set like this ...

 \override TextSpanner #'bound-details #'left-broken #'text = ""

... if, for example, you do *not* want text to appear immediately
before or after a line break.




4) text spanners are printed for some reason some times very very far
from the musical context, with no reason. Also, markup texts are placed
always above text spanners, which not always is convenient, but I don't
know how to change this behaviour. Also, if I have several text spanners
the one after the other, every new text spanner gets placed above the
prior one, causing the space between the staves to be enormous. The
normal behaviour for this should be that in this cases they come one
time above, the next time below the prior text spanner, respectively, to
keep space. Can I force the spanners to do this somehow?


The first question about the relative vertical order of markups and
spanners can be solved, I think. Text spanners come from the
TextSpanner grob; markups come, less intuitively, from the TextScript
grob.

I think that both TextSpanner and TextScript will respect the
#'outside-staff-priority attribute which is an arbitrary and
relatively integer vertical ordering index. So you can say

 \override TextSpanner #'outside-staff-priority = #500
 \override TextScript #'outside-staff-priority = #100

... to, for example, specify that the TextSpanner should be closer to
the staff while the markup (TextScript) should be farther away from
the staff; bigger values mean "I really wanna be closer to the staff".

So compare these two scores:

\version "2.11.28"

\new Staff {
  c'4 ^ \markup { foo } \startTextSpan
  c'4 \stopTextSpan
}

\new Staff {
  \override TextSpanner #'outside-staff-priority = #200
  \override TextScript #'outside-staff-priority = #100
  c'4 ^ \markup { foo } \startTextSpan
  c'4 \stopTextSpan
}


The second part of your question about keeping spanners from
incrementally getting higher and higher on the page is harder for me
to answer. Try making these other fixes first and see if the problem
gets better. If now, post back again and we might try turning off
skyline spacing for spanners and perhaps a couple of other grobs.





5) There's a line in my score where I get no more linebreak. In 2.10,
Lilypond broke me the line at that particular place, thus I got a very
nice and balanced score (this

Re: Microtone accidentals

2007-07-26 Thread Valentin Villenave

2007/7/26, Siska Ádám <[EMAIL PROTECTED]>:


BTW, could you explain a bit (maybe in a private mail) how actually it
works? I would like to adopt the sign to be able to create the
down-arrowed accidentals too, and to be able to attach them to natural
signs also, but unfortunately I know nothing about postscripting...


Actually, neither do I :)

The basics are quite easy to learn though (I've been playing with it
for only a couple weeks).

Think of a pen on the paper. I've just printed the accidental glyph,
so the postscript object will start on the right of the sign.
Therefore I have to move it to the left:

-1.4 0.5 moveto  %% where -1.4 is the X coordinate of my new origin point

Then I print the first (vertical line), starting from this point and going up:

-1.4 2 lineto  %% as you can see, only the Y coordinate has changed

Besides, I use

0.17 setlinewidth

to make a thicker line so it's seamlessly integrated with the glyph.

This was my first line. I could go on with the other lines, but I want
thiner lines now.
So have to create two distincts objects.

I add

stroke  %% to tell the engine to actually draw my first object (the
line); and I'll insert

gsave %% at the beginning of my code , and

grestore %% after my code, to start a whole new object (the arrowhead)

The new object is printed in a similar way:

gsave %% I save the initial state

0.1 setlinewidth %% previously it was 0.17, so this is thiner

-1.7 1.4 moveto %% I move my pen without drawing anything

-1.4 2.18 lineto %% first line, towards the top of the thick line
(notice the -1.4 Y axis)

-1.1 1.4 lineto  %% starting from the end of the previous line, I
directly draw the second (to the right)

stroke %% don't ask me why this is needed

Here ends the PostScipt part.

I included it in a very basic Scheme function I found in the manual:
http://lilypond.org/doc/v2.10/Documentation/user/lilypond/Simple-substitution-functions

#(define-music-function (parser location note)   (ly:music?)

I create a variable, which will be named "note" (don't ask me how it works)
the (ly:music?) is a musical expression (so if you have several notes
to affect, you can encloe them in brackets and each accidental in the
brackets will be modified)

Here's the cool part: you can use Scheme to write genuine lilypond code

#{ \once \override Voice.Accidental #'stencil =
  #ly:text-interface::print

%%The Accidental object is replaced by a Text object (so I can use \markup)

   \once \override Voice.Accidental #'text =

%% Here comes the \markup, which include two objects: the glyph...

   \markup {\musicglyph #"accidentals.sharp"

%% ...and the postscript code

\postscript #"gsave 0.17 setlinewidth -1.4 0.5 moveto -1.4 2 lineto
   stroke grestore
gsave 0.1 setlinewidth -1.7 1.4 moveto -1.4 2.18 lineto -1.1 1.4
lineto
   stroke grestore"}

%%And of course, I don't forget to print the note after the accidental

$note #})

I'm really new to this (both Scheme and PostScript), so you see it
isn't very hard to do basic things. It is probably a very dirty code,
but it works.

Regards,
Valentin


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


Re: Microtone accidentals

2007-07-26 Thread Siska Ádám

Hello,


wow, this is very nice! I also tried it with flat sign (just to try it 
out), and also works fine. Thank you!
BTW, could you explain a bit (maybe in a private mail) how actually it 
works? I would like to adopt the sign to be able to create the 
down-arrowed accidentals too, and to be able to attach them to natural 
signs also, but unfortunately I know nothing about postscripting...


Many thanks again!
Adam



Siska Ádám
+36 (70) 207-63-85
http://apocalypse.rulez.org/~sadam


Valentin Villenave wrote:

2007/7/25, Siska Ádám <[EMAIL PROTECTED]>:


As an explanation, the 1/6 pitch accidentals are actually simple
vertical arrows, which can be standalone (that means 1/6 pitch higher or
lower as the base pitch) or combined with sharp symbols (if this is the
case, the obtained pitch is 1/6 higher or lower than the respective
sharp). Theoretically there could also be arrows combined with flats,
but they are not necessary to get the full 'palette' of 1/6 pitches (for
example, [uparrow + g flat] would mean the same as [uparrow + f sharp]).
Some times the standalone arrows are combined with natural symbols. I'm
not sure if these signs are standardized or not, but composers like
Grisey or Murail use these symbols frequently in their scores.


What about the following trick? (It looks ugly on screen, but fine 
when printed)

It has to be adapted, of course.


%%%snippet

upp =
#(define-music-function (parser location note)   (ly:music?)
 #{ \once \override Voice.Accidental #'stencil =
  #ly:text-interface::print
\once \override Voice.Accidental #'text =
  \markup {\musicglyph #"accidentals.sharp"
\postscript #"gsave 0.17 setlinewidth -1.4 0.5 moveto -1.4 2 lineto
   stroke grestore
gsave 0.1 setlinewidth -1.7 1.4 moveto -1.4 2.18 lineto -1.1 1.4 
lineto

   stroke grestore"}
$note #})

\relative {
a b d \upp gis
}

%%%

Regards,
Valentin Villenave




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


Re: Microtone accidentals

2007-07-26 Thread Siska Ádám

Hello,


after lot of people suggested to me to upgrade to version 2.11, I did 
it. I have to admit that the result is much better than in 2.10, 
specially with a lot of smart automation on text positioning, which up 
to now was done by myself. But I have some serious problems which I 
don't know how to solve. These are almost all related to textspanners.


1) If I simply use the method suggested by upgrade-ly for text spanners, 
that is:


\override TextSpanner #'bound-details #'left #'text = 
\override TextSpanner #'bound-details #'right #'text = 

I don't get the dashed lines, only the texts (in my particular case, 
 was set to #(markup #:italic "restez IV"), and  
to "", but also doesn't work with #(markup #:italic "sul sol") and "", etc.)


2) I'm also getting the bug posted some time ago by Trevor Bača ('Overly 
thick results from markup with draw-line'). Is there some workaround 
related to this?


3) If there's a linebreak while a text spanner is active, the 
textspanner's end-text gets displayed on the end of the line, and the 
textspanner's begin-text gets displayed at the beginning of the new 
line. How can I avoid this behaviour and get the one that worked in 
2.10? (No duplications of the begin and end texts.) The reason in my 
particular case is that the mentioned text-spanner tells the player that 
he has to go from ordinary bow to sul ponticello while playing, and he 
only has to reach the sul ponticello at the end of the text span. If I 
got the sp sign printed on the end of the line, and I get the ord sign 
printed at the beginning of the new line again, that would mean that the 
player should do this two times (the ord->sp transition).


4) text spanners are printed for some reason some times very very far 
from the musical context, with no reason. Also, markup texts are placed 
always above text spanners, which not always is convenient, but I don't 
know how to change this behaviour. Also, if I have several text spanners 
the one after the other, every new text spanner gets placed above the 
prior one, causing the space between the staves to be enormous. The 
normal behaviour for this should be that in this cases they come one 
time above, the next time below the prior text spanner, respectively, to 
keep space. Can I force the spanners to do this somehow?


5) There's a line in my score where I get no more linebreak. In 2.10, 
Lilypond broke me the line at that particular place, thus I got a very 
nice and balanced score (this was not a manual linebreak, however, it 
was a very good decision by the engine to put it there). Now, I don't 
get the linebreak, and thanks to this, I have two pages that contain 
single systems (I'm engraving a string quartet!), and in one of them the 
system is longer than the page... And even if I put a manual linebreak, 
it does nothing. In the particular case, there are several glissandi 
crossing that barline. Can this cause this error? Do you have any idea 
to avoid it?


6) At compilation time, I'm getting lots of 'warning: Found infinity or 
nan in output. Substituting 0.0' warnings, which I hadn't get before. Do 
you have any idea for this?



Thank you,
Adam



Siska Ádám
+36 (70) 207-63-85
http://apocalypse.rulez.org/~sadam


Valentin Villenave wrote:

2007/7/26, Valentin Villenave <[EMAIL PROTECTED]>:

What about the following trick? (It looks ugly on screen, but fine 
when printed)


[snip]

I forgot to mention that it will only work with 2.11 (the syntax has
changed since 2.10).
Since you're running 2.10, you may have to use a few modifications
(such as accidentals.2 instead of accidentals.sharp, etc.). --
however, you'd better upgrade to 2.11.27; it's quite reliable and
better in some ways.

V.




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


Re: Microtone accidentals

2007-07-25 Thread Valentin Villenave

2007/7/26, Valentin Villenave <[EMAIL PROTECTED]>:


What about the following trick? (It looks ugly on screen, but fine when printed)


[snip]

I forgot to mention that it will only work with 2.11 (the syntax has
changed since 2.10).
Since you're running 2.10, you may have to use a few modifications
(such as accidentals.2 instead of accidentals.sharp, etc.). --
however, you'd better upgrade to 2.11.27; it's quite reliable and
better in some ways.

V.


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


Re: Microtone accidentals

2007-07-25 Thread Valentin Villenave

2007/7/25, Siska Ádám <[EMAIL PROTECTED]>:


As an explanation, the 1/6 pitch accidentals are actually simple
vertical arrows, which can be standalone (that means 1/6 pitch higher or
lower as the base pitch) or combined with sharp symbols (if this is the
case, the obtained pitch is 1/6 higher or lower than the respective
sharp). Theoretically there could also be arrows combined with flats,
but they are not necessary to get the full 'palette' of 1/6 pitches (for
example, [uparrow + g flat] would mean the same as [uparrow + f sharp]).
Some times the standalone arrows are combined with natural symbols. I'm
not sure if these signs are standardized or not, but composers like
Grisey or Murail use these symbols frequently in their scores.


What about the following trick? (It looks ugly on screen, but fine when printed)
It has to be adapted, of course.


%%%snippet

upp =
#(define-music-function (parser location note)   (ly:music?)
 #{ \once \override Voice.Accidental #'stencil =
  #ly:text-interface::print
\once \override Voice.Accidental #'text =
  \markup {\musicglyph #"accidentals.sharp"
\postscript #"gsave 0.17 setlinewidth -1.4 0.5 moveto -1.4 2 lineto
   stroke grestore
gsave 0.1 setlinewidth -1.7 1.4 moveto -1.4 2.18 lineto -1.1 1.4 lineto
   stroke grestore"}
$note #})

\relative {
a b d \upp gis
}

%%%

Regards,
Valentin Villenave


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


Microtone accidentals

2007-07-25 Thread Siska Ádám

Dear Users,



I'm engraving a score that has several microtonal accidentals of 1/6 
pitches. I know that there are no 1/6-pitch accidentals in Lilypond (as 
far as I know there are only 1/4 tone accidentals), and I have a very 
short deadline for this work, so I don't think I could put this wish to 
a feature request list, but must do something by myself (as I need to 
solve the issue in a very short time).


Does anyone know how should I start with this?

As an explanation, the 1/6 pitch accidentals are actually simple 
vertical arrows, which can be standalone (that means 1/6 pitch higher or 
lower as the base pitch) or combined with sharp symbols (if this is the 
case, the obtained pitch is 1/6 higher or lower than the respective 
sharp). Theoretically there could also be arrows combined with flats, 
but they are not necessary to get the full 'palette' of 1/6 pitches (for 
example, [uparrow + g flat] would mean the same as [uparrow + f sharp]). 
Some times the standalone arrows are combined with natural symbols. I'm 
not sure if these signs are standardized or not, but composers like 
Grisey or Murail use these symbols frequently in their scores.


Thank you,
Adam



Siska Ádám
+36 (70) 207-63-85
http://apocalypse.rulez.org/~sadam


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