Re: Marking up titles - font-name and italics

2017-08-24 Thread Daniel Cory


Wow, you both really helped me there. I understand what is going on behind the 
scenes. I will have to try that when I get a chance. I also have a follow up 
question. Is there a way to adjust a text's tracking or kearning?




 On Fri, 25 Aug 2017 01:30:16 -0400 Abraham Lee 
tisimst.lilyp...@gmail.com wrote 




Hi, Brian. 



On Thu, Aug 24, 2017 at 11:22 PM Brian Barker b.m.bar...@btinternet.com 
wrote:

At 22:07 24/08/2017 -0700, Abraham Noname wrote:

 In order for \italic, \bold, etc. to work in a markup, what you need

 to do as add Arial as a font-family. The easiest way is to set it as

 one of the main global text fonts, like 'sans. If you are using

 2.18, then use make-pango-font-tree, as described here: [...]

 

 Why not just \override #'(font-name . "Arial Italic") and no \italic ?



That definitely works. I was just trying to clear up the misconception 
surrounding what the OP thought \override #'(font-name . "Arial") was supposed 
to do. If that is really all that Daniel wanted to accomplish without the 
flexibility of being able to use the other font variants, then what you 
suggested is a perfectly acceptable  way to do that. 



(I suggested this to the list, but - like most of my messages - it

 was not posted.)



Hmmm... that is odd. Are you certain you are subscribed to the mailing list?



Best,

Abraham








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


Re: Marking up titles - font-name and italics

2017-08-24 Thread tisimst
Hi, Daniel!

On Thu, Aug 24, 2017 at 9:17 PM, Daniel Cory [via Lilypond] <
ml+s1069038n205248...@n5.nabble.com> wrote:

> Hello,
>
> I have what seems to be a rather simple problem. I am trying to format the
> font of my piece title. I can change it to italics, and I can change the
> font name, but I just can't seem to do both. Please keep in mind that I am
> extremely new to lilypond, so I may be missing something simple, but here
> is my code.
>
> \header {
>
>title = \markup {
>   \override #'(font-name . "Arial")
>   \italic
>   {This is a test}
>
>}
> }
>
> I thought that maybe it was the braces around my text so I took them out,
> I've tried putting quotes around, I've tried changing the order of my
> markup. I just can't seem to do both font-name and another markup. Could
> someone please tell me what I'm doing wrong?
>

Here's what's going on. When you override 'font-name, you are very
specifically changing the font to the one file who's internal name is
"Arial". In other words, it doesn't tell LilyPond that there are other
variants (like Italic, Bold, and Bold-Italic), just the exact one you
specify. That is why nothing seems to happen when you use \italic here. If
LilyPond doesn't think a italic/bold/whatever font variant is there, it
falls back to the regular variant.

So, what is to be done? In order for \italic, \bold, etc. to work in a
markup, what you need to do as add Arial as a font-family. The easiest way
is to set it as one of the main global text fonts, like 'sans. If you are
using 2.18, then use make-pango-font-tree, as described here:

http://lilypond.org/doc/v2.18/Documentation/notation/fonts#entire-document-fonts

make-pango-font-tree takes three inputs in this order: a roman (or serif)
font, a sans-serif font, and typewriter (or monospace) font. So, all you
need to do is make sure that you put "Arial" as the second input. Then, in
the markup you can do

title = \markup { \sans \italic "This is a test" }

and it will display in the correct form you expected.

Hope that helps,
Abraham




--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Marking-up-titles-font-name-and-italics-tp205248p205249.html
Sent from the User mailing list archive at Nabble.com.___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Marking up titles - font-name and italics

2017-08-24 Thread Daniel Cory
Hello,



I have what seems to be a rather simple problem. I am trying to format the font 
of my piece title. I can change it to italics, and I can change the font name, 
but I just can't seem to do both. Please keep in mind that I am extremely new 
to lilypond, so I may be missing something simple, but here is my code.



\header {



   title = \markup {

  \override #'(font-name . "Arial")

  \italic

  {This is a test}



   }

}


I thought that maybe it was the braces around my text so I took them out, I've 
tried putting quotes around, I've tried changing the order of my markup. I just 
can't seem to do both font-name and another markup. Could someone please tell 
me what I'm doing wrong?



Thank you!



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


Re: Jianpu Notation

2017-08-24 Thread David Zhang
Hi MING !

I can't do the merge right now for I have to look deep into the code. But 
anyone who do is welcome to make a pull request.
Also, for any feature wanted, please fire an issue.

David Zhang


> 在 2017年8月25日,上午2:26,MING TSANG  写道:
> 
> Thank you David Zhang for setting this github. Now the lilipond-jianpu 
> development can proceed after two years wait.
> Can you  merge your jianpu6.y code with jianpu10a.ly? 
> Thank you.
> Ming
> 
> 
> From: David Zhang 
> To: MING TSANG ; Paul Morris ; 
> Werner LEMBERG ; Carl Sorensen ; David 
> Nalesnik ; Lilypond-usermailinglist 
>  
> Sent: Thursday, August 24, 2017 1:02 AM
> Subject: Re: Jianpu Notation
> 
> Hi all!
> 
> I have created a github resp. and uploaded our previous code to 
> https://github.com/nybbs2003/lilypond-Jianpu 
>  . And we can resume the 
> development and make further discussion on github.
> 
> David Zhang
> 
> 
>> 在 2017年8月24日,上午11:18,MING TSANG > > 写道:
>> 
>> From:Paul Morris
>> Subject: Re: Jianpu Notation
>> Date:Thu, 30 Apr 2015 11:36:28 -0400
>> There has no activities since April 30/2015 - two year past.
>> I hope Paul Morris and David Zhang can re-start the development of Jianpu.
>> Thank you.
>> Ming.
>> 
>> > On Apr 30, 2015, at 9:10 AM, MING TSANG  wrote:
>> > 
>> > David & Paul: 
>> > I created jianpu-test_1.ly for testing jianpu9.ly 
>> > The result is self explaining.   
>> 
>> Thanks Ming, this is helpful.
>> 
>> > There is a difference in coding c''8 8 vs c''8 c’'
>> 
>> Ah, it seems that in c’’8 8 the 8 does not have a pitch property when it is 
>> received by the jianpuMusic function:
>> 
>> \displayMusic shows that c’’8 becomes:
>> 
>> (make-music
>> 'NoteEvent
>> 'duration
>> (ly:make-duration 3)
>> 'pitch
>> (ly:make-pitch 1 0))
>> 
>> …and then 8 becomes
>> 
>> (make-music
>> 'NoteEvent
>> 'duration
>> (ly:make-duration 3))
>> 
>> with no pitch property.  So I’ll need to handle these pitch-less note 
>> events. 
>> 
>> > Lyric treat -  0  as notes
>> 
>> Yes, this I knew about, but I don’t know what the solution might be.  The - 
>> and 
>> 0 are notes with modified stencils, which gives us good spacing and lets 0s 
>> have beams.  But that breaks how the lyrics align with the notes, and I 
>> can’t 
>> think of an automatic way to adjust the lyric durations so that, for 
>> example, a 
>> syllable that originally aligned with a whole note now aligns with four 
>> quarter 
>> notes.  
>> 
>> So currently you have to do this by hand by adjusting the durations of 
>> lyrics 
>> or adding skips, etc.  You could use tags, skips, and removeWithTag to have 
>> one 
>> set of lyrics that works with either standard notation or jianpu.
>> 
>> -Paul
>> 
> 
> 
> 

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


Re: Weird tremolo beams in whole-note tremolo.

2017-08-24 Thread Simon Albrecht

On 01.08.2017 22:32, Darek Cidlinský wrote:

This one slipped my attention since it's classified as an "enhancement" (I had a look in 
"defects" and "ugly"). Maybe the bug could be re-classified?


I agree that ‘ugly’ fits better and re-classified the issue.

Best, Simon

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


Re: improving Janek's \dynamic function (for combo dynamics)

2017-08-24 Thread Kieren MacMillan
Hi Saul,

> Personally, I think the behavior would be better if it aligned on the first 
> dynamic to appear in the markup, rather than default to left.

Perhaps better if this is a preference/parameter, with the default being 
*left-aligned* not *dynamic-aligned*.
(I would personally keep it left-aligned, and then use the edition-engraver to 
tweak the position of the rare "outliers".)

> With something like "poco f", it can be visually unclear where the f is 
> supposed to begin — at the beginning of "poco" or at the "f"? That's a bit 
> clearer of the dynamic itself is always the alignment point (though I prefer 
> to always have the dynamic first for maximum clarity).

Gould (pg. 107) addresses this. There are definitely more ambiguities and 
potential problems with dynamic-aligning such texts than there are "safe 
situations" (e.g., with preceding rests) — which is why, like you, I always 
prefer to have the dynamic first (when possible).

Cheers,
Kieren.


Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info
‣ email: i...@kierenmacmillan.info


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


Re: improving Janek's \dynamic function (for combo dynamics)

2017-08-24 Thread Saul Tobin
Thanks for putting that together. I'm no Scheme expert, but it looks good
to me.

Personally, I think the behavior would be better if it aligned on the first
dynamic to appear in the markup, rather than default to left. With
something like "poco f", it can be visually unclear where the f is supposed
to begin — at the beginning of "poco" or at the "f"? That's a bit clearer
of the dynamic itself is always the alignment point (though I prefer to
always have the dynamic first for maximum clarity). The Scheme code to find
the first appearance of a dynamic would be a bit more intricate, though,
since it would have to keep track of the width of text on either side of
the alignment point.

On Aug 24, 2017 3:16 AM, "Lukas-Fabian Moser"  wrote:

> Hello,
>
> I'm almost embarassed to post this as it's the ugly result of "trying to
> learn scheme and lilypond internals all at the same time" - but at least it
> seems to work. I've tried to achieve exactly what you described: _If_ the
> first word is a dynamic expression, then Shevek's adjustment is applied.
>
> Best
> Lukas
>
>
> %%%  SNIPPET BEGINS
> \version "2.19.44"
>
> #(use-modules (ice-9 regex))
>
> dynamic =
> #(define-event-function (text) (markup?)
>(if (string? text)
>(let* ((underscores-replaced
>(string-map
> (lambda (x) (if (eq? x #\_) #\space x))
> text)
>)
>   (split-text (string-split underscores-replaced #\space))
>   (first-is-dynamic (string-match "^[mrzfps]*$" (car
> split-text)))
>   (formatted (map
>   (lambda (word)
> (if (string-match "^[mrzfps]*$" word)
> (markup #:dynamic word #:hspace 0.25)
> (markup #:normal-text #:fontsize 0.625
> #:italic word)))
>   split-text))
>   (offset (lambda (grob)
> (if first-is-dynamic
> (let* (
> (first-as-dynamic
>  (list (markup #:dynamic (car
> split-text)))
>  )
> (layout (ly:grob-layout grob))
> (props (ly:grob-alist-chain grob
>  (ly:output-def-lookup layout
> 'text-font-defaults)))
> (dyn-X-extent
>  (ly:stencil-extent
>
>   (ly:text-interface::interpret-markup
> layout props (make-line-markup first-as-dynamic))
>   X))
> (width (abs
> (- (cdr dyn-X-extent) (car
> dyn-X-extent
> )
>   (- 1 (/ width 2))
>   )
> 0)
> )))
>  #{
>-\tweak X-offset #offset
>#(make-dynamic-script (make-line-markup formatted))
>  #})
>
>;; user provided a full-blown markup, so we don't mess with it:
>#{
>  #(make-dynamic-script (markup #:normal-text #:fontsize 0.625
> text))
>#}))
>
> <<
>   \new Staff { c''\dynamic "f dramatically" }
>   \new Staff { c''\dynamic "slightly more pp" }
> >>
> %%%  SNIPPET ENDS
>
>
>
>
> 2017-08-20 22:24 GMT+02:00 Kieren MacMillan  >:
>
>> Hi Shevek,
>>
>> > I posted a snippet to do correct custom dynamic alignment a month or so
>> ago.
>>
>> Yes, I know. I like the alignment very much.
>>
>> But I prefer Janek's interface, which offers the ability to put an
>> arbitrary string (e.g., "poco f, but p sub. ma non troppo") and it Does The
>> Right Thing™… well, the Right Thing modulo alignment when the leading word
>> is a dynamic.  =\
>>
>> > I tried just copy and pasting my offset callback into Janek's snippet,
>> but
>> > it doesn't quite work because the callback relies on assuming the
>> dynamic is
>> > at the beginning, and any additional text follows it.
>>
>> I think a single "if" added to Janek's function would suffice: if the
>> word in question is a dynamic (which Janek's function already works out)
>> *AND* it's the first word (Janek's function *doesn't* do this), then apply
>> an appropriate X-offset adjustment (similar or identical to yours),
>> otherwise left-align (which Janek's function already does).
>>
>> I'm scrambling to get a commission engraving out the door — what else is
>> new!? — so I don't have time to climb the Scheme-fu learning curve to get
>> that done right now… If nobody's done it before this score gets sent off
>> (mid-week?), I'll try to tackle it myself.
>>
>> Thanks,
>> Kieren.
>> 
>>
>> Kieren MacMillan, composer
>> ‣ 

Re: Jianpu Notation

2017-08-24 Thread MING TSANG
Thank you David Kastrup for helping.Paul: does the info provide help to solve 
the lyrics placement in jianpu?
Thank you Ming.

  From: David Kastrup 
 To: MING TSANG  
Cc: Paul Morris ; Super-User ; Werner 
LEMBERG ; Carl Sorensen ; David Nalesnik 
; Lilypond-usermailinglist 
 Sent: Thursday, August 24, 2017 2:47 AM
 Subject: Re: Jianpu Notation
   
MING TSANG  writes:

> | From: | Paul Morris |
> | Subject: | Re: Jianpu Notation |
> | Date: | Thu, 30 Apr 2015 11:36:28 -0400 |
>
> There has no activities since April 30/2015 - two year past.I hope
> Paul Morris and David Zhang can re-start the development of
> Jianpu.Thank you.Ming.
>> On Apr 30, 2015, at 9:10 AM, MING TSANG  wrote:
>> 
>> David & Paul: 
>> I created jianpu-test_1.ly for testing jianpu9.ly
>> The result is self explaining.  
>
> Thanks Ming, this is helpful.
>
>> There is a difference in coding c''8 8 vs c''8 c’'
>
> Ah, it seems that in c’’8 8 the 8 does not have a pitch property when it is 
> received by the jianpuMusic function:
>
> \displayMusic shows that c’’8 becomes:
>
> (make-music
> 'NoteEvent
> 'duration
> (ly:make-duration 3)
> 'pitch
> (ly:make-pitch 1 0))
>
> …and then 8 becomes
>
> (make-music
> 'NoteEvent
> 'duration
> (ly:make-duration 3))
>
> with no pitch property.  So I’ll need to handle these pitch-less note events. 

The definition of \retrograde in ly/music-functions-init.ly shows how
this can be done:

retrograde =
#(define-music-function (music) (ly:music?)
    (_i "Return @var{music} in reverse order.")
    (retrograde-music
    (expand-repeat-notes!
      (expand-repeat-chords!
      (cons 'rhythmic-event
            (ly:parser-lookup '$chord-repeat-events))
      music

-- 
David Kastrup

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


Re: Jianpu Notation

2017-08-24 Thread MING TSANG
Thank you David Zhang for setting this github. Now the lilipond-jianpu 
development can proceed after two years wait.Can you  merge your jianpu6.y code 
with jianpu10a.ly? Thank you.Ming

  From: David Zhang 
 To: MING TSANG ; Paul Morris ; 
Werner LEMBERG ; Carl Sorensen ; David 
Nalesnik ; Lilypond-usermailinglist 
 
 Sent: Thursday, August 24, 2017 1:02 AM
 Subject: Re: Jianpu Notation
   
Hi all!
I have created a github resp. and uploaded our previous code to 
https://github.com/nybbs2003/lilypond-Jianpu . And we can resume the 
development and make further discussion on github.
David Zhang


在 2017年8月24日,上午11:18,MING TSANG  写道:

| From: | Paul Morris |
| Subject: | Re: Jianpu Notation |
| Date: | Thu, 30 Apr 2015 11:36:28 -0400 |

There has no activities since April 30/2015 - two year past.I hope Paul Morris 
and David Zhang can re-start the development of Jianpu.Thank you.Ming.
> On Apr 30, 2015, at 9:10 AM, MING TSANG  wrote:
> 
> David & Paul: 
> I created jianpu-test_1.ly for testing jianpu9.ly
> The result is self explaining.   

Thanks Ming, this is helpful.

> There is a difference in coding c''8 8 vs c''8 c’'

Ah, it seems that in c’’8 8 the 8 does not have a pitch property when it is 
received by the jianpuMusic function:

\displayMusic shows that c’’8 becomes:

(make-music
'NoteEvent
'duration
(ly:make-duration 3)
'pitch
(ly:make-pitch 1 0))

…and then 8 becomes

(make-music
'NoteEvent
'duration
(ly:make-duration 3))

with no pitch property.  So I’ll need to handle these pitch-less note events. 

> Lyric treat -  0  as notes

Yes, this I knew about, but I don’t know what the solution might be.  The - and 
0 are notes with modified stencils, which gives us good spacing and lets 0s 
have beams.  But that breaks how the lyrics align with the notes, and I can’t 
think of an automatic way to adjust the lyric durations so that, for example, a 
syllable that originally aligned with a whole note now aligns with four quarter 
notes.  

So currently you have to do this by hand by adjusting the durations of lyrics 
or adding skips, etc.  You could use tags, skips, and removeWithTag to have one 
set of lyrics that works with either standard notation or jianpu.

-Paul





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


Re: improving Janek's \dynamic function (for combo dynamics)

2017-08-24 Thread Lukas-Fabian Moser
Hello,

I'm almost embarassed to post this as it's the ugly result of "trying to
learn scheme and lilypond internals all at the same time" - but at least it
seems to work. I've tried to achieve exactly what you described: _If_ the
first word is a dynamic expression, then Shevek's adjustment is applied.

Best
Lukas


%%%  SNIPPET BEGINS
\version "2.19.44"

#(use-modules (ice-9 regex))

dynamic =
#(define-event-function (text) (markup?)
   (if (string? text)
   (let* ((underscores-replaced
   (string-map
(lambda (x) (if (eq? x #\_) #\space x))
text)
   )
  (split-text (string-split underscores-replaced #\space))
  (first-is-dynamic (string-match "^[mrzfps]*$" (car
split-text)))
  (formatted (map
  (lambda (word)
(if (string-match "^[mrzfps]*$" word)
(markup #:dynamic word #:hspace 0.25)
(markup #:normal-text #:fontsize 0.625
#:italic word)))
  split-text))
  (offset (lambda (grob)
(if first-is-dynamic
(let* (
(first-as-dynamic
 (list (markup #:dynamic (car
split-text)))
 )
(layout (ly:grob-layout grob))
(props (ly:grob-alist-chain grob
 (ly:output-def-lookup layout
'text-font-defaults)))
(dyn-X-extent
 (ly:stencil-extent

  (ly:text-interface::interpret-markup
layout props (make-line-markup first-as-dynamic))
  X))
(width (abs
(- (cdr dyn-X-extent) (car
dyn-X-extent
)
  (- 1 (/ width 2))
  )
0)
)))
 #{
   -\tweak X-offset #offset
   #(make-dynamic-script (make-line-markup formatted))
 #})

   ;; user provided a full-blown markup, so we don't mess with it:
   #{
 #(make-dynamic-script (markup #:normal-text #:fontsize 0.625 text))
   #}))

<<
  \new Staff { c''\dynamic "f dramatically" }
  \new Staff { c''\dynamic "slightly more pp" }
>>
%%%  SNIPPET ENDS




2017-08-20 22:24 GMT+02:00 Kieren MacMillan :

> Hi Shevek,
>
> > I posted a snippet to do correct custom dynamic alignment a month or so
> ago.
>
> Yes, I know. I like the alignment very much.
>
> But I prefer Janek's interface, which offers the ability to put an
> arbitrary string (e.g., "poco f, but p sub. ma non troppo") and it Does The
> Right Thing™… well, the Right Thing modulo alignment when the leading word
> is a dynamic.  =\
>
> > I tried just copy and pasting my offset callback into Janek's snippet,
> but
> > it doesn't quite work because the callback relies on assuming the
> dynamic is
> > at the beginning, and any additional text follows it.
>
> I think a single "if" added to Janek's function would suffice: if the word
> in question is a dynamic (which Janek's function already works out) *AND*
> it's the first word (Janek's function *doesn't* do this), then apply an
> appropriate X-offset adjustment (similar or identical to yours), otherwise
> left-align (which Janek's function already does).
>
> I'm scrambling to get a commission engraving out the door — what else is
> new!? — so I don't have time to climb the Scheme-fu learning curve to get
> that done right now… If nobody's done it before this score gets sent off
> (mid-week?), I'll try to tackle it myself.
>
> Thanks,
> Kieren.
> 
>
> Kieren MacMillan, composer
> ‣ website: www.kierenmacmillan.info
> ‣ email: i...@kierenmacmillan.info
>
>
> ___
> 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: Jianpu Notation

2017-08-24 Thread David Kastrup
MING TSANG  writes:

> | From: | Paul Morris |
> | Subject: | Re: Jianpu Notation |
> | Date: | Thu, 30 Apr 2015 11:36:28 -0400 |
>
> There has no activities since April 30/2015 - two year past.I hope
> Paul Morris and David Zhang can re-start the development of
> Jianpu.Thank you.Ming.
>> On Apr 30, 2015, at 9:10 AM, MING TSANG  wrote:
>> 
>> David & Paul: 
>> I created jianpu-test_1.ly for testing jianpu9.ly
>> The result is self explaining.   
>
> Thanks Ming, this is helpful.
>
>> There is a difference in coding c''8 8 vs c''8 c’'
>
> Ah, it seems that in c’’8 8 the 8 does not have a pitch property when it is 
> received by the jianpuMusic function:
>
> \displayMusic shows that c’’8 becomes:
>
> (make-music
> 'NoteEvent
> 'duration
> (ly:make-duration 3)
> 'pitch
> (ly:make-pitch 1 0))
>
> …and then 8 becomes
>
> (make-music
> 'NoteEvent
> 'duration
> (ly:make-duration 3))
>
> with no pitch property.  So I’ll need to handle these pitch-less note events. 

The definition of \retrograde in ly/music-functions-init.ly shows how
this can be done:

retrograde =
#(define-music-function (music) (ly:music?)
(_i "Return @var{music} in reverse order.")
(retrograde-music
 (expand-repeat-notes!
  (expand-repeat-chords!
   (cons 'rhythmic-event
 (ly:parser-lookup '$chord-repeat-events))
   music

-- 
David Kastrup

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