Re: Dotted lyric extenders

2017-05-05 Thread Thomas Morley
2017-05-05 2:58 GMT+02:00 pmtanx :
> Hello! I am a relatively new Lilypond user and have been greatly enjoying the
> program. I would appreciate the capability of creating dotted rather than
> solid lyric extender lines, and am wondering whether this is possible (and
> how to place a feature request if it is not). Looking through past posts, I
> see that other users have made the same request, once in 2011 and again in
> 2014 (links below).

A feature request about dotted or dashed LyricExtenders needs to be
send to the bug-list.
Although this feature was requested before, it never reached the buglist.


> If it would help, I can provide several examples of
> published works (especially hymnals) using dotted lyric extender lines. For
> example, the image below is from the 1940 hymnal of the Episcopal Church.
>
> Thanks in advance for your help!
>
> Philip
> Charlottesville, VA
>
> http://lilypond.1069038.n5.nabble.com/Extender-style-td3.html
>
> http://lilypond.1069038.n5.nabble.com/Filling-empty-space-in-inline-lyrics-with-dots-td154475.html#a161832
>
> 

Once 2.19.60 is released you could do something at the lines of:

\version "2.19.60"

dottedExtender = {
  \override LyricExtender.style = #'dashed-line
  \override LyricExtender.thickness = 2
  \override LyricExtender.dash-fraction = 0
  \override LyricExtender.stencil =
#(lambda (grob)
  (let* ((stil (ly:lyric-extender::print grob))
 (x-ext (ly:stencil-extent stil X)))
 (make-connected-line
   (list
 (cons (car x-ext) 0)
 (cons (cdr x-ext) 0))
   grob)))
}

<<
\new Staff { c'2( d' e' f') g' }
\new Lyrics \lyricsto "" { \dottedExtender foo __ bar }
>>

HTH,
  Harm

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


Re: Apply a music-function script to all elements of a list

2017-05-04 Thread Thomas Morley
2017-05-04 18:59 GMT+02:00 zaord :
> Hi,
>
> I still have a little question :
>
> In my code, I use a define-music-function to exctract the nots of chords
> from a chordmode , and i compare each pitch of the notes events with a list
> to find x/y position of a colored dot making a custom diagram.
>
> My problem is that I can't get the name of the pitch, and when I compare the
> pitch and my list, the values didn't match.

Ofcourse, you try to compare a pitch with a symbol to get an entry
from an alist, so no result.

[...]
> I would like to extact from the varioable only c' in this case.
> Why the function ly:pitch-notename fails ?

It does not fail, though I understand it does not match your
expectations. You know it returns a number.
But then you try to compare a number with a symbol to get an entry
from an alist, so no result.


Brute-force, I sometimes do things like:

#(define (pitch->symbol pitch)
  (string->symbol (second (string-split (object->string pitch) #\SPACE

The is code of type "Don't get on my nerves" ;)

Though, it works with:

#(define (make-dot-list l1)
   (if (null? l1)
   empty-stencil
   (ly:stencil-add
  (make-dot (pitch->symbol (car l1)))
  (make-dot-list (cdr l1)

Nevertheless,  your 'Color-KEY-LIST ' has no entries for c'' and
higher, nor for b,, and below so there are still errors.


> I join the ly file.


You didn't ;)
So I attached the file you sent me earlier. Had not the time to look
into it earlier.


In general I have the impression that things can be done much easier,
but formating/indenting of your file is terrible.
Makes it very hard to read and does not encourage to work on it ;)

Cheers,
  Harm

% ici on défini les points qu'on fait sur le piano
#(define (make-dot-list l1)
   (if (null? l1) 
   empty-stencil
   (ly:stencil-add 
  (make-dot (ly:pitch-notename(car l1)))
  (make-dot-list (cdr l1)

% ici on défini i on fait des ronds noirs ou blancs
#(define (make-dot key)
(let ((test (cons (key-to-pos key) ( key-to-pos key) )))   
 (ly:stencil-in-color(ly:stencil-translate (make-circle-stencil  0.25 0.1 #f) (  key-to-pos key  )) (car(  key-to-color key ) )(car(  key-to-color key ) )(car(  key-to-color key ))) 
 ))  % pour les ronds noirs

% ici on défini les couleurs R V B associés à chaque notes
#(define (key-to-color key )
  (let ((keycolor (caddr(assq key Color-KEY-LIST
   (if (not keycolor)
(ly:error (_ "Color diagram error - unkown note '~a'") key)
( caddr (assq key Color-KEY-LIST) 

#(define (key-to-pos key )
  (let ((keypos (assq key KEY-POS-LIST))) 
   (if (not keypos)
(ly:error (_ "keyboard diagram error - unkown note '~a'") key)
(caddr (assq key KEY-POS-LIST) 


% ici on associe un numéro aux touches
#(define Color-KEY-LIST'( 
   (c.  '( 0.71  0.28 0.58) ) (cis  .  '( 0.4 0.4 0.4) )  (des .  '( 0.4  0.4  0.4 ) )  (d.  '( 0.15  0.33 0.68) )
   (dis  .  '( 0.4   0.4  0.4 ) ) (ees  .  '( 0.4 0.4 0.4) )  (e   .  '( 0.58 0.73 0.91) )  (f.  '( 0.71  0.86 0.69) )(fis  .  '( 0.4 0.4 0.4 ) )   (ges .  '( 0.4 0.4 0.4 ) ) 
   (g.  '( 1 0.87 0.4 ) ) (gis  .  '( 0.4 0.4 0.4) )  (aes  . '( 0.4  0.4  0.4 ) )  (a.  '( 1  0.58 0.55   ) )   
   (ais  .  '( 0.4   0.4  0.4 ) ) (bes  .  '( 0.4 0.4 0.4) )  (b   .  '( 0.93 0.15 0.2 ) )
   
   (c'.  '( 0.71  0.28 0.58) ) (cis'  .  '( 0.4 0.4 0.4) )  (des' .  '( 0.4  0.4  0.4 ) )  (d'.  '( 0.15  0.33 0.68) )
   (dis'  .  '( 0.4   0.4  0.4 ) ) (ees'  .  '( 0.4 0.4 0.4) )  (e'   .  '( 0.58 0.73 0.91) )  (f'.  '( 0.71  0.86 0.69) )(fis'  .  '( 0.4 0.4 0.4 ) )   (ges' .  '( 0.4 0.4 0.4 ) ) 
   (g'.  '( 1 0.87 0.4 ) ) (gis'  .  '( 0.4 0.4 0.4) )  (aes'  . '( 0.4  0.4  0.4 ) )  (a'.  '( 1  0.58 0.55   ) )   
   (ais'  .  '( 0.4   0.4  0.4 ) ) (bes'  .  '( 0.4 0.4 0.4) )  (b'   .  '( 0.93 0.15 0.2 ) )  
  
   (c,.  '( 0.71  0.28 0.58) ) (cis,  .  '( 0.4 0.4 0.4) )  (des, .  '( 0.4  0.4  0.4 ) )  (d,.  '( 0.15  0.33 0.68) )
   (dis,  .  '( 0.4   0.4  0.4 ) ) (ees,  .  '( 0.4 0.4 0.4) )  (e,   .  '( 0.58 0.73 0.91) )  (f,.  '( 0.71  0.86 0.69) )(fis,  .  '( 0.4 0.4 0.4 ) )   (ges, .  '( 0.4 0.4 0.4 ) ) 
   (g,.  '( 1 0.87 0.4 ) ) (gis,  .  '( 0.4 0.4 0.4) )  (aes,  . '( 0.4  0.4  0.4 ) )  (a,.  '( 1  0.58 0.55   ) )   
   (ais,  .  '( 0.4   0.4  0.4 ) ) (bes,  .  '( 0.4 0.4 0.4) )  (b,   .  '( 0.93 0.15 0.2 ) )  
   ))






% ici on défini les positions des points noirs du clavier

%-

#(define KEY-POS-LIST'(
   (c.  '( 0  . 0)) (cis  .  '( 1  . 0)  ) (des .  '( 1  . 0) ) (d.  '( 2  . 0)) 
   (dis  .  '( -0.5  .  0.5) ) (ees  .  '( -0.5  . 0.5)  ) (e   .  '( 0.5  .  0.5)  )  (f.  '( 1.5  .  0.5)) (fis  .  '( 2.5  .  0.5)  ) (ges .  '( 2.5  .  0.5) )
   (g.  '( 0  . 1)   ) (gis  .  '( 1  . 1)  ) (aes  .  '( 1  . 1)  ) (a   .  '( 2  . 1) 

Re: Box around mark

2017-05-04 Thread Thomas Morley
2017-05-04 17:03 GMT+02:00 Dave Higgins :
> I'd like to draw a box around this:
> \mark \markup { \bold { \huge "A" \super "1" } }
>
> But if I add in \box, e.g.:
> \mark \markup \box { \bold { \huge "A" \super "1" } }
>
> I get a box around the A and a box around the 1.  On the graphics
> documentation page, other than manually defining a box, is there a way
> to make the box without the "extra" work?



Markup-commands expecting an argument of type markup? are applied to
all markups of a markup-list.
Like \box or \rotate:

\markup \rotate #45 \box { "|" "|" "|" "|" }

If you want to have markup-commands like box, rotate etc applied to
"the result" of a markup-list, then you have to "transform" this list
of markups to a single markup.
Most common would be \line, \concat and the like:

\markup \rotate #45 \box \line { "|" "|" "|" "|" }

HTH,
  Harm

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


Re: Up and down arrows

2017-05-04 Thread Thomas Morley
2017-05-02 23:17 GMT+02:00 Federico Bruni :
> Il giorno mar 2 mag 2017 alle 22:54, Federico Bruni  ha
> scritto:
>>
>> Here's the snippet: http://lsr.di.unimi.it/LSR/Item?id=879
>
>
> BTW, I would change this snippet and replace manual beams with automatic
> beams, in order to make stand what matters.
> I would add also a comment to explain the override of TextScript.padding.
>
> Harm, can you update it on the LSR?
>
> \version "2.18.2"
>
> arrUp = _\markup \translate #'(-.2 . 0) \rotate #90 \char ##x279B
> arrDown = _\markup \translate #'(-.2 . 0) \rotate #-90 \char ##x279B
>
> music = \relative c {
>  \time 4/4
>  \set Timing.beamExceptions = #'()
>  \set Timing.baseMoment = #(ly:make-moment 1/8)
>  \set Timing.beatStructure = #'(3 3 2)
>  d8\arrDown g\arrDown b\arrUp d,\arrDown g\arrDown b\arrUp d,\arrDown
> g\arrUp |
>  f8\arrDown b\3\arrDown  d\arrUp f,\arrDown b\3\arrDown  d\arrUp f,\arrDown
> b\3\arrUp |
>  c8\arrUp g\arrUp e\arrDown c'8\arrUp g\arrUp e\arrDown c'8\arrUp g\arrDown
> |
>  b8\arrUp g\arrUp d\arrDown b'\arrUp g\arrUp d\arrDown b'\arrUp g\arrUp |
> }
>
>
> \score {
>  \new StaffGroup <<
>\new Staff <<
>  \context Voice { \clef "G_8" \music }
>>>
>\new TabStaff  <<
>  \context TabVoice { \clef "moderntab" \music }
>>>
>  >>
>  \layout {
>\context {
>  \Score
>  % vertically align the arrows and add padding from staff
>  \override TextScript.padding = #3
>}
>\context {
>  \Staff
>  \override StringNumber.stencil = ##f
>}
>  }
> }
>

Hi Federico,

for now I uploaded (unapproved):
"Symbols for flatpicking guitar [revised]"
http://lsr.di.unimi.it/LSR/Item?u=1&id=1056

But again no image :(
Obviously there's need to contact LSR-admin again.

Cheers,
  Harm

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


Re: Align to left the instrument title

2017-05-02 Thread Thomas Morley
2017-05-02 21:41 GMT+02:00 Marco Bagolin :
>
> Hello all,
> you can see what I want to obtain in the example attached.
>
> I want the title in the center of the page.
> The name of the instrument at the left margin of the first page.
> The name of the instrument in the center on the top of the other pages.
>
> I don't know what code to write for this result.
> I am not so expert at the moment.
> Hope someone can help me.
>
> Thank you all in advance.
>
> MB
>
>  File_000.jpeg
>
>
> 2017-05-02 17:27 GMT+02:00 Jacques Menu Muzhic :
>>
>> Hello Marco,
>>
>> You minimal working example (MWE) is too minimal actually.
>>
>> How about:
>>
>> \version "2.19.55"
>>
>> \version "2.18.2"
>> \header {
>>   title = \markup \fontsize #+1.5 {"My Music"}
>>   instrument = \markup {\left-align \fontsize #+1.5 {"Flute"}}
>> }
>>
>> { c }
>>
>> JM
>>
>> > Le 2 mai 2017 à 14:14, Marco Bagolin  a écrit :
>> >
>> >
>> > Hello all,
>> > I am not so expert and need a help.
>> > I would like that instrument title appear on the left of the first page 
>> > and in the center of the other pages.
>> >
>> > I am trying with this code:
>> >
>> > \version "2.18.2"
>> > \header {
>> > title = \markup \fontsize #+1.5 {"My Music"}
>> > instrument = \left-align \fontsize #+1.5 {"Flute"}
>> > }
>> >
>> > but nothing happens.
>> > Instrument title in the first page is always centered.
>> > I tried to read manual section Titles and headers and to search examples 
>> > in the site, but I did not find solutions about my problem.
>> >
>> > Hope some expert user can help me.
>> > Thank you all in advance.
>> >
>> > Regards
>> > Marco B.

Hello,

quick'n dirty:

\version "2.18.2"

\header {
  title = \markup \fontsize #1.5 "My Music"
  instrument = \markup \fill-line { \fontsize #1.5 "Flute" \null }
  %poet = "POET"
}

{ c }

It will fail if you want to use the 'poet'-field, though. To check
uncomment 'poet'.

In this case define a custom bookTitleMarkup.
I recently (yesterday?) wrote a tutorial about it, search the archives for it.

Cheers,
  Harm

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


Re: Apply event function *within* music-function

2017-05-02 Thread Thomas Morley
2017-05-02 10:08 GMT+02:00  :
> Wouldn't the <>\stopGroup extend the group one note too far?



You're right.
I shouldn't post before second coffee...

Sorry for the noise.

:Harm

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


Re: Apply event function *within* music-function

2017-05-02 Thread Thomas Morley
2017-05-02 8:29 GMT+02:00 Urs Liska :
> Hi all,
>
> I'm trying to apply event functions to music passed into a music function
> like that:
>
> \version "2.19.57"
>
> test =
> #(define-music-function (mus)(ly:music?)
>#{
>  #mus \startGroup
>#})
>
> {
>   \test c' d' e' f' \stopGroup
> }
>
>
> (of course this is not what I ultimately want to achieve, but the nucleus
> from which I'll be able to continue on my own).
>
> This fails with "error: syntax error, unexpected EVENT_IDENTIFIER". I think
> it is because the #mus expression is somehow already complete (differently
> from when used in regular input) and I have to somehow *apply* the
> \startGroup event function to the #mus argument.
>
> From \displayMusic I can see that it is added as a NoteGroupingEvent to the
> note's articulations, but I'd like to ask if there's a more straightforward
> way to attach the event to the music than rebuilding the music expression in
> Scheme.
> OTOH I will want to do that for the first *and last* element in a music
> expression (in order to apply the start and stop command to a sequence of
> notes), so I may *have* to extract the Scheme representation anyway?
>
> TIA
> Urs



\layout {
  \context {
\Voice
\consists "Horizontal_bracket_engraver"
  }
}

test =
#(define-music-function (mus)(ly:music?)
   #{
  <>\startGroup
  $mus
  <>\stopGroup
   #})

{
  \test { c' d' e' f' }
}

Should do the trick.

Cheers,
   Harm

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


Re: opus conflict

2017-04-30 Thread Thomas Morley
2017-04-30 23:09 GMT+02:00 Mark Stephen Mrotek :
> [...] I have very limited knowledge as to how to customize (write Lilypond), 
> [...]

So here a little tutorial about writing custom book/scoreTitleMarkup

%
(1)
%

book/scoreTitleMarkup are predefined/customized markups. They need to be
defined in \paper.
This is done in exp. 1, but set to false (##f). So it will never print anything.
(Just to get the basics)

%% exp. 1

\paper {
  bookTitleMarkup = ##f
  scoreTitleMarkup = ##f
}

\header { title = "TITLE-1" } %% not called

{ c'1 }


%
(2)
%

Usually book/scoreTitleMarkup contains settings for dedication, title, subtitle,
subsubtitle, composer, poet, meter, arranger, piece and opus.

Let's try to set them as static literals in bookTitleMarkup. I.e. we use strings
which will not be called from the \header
(Keeping scoreTitleMarkup = ##f)

%% exp. 2

\paper {
  bookTitleMarkup =
\markup
  \column {
dedication
title
subtitle
subsubtitle
composer
poet
meter
arranger
piece
opus
  }

  scoreTitleMarkup = ##f
}

\header { title = "TITLE-1" } %% not called

{ d'1 }

%
(3)
%

This ofcourse most simple and not very nice. Let's do some formatting.
I.e. distribute them over the whole line-width, some as single markup, some in
the same line.

%% exp. 3

\paper {
  bookTitleMarkup =
\markup
  \column {
%% 8 lines, all done with fill-line
\fill-line { dedication } %% center
\fill-line { title } %% center
\fill-line { subtitle } %% center
\fill-line { subsubtitle } %% center
\fill-line { poet composer } %% center
\fill-line { \null opus } %% right
\fill-line { meter arranger } %% left - right
\fill-line { piece \null } %% left
  }

  scoreTitleMarkup = ##f
}

\header { title = "TITLE-1" } %% not called

{ e'1 }

%
(4)
%

Though eventually we want some settings to be called from a score-header.
As an example we go for subtitle and piece.

We delete them from bookTitleMarkup and define them in scoreTitleMarkup.

%% exp. 4

\paper {
  bookTitleMarkup =
\markup
  \column {
%% 8 lines, all done with fill-line
\fill-line { dedication } %% center
\fill-line { title } %% center
\fill-line { subtitle } %% center
\fill-line { subsubtitle } %% center
\fill-line { poet composer } %% center
\fill-line { \null opus } %% right
\fill-line { meter arranger } %% left - right
  }

  scoreTitleMarkup =
\markup
  \column {
%% 8 lines, all done with fill-line
\fill-line { subtitle } %% center
\fill-line { piece \null } %% left
  }
}

\header { title = "TITLE-1" } %% not called

{ e'1 }

{ f'1 }

%
(5)
%

Let's change it to call the values from \header.

We need to insert a fromproperty-markup and take the name of the header-setting
preceded by #'header:

%% exp. 5

\paper {
  bookTitleMarkup =
\markup
  \column {
\fill-line { \fromproperty #'header:dedication } %% center
\fill-line { \fromproperty #'header:title } %% center
\fill-line { \fromproperty #'header:subtitle } %% center
\fill-line { \fromproperty #'header:subsubtitle } %% center
\fill-line {
  \fromproperty #'header:poet \fromproperty #'header:composer
} %% center
\fill-line { \null \fromproperty #'header:opus } %% right
\fill-line {
  \fromproperty #'header:meter \fromproperty #'header:arranger
} %% left - right
  }

  scoreTitleMarkup =
\markup
  \column {
\fill-line { \fromproperty #'header:subtitle } %% center
\fill-line { \fromproperty #'header:piece \null } %% left
  }
}

\header { title = "TITLE-1" } %% called

\score {
  { e'1 }
  \header {
  piece = "PIECE-1"
subtitle = "SUBTITLE-1"
  }
}

\score {
  { f'1 }
  \header {
  piece = "PIECE-2"
subtitle = "SUBTITLE-2"
  }
}


%
(6)
%

Currently no fontsize-markup is applied. We let it as an exercise for the
reader.

Also, print-all-headers will take no effect.
If custom book/scoreTitleMarkups are used, then they should be tailored to
measure. So no real need for it.

%
(7)
%

Ofcourse some points in the above tutorial are omitted or simplified.
Please ask if something is not clear.
Also, it is possible to do even more...



Cheers,
  Harm

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


Re: opus conflict

2017-04-30 Thread Thomas Morley
2017-04-30 21:04 GMT+02:00 Mark Stephen Mrotek :
> Thomas,
>
> Thank you for your detailed explanation. Your patient effort is appreciated.
> As I understand now, some of the header fields are controlled by the \book 
> and some by the \score.
> Your colored version is very illustrative, yet note that the "opus" is under 
> the first piece (subtitle) and not under the composer where I want it to be.

This happens because the complete bookTitleMarkup is printed first by
the scoreTitleMarkup
(if print-all-headers = ##t). The remaining parts of the score-header
are printed below (i.e. piece and opus).

> That is where I have always seen it in my limited experience.
>
> Woodland Sketches
>   
>   E. MacDowell
>   
>  Op. 51
>
> To a Wild Rose
>
>   Will o' the Wisp
>
> Is this possible with Lilypond?
>
> Mark
>

Sure. At least three possibilities

(1) quick'n dirty
arranger = "Op. 51"

(2) quick'n dirty
composer = \markup \right-column { "E. MacDowell" "Op. 51" }

(3) go for custom book/scoreTitleMarkup

I'd really recommend (3).
You are not happy with the default, so why not change it?
Timothy already posted a possibility.
If you like it, ok. If you want some changes and feel not confident
enough to implement them yourself, ask back.



Cheers,
  Harm

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


Re: opus conflict

2017-04-30 Thread Thomas Morley
2017-04-30 19:19 GMT+02:00 Mark Stephen Mrotek :
> Thomas,
>
> Attached is the pdf generated by my code.
>
> Thank you again.
>
> Mark

Your first \header is inside the book as well as the \paper (where you
set print-all-headers = ##t).
This \header contains settings which are read and printed by the
bookTitleMark mixed with the 'opus', which is read and printed by the
scoreTitleMarkup.
Because you've set print-all-headers = ##t all of the
book-header-settings are printed within every scoreTitleMarkup. (Thus
the need to clear unwanted fileds in the score-header.) But opus is
never printed by the bookTitleMarkup but the scoreTitleMarkup and you
clear every instance of opus in every score-header.

As a result 'opus' is never printed.
I think, if you carefully read the doc, you'll see it's a consequence
of whats said there.

So you have two possibilities

(1) go for custom book/scoreTitleMarkup as already demonstrated

(2) don't clear opus for the first score


To make book/scoreTitleMarkup more clear, I colored them in an
additional \paper (delete it)

\version "2.18.2"

\paper {
  bookTitleMarkup = \markup \with-color #red \bookTitleMarkup
  scoreTitleMarkup = \markup \with-color #green \scoreTitleMarkup
}

\book {
  \paper {
print-all-headers = ##t
  }
  \header {
title = "Woodland Sketches"
composer = "E. MacDowell"
opus = "Op. 51"
tagline = ##f
  }
  \score {
\new PianoStaff <<
  \new Staff { s1 }
  \new Staff { \clef "bass" s1 }
>>
\header {
title = ##f
composer = ##f
%opus = ##f
subtitle = "To a Wild Rose"
}
  }
  \score {
\new PianoStaff <<
  \new Staff { s1 }
  \new Staff { \clef "bass" s1 }
>>
\header {
title = ##f
composer = ##f
opus = ##f
subtitle = "Wil o' the Wisp"
}
  }
}


HTH,
  Harm

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


Re: opus conflict

2017-04-30 Thread Thomas Morley
2017-04-30 18:15 GMT+02:00 Mark Stephen Mrotek :
> Timothy,
>
> Thank you for your response. Your time spent writing out a solution is
> greatly appreciate.
> I would like to have something that is consistent with the manual.
>
> Mark



Hi Mark,

defining a custom book/scoreTitleMarkup is explained in the docs, so
it _is_ "consistent with the manual".

That said, I was musing some time over your request, tried this and
that but never got the results you described.
In other words, please provide a minimal example, showing the
structure of your ly-file:
Do you use multiple books?
One book but multiple bookparts?
One book(part), but multiple scores?
Where are headers in?

Look at the example below (btw it compiles, although no header is ever
printed. "content" is never called by default).

Please change the structure to the one of your ly-file and fill the
remaining headers with something meaningful to demonstrate the
problem.

\version "2.18.2"
\header { content = "general-whatever" }

\book {
  \header { content = "1book-whatever" }
  \bookpart {
\header { content = "1bookpart1-whatever" }
\score {
  { c'1 }
  \header { content = "1score1.1-whatever" }
}
\score {
  { d'1 }
  \header { content = "1score1.2-whatever" }
}
  }
  \bookpart {
\header { content = "1bookpart2-whatever" }
\score {
  { e'1 }
  \header { content = "1score2.1-whatever" }
}
\score {
  { f'1 }
  \header { content = "1score2.2-whatever" }
}
  }
}

\book {
  \header { content = "2book-whatever" }
  \bookpart {
\header { content = "2bookpart1-whatever" }
\score {
  { g'1 }
  \header { content = "2score1.1-whatever" }
}
\score {
  { a'1 }
  \header { content = "2score1.2-whatever" }
}
  }
  \bookpart {
\header { content = "2bookpart2-whatever" }
\score {
  { b'1 }
  \header { content = "2score2.1-whatever" }
}
\score {
  { c''1 }
  \header { content = "2score2.2-whatever" }
}
  }
}

%% other books?

Cheers,
  Harm

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


Re: \magnifyMusic omits unison notes in \partcombine?

2017-04-29 Thread Thomas Morley
2017-04-28 0:02 GMT+02:00 Karlin High :
> A songwriter looked at my LilyPond job and asked, "Can you make the note
> heads bigger in proportion to everything else?" Yes, thanks to
> \magnifyMusic, I thought. It's a SATB hymn, I'm using \partcombine, and
> apparently \magnifyMusic doesn't pick up the unison notes the way I'm
> writing it. Minimal example below, PNG result attached. Magnify is at
> 1.2 for effect; I'm using 1.1 in practice.
>
> % BEGIN LILYPOND CODE
> \version "2.19.59"
> one = { a'2 f' }
> two = { f'2 f' }
> \partcombine #'(2 . 9) \magnifyMusic 1.2 { \one } \magnifyMusic 1.2 { \two }
> % END LILYPOND CODE
>
> I've found I need to put \magnifyMusic inside \partcombine, because it
> seems to have no effect the other way around. Any ideas for how I could
> get \magnifyMusic to catch the unison notes?
> --
> Karlin High
> Missouri, USA
>
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>

Under the hood \partcombine distributes the music to up to four
different Voices. They are called "one", "two", "shared" and "solo".
(And a NullVoice called "null".)
\magnifyMusic is applied to a Bottom-context.
Meaning, if the context is changed, for example from a Voice called
"shared" to a Voice called "one" magnifyMusic is not longer applied.
That's usual behaviour for all
overrides/context-settings/music-functions etc
A general feature not a bug.

You could create those Voices yourself, keep them alive and apply
magnifyMusic there.
Though why not set an appropriate fontSizeValue for all Voices in layout?

Below both codings:

\version "2.19.59"

one = { a'2  f' }
two = { f'2  f' }

\new Staff <<
  \context Voice = "one" { \voiceOne \magnifyMusic 2 #(skip-of-length one) }
  \context Voice = "two" { \voiceTwo \magnifyMusic 2 #(skip-of-length two) }
  \context Voice = "shared" { \magnifyMusic 2 #(skip-of-length one) }
  \context Voice = "solo" { \magnifyMusic 2 #(skip-of-length one) }

  \partcombine #'(2 . 9)
  \one
  \two
>>

\score {
  \new Staff
\partcombine #'(2 . 9)
\one
\two
  \layout {
\context {
  \Voice
  fontSize = #(magnification->font-size 2)
}
  }
}



HTH,
  Harm

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


Re: Magnifystaff question (possibly bug?)

2017-04-29 Thread Thomas Morley
)se

2017-04-29 4:49 GMT+02:00 Michiel Sikma :
>
> Hi there,
>
> There's something I don't entirely understand about \magnifyStaff - I'm using 
> it to scale down my entire score, without having to use layout-set-staff-size 
> (since I don't want to switch to a different feta font size, but just scale 
> the feta20 one slightly.)
>
> However, I discovered that something funny happens when you use \teeny or 
> \normalsize or any of the other commands that set fontSize.
>
> Here's an example:
> http://lilybin.com/nqeqsu/1
>
> Basically, when using \teeny, it sets the note heads to a smaller than normal 
> size, but it doesn't take \magnifyStaff into account. So the notes are scaled 
> according to a base of 100 rather than whatever the staff magnification is. 
> Similarly, setting \normalsize resets the note heads to 100% of an 
> unmagnified staff.
>
> My expectation is that \magnifyStaff magnifies everything. So if \teeny sets 
> the size to, say, 70%, and \magnifyStaff is set to #50/100, I expect the size 
> to be 35%. And if \normalsize sets the size to 100%, in \magnifyStaff #50/100 
> I expect the result to be 50%. Et cetera.
>
> The \normalsize/etc commands permanently change the note head size (and 
> markup size) for a voice, leaving everything else the same. Probably, they 
> are internally setting the fontSize to a static value rather than taking the 
> magnification into account.
>
> Either this is a bug or I'm not using it correctly. But it seems like if you 
> have a magnified staff, one should still be able to use the fontSize commands.
> Would love to hear people's thoughts, I'm going to see if I can find a 
> workaround - probably I can just set the fontSize myself based on my magnify 
> value.
>
> Regards,
> Michiel


Hi Michiel,

all of the predifined commands teeny, tiny, small, normalsize, large,
huge set the fontSize for the Bottom-context where they are applied,
to an absolute Volume, as well does magnifyStaff for the Staff.
They don't add up and they shouldn't, otherwise collecting several
music-variables in one Staff from different sources will be pretty
unpredictable.

See the examples below. First usual \huge is demonstrated, i.e (\set
fontSize = #2)
Then I add up the applied fontSizes using 'my-fontSize'-music-function.
Note how the content of \zz changes depending where called.
Why should this ever be the default?

\version "2.19.56"

\paper { indent = 30 }

%% For convenient checking
% currently not used below
check-fontSize =
  \applyContext
#(lambda (ctx)
   (format #t
 "\n\tfontSize is:\t~a\n"
 (ly:context-property ctx 'fontSize)))

x = { \huge c'1 }
y = { \huge d'1 }
z = { \huge e'1 }

\new Staff \with { instrumentName = "default \\huge" } { \x \y \z }
\new Staff \with { instrumentName = "default \\huge" } { \x \z \y }

my-fontSize =
#(define-music-function (val)(number?)
  #{
\applyContext
  #(lambda (ctx)
 (ly:context-set-property! ctx 'fontSize
  (+ val (ly:context-property ctx 'fontSize 0
  #})

xx = { \my-fontSize 2 c'1 }
yy = { \my-fontSize 2 d'1 }
zz = { \my-fontSize 2 e'1 }

\new Staff \with { instrumentName = "adding fontSize" } { \xx \yy \zz }
\new Staff \with { instrumentName = "adding fontSize" } { \xx \zz \yy }
\new Staff \with { instrumentName = "adding fontSize" } { \zz \xx \yy }

Cheers,
  Harm

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


Re: MagnifyMusic omits unison notes from PartCombine

2017-04-29 Thread Thomas Morley
2017-04-28 1:37 GMT+02:00 Karlin High :
> Meta-minimal example: can I post AT ALL? Third try, no list acknowledgement 
> so far.



Hi Karlin,

all three came through:
http://lists.gnu.org/archive/html/lilypond-user/2017-04/index.html
(search for your name)

If you've got no answer, then possibly because nobody knows an answer
or lack of time to write an email or ...

Meanwhile Manuela replied.


Cheers,
  Harm
-

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


Re: Changing the length of voice follower lines

2017-04-28 Thread Thomas Morley
2017-04-28 21:04 GMT+02:00 DJF :
> I’ve got a piano piece with many voice follower lines from one hand to the 
> other. Most often the lines end up being too long and unsightly, extending 
> through beams and stems. I know how to move them with 
> VoiceFollower.extra-offset, but I can’t figure out how to change their 
> length. I messed around with other things, like extents, but I don’t really 
> understand those (I understand them theoretically, but not practically) and, 
> anyway, nothing ever gets changed regardless of the values I use. Can’t help 
> but think there’s probably an obvious answer, but I’m certainly not finding 
> it!
>
> What could I add below to shorten the right (top) end of the voice-follow 
> line?
>
> Thanks for any help.
>
> --
> Dan
>
>
> \version "2.19.58"
>
> \score {
>  \new PianoStaff
><<
>  \new Staff = "right" \relative c'
>  { \clef treble 2. f'4 }
>
> \new Staff = "left" \relative c
> { \showStaffSwitch
>   \clef bass r4 bes ees4
>   \change Staff = "right" \stemDown d'8 f, }
>   >>
> }


\score {
  \new PianoStaff
<<
  \new Staff = "right" \relative c'
  { \clef treble 2. f'4 }

 \new Staff = "left" \relative c
 {
   \showStaffSwitch
   \clef bass r4 bes
   ees4
   \once \override VoiceFollower.bound-details.right.padding = 2.4
   %% Similar for bound-details.left.padding
   %% Other keys are possible as well
   \change Staff = "right" \stemDown d'8 f,
 }
>>
}


HTH,
  Harm

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


Re: Center-align a score

2017-04-28 Thread Thomas Morley
2017-04-28 17:39 GMT+02:00 David Nalesnik :

> It would be relatively easy to alter the function make-page-stencil in
> scm/page.scm to do what you want.  The stencils of the individual
> systems are already made at this point, and it's just a matter of
> moving them around to your liking.  Unfortunately, this requires a
> change to program files.  I've had no luck copy/pasting code from that
> file into the LY file.

It may be possible if one could get access to the (scm page)-module.
Though, I had no luck with this either.

Nevertheless, below probably a method to avoid ly:grob-extent's side-effects:



\version "2.19.59"

\paper {
  ragged-right = ##t
  indent = 0
}

centerLines =
  \override NonMusicalPaperColumn.after-line-breaking =
#(lambda (grob)
   (if (eqv? (ly:item-break-dir grob) 1) ; line beginning
   (let* ((sys (ly:grob-system grob))
  ;; filter for StaffSymbol-grobs
  (staff-symbols
(filter
  (lambda (grob)
(grob::has-interface grob 'staff-symbol-interface))
  (ly:grob-array->list (ly:grob-object sys 'all-elements
  ;; StaffSymbols may start/end during same system
  ;; Best bet is to look for the most left/right start/end-coord
  (min-max
(lambda (list-of-pairs)
  (cons
(reduce min +inf.0 (map car list-of-pairs))
(reduce max -inf.0 (map cdr list-of-pairs)
  (line-width
(interval-length
  (min-max
(map
  (lambda (g) (ly:grob-property g 'X-extent))
  staff-symbols
  (layout (ly:grob-layout grob))
  (line-full-width (ly:output-def-lookup layout 'line-width)))
 (ly:grob-set-nested-property! grob
   '(line-break-system-details X-offset)
   (/ (- line-full-width line-width) 2)

\layout {
  \context {
\Score
\centerLines
\override BarNumber.stencil = ##f
  }
}

\score {
\new Staff \with {
\override StaffSymbol.line-count = #1
\omit Staff.TimeSignature
\omit Staff.Clef
}
{
b'4 b' b'2 \break
b'4 b' b'2 \break
b'4 b' b' b' b' b' b'2 \break

}
\addlyrics {
Häns -- chen klein
ging al -- lein
in die wei -- te Welt hi -- nein
}
}


Cheers,
  Harm

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


Re: relative offset of systems [WAS: Center-align a score]

2017-04-27 Thread Thomas Morley
Hi David,

nice stuff!

Some comments, though:

2017-04-27 19:27 GMT+02:00 David Nalesnik :
> On Thu, Apr 27, 2017 at 12:22 PM, David Nalesnik
>  wrote:
>
>>
>> I'll just quote the relevant changes with some context.
>>
>> Within the function make-page-stencil:
>>
>> [...]
>>

I see no advantage to add 'extra-y' to the arguments.
Why not do the calculation in 'add-system' ...

>>  (add-to-page (lambda (stencil x y extra-y)
>
> Oh, "nota bene" the above line too!
>
>> (set! page-stencil
>>   (ly:stencil-add page-stencil
>> (ly:stencil-translate stencil
>>   (cons
>>(+
>> system-xoffset x)
>>(-
>> 0 y extra-y (prop 'top-margin))) ; NB
>>
>>   )
>>  (add-system
>>   (lambda (system)
>> (let* ((stencil (paper-system-stencil system))
>>(y (ly:prob-property system 'Y-offset 0))
>>(extra-y (ly:prob-property system 'extra-Y-offset 0)) ; NB
>>(is-title (paper-system-title?
>>   system)))
>>   (add-to-page stencil
>> (ly:prob-property system 'X-offset 0.0)
>> y
>> extra-y) ; NB


It will fail if system-separator-markup is used.

Here my attempt (for comparison I added greyed stencils)

 (add-system
  (lambda (system)
(let* ((stencil (paper-system-stencil system))
   (y (ly:prob-property system 'Y-offset 0))
   (extra-y (ly:prob-property system 'extra-Y-offset 0)) ;; NB
   (is-title (paper-system-title?
  system)))

 For comparison: print the greyed system-stencil without extra-y
  (add-to-page (stencil-with-color stencil '(0.8 0.8 0.8))
(ly:prob-property system 'X-offset 0.0)
y)
 The moved system-stencil
  (add-to-page stencil
(ly:prob-property system 'X-offset 0.0)
(+ y extra-y)) ;; NB

(if (and (ly:stencil? system-separator-stencil)
 last-system
 (not (paper-system-title? system))
 (not (paper-system-title? last-system)))
(begin
 For comparison: print the greyed system-separator-stencil without 'extra-y
  (add-to-page
   (stencil-with-color system-separator-stencil '(0.8 0.8 0.8))
   0

   (average (- last-y
   (car (paper-system-staff-extents last-system)))
(- y
   (cdr (paper-system-staff-extents system)

 The moved system-separator-stencil
  (add-to-page
   system-separator-stencil
   0

   (+
 (average (- last-y
 (car (paper-system-staff-extents last-system)))
  (- y
 (cdr (paper-system-staff-extents system
 (/ extra-y 2)  ;; NB
(set! last-system system)
 set last-y, taking extra-y into account
(set! last-y (+ y extra-y)  ;; NB

As an example I used:

\paper {
  system-separator-markup = \slashSeparator
  ragged-last-bottom = ##t
}
top = \repeat unfold 5 { c''4 d'' e'' f'' }

bottom = {
  \clef bass
  \repeat unfold 5 { c,1 }
  \break
}

\new PianoStaff <<
  \new Staff {
\top
\top
\top
  }
  \new Staff {
\bottom
\overrideProperty
Score.NonMusicalPaperColumn.line-break-system-details
#'((extra-Y-offset . 2))
\bottom
\overrideProperty
Score.NonMusicalPaperColumn.line-break-system-details
#'((extra-Y-offset . 5))
\bottom
  }
>>

png attached



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


Re: Line breaks on a "where allowed" basis

2017-04-26 Thread Thomas Morley
2017-04-26 23:20 GMT+02:00 Lukas-Fabian Moser :
> As far as I can see, the default line breaking behaviour in Lilypond is
> roughly as follows:
> "Break where forced by user (\break), add additional line breaks 'for best
> result'."
>
> By issuing \override NonMusicalPaperColumn.line-break-permission = ##f, this
> behaviour may be changed to:
> "Break where forced by user (\break) and nowhere else".
>
> Is there a way to get something like
> "Break at most where allowed by user"?
>
> I.e. I want to tell Lilypond explicitly every point at which a line break
> would be acceptable, but I would like the program to determine which of
> these places to actually use for a line break.

Checkout:

\once
\override Score.NonMusicalPaperColumn.line-break-penalty = #-1

Also, see:
See IR 3.2.85 paper-column-interface

 line-break-penalty (number)

Penalty for a line break at this column. This affects the choices
of the line breaker; it avoids a line break at a column with a
positive penalty and prefers a line break at a column with a negative
penalty.

Cheers,
  Harm


>
> (Background: Files containing lots of short exercises for use in a
> presentation, three to eight measures each; line breaks in the middle of an
> exercise being undesirable, and page breaks in the middle of an exercise
> being a no-go.)
>
> Best
> Lukas
>
> ___
> 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: Center-align a score

2017-04-26 Thread Thomas Morley
2017-04-26 21:09 GMT+02:00 Simon Albrecht :
> Am 26.04.2017 um 20:47 schrieb Hendrik Fuß:
>>
>> There are paper variables to achieve ragged-right and ragged-last layout.
>> Is there a way to achieve center-aligned music in a score?
>
>
> Not really. One way would be entering each line as a separate \score inside
> \markup \center-column {},

One could do:

\version "2.19.56"

#(define-markup-list-command (center-column-list-args layout props args)
  (markup-list?)
  #:properties ((baseline-skip))
  (let ((stils (interpret-markup-list layout props args))
(line-width (ly:output-def-lookup layout 'line-width)))
  (space-lines baseline-skip
(map
  (lambda (arg)
(ly:stencil-translate-axis
  arg
  (/ (- line-width (interval-length (ly:stencil-extent arg X))) 2)
  X))
  stils

%%%
%% EXAMPLE
%%%

\header {
  title = "TITLE"
  subtitle = "SUBTITLE"
}

mus = {
  a'1 1 1 \break
  1 1 \break
  1 \break
  1 1 \break
  1 1 1 \break
}

sc =
\score {
\new Staff \repeat unfold 6 \mus
\layout { ragged-right = ##t indent = 0 }
  }

\markuplist \center-column-list-args \score-lines { \sc }

Cheers,
  Harm

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


Re: Parenthesize bass figures as a whole

2017-04-25 Thread Thomas Morley
2017-04-25 12:45 GMT+02:00 Lukas-Fabian Moser :
> Hello,
>
> I hope I don't mess up completely, this being my first posting to this list
> (which I nevertheless often consulted before).

You know you can insert brackets doing what you want?

To have them look like rounded paranthesis is more difficult.
Currently I've only an ugly hack for you (see below), mayne someone
comes up with a better idea.

hack =
\override BassFigureBracket.stencil =
  #(lambda (grob)
 (let* ((default-stil (ly:enclosing-bracket::print grob))
(x-ext (ly:stencil-extent default-stil X))
(y-ext (ly:stencil-extent default-stil Y))
(thick (ly:grob-property grob 'thickness 0.1))
(height-limit 0.7)
(ratio 0.15)
(padding -0.3)
;; taken from bezier-bow.cc
(F0_1
  (lambda (x) (* (/ 2 PI) (atan (* PI x 0.5)
(bow-height
  (lambda (w h_inf r_0) (F0_1 (* (/ (* w r_0) h_inf) h_inf
;; length from bow start to end
(lngth (abs (- (cdr y-ext) (car y-ext
(angularity 0.5)
(height (bow-height lngth height-limit ratio)))
   (parenthesize-stencil
 (make-transparent-box-stencil x-ext y-ext)
 thick
 height
 angularity
 padding)))

tst-figures =
\figuremode {
  <[2]>
  <[2 4]>
  <[2 4 5]>
  <[2 4 5 7]>
  <[2 4 5 7 8]>
  <[2] [4 5 7 8]>
  <[2 4] [5 7 8]>
}

\new FiguredBass {
  \tst-figures
  \hack
  \tst-figures
}

Cheers,
  Harm

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


Re: Is it possible to change the PDF title?

2017-04-24 Thread Thomas Morley
2017-04-25 2:18 GMT+02:00 Thomas Morley :
> 2017-04-25 1:43 GMT+02:00  :
>> ```
>> title = \markup {
>>   \concat {
>> "W"
>> \scale #'(15/22 . 15/22) \combine
>>   "o"
>>   \translate-scaled #'(0 . 1.2) "a"
>> "ndering"
>>   }
>> }
>> ```
>>
>> This is extracted as "Wandering" (or at least that's what Atril shows).
>
> The function doing so is markup->string.
> I'll have to think whether it's the desired behaviour for combine-markup.
>
> Though it's not likely it will ever insert brackets or "a o"->"ꜵ"
>
>> I want it to be "W[ao]ndering" (or maybe "Wꜵndering"), because it's supposed
>> to be ambiguous.
>
>
> Try:
>
> \header {
>   title = \markup
> \concat {
>   "W"
>   \scale #'(15/22 . 15/22) \combine
> "o"
> \translate-scaled #'(0 . 1.2) "a"
>   "ndering"
> }
>   pdftitle = "W[ao]ndering"
>   %% or
>   %pdftitle = "Wꜵndering"
> }
>
> Cheers,
>   Harm

Also, see NR 3.2.3 Creating output file metadata

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


Re: Is it possible to change the PDF title?

2017-04-24 Thread Thomas Morley
2017-04-25 1:43 GMT+02:00  :
> ```
> title = \markup {
>   \concat {
> "W"
> \scale #'(15/22 . 15/22) \combine
>   "o"
>   \translate-scaled #'(0 . 1.2) "a"
> "ndering"
>   }
> }
> ```
>
> This is extracted as "Wandering" (or at least that's what Atril shows).

The function doing so is markup->string.
I'll have to think whether it's the desired behaviour for combine-markup.

Though it's not likely it will ever insert brackets or "a o"->"ꜵ"

> I want it to be "W[ao]ndering" (or maybe "Wꜵndering"), because it's supposed
> to be ambiguous.


Try:

\header {
  title = \markup
\concat {
  "W"
  \scale #'(15/22 . 15/22) \combine
"o"
\translate-scaled #'(0 . 1.2) "a"
  "ndering"
}
  pdftitle = "W[ao]ndering"
  %% or
  %pdftitle = "Wꜵndering"
}

Cheers,
  Harm

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


Re: Is it possible to change the PDF title?

2017-04-24 Thread Thomas Morley
2017-04-25 0:49 GMT+02:00  :
> By PDF title I mean the one shown in the PDF viewer's title bar. It seems to
> be extracted from the header:title field, but in my case, the title contains
> some complex markup and isn't extracted properly.

It should.
Could you post the title-markup?

Cheers,
  Harm

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


Re: Hairpin endings

2017-04-24 Thread Thomas Morley
Hi David,

2017-04-24 1:34 GMT+02:00 David Nalesnik :
> On Sun, Apr 23, 2017 at 6:15 PM, Thomas Morley  
> wrote:
>> 2017-04-23 12:34 GMT+02:00 Andrew Bernard :
>>
>>> Next thing to do is to achieve the half dashed/half solid appearance - or
>>> can this be done already, in the same way that slurs can?
>>
>> How about:
>
> This is great!

Glad you like it.

>
>>
>> #(define (solid-dashed-print-proc grob startx starty endx endy)
>>   (let* ((dash-def (ly:grob-property grob 'dash-definition))
>>  (thick
>>(* (layout-line-thickness grob)
>>   (ly:grob-property grob 'thickness 0.1
>> (if (null? dash-def)
>> (ly:line-interface::line grob startx starty endx endy)
>> (apply ly:stencil-add empty-stencil
>
> Why not reduce instead of apply?  Tiny point, but then you won't have
> the extra empty stencil in the stencil expression.

True, so the above should read:

[...]
 (reduce ly:stencil-add empty-stencil
[...]

Thanks,
  Harm

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


Re: RehearsalMark adds unwanted space

2017-04-24 Thread Thomas Morley
2017-04-24 23:02 GMT+02:00 Peter Crighton :
> Hello all,
>
> when removing both the Clef and BarNumber engraver, an occasional
> RehearsalMark at the beginning of a line affects the horizontal position of
> the following note. How can I prevent this, so the first note of every line
> is in the same horizontal position? See example below.
>
> This is not unique to RehearsalMarks. For instance, if you did not remove
> the BarNumber engraver, every line would have that space at the beginning.
>
>
> \version "2.19.59"
>
> \relative c' {
>   R1 \break
>   \mark \default
>   \repeat unfold 2 {
> \repeat unfold 2 {
>   c4 c c c
> } \break
>   }
>   \mark \default
>   \repeat unfold 2 {
> \repeat unfold 3 {
>   c4 c c c
> } \break
>   }
> }
>
> \layout {
>   \context {
> \Staff
> \remove "Clef_engraver"
>   }
>
>   \context {
> \Score
> \remove "Bar_number_engraver"
>   }
> }
>
>
> Thanks,
> Peter


Not sure why this happens, as a workaround you could do:

\layout {
  \context {
\Staff
%\remove "Clef_engraver"
\override Clef.stencil = #point-stencil
\override Clef.space-alist.first-note = #'(fixed-space . 0) %% adjust!
  }

  \context {
\Score
%\remove "Bar_number_engraver"
\override BarNumber.stencil = #point-stencil
\override LeftEdge.space-alist.clef = #'(fixed-space . 0) %% adjust!
  }
}


Cheers,
  Harm

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


Re: LSR down

2017-04-24 Thread Thomas Morley
2017-04-24 5:52 GMT+02:00 Andrew Bernard :
> LSR down again.
>
> Who is the maintainer? I'd be happy to mail them.
>
> Andrew



:((
I'll send you the contact-data privately, afaik he's not subscribed to
the user-list.

Cheers,
  Harm

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


Re: Hairpin endings

2017-04-23 Thread Thomas Morley
2017-04-23 12:34 GMT+02:00 Andrew Bernard :

> Next thing to do is to achieve the half dashed/half solid appearance - or
> can this be done already, in the same way that slurs can?

How about:

#(define (solid-dashed-print-proc grob startx starty endx endy)
  (let* ((dash-def (ly:grob-property grob 'dash-definition))
 (thick
   (* (layout-line-thickness grob)
  (ly:grob-property grob 'thickness 0.1
(if (null? dash-def)
(ly:line-interface::line grob startx starty endx endy)
(apply ly:stencil-add empty-stencil
  (map
(lambda (dash-def-elt)
  (let* ((start-x
   (+ startx (* (- endx startx) (first dash-def-elt
 (start-y
   (+ starty (* (- endy starty) (first dash-def-elt
 (end-x
   (+ startx (* (- endx startx) (second dash-def-elt
 (end-y
   (+ starty (* (- endy starty)  (second dash-def-elt)
(ly:stencil-translate
  (ly:make-stencil
(list 'dashed-line
  ;; thickness
  thick
  ;; on
  (third dash-def-elt)
  ;; off
  (- 1 (fourth dash-def-elt)) ;; calculation correct?
  ;; x-dest
  (- end-x start-x)
  ;; y-dest
  (- end-y start-y)
  ;; phase
  0)
;; x-ext
(cons start-x (- end-x start-x))
;; y-ext
(ordered-cons 0 (- end-y start-y)))
  (cons start-x start-y
dash-def)

#(define ((open-hairpin open-gap close-gap) grob)
   (let* ((stencil (ly:hairpin::print grob))
  (thick (layout-line-thickness grob))
  (dir (ly:grob-property grob 'grow-direction))
  (X-ext (ly:stencil-extent stencil X))
  (Y-ext (ly:stencil-extent stencil Y))
  (width (- (interval-length X-ext) thick))
  (height (- (interval-length Y-ext) thick))
  (scaled-height (* height (max open-gap close-gap)))
  (scaled-gap (* height (min open-gap close-gap)))
  (upper-stil-part
(solid-dashed-print-proc
  grob
  0
  (/ (if (= dir -1) scaled-height scaled-gap) 2)
  width
  (/ (if (= dir -1) scaled-gap scaled-height) 2
 (ly:stencil-translate
   (ly:stencil-add
 upper-stil-part
 (ly:stencil-scale upper-stil-part 1 -1))
   (cons (interval-start X-ext) (interval-start Y-ext)

{
  c'1\> c'1 c'1\!
  \once \override Hairpin.dash-definition =
#'((0  0.300.4)
   (0.30.711)
   (0.71.00.4  0.75))
  %% order of arguments for 'open-hairpin' doesn't matter!
  \override Hairpin.stencil = #(open-hairpin 0.2 1.0)
  c'1\fff\> c'1 c'2 c'2\\!
  \once \override Hairpin.dash-definition =
#'((0  0.300.4)
   (0.30.4511)
   (0.71.00.4  0.3))
  \once \override Hairpin.thickness = 2
  c'1\< c'1 c'1\!
  \revert Hairpin.dash-definition
  \override Hairpin.style = #'dashed-line
  \once \override Hairpin.stencil = #(open-hairpin 1.0 0.5)
  c'1\> c'1 c'1\!
  \override Hairpin.dash-fraction = 0.3
  \override Hairpin.dash-period = 1.5
  \once \override Hairpin.stencil = #(open-hairpin 0.5 0.0)
  c'1-\tweak thickness 3 \> c'1 c'1\!
}

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


Re: Hairpin endings

2017-04-22 Thread Thomas Morley
2017-04-21 19:15 GMT+02:00 Thomas Morley :
> 2017-04-21 14:39 GMT+02:00 David Nalesnik :

> The code for "Ferneyhough" hairpins uses make-connected-path-stencil,
> hence it will not work for this purpose.
>
> Below a rewrite using make-path-stencil:
[...]
> Probably worth a patch.

[...]

I newly rewrote it, now using ly:line-interface::line.

It's now
https://sourceforge.net/p/testlilyissues/issues/5123/
with patch.

Cheers,
  Harm

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


Re: Lines to edges of \center-column

2017-04-22 Thread Thomas Morley
2017-04-23 0:34 GMT+02:00 David Nalesnik :
> On Sat, Apr 22, 2017 at 3:22 PM,   wrote:
>> Is there some way to make a center-column draw lines from slightly outside
>> the text to the edges of the column (see example)?
>>
>> In this specific case, I have both English and Japanese names for stuff, and
>> without those lines, I think it's a bit unclear exactly what part the
>> Japanese refers to.
>>
>> ```
>> subtitle = \markup \bold \large \line {
>>   "from"
>>   \center-column {
>> "Legend of Heroes"
>> \smaller \smaller \smaller
>> "英雄伝説"
>>   }
>>   "VI:"
>>   \center-column {
>> "Trails in the Sky"
>> \smaller \smaller \smaller
>> "空の軌跡"
>>   }
>> }
>> ```
>
> Try this:
>
> \version "2.19.59"
>
> % based on general-column from scm/define-markup-commands.scm
> #(define (general-column align-dir baseline mols)
>(let* ((aligned-mols
>(map (lambda (x) (ly:stencil-aligned-to x X align-dir))
>  mols))
>   (max-extent (ly:stencil-extent (car aligned-mols) X))
>   (aligned-mols
>(cons (car aligned-mols)
>  (map (lambda (x)
> (let ((stil-ext (ly:stencil-extent x X)))
>   (ly:stencil-add
>(make-line-stencil 0.1 (car max-extent) 0 (1-
> (car stil-ext)) 0)
>(make-line-stencil 0.1 (1+ (cdr stil-ext)) 0
> (cdr max-extent) 0)
>(make-line-stencil 0.1 (car max-extent) 0 (car
> max-extent) 1.5)
>(make-line-stencil 0.1 (cdr max-extent) 0 (cdr
> max-extent) 1.5)
>x)))
>(cdr aligned-mols
>   (stacked-stencil (stack-lines -1 0.0 baseline aligned-mols))
>   (stacked-extent (ly:stencil-extent stacked-stencil X)))
>  (ly:stencil-translate-axis stacked-stencil (- (car stacked-extent)) X)))
>
> #(define-markup-command (center-column layout props args)
>(markup-list?)
>#:category align
>#:properties ((baseline-skip))
>(general-column CENTER baseline-skip (interpret-markup-list layout
> props args)))
>
> \header {
>   subtitle = \markup \bold \large \line {
> "from"
> \center-column {
>   "Legend of Heroes"
>   \smaller \smaller \smaller
>   "英雄伝説"
>   "英雄伝説"
>   \huge
>   "英雄伝説"
> }
> "VI:"
> \center-column {
>   "Trails in the Sky"
>   \smaller \smaller \smaller
>   "空の軌跡"
> }
>   }
> }
>
> { c }
>
> You might want to adjust some of the hard-coded values
> (line-thickness, length of "protrusions," offset of bracket from
> text), but this should get you started.
>
> -David
>

Here my approach:

#(define-markup-command (single-hbracket-with-text layout props ref arg)
  (markup? markup?)
  #:properties ((thick 0.1)
(protrusion 1)
(dir 1)
(axis X))
"Prints a bracket overlayed by @code{arg}. Both are center-aligned.

Takes the bracket-ext from @var{ref} in direction of the @code{axis}-property.
The angles of the bracket are printed in direction of the @code{dir}-property.
The appearance is tweakable with overrides for @code{thick} and
@code{protrusion}."

  (define (bracket-stencil stil axis thick protrusion dir)
   (let* ((ext (ly:stencil-extent stil axis))
  (lb (ly:bracket axis ext thick protrusion))
  (rb (ly:bracket axis ext thick (- protrusion
 (if (= 1 dir) lb rb)))

  (let* ((stil (interpret-markup layout props ref)))
(ly:stencil-add
  (ly:stencil-aligned-to
(bracket-stencil stil axis thick protrusion dir) axis CENTER)
  (ly:stencil-aligned-to
(interpret-markup layout props arg) axis CENTER



\markup \bold \large \line {
  "from"
  \override #'(baseline-skip . 1)
  \center-column {
"Legend of Heroes"
\single-hbracket-with-text
  "Legend of Heroes"
  \whiteout \vcenter \smaller \smaller \smaller \pad-x #0.3 "英雄伝説"
  }
  "VI:"
  \override #'(baseline-skip . 1)
  \center-column {
"Trails in the Sky"
\single-hbracket-with-text
  "Trails in the Sky"
  \whiteout \vcenter \smaller \smaller \smaller \pad-x #0.3 "空の軌跡"
  }
}


It needs a ref-markup for the bracket-extent and the text is overlayed
with control-possibilities for the user.
Didn't want to do too much automatically.


Cheers,
  Harm

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


Re: Can't refer to variable directly after defining it

2017-04-22 Thread Thomas Morley
2017-04-22 23:32 GMT+02:00  :
> For some reason, it seems I can't refer to a variable directly after
> defining it. As soon as I do /anything/ else, it works, but `foo={...} \foo`
> gives errors.
>
> ```
> $ cat bug.ly
> \version "2.18.2"
> foo = {c' c' c' c'}
> % bar = {d' d' d' d'}
> % {e' e' e' e'}
> % #foo
> \foo
> $ lilypond bug.ly
> GNU LilyPond 2.18.2
> Processing `bug.ly'
> Parsing...
> bug.ly:6:1: error: unknown escaped string: `\foo'
>
> \foo
> bug.ly:6:5: error: syntax error, unexpected end of input
> \foo
>
> fatal error: failed files: "bug"
> ```
>
> Uncommenting either of the three commented-out lines makes it work, all with
> the same resulting PDF.

The reason for it: The parser needs to check whether there is
something else which needs to be added to the definition of 'foo',
(most common example for those stuff is 'addlyrics') or, something
else makes clear the declaration of 'foo' is complete.

So, in your example 'foo' is used before the parser "understood" it's
definition.

Not sure it's a bug, more a consequence of the wished parser-behaviour.

>
> I'm currently using `\void {}` as a workaround, but I'd obviously prefer not
> having to do that.



Any new declaration will work:

For example:

\new Voice \foo
will work or separate with
#(begin)

David could explain more detailed.

hth a bit,
  Harm

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


Re: Center Systems

2017-04-22 Thread Thomas Morley
2017-04-22 18:16 GMT+02:00 Johannes Roeßler :
> Nobody? :(
>
> Hi again,
>
> I'd like to centre my systems vertically. Up to now the only options to
> manipulate the vertical features I use/know are
> ragged-bottom = ##f or ##t in the \paper-Env or explicit
> system-system-spacings. But is there an option to keep the auto-distance
> that
> is used for ragged-bottom = ##t but all systems not top-aligned but
> centre-aligned?

Hi,

well, I did not understand what you're aiming at...

Maybe an image would help. Probably faked by a graphic program.

Did you already try the flexible-vertical-spacing-paper-variables as
listed here:
http://lilypond.org/doc/v2.19/Documentation/notation-big-page#list-of-flexible-vertical-spacing-paper-variables
?

Probably:

\header { tagline = ##f }
\paper {
  ragged-bottom = ##f
  ragged-last-bottom = ##f
  annotate-spacing = ##t
  top-system-spacing =
#'((basic-distance . 6)
   (minimum-distance . 24)
   (padding . 1)
   (stretchability . 0))
  last-bottom-spacing =
#'((basic-distance . 6)
   (minimum-distance . 24)
   (padding . 1)
   (stretchability . 0))
  system-system-spacing =
#'((basic-distance . 12)
   (minimum-distance . 6)
   (padding . 1)
   (stretchability . 1000))

}

\score {
  <<
\new Staff <<
  \repeat unfold 15 { c'4 c' c' c' }
>>
\new Staff {
  \repeat unfold 15 { d'4 d' d' d' }
}
  >>
}

Cheers,
  Harm


>
>
> \version "2.19.58"
>
> \header { tagline = ##f }
> \paper {
>   ragged-bottom = ##f
>   ragged-last-bottom = ##f
> }
>
> \score {
>   <<
> \new Staff <<
>   \repeat unfold 15 { c'4 c' c' c' }
> >>
> \new Staff {
>   \repeat unfold 15 { d'4 d' d' d' }
> }
>   >>
> }
>
> cheers Joei
>
> ***

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


Re: tracking/letterspacing markup

2017-04-21 Thread Thomas Morley
2017-04-21 17:40 GMT+02:00 Kieren MacMillan :
> Hello all,
>
> Is there an easy markup tracking/letterspacing function floating around out 
> there? The last time I needed to adjust letterspacing (for a style demo), I 
> simply wrote e.g.
>
>   \markup \override #'(word-space . 0) \line { l e t t e r s p a c i n g }
>   \markup \override #'(word-space . 0.2) \line { l e t t e r s p a c i n g }
>   \markup \override #'(word-space . 2) \line { l e t t e r s p a c i n g }
>
> If somebody out there has built, or could help me build, a real letterspacing 
> function — or, I suppose better yet, add letterspacing as a parameter to the 
> underlying markup code — I’d appreciate it.
>
> Thanks,
> Kieren.



Hi Kieren,

the attached was once coded in the now down German Forum by Arnold.
Please be aware of the problems, let me quote the comment for
'unicode-diacritics':
"
; These are the UNICODE ranges of the diacritical symbols, which
; should not be insulated form their predestinating glyph.
; Look at the code charts at www.unicode.org for more information.
; As long as this table is entered manually there is a high risk of errors.
; This list (ascending order) tends to be incomplete
"


Furthermore I tested with my experimental guile-2.2.1-lilypond-build:

\markup \box #(map string (string->list "名字äüö\\letterspacing"))
\markup #(map string (string->list "名字äüö\\letterspacing"))
\markup
  \override #'(word-space . -0.2)
  \line #(map string (string->list "名字äüö\\letterspacing"))
\markup
  \override #'(word-space . 2)
  \line #(map string (string->list "名字äüö\\letterspacing"))

Returning the attached png.
Though, don't try it with guilev1-lilypond.
It will return wagonloads of pango-warnings and bad output...


HTH,
  Harm
\version "2.18.2"

#(define (utf-8-string->wide-char-list str)
"
 Convert a UTF-8 byte string into an list with integer representing the 
 UNICODE character codes
"
  (let ((erg '())
(mult 1)
(sum 0))

  (for-each 
(lambda (single-byte-char)
  (let ((numeric (char->integer single-byte-char)))
  (if (< numeric #x80)
   (begin ; 7-Bit-ASCII stand alone character
 (if (not (equal? mult 1)) 
   (begin
 (ly:warning 
   "utf-8-string->wide-char-list: UTF-8-string out of sequence!")
 (set! mult 1) (set! sum 0)))
 (set! erg (cons numeric erg)))
   (if (< numeric #xc0)
(begin ; 10. . = UTF-8 expansion byte
  (set! sum (+ sum (* mult (- numeric #x80
  (set! mult (* 64 mult)))
(if (< numeric #xe0)
 (begin ; 110.  = UTF-8 start of two byte sequence
   (if (not (equal? mult 64))
(ly:warning 
  "utf-8-string->wide-char-list: UTF-8-string out of sequence!")
(begin
  (set! sum (+ sum (* mult (- numeric #xc0
  (set! erg (cons sum erg
   (set! mult 1) (set! sum 0))
 (if (< numeric #xf0)
  (begin ; 1110  = UTF-8 start of three byte sequence
   (if (not (equal? mult 4096))
(ly:warning 
  "utf-8-string->wide-char-list: UTF-8-string out of sequence!")
(begin
  (set! sum (+ sum (* mult (- numeric #xe0
  (set! erg (cons sum erg
   (set! mult 1) (set! sum 0))
  (if (< numeric #xf8)
   (begin ;  0... = UTF-8 start of four byte sequence
(if (not (equal? mult 262144))
 (ly:warning 
   "utf-8-string->wide-char-list: UTF-8-string out of sequence!")
 (begin
   (set! sum (+ sum (* mult (- numeric #xf0
   (set! erg (cons sum erg
(set! mult 1) (set! sum 0))
   (begin ;; This would be the header of a UTF-8 encoding of an 
  ;; UNICODE character with more than 21 bits - this
  ;; does not exist!
 (ly:warning 
   "utf-8-string->wide-char-list: UTF-8-string out of sequence!")
 (set! mult 1) (set! sum 0)
(reverse (string->list str)))
  erg))

#(define unicode-diacritics 
; These are the UNICODE ranges of the diacritical symbols, which
; should not be insulated form their predestinating glyph.
; Look at the code charts at www.unicode.org for more information.
; As long as this table is entered manually there is a high risk of errors.
; This list (ascending order) tends to be incomplete
 '( 
   ; Combining Diacritical Marks
   ( #x0300 . #x036f )
   ; Cyrillic
   ( #x0483 . #x0489 )
   ; Hebrew
   ( #x0591 . #x05bd )
   ( #x05bf . #x05bf )
   ( #x05c1 . #x05c2 )
   ( #x05c4 . #x05c5 )
   ( #x05c7 . #x05c7 )
   ; Arabic
   ( #x0610 . #x061a )
   ( #x064b . #x065f )
   ( #x0670 . #x0670 )
   ( #x06d6 . #x06dc )
   ( #x06df . #x06e4 )
   ( #x06ea . #x06ed )
   ; Syriac
   ( #x0711 . #x0711 )
   ( #x0730 . #x074a )
   ; Thaana
   ( #x07a6 . #x07b0 )
   ; NKo
   ( #x07eb . #x07f3 )
  

Re: Hairpin endings

2017-04-21 Thread Thomas Morley
2017-04-21 14:39 GMT+02:00 David Nalesnik :
> Hi,
>
> On Fri, Apr 21, 2017 at 1:07 AM,   wrote:
>> Am 2017-04-21 07:41, schrieb Nathan Ho:
>>>
>>> On 2017-04-20 20:42, Andrew Bernard wrote:

 I posted a while ago with a query about hairpins, to which no
 response.

 Would there be any way to have hairpins that don't start, or end in
 the other direction, with the lines converging to the same point? I
 have need from time to time of hairpins where the end points are still
 separated, rather than coming to a termination together. Sure this can
 be done with a whiteout box, but that is always fiddly and the
 position tends to move when the score is repaginated etc etc. In the
 same way as the 'height' property allows you to specify the separation
 at the open end, it would be useful to have some property for this
 sort of thing at the pointy end. Yes, definitely not Common Era
 engraving practice, but this keeps coming up in the New Complexity
 scores I work with.
>
> Besides Nathan's code below, you might be able to use the
> "Ferneyhough" hairpins.
>
> Can you provide an usage example of these partial hairpins?  How would
> they behave over line breaks?

The code for "Ferneyhough" hairpins uses make-connected-path-stencil,
hence it will not work for this purpose.

Below a rewrite using make-path-stencil:

#(define ((elbowed-hairpin coords mirrored?) grob)
  "Create hairpin based on a list of @var{coords} in @code{(cons x y)}
form.  @code{x} is the portion of the width consumed for a given line
and @code{y} is the portion of the height.  For example,
@code{'((0 . 0) (0.3 . 0.7) (0.8 . 0.9) (1.0 . 1.0))} means that at the point
where the hairpin has consumed 30% of its width, it must
be at 70% of its height.  Once it is to 80% width, it
must be at 90% height.  It finishes at 100% width and 100% height.
If @var{coords} does not begin with @code{'(0 . 0)} the final hairpin will have
an open tip.  For example '(0 . 0.5) will cause an open end of 50% of the usual
height.
@var{mirrored?} indicates if the hairpin is mirrored over the Y-axis or if
just the upper part is drawn.
Returns a function that accepts a hairpin grob as an argument
and draws the stencil based on its coordinates.

@lilypond[verbatim,quote]
#(define simple-hairpin
  (elbowed-hairpin '((0 . 0)(1.0 . 1.0)) #t))

\\relative c' {
  \\override Hairpin #'stencil = #simple-hairpin
  a\\p\\< a a a\\f
}
@end lilypond
"
  (define (normalize-coords goods x y)
(map
  (lambda (coord)
(cons (* x (car coord)) (* y (cdr coord
  goods))

  (define (my-c-p-s points thick decresc?)
(let ((start-point (car points)))
  (make-path-stencil
(append
  `(moveto
,(car start-point)
,(cdr start-point))
  (append-map
(lambda (elt)
  (list 'lineto (car elt) (cdr elt)))
(cdr points)))
thick
(if decresc? -1.0 1.0)
1.0
#f)))
  ;; outer let to trigger suicide
  (let ((sten (ly:hairpin::print grob)))
(if (grob::is-live? grob)
(let* ((decresc? (eqv? (ly:grob-property grob 'grow-direction) LEFT))
   (thick (ly:grob-property grob 'thickness 0.1))
   (thick (* thick (layout-line-thickness grob)))
   (xex (ly:stencil-extent sten X))
   (lenx (interval-length xex))
   (yex (ly:stencil-extent sten Y))
   (leny (interval-length yex))
   (xtrans (+ (car xex) (if decresc? lenx 0)))
   (ytrans (car yex))
   (uplist (normalize-coords coords lenx (/ leny 2)))
   (downlist (normalize-coords coords lenx (/ leny -2)))
   (stil
 (ly:stencil-aligned-to
   (ly:stencil-translate
 (ly:stencil-add
   (my-c-p-s uplist thick decresc?)
   (if mirrored?
   (my-c-p-s downlist thick decresc?)
   empty-stencil))
 (cons xtrans ytrans))
   Y CENTER))
   (stil-y-extent (ly:stencil-extent stil Y)))
;; Return a final stencil properly aligned in Y-axis direction and with
;; proper extents. Extent in X-axis direction is taken from the
;; original, in Y-axis direction from the new stencil.
;; Otherwise stencil-operations like 'box-stencil' will return badly.
(ly:make-stencil (ly:stencil-expr stil) xex stil-y-extent))
;; return empty if no Hairpin.stencil present.
'(

%%
%% EXAMPLE
%%

{
  \override Hairpin.to-barline = ##f
  \once \override Hairpin.stencil =
#(elbowed-hairpin '((0.0 . 0.4)(1.0 . 1.2)) #t)
  c'4\> c'' c''' d'''\! d'''1

  \once \override Hairpin.stencil =
#(elbowed-hairpin '((0.0 . 0.0)(1.0 . 0.5)) #t)
  c'1\pp\<
  \once \override Hairpin.stencil =
#(elbowed-hai

Re: Specify output directory *in* the file

2017-04-18 Thread Thomas Morley
2017-04-18 20:34 GMT+02:00 Jeffery Shivers :
> On Tue, Apr 18, 2017 at 12:57 PM, Patrick Hubers  wrote:
>>
>> I would love to use this solution, but it means that you also have to define
>> the actual name of the *file* in addition to the directory. Is there a way
>> to derive the filename from the title and use that? I found that using
>>
>>   \bookOutputName \concat { "/home/foo/" \fromproperty #'header:title }
>>
>> does not work...
>
> Couldn't one do this in scheme alone?
>
> I don't know how to retrieve bookOutputName after it is set, but maybe
> setting it independently like:
>
> #(define mytitle "mytitle")
>
> \book {
>   \header {
> title = #mytitle
>   }
>   \bookOutputName #(string-append "sub/" mytitle)
>   \score {
> c'4
>   }
> }
>
> But if there is a way to use fromproperty in scheme, I can't figure it out.
>
> --
>
> Jeffery Shivers
>  jefferyshivers.com
>  soundcloud.com/jefferyshivers



Not sure if it'll help, here some methods to retrieve values:

\header {
  title = "My first title"
  secondtitle = "My second title"
}

\bookOutputName "my-out"

#(format #t
  "\nBindings in the header-module:\n~y"
  (ly:module->alist $defaultheader))

#(format #t
  "\ntitle from header-module, if not found fallback is used: \"~a\"\n"
  (assoc-get 'title (ly:module->alist $defaultheader)
  "fall-back-value"))

#(format #t
  "\nsecondtitle from header-module, if not found fallback is used: \"~a\"\n"
  (assoc-get 'secondtitle (ly:module->alist $defaultheader)
  "second-fall-back-value"))

#(format #t
  "\nthirdtitle from header-module, if not found fallback is used: \"~a\"\n"
  (assoc-get 'thirdtitle (ly:module->alist $defaultheader)
  "third-fall-back-value"))

#(format #t
  "\nCurrent output-filename: \"~a\"\n"
  (paper-variable (ly:parser-lookup '$current-book) 'output-filename))

#(format #t
  "\nCurrent filename: \"~a.ly\"\n"
  (ly:parser-output-name))


HTH,
  Harm

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


Re: Problem with /accepts

2017-04-18 Thread Thomas Morley
2017-04-18 15:45 GMT+02:00 David Kastrup :
> Thomas Morley  writes:

>> Out of curiosity, could you point me to where the current error is triggered?

>
> My guess is lily/context.cc:
>
> void
> Context::create_context_from_event (SCM sev)
> {
>   Stream_event *ev = unsmob (sev);
>
>   string id = ly_scm2string (ev->get_property ("id"));
>   SCM ops = ev->get_property ("ops");
>   SCM type_scm = ev->get_property ("type");
>   string type = ly_symbol2string (type_scm);
>
> It's probably the last line quoted that gives this error.  The "accepts"
> stuff is likely a red herring: if a context is not acceptable, it won't
> get created in the first place and thus not trigger the error.
>
> --
> David Kastrup

Thanks for the info,
  Harm

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


Re: Problem with \slashedGrace and \partial

2017-04-18 Thread Thomas Morley
2017-04-18 17:51 GMT+02:00 Pieter Terpstra :
> Dear Readers,
> Have some issues here.
>
> Stem goes down here (even if i try a \stemUp)

This is a bug with 2.18.2, already cured in devel-versions.

> and get double crosses and time signature.

This is issue 34.

> What goes wrong here?
>
> Thank you again so much!
>
> Peter
>
> score:
> \version "2.18.2"
>
> global = {
>   \key a \major
>   %\defaultTimeSignature
>   \time 2/4
> }
>
> CGVoiceOne = \relative c' {
>   \global
>   \partial 8 \slashedGrace fis8 e16. dis32\p |
>   e8 a a \slashedGrace fis8 e16. dis 32 |
> }
> CGVoiceTwo = \relative c {
>   \global
>   \partial 8

%% to cure issue 34 add:
  \grace s8
%% for more see NR

> r8 |
>   r a [a] r |
> }
> \score {
>\new Staff \with {
> midiInstrument = "acoustic guitar (nylon)"
>   } { \clef "treble_8" << \CGVoiceOne
>   \\ \CGVoiceTwo >>
> }}



I'd recommend to upgrade to a recent devel-version.
For 2.18.2 you may try:

global = {
  \clef "treble_8"
  \key a \major
  \time 2/4
}

CGVoiceOne =
\new Voice \with { \voiceOne }
  \relative c' {
\global
\partial 8 \slashedGrace fis8 e16. dis32\p |
e8 a a \slashedGrace fis8 e16. dis 32 |
  }
CGVoiceTwo =
\new Voice \with { \voiceTwo }
  \relative c {
\global
\partial 8 \grace s8 r8 |
r a [a] r |
  }
\score {
  \new Staff \with { midiInstrument = "acoustic guitar (nylon)" }
  << \CGVoiceOne \CGVoiceTwo >>
}


HTH,
  Harm

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


Re: Problem with /accepts

2017-04-18 Thread Thomas Morley
2017-04-18 10:55 GMT+02:00 David Kastrup :
> Thomas Morley  writes:
>
>> 2017-04-17 21:08 GMT+02:00 Roman Stawski :
>>> Hello all
>>>
>>>
>>> I'm coming across a problem with context definitions:
>>>
>>> \layout {
>>> \context {
>>> \name P
>>> \alias Voice
>>> }
>>>
>>> This blows up with the error
>>>
>>> Interpreting music...ERROR: In procedure symbol->string:
>>> ERROR: Wrong type argument in position 1 (expecting symbol): ()
>>> Exited with return code 1.
>>>
>>> If I comment out the '\accepts' compilation finishes, (but ignores the
>>> context P obviously).
>>
>> From: NR 5.1.6 Defining new contexts
>>
>> "The mechanisms with which contexts communicate are established by declaring
>> the context \type. Within a \layout block, most contexts will be of type
>> Engraver_group.
>> [...]
>> Copying and modifying an existing context definition will also fill in
>> the type."
>>
>>
>> So (see comments):
>>
>>
>> \layout {
>> %% define "P" from scratch
>> \context {
>> \type "Engraver_group"
>> \name P
>> \alias Voice
>> %% put in engravers for what you want
>> %% otherwise no output
>> }
>
> Trigger and wording of error message are not overly helpful here.  This
> should likely be caught at an earlier point of time.
>
> --
> David Kastrup

Out of curiosity, could you point me to where the current error is triggered?

I've added some debugging code:

(define (print-book-with parser book process-procedure)
  (let* ((paper (ly:parser-lookup parser '$defaultpaper))
 (layout (ly:parser-lookup parser '$defaultlayout))
 (outfile-name (get-outfile-name parser book)))

  (pretty-print
(list
  book
  paper
  (map
(lambda (sym)
 (cons
  (ly:context-def-lookup
 (assoc-get 'P (ly:module->alist
(ly:output-def-scope layout)))
 sym)
  sym))
  (list
'default-child
'consists
'description
'aliases
'accepts
'property-ops
'context-name
'group-type))
  (assoc-get 'P (ly:module->alist (ly:output-def-scope layout)))
  outfile-name))

(process-procedure
  book
  paper
  layout
  outfile-name)))

returning:

(#
 #< Output_def>
 ((() . default-child)
  (() . consists)
  (() . description)
  ((Voice) . aliases)
  (() . accepts)
  (() . property-ops)
  (P . context-name)
  (() . group-type))
 #
 "atest-55")

Though, I don't see symbol->string applied anywhere there.

Cheers,
  Harm

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


Re: Problem with /accepts

2017-04-17 Thread Thomas Morley
2017-04-17 21:08 GMT+02:00 Roman Stawski :
> Hello all
>
>
> I'm coming across a problem with context definitions:
>
> \version "2.19.59"
> \layout {
> \context {
> \Staff
> \accepts P
> }
> \context {
> \name P
> \alias Voice
> }
> }
>
> \new Staff {
> \new P \relative c'' { c c c c }
> }
>
>
> This blows up with the error
>
> Interpreting music...ERROR: In procedure symbol->string:
> ERROR: Wrong type argument in position 1 (expecting symbol): ()
> Exited with return code 1.
>
> If I comment out the '\accepts' compilation finishes, (but ignores the
> context P obviously).
>
> Could someone let me know what I'm doing wrong here?
>
> Thanks



From: NR 5.1.6 Defining new contexts

"The mechanisms with which contexts communicate are established by declaring
the context \type. Within a \layout block, most contexts will be of type
Engraver_group.
[...]
Copying and modifying an existing context definition will also fill in
the type."


So (see comments):


\layout {
\context {
\Staff
\accepts P
}
%% define "P" from scratch
\context {
\type "Engraver_group"
\name P
\alias Voice
%% put in engravers for what you want
%% otherwise no output
}
}

\new Staff {
\new P \relative c'' { c c c c }
}

%% or:

\layout {
\context {
\Staff
\accepts PP
}
%% copy "Voice"-settings, rename to "PP"
\context {
\Voice
\name PP
\alias Voice
%% all engravers from Voice are present
%% remove/add what you want
%% add overrides as well
}
}

\new Staff {
\new PP \relative c'' { c c c c }
}

HTH,
  Harm

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


Re: Metronome mark stem length

2017-04-17 Thread Thomas Morley
2017-04-17 14:21 GMT+02:00 Andrew Bernard :
> Hi Simon,
>
> It's the signum function sgn of course,

Ofcourse.

> implemented in racket as sgn, but
> not in guile or the SRFI's with guile AFAIK.

Don't know racket, but it's not in guile, afaik.

> You could also say in Scheme:
>
> (define (sgn n)
>   (cond ((negative? n) -1)
> ((positive? n)  1)
> (else 0)))
>
> A dozen ways to implement, of course, Would be worth having this function
> somewhere in the lily libraries.

It _is_ in lily-library.scm.

>From there I copied it.
The purpose was to make issue 5122 work, before the patch is released.
Thus all needed definitions/procedures have to be present _in_ the
ly-file (ofcourse \include from an .ily-file is possible as well).
Leading to numerous lines of code.

The patch itself changes only 4 lines of code-changes and adds three
lines of comments...
https://codereview.appspot.com/324780043/diff/20001/scm/define-markup-commands.scm


One could argue whether 'sign' should be public, though ...


Cheers,
  Harm

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


Re: flip clef, key and time signature [Re: flip clef at end of line only]

2017-04-17 Thread Thomas Morley
2017-04-17 13:35 GMT+02:00 Marc Hohl :
> Hi Harm,

>>
>> (ly:grob-set-property! grob 'space-alist
>>   '((staff-bar extra-space . 1))
>
>
> Ah, that's the way to go here – thanks a lot for your brilliant solution!
>
> Can you explain why you use before-line-breaking? Does it make any
> difference to after-line-breaking?

Well, I tried to affect _one_ grob with _one_ override.

The stencil-override could be done directly or before-line-breaking or
after-line-breaking.
The 'space-alist needs to be set directly (with a _separate_ override)
or 'before-line-breaking, it doesn't work sufficiently
'after-line-breaking.

Best,
  Harm

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


Re: flip clef, key and time signature [Re: flip clef at end of line only]

2017-04-16 Thread Thomas Morley
2017-04-16 17:54 GMT+02:00 Marc Hohl :
> Am 15.04.2017 um 18:02 schrieb Malte Meyn:
>>
>>
>>
>> Am 15.04.2017 um 17:32 schrieb Marc Hohl:
>>>
>>> Hi list,
>>>
>>> I am working on a little piece that's played as written; after
>>> that, the musician has to turn the page upside down and play the
>>> resulting notes.
>>>
>>> I managed to get the clef displayed at the beginning and the end of
>>> each line, and I can flip the clef ;-)
>>>
>>> Unfortunately, overriding the Clef.stencil at the end of the line
>>> changes the apperance for the clef in the next line, too.
>>
>>
>> You need before-line-breaking here so you can use the function
>> ly:item-break-dir:
>>
>>
>> \override Clef.before-line-breaking = #(lambda (grob) (if (equal?
>> (ly:item-break-dir grob) LEFT) (ly:grob-set-property! grob 'stencil
>> (lambda (grobb) (grob-interpret-markup grobb #{ \markup \translate
>> #'(0 . 2) \flip \musicglyph #"clefs.G" #})
>
>
> I tried to go one step further and include the key signature and time
> signature in my example, see the attached code.
>
> It works and looks quite ok (the spacing between the flipped sharp and
> the 3/4 is a little too wide), but I get a lot of errors:
>
> Programmierfehler: No spacing entry from Item to `clef'
> Fortsetzung, die Daumen drücken
>
> and one line like this:
>
> Programmierfehler: No spacing entry from TimeSignature to `key-signature'
> Fortsetzung, die Daumen drücken
>
> I searched in the sources and assume that I have to enhance the
> space-alist entries in the concerning grobs, but I do not have a clue
> about the first error message, so any help is highly apprechiated.
>
> Happy Easter!
>
> Marc



Hi Marc,

how about below?

retrogradeItem = {
  \override Score.SystemStartBar.collapse-height = 1

  \override Staff.Clef.before-line-breaking =
#(lambda (grob)
  (if (equal? (ly:item-break-dir grob) LEFT)
  (begin
(ly:grob-set-property! grob 'stencil
  (ly:stencil-rotate
(ly:grob-property grob 'stencil) 180 0 -0.04))
(ly:grob-set-property! grob 'space-alist
  '((staff-bar extra-space . 1))

  \override Staff.TimeSignature.before-line-breaking =
#(lambda (grob)
  (if (equal? (ly:item-break-dir grob) LEFT)
  (begin
(ly:grob-set-property! grob 'space-alist
  '((key-signature extra-space . 1)))
(ly:grob-set-property! grob 'stencil
  (ly:stencil-rotate
(ly:grob-property grob 'stencil) 180 0 0)

  \override Staff.KeySignature.before-line-breaking =
#(lambda (grob)
  (if (equal? (ly:item-break-dir grob) LEFT)
  (begin
(ly:grob-set-property! grob 'space-alist '((clef extra-space . 1)))
(ly:grob-set-property! grob 'stencil
  ;; -0.51 found by trial and error, needs to be always adjusted :(
  (ly:stencil-rotate
(ly:grob-property grob 'stencil) 180 0 -0.51)

  %% TODO same for KeyCancellation

  \override Score.BreakAlignment.break-align-orders =
 #(vector
'(left-edge
  cue-end-clef
  ambitus
  breathing-sign
  time-signature
  key-signature
  key-cancellation
  clef
  cue-clef
  staff-bar
  custos)
'(left-edge
  cue-end-clef
  ambitus
  breathing-sign
  clef
  cue-clef
  staff-bar
  key-cancellation
  key-signature
  time-signature
  custos)
'(left-edge
  ambitus
  breathing-sign
  clef
  key-cancellation
  key-signature
  time-signature
  staff-bar
  cue-clef
  custos))
}

global = {
  \retrogradeItem
  \repeat unfold 4 {
s1 * 4 |
\once\override Staff.BarLine.allow-span-bar = ##t
\break
}
}

melody = {
  \key c \minor
  \repeat unfold 16 { c'4 4 4 4 }
  \time 4/4
}


\score {
  \new StaffGroup
  \new Staff << \global \melody >>
  \layout {
\context {
  \Staff
  explicitKeySignatureVisibility = ##(#t #f #t)
  explicitClefVisibility = ##(#t #f #t)
  \override Clef.break-visibility = ##(#t #f #t)
  \override KeySignature.break-visibility = ##(#t #f #t)
}
  }
}

For the BarNumbers you'll likely need an engraver ...

Happy Easter,
  Harm

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


Re: Metronome mark stem length

2017-04-16 Thread Thomas Morley
2017-04-16 15:00 GMT+02:00 Thomas Morley :
> 2017-04-16 12:59 GMT+02:00 Robert Murdoch :
>> When I adjust my score's size with #(layout-set-staff-size N) and the score
>> has a tempo with a metronome mark, the metronome mark's stem gets longer if
>> the size is smaller, and shorter if the size is larger. There should be
>> examples attached at sizes 20 and 12 to show you.
>
> Confirmed.

> Lemme have a closer look at that note-by-number-markup.



It's now
https://sourceforge.net/p/testlilyissues/issues/5122/
with patch.

If you can't wait for next release, try:

#(define (sign x)
  (if (= x 0)
  0
  (if (< x 0) -1 1)))

#(define-markup-command (note-by-number layout props log dot-count dir)
  (number? number? number?)
  #:category music
  #:properties ((font-size 0)
(flag-style '())
(style '()))
  "
@cindex notes within text by log and dot-count

Construct a note symbol, with stem and flag.  By using fractional values for
@var{dir}, longer or shorter stems can be obtained.
Supports all note-head-styles.  Ancient note-head-styles will get
mensural-style-flags.  @code{flag-style} may be overridden independently.
Supported flag-styles are @code{default}, @code{old-straight-flag},
@code{modern-straight-flag}, @code{flat-flag}, @code{mensural} and
@code{neomensural}.  The latter two flag-styles will both result in
mensural-flags.  Both are supplied for convenience.

@lilypond[verbatim,quote]
\\markup {
  \\note-by-number #3 #0 #DOWN
  \\hspace #2
  \\note-by-number #1 #2 #0.8
}
@end lilypond"
  (define (get-glyph-name-candidates dir log style)
(map (lambda (dir-name)
   (format #f "noteheads.~a~a"
   dir-name
   (if (and (symbol? style)
(not (equal? 'default style)))
   (select-head-glyph style (min log 2))
   (min log 2
 (list (if (= dir UP) "u" "d")
   "s")))

  (define (get-glyph-name font cands)
(if (null? cands)
""
(if (ly:stencil-empty? (ly:font-get-glyph font (car cands)))
(get-glyph-name font (cdr cands))
(car cands

  (define (buildflags flag-stencil remain curr-stencil spacing)
;; Function to recursively create a stencil with @code{remain} flags
;; from the single-flag stencil @code{curr-stencil}, which is already
;; translated to the position of the previous flag position.
;;
;; Copy and paste from /scm/flag-styles.scm
(if (> remain 0)
(let* ((translated-stencil
(ly:stencil-translate-axis curr-stencil spacing Y))
   (new-stencil (ly:stencil-add flag-stencil translated-stencil)))
  (buildflags new-stencil (- remain 1) translated-stencil spacing))
flag-stencil))

  (define (straight-flag-mrkp flag-thickness flag-spacing
  upflag-angle upflag-length
  downflag-angle downflag-length
  dir)
;; Create a stencil for a straight flag.  @var{flag-thickness} and
;; @var{flag-spacing} are given in staff spaces, @var{upflag-angle} and
;; @var{downflag-angle} are given in degrees, and @var{upflag-length} and
;; @var{downflag-length} are given in staff spaces.
;;
;; All lengths are scaled according to the font size of the note.
;;
;; From /scm/flag-styles.scm, modified to fit here.

(let* ((stem-up (> dir 0))
   ;; scale with the note size
   (factor (magstep font-size))
   (stem-thickness (* factor 0.1))
   (line-thickness (ly:output-def-lookup layout 'line-thickness))
   (half-stem-thickness (/ (* stem-thickness line-thickness) 2))
   (raw-length (if stem-up upflag-length downflag-length))
   (angle (if stem-up upflag-angle downflag-angle))
   (flag-length (+ (* raw-length factor) half-stem-thickness))
   (flag-end (polar->rectangular flag-length angle))
   (thickness (* flag-thickness factor))
   (thickness-offset (cons 0 (* -1 thickness dir)))
   (spacing (* -1 flag-spacing factor dir))
   (start (cons (- half-stem-thickness) (* half-stem-thickness dir)))
   (raw-points
 (list
   '(0 . 0)
   flag-end
   (offset-add flag-end thickness-offset)
   thickness-offset))
   (points (map (lambda (coord) (offset-add coord start)) raw-points))
   (stencil (ly:round-filled-polygon points half-stem-thickness))
   ;; Log for 1/8 is 3, so we need to subtract 3
   (flag-stencil (buildflags stencil (- log 3) stencil spacing)))
  flag-stencil))

  (let* ((font (ly:paper-get-font layout (cons '((font-encoding . fetaMusic)
  

Re: Metronome mark stem length

2017-04-16 Thread Thomas Morley
2017-04-16 12:59 GMT+02:00 Robert Murdoch :
> When I adjust my score's size with #(layout-set-staff-size N) and the score
> has a tempo with a metronome mark, the metronome mark's stem gets longer if
> the size is smaller, and shorter if the size is larger. There should be
> examples attached at sizes 20 and 12 to show you.

Confirmed.

After putting some debugging code into note-by.number-markup:

mus = \new Staff { \tempo 4=120 c'1 }

\score {
  \mus
}
%% stem-stencil height: 2.51290232058999

\score {
  \mus
  \layout { #(layout-set-staff-size 2) }
}

%% stem-stencil height: 2.66051672727502

\score {
  \mus
  \layout { #(layout-set-staff-size 40) }
}
%% stem-stencil height: 2.32216286195653


I followed this one back to 2.12.3, so it's a long standing issue.


> The question is, how do I stop this from happening?

Obviously you could construct the MetronomeMark-markups manually.
Though, this is tedious...
Lemme have a closer look at that note-by-number-markup.


Cheers,
  Harm

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


Re: Custom parenthesize ignoring Staves?

2017-04-16 Thread Thomas Morley
Hi Krzysztof ,

2017-04-15 20:11 GMT+02:00 kmg :
> Hey, I'm working on re-typing some educational notes and I'm wondering if
> maybe someone had this problem and also came up with some Scheme to deal
> with this.
>
> http://i.imgur.com/T7z8Ty7.png - this is the source;
>
> http://i.imgur.com/IGocUKW.png - this is what I came up with (nevermind
> wrong notes)
>
> So, I'm basically using #parch scheme which I luckily found on german
> Lilypond forums (sadly seems to be down now)..

I'm pretty furious about that ...

> scheme for it is the
> following:
>
> parch =  #(define-music-function (parser location gap) (number?)
> #{
>\once \override Arpeggio.stencil = #(lambda (grob)
>  (ly:stencil-add
>(ly:arpeggio::brew-chord-slur grob)
>(ly:stencil-translate-axis
>  (ly:stencil-rotate (ly:arpeggio::brew-chord-slur grob) 180 0 0)
>  gap X)))
>\once \override Arpeggio.X-extent = #(lambda (grob)
>  (ly:stencil-extent (ly:arpeggio::brew-chord-slur grob) X))
>\once \override Arpeggio.positions = #(lambda (grob)
>  (interval-widen (ly:arpeggio::calc-positions grob) 1.5))
>$(make-music 'EventChord 'elements (list (make-music 'ArpeggioEvent)))
> #})
>
> // usage: \parch #
>
> which I kinda made work by doing the chord on d# note with greater range,
> but with the upper note hidden, so the parenthese is not too small. However,
> if I make the chord with super low note, staff will stretch and it's not
> working.
>
> I've been thinking, would there be an easy way to do this? I already use
> handy Scheme for Box markup (http://lsr.di.unimi.it/LSR/Item?id=953). I
> think it's superior in the sense that you can place it basically anywhere
> and offset it like you want it. So there are no problems with having to do
> some gimmicks to make it work.
>
> Thought that chords will be trickier, but it seems that using harmony scheme
> from Repository and doing \center-column in \figuremode with markups does
> the job nicely.
>
> I sometimes wonder if it should be that tricky (I mean, having to learn
> Scheme to do some things).. but then, I wonder if such thing would be doable
> at all in other notation programs. .
>
> Anyway, thanks for your input guys and.. Happy Easter!
>
>
> Pozdrawiam,
> Krzysztof Gutowski


How about below (Hijacking GridPoint and GridLine)?

Usage should be clear from doc-string/comments/example. If not, ask back.

\version "2.19.56"

parentheses =
#(define-music-function (shorten-pair padding dir)
  ((pair? '(0 . 0)) number? ly:dir?)
  "@var{dir} sets the opening/closing direction of the parentheses.
  @var{padding} moves the parentheses in X-axis direction, recognized by the
  spacing-engine.  See limitations below, though.
  The optional @var{shorten-pair} may be used to adjust the parentheses in
  Y-axis direction.
  The final parentheses will cover all Staffs of the current system.
  Limitation:
  Accidentals, dots, etc are not taken into account.
  To avoid collisions adjusting @var{padding} neds to be done manually."
  #{
\once \override Staff.GridPoint.X-offset = $padding
\once\override Score.GridLine.shorten-pair = $shorten-pair
\once \override Score.GridLine.stencil =
  #(lambda (grob)
(let* ((stil (ly:grid-line-interface::print grob))
   (stil-y-ext (ly:stencil-extent stil Y))
   (thick (ly:grob-property grob 'thickness 0.1))
   ;; hijacking shorten-pair
   (shorten-pair (ly:grob-property grob 'shorten-pair '(0 . 0)))
   ;; GridLine goes from the middle of top to bottom staff
   ;; Thus we extend it by 2 (the default staff-space) and add a
   ;; little extra over-shoot, i.e 0.5.
   ;; The new parentheses starts at '(- dir) in X-axis direction to
   ;; avoid collisions with preceding grobs
   ;; The values are tweakable via overrides for
   ;; Score.GridLine.shorten-pair.
   ;; TODO get staff-space from layout
   (start
 (cons (- dir)
   (- (car stil-y-ext) 2.5 (- (car shorten-pair)
   (stop
 (cons (- dir)
   (+ (cdr stil-y-ext) 2.5 (- (cdr shorten-pair)
   ;; see 'make-tie-stencil' from stencil.scm
   (height-limit 0.7)
   (ratio 0.33)
   ;; taken from bezier-bow.cc
   (F0_1
 (lambda (x) (* (/ 2 PI) (atan (* PI x 0.5)
   (slur-height
 (lambda (w h_inf r_0) (F0_1 (* (/ (* w r_0) h_inf) h_inf
   (width (abs (- (cdr start) (cdr stop
   (angularity 0.5)
   (height (slur-height width height-limit ratio)))
(make-bow-stencil
  start
  stop
  thick angularity height (- dir
  #})



\layout {
  \context {
\Staff
\consists "Grid_point_engraver"
%% adjust the value if needed
gridInterv

Re: What are the units for \hspace?

2017-04-15 Thread Thomas Morley
Hi Andrew,

2017-04-15 13:14 GMT+02:00 Andrew Bernard :
> Hi All,
>
> It would be great if the documentation could actually state that.

We have
LM 4.3.3 Length and thickness of objects
and
NR 5.4.3 Distances and measurements

Also, I did a quick glance over the available markup-commands, seems
to confirm whats said in the docs.

Not enough?

> The
> average user is not going to be able to cook up that code to probe the size.

Well, the code was meant as sort of proof, checking whether the docs
are outdated.

> I am great believer in reference manuals being terse (e.g. UNIX man pages),
> but they lilypond ones tend to err on the side of being too terse
> altogether.
>
> Andrew
>

Cheers,
  Harm

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


Re: What are the units for \hspace?

2017-04-15 Thread Thomas Morley
2017-04-15 10:35 GMT+02:00 Richard Shann :
> Is it documented anywhere what the units used in the markup command
> \hspace are?

The general doc is at NR 5.4.3 Distances and measurements

>
> the documentation is:
>
> \hspace amount (number)
>
> Create an invisible object taking up horizontal space amount.
>
>
> The "amount" appears to be smaller than the width of the "m", but larger
> than a staff-space...
>
> Richard


It's exactly staff-space. See also the terminal-output of:

#(define-markup-command (demo layout props) ()
(let ((stil (interpret-markup layout props #{ \markup \hspace #1 #} )))
(format #t
"\n++\n
staff-space is:   ~a\n
length of \\markup \\hspace \\#1 is: ~a
\n++
"
(assoc-get 'staff-space (ly:module->alist (ly:output-def-scope layout)))
(interval-length (ly:stencil-extent stil X)))

 stil))


\markup \demo


Cheers,
  Harm

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


Re: lilypond errors on a guitar minor sixth chord

2017-04-15 Thread Thomas Morley
2017-04-15 2:36 GMT+02:00 Stan Mulder :
> Thomas,
>
> Got it. I used your first solution with the addendum. If at some point in
> the future I need more chords, I will construct a more extensive file for
> guitar chords. I did construct a fingering file for plectrum banjo a while
> back. It's got 25 chords for each of 12 keys, but I don't have any
> inversions.
>
> Thanks for the clarification on the reply-all. I wasn't sure what to do. Is
> there some place on the web were I can see other discussions?
>
> Stan
>
> On 04/14/2017 06:25 AM, Thomas Morley wrote:
>>
>> 2017-04-14 5:18 GMT+02:00 Stan Mulder :
>>>
>>>
>>> (1)
>>> Define it yourself, search the NR for 'storePredefinedDiagram'. Leading
>>> to:
>>>
>>> \version "2.19.56"
>>>
>>> \language "english"
>>>
>>> \storePredefinedDiagram #default-fret-table \chordmode {e-flat:m6}
>>>  #guitar-tuning
>>>  #"x;x;1-1-(;3-3;1-1-);3-3;"
>>>
>>> \include "predefined-guitar-fretboards.ly"
>>>
>>> \new FretBoards \chordmode { e-flat:m6 }
>>>
>>>
>> %% That should rather be:
>>  #"x;x;1-1-(;3-3;1-1-);3-4;"
>
>

Aaargh, this fret-diagram shows a major-chord.
I shouldn't post anything being overtired ...

Try:

\language "english"

\storePredefinedDiagram #default-fret-table \chordmode {e-flat:m6}
#guitar-tuning
#"x;x;1-1-(;3-3;1-1-);2-2;"

\include "predefined-guitar-fretboards.ly"

<<
\new FretBoards \chordmode { e-flat:m6 }
\new Staff \chordmode { e-flat:m6 }
>>

Cheers,
  Harm

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


Re: "Winged" repeat after double bar and line break

2017-04-14 Thread Thomas Morley
2017-04-15 0:05 GMT+02:00 Daniel Rosen :
> \version "2.19.56"
>
>
>
> \relative c'' {
>
>   c4 c c c
>
>   \bar "[|:"
>
>   c4 c c c \break
>
>   \bar ".|:-||"
>
>   c4 c c c
>
> }
>
>
>
> 
>
>
>
> I would like the first line in the above example to end with a double bar
> (\bar "||"), and the second line to begin with a winged begin-repeat bar
> (\bar "[|:"). How can I accomplish this?
>
>
>
> DR

Search NR for defineBarLine, leading to:


\defineBarLine "[|:-||" #'("||" "[|:" ".|")

%% or using scheme-syntax:
%#(define-bar-line "[|:-||" "||" "[|:" ".|")

\relative c'' {
  c4 c c c
  \bar "[|:"
  c4 c c c \break
  \bar "[|:-||"
  c4 c c c
}


HTH,
  Harm

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


Re: lilypond errors on a guitar minor sixth chord

2017-04-14 Thread Thomas Morley
2017-04-14 12:25 GMT+02:00 Thomas Morley :

> Sollution(s):
>
> (1)
> Define it yourself, search the NR for 'storePredefinedDiagram'. Leading to:
>
> \version "2.19.56"
>
> \language "english"
>
> \storePredefinedDiagram #default-fret-table \chordmode {e-flat:m6}
> #guitar-tuning
> #"x;x;1-1-(;3-3;1-1-);3-3;"
%% That should rather be:
#"x;x;1-1-(;3-3;1-1-);3-4;"
>
> \include "predefined-guitar-fretboards.ly"
>
> \new FretBoards \chordmode { e-flat:m6 }

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


Re: lilypond errors on a guitar minor sixth chord

2017-04-14 Thread Thomas Morley
2017-04-14 5:18 GMT+02:00 Stan Mulder :
>
> Thomas,
>
> Here's your example, but with fretboards added. The error is there. 
> Apparently it has to do with fretboards. Also, I am running 2.19.59:
>
> \version "2.19.56"
> \language "english"
> \include "predefined-guitar-fretboards.ly"
>
> m = \chordmode {
>   \override FretBoard.fret-diagram-details.dot-radius = #0.4
>   \override FretBoard.fret-diagram-details.number-type = #'arabic
>   b-flat4 bf/f g4:dim/e e-flat:m6
> }
> <<
> \new ChordNames \m
> \new FretBoards \m
> \new Staff { \accidentalStyle forget \m }
> >>
>
> Error:
[...]

Hi Stan,

please always reply to all, unless real private topics are discussed.

I now get the _warning_ myself.
So this is a good show-case about minimals. Obviously your
code-example should have pointed to FretBoards:

\version "2.19.59"

\language "english"
\include "predefined-guitar-fretboards.ly"

\new FretBoards \chordmode { e-flat:m6 }

Would have done it.


That said,

Some basics:

Lilypond creates FretBoards (without predefined-guitar-fretboards.ly)
by looking at the actual chord-pitches.
Which are < ef' gf' bf' c'' > in this case. Here LilyPond thinks it's
not doable and indeed it would be very hard to do something like:
\new FretBoards { < ef'\4-4 gf'\3-2 bf'\2-3 c''\1-1 > }

If predefined-guitar-fretboards.ly is included, LilyPond looks there
whether a fret-diagram-definition for the chord is stored there.
If found it's taken otherwise lily falls back to look at the actual
chord-pitches.

In predefined-guitar-fretboards.ly are definitions stored for all
chords of type:
major, minor, 7, m7, dim, aug, maj7, dim7, 9

Thus Lilypond does not find m6-chords, falls back to the pitches,
can't find a sensible fret-diagram, prints what's possible and finally
emitts the warning about the missing part(s).



Sollution(s):

(1)
Define it yourself, search the NR for 'storePredefinedDiagram'. Leading to:

\version "2.19.56"

\language "english"

\storePredefinedDiagram #default-fret-table \chordmode {e-flat:m6}
#guitar-tuning
#"x;x;1-1-(;3-3;1-1-);3-3;"

\include "predefined-guitar-fretboards.ly"

\new FretBoards \chordmode { e-flat:m6 }

(2)
Look at
http://lists.gnu.org/archive/html/lilypond-user/2017-02/msg00500.html
and follow the link to Philomenos
Although I have to admit I never tried it myself.

(3)
Extend predefined-guitar-fretboards.ly
That would mean to create a patch for the missing chords.

Though I'm not sure to which amount such a patch would be accepted.
Currently only the "most common" chords are stored there. Ofcourse
it's debattable which chords are "most common"...
And if we extend the file, what comes in what not?
11, 13, b5, inversions, added bass-pitches, etc etc
The Philomenos-files obviously try to cover most possible, so their
files are of huge size ...
I'd say too huge to ship them with default LilyPond.


HTH,
  Harm

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


Re: How to enlarge the size of accidentals in a figured bass ?

2017-04-13 Thread Thomas Morley
2017-04-13 19:52 GMT+02:00 Ziad Gholam :
> Hello,
>
>
>
> Could someone help with advice about :
>
> How to enlarge the size of accidentals in a figured bass ?
> ... Either leaving the size of the numbers unchanged or not ...
>
> (version used = 2.18.2)
>
>
> Thanks you &
> R
> egards,
>
>
> Ziad R. GHOLAM


Hi,

figured bass is fomated by the context-property `figuredBassFormatter'
which is set per default to the procedure `format-bass-figure'.

There is no single property to affect fontsize of accidentals only, afaik.

Though you could c/p the definition from translation-functions.scm
into your ly-file, change it to fit your needs and let LilyPond use
it.
Below I did exactly that, giving accidentals a far too huge fontsize
(just to make it obvious).


#(define-public (format-bass-figures figure event context)
  (let* ((fig (ly:event-property event 'figure))
 (fig-markup (if (number? figure)

 ;; this is not very elegant, but center-aligning
 ;; all digits is problematic with other markups,
 ;; and shows problems in the (lack of) overshoot
 ;; of feta-alphabet glyphs.
 ((if (<= 10 figure)
  (lambda (y) (make-translate-scaled-markup
   (cons -0.7 0) y))
  identity)

  (cond
   ((eq? #t (ly:event-property event 'diminished))
(markup #:slashed-digit figure))
   ((eq? #t (ly:event-property event 'augmented-slash))
(markup #:backslashed-digit figure))
   (else (markup #:number (number->string figure 10)
 #f))

 (alt (ly:event-property event 'alteration))
 (alt-markup
  (if (number? alt)
  (markup
   #:general-align Y DOWN #:fontsize
;; !
   (if (not (= alt DOUBLE-SHARP))
   ;-2 2 :; is the default
   4 4 ;; changed
 )
;; !
   (alteration->text-accidental-markup alt))
  #f))

 (plus-markup (if (eq? #t (ly:event-property event 'augmented))
  (markup #:number "+")
  #f))

 (alt-dir (ly:context-property context 'figuredBassAlterationDirection))
 (plus-dir (ly:context-property context 'figuredBassPlusDirection)))

(if (and (not fig-markup) alt-markup)
(begin
  (set! fig-markup (markup #:left-align #:pad-around 0.3 alt-markup))
  (set! alt-markup #f)))


;; hmm, how to get figures centered between note, and
;; lone accidentals too?

;;(if (markup? fig-markup)
;;  (set!
;;   fig-markup (markup #:translate (cons 1.0 0)
;;  #:center-align fig-markup)))

(if alt-markup
(set! fig-markup
  (markup #:put-adjacent
  X (if (number? alt-dir)
alt-dir
LEFT)
  fig-markup
  #:pad-x 0.2 alt-markup)))

(if plus-markup
(set! fig-markup
  (if fig-markup
  (markup #:put-adjacent
  X (if (number? plus-dir)
plus-dir
LEFT)
  fig-markup
  #:pad-x 0.2 plus-markup)
  plus-markup)))

(if (markup? fig-markup)
(markup #:fontsize -2 fig-markup)
empty-markup)))


\layout {
  \context {
\Score
figuredBassFormatter = #format-bass-figures
  }
}

\figures {
  <7! 6+ 4-> <5++> <3--> < _+ > < 7 _!>
}



HTH,
  Harm

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


Re: lilypond errors on a guitar minor sixth chord

2017-04-13 Thread Thomas Morley
2017-04-13 19:57 GMT+02:00 Stan Mulder :
> I would seem that lilypond doesn't like minor sixth chords. All my guitar
> fretboards seem to be fine, but I get errors on all chords with a minor
> sixth. Here's some of the code:
>
> b-flat4 bf/f g4:dim/e e-flat:m6
>
> Here's the corresponding error complaining about the "m6"
>
> warning: No string for pitch # (given frets (11 11 8))
>
> b-flat4 bf/f g4:dim/e
>
> e-flat:m6
>
> [8][16][24]
>
> If i remove the sixth and just make it an "e-flat:m", there's no error.
>
> I thought a minor sixth was pretty standard. Or am I misinterpreting the
> error?
>
> I have \include "predefined-guitar-fretboards.ly" at the top of the file...
>
> I'm using \version "2.19.49"
>
> Stan
>
>
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>

Can't confirm.

Compiling:


\version "2.19.56"

\language "english"

\include "predefined-guitar-fretboards.ly"

m = \chordmode { b-flat4 bf/f g4:dim/e e-flat:m6 }
<<
\new ChordNames \m
\new Staff { \accidentalStyle forget \m }
>>

gives a clean run, no warnings/errors and the attached (cropped) image.

The problem must be somewhere else.


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


Re: Forcing a downward line at the end of a second time bar marking

2017-04-13 Thread Thomas Morley
2017-04-13 12:13 GMT+02:00 Richard Shann :
>
> Is there a way of forcing a downward line at the end of a second time
> bar marking - e.g in this
>
> \version "2.19.43"
> { \repeat volta 2 {c c c c} \alternative { { c c c c} {c c c c} } \bar "||" c 
> c c c
> }
>
>
> can the second time bar be made to look like the first time bar, being
> "finished off" with a downward verstical stroke at the double barline?
>
> Richard Shann



\version "2.19.43"

\allowVoltaHook "||"

{
  \repeat volta 2 {c c c c}
  \alternative { { c c c c} {c c c c} } \bar "||" c c c c
}

HTH,
  Harm

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


Re: placement of tuplet number on broken tuplet

2017-04-12 Thread Thomas Morley
2017-04-11 21:26 GMT+02:00 Juan Cristóbal Cerrillo :
> Hello,
>
> Is there a way of changing the position of tuplet numbers in broken tuplets?
> In the following example I would like to be able to displace the lower three 
> in the first bar to the right.
> Any suggestions?

It's not clear to me what you want. Could you post an image faked by a
graphic program?

Cheers,
  Harm

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


Re: Slurs within chords, within tuplets -- seem to be ignored (without warnings!)

2017-04-12 Thread Thomas Morley
2017-04-12 10:59 GMT+02:00 Pete Farmer :
> Dear lilypond experts,
>
> This tiny example compiles without warnings or errors, yet the Slurs in the
> first two measures seem to be ignored.
>
> Measures three and four demonstrate that the issue can be resolved by
> splitting into separate Voices, and could be cleaned up by tweaking, but as
> the music is only one voice, this is hardly an improvement.
>
> Can anybody tell me why the interleaved inter-chord inter-tuplet slurs are
> not appearing? ...and no collision warnings?

You already got a reply best fitting your needs.

Though to be complete, I had a closer look at your example:
_All_ Slurs and PhrasingSlurs you coded are present, none is ignored.
It may not match your expectations, but this is another story.

Slurred chords always get _one_ Slur, this common best practice.

For the special case of slurred thirds (and similiar) we have the
doubleSlur-context-property.

See also:

\version "2.18.2"

\relative c'' {
(
)
\set doubleSlurs = ##t
(
)
\unset doubleSlurs


}

For the very rare exception of every chords element to be slurred, new
devel versions offer a special command to set the spanner-id:

\version "2.19.56"

\fixed c' {
  < c\=1( e\=2( g\=3( >2
  < g\=1) b\=2) d'\=3) >
}

Cheers,
  Harm

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


Re: LD_LIBRARY_PATH in different installation contexts

2017-04-11 Thread Thomas Morley
2017-04-11 17:47 GMT+02:00 N. Andrew Walsh :
> Hi Urs, List,
>
> On Tue, Apr 11, 2017 at 11:04 AM, Urs Liska  wrote:
>>
>> b) Linux, self-compiled
>>
>> I've never experienced this issue with self-compiled LilyPonds. I assume
>> this is *not* because self-compiled versions implicitly use the bundled libs
>> but because they implicitly compile against what is available in the system.
>> But if that assumption is correct I'd experience the same issue if I should
>> run a self-compiled Lilypond that has been compiled some time ago, e.g.
>> before a major Linux upgrade.
>
>
> This was my previous method, building from most recent source (which oddly
> also reported itself as a version more recent [ie, higher version number]
> than that listed on the website as the latest source). However, I am no
> longer able to get a working Lilypond via this method, because Gentoo Linux
> has dropped support for Guile-1.*. Does newer Lily work with Guile-2.*, or
> would this still be an issue?

Hi Andrew,

there are still problems with guilev2.

But you could try to checkout the experimental branch
dev/guile-v2-work, rebase it.
Though, be prepared needing to resolve some merge conflicts. I started
to insert some of them in revised versions into master.
Then you should be able to compile LilyPond with guile up to guile-2.1.14.
Ofcourse you'll likely experience some yet unknown bugs and be
prepared to experience a heavy slow down.

It would be great to have more feedback from more testers.

If Gentoo supports only the new stable guile-2.2, please ask back. I
have an admittedly brute-force patch to make it work (simply deleting
some very rare used functionality).


Cheers,
  Harm

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


Re: Volta endings and using \set Score.repeatCommands

2017-04-11 Thread Thomas Morley
2017-04-10 3:45 GMT+02:00 Stan Mulder :
> Hi group.
>
> I'm trying to construct a certain volta ending where there is a first and
> second ending, but the first ending does a D.S. to the sign, while the the
> second ending is a multiple repeat for solos. I seem to have made it render
> correctly, but I keep getting this error. Hopefully this is enough code:
>
>
> warning: already have a volta spanner, ending that one prematurely
>
> [64]
>
>
> DSalCoda = {
>   \once \override Score.RehearsalMark.self-alignment-X = #RIGHT
>   \mark \markup "D.S. al Coda"
> }
>
> voltaSolos = \markup { "2, 3, 4 . . ." }
>
>   \alternative {
> {
>   s1
>   \DSalCoda
>   \bar "||"
> }
> {
>   \set Score.repeatCommands = #(list (list 'volta voltaSolos)
> 'start-repeat)
>   s1
>   \bar ":|."
> }
>   }
>
>
> Stan



Hi Stan,

(1) %%%

In general, the settings accepted in the argument-list for
repeatCommands may manually create repeats with or without alternative
endings.
Drawback: \unfoldRepeats doesn't work on those manual settings. See
the following example where simple repeats are done (manually and via
\repeat volta ...):

\unfoldRepeats
\relative {
  c''1
  \set Score.repeatCommands = #'(start-repeat)
  d4 e f g
  \set Score.repeatCommands = #'(end-repeat)
  c1
  \repeat volta 2 { d,4 e f g }
}

(2) %%%

If you don't care about midi you could do the following.
Note that 'start-repeat would be used to begin a (new) repeated
section, but _not_ to start an alternative ending. Don't use it here.

\repeat volta 2 { c'1 }
\alternative {
  {
d'1
  }
  {
\set Score.repeatCommands =
  #(list
'end-repeat ;; print the ending repeat-bar
'(volta #f) ;; finish first volta
(list 'volta voltaSolos) ;; set text for second volta
)
e'
  }
}

Though, in your example you don't want the closing repeat-bar, but \bar "||".
Hence 'end-repeat should be deleted and to ensure a closing first
VoltaBracket use \allowVoltaHook "||" at top-level.

Full example:

\allowVoltaHook "||"

DSalCoda = {
  \once \override Score.RehearsalMark.self-alignment-X = #RIGHT
  \mark \markup "D.S. al Coda"
}

voltaSolos = \markup { "2, 3, 4 . . ." }

\repeat volta 2 {c4 c c c }
\alternative {
  {
c4 c c c
\DSalCoda
\bar "||"
  }
  {
\set Score.repeatCommands = #(list '(volta #f) (list 'volta voltaSolos) )
c4 c c c
\bar ":|."
  }
}

(3) %%%

If you need unfoldRepeats, an override may fit better:

\allowVoltaHook "||"

DSalCoda = {
  \once \override Score.RehearsalMark.self-alignment-X = #RIGHT
  \mark \markup "D.S. al Coda"
}

voltaSolos = \markup { "2, 3, 4 . . ." }


voltaTxt =
\once \override Score.VoltaBracket.before-line-breaking =
#(lambda (grob) (ly:grob-set-property! grob 'text voltaSolos))

%\unfoldRepeats
\repeat volta 2 {c4 c c c }
\alternative {
  {
c4 c c c
\DSalCoda
\bar "||"
  }
  {
  \voltaTxt
c4 c c c
\bar ":|."
  }
}



HTH,
  Harm

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


Re: List test

2017-04-09 Thread Thomas Morley
Hi Stan,

2017-04-10 1:59 GMT+02:00 Stan Mulder :
> Thanks Thomas. I think I registered a long time ago and forgot how it
> worked.
>
> It seems gmane is down. Last time I posted I used the gmane web interface.
> Which is convenient.

I never used it and don't know exactly, maybe others can reply more detailed.

>
> Remind me please: do I just post questions via this email list?

Yes.
Best with a minimal code example.
http://lilypond.org/website/tiny-examples.html

> Are attachments allowed? Small jpg screen shots, etc?

Sure. Best to keep them as small as possible, ofcourse.

>
> Stan
>
>
> On April 9, 2017 6:31:16 PM EDT, Thomas Morley 
> wrote:
>>
>> 2017-04-09 22:56 GMT+02:00 Stan Mulder :
>>>
>>>  Is this list working?
>>
>>
>> Yep!

Two generals:
- please always reply to all, unless real private things are discussed
- no top-posting

Cheers,
  Harm

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


Re: List test

2017-04-09 Thread Thomas Morley
2017-04-09 22:56 GMT+02:00 Stan Mulder :
> Is this list working?

Yep!

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


Re: Ghostscipt failure 256

2017-04-08 Thread Thomas Morley
2017-04-08 16:15 GMT+02:00 Pieter Terpstra :
> Thomas Morley wrote:
>
>> \markup \override #'(font-name . "Morris Roman,") "qwerty"
>
> Thanks, interesting your use of a comma after the fontname, never did that 
> before but it works for this
> Morris Roman font.
>
> Kindly,
>
>Peter


It was
https://sourceforge.net/p/testlilyissues/issues/4591/

"Times New Roman" is another font where the comma is required: "Times
New Roman,"

See the link above for more details.

Cheers,
  Harm

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


Re: Line break on a subtitle

2017-04-08 Thread Thomas Morley
2017-04-08 15:33 GMT+02:00 Son_V :
> I found a lot of interesting things but sorry, I was not able to find an
> answer to my humble question.



Whats wrong with

\header {
  subtitle =
\markup \wordwrap {
  Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
  tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
  veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
  commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
  velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat
  cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id
  est laborum.
}
}

\markup \null

-Harm

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


Re: Rootless slash chords, 2017 edition

2017-04-08 Thread Thomas Morley
2017-04-05 22:46 GMT+02:00 Dmitry :
> Thomas, thanks a lot for the solution!
>
> If you have a SF account, could I ask you please to add a link to this
> discussion to the SF issue?
> The only solution mentioned there doesn't work with modern Lilypond.
>
> Thx,
> Dmitry

Done.
https://sourceforge.net/p/testlilyissues/issues/3909/#888a

Cheers,
  Harm

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


Re: Ghostscipt failure 256

2017-04-08 Thread Thomas Morley
"

2017-04-07 0:58 GMT+02:00 Thomas Morley :
> 2017-04-06 18:11 GMT+02:00 Pieter Terpstra :
>> Dmytro O. Redchuk wrote:
>>
>> Thanks for your help Dmytro!
>>
>>> Do you use any custom fonts in the .ly?
>>
>> That seems to be the issue in the title i used Morris Roman, which was no 
>> problem before.
>> Always have used custom fonts. Some other fonts aslo seem to work fine on 
>> this file.
>
> Don't know where and how you specified the font and I don't have the
> font myself.
> Though, could you try "Morris,Roman" or "Morris Roman," ?
>
> Cheers,
>   Harm

I've now installed "Morris Roman"

\markup \override #'(font-name . "Morris Roman,") "qwerty"

Works on my machine.


Cheers,
  Harm

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


Re: Ghostscipt failure 256

2017-04-06 Thread Thomas Morley
2017-04-06 18:11 GMT+02:00 Pieter Terpstra :
> Dmytro O. Redchuk wrote:
>
> Thanks for your help Dmytro!
>
>> Do you use any custom fonts in the .ly?
>
> That seems to be the issue in the title i used Morris Roman, which was no 
> problem before.
> Always have used custom fonts. Some other fonts aslo seem to work fine on 
> this file.

Don't know where and how you specified the font and I don't have the
font myself.
Though, could you try "Morris,Roman" or "Morris Roman," ?

Cheers,
  Harm

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


Re: Link to "A Complete List of Music Symbols With Their Meaning"

2017-04-03 Thread Thomas Morley
2017-04-03 23:20 GMT+02:00 Thomas Morley-2 :
> This is a test posting via the nabble-interface.
>
> Below the quoted message:
>
>
> Son_V wrote
>> Maybe useful for someone (I hope)
>> Should it be multilanguage...
>>
>> http://www.buzzle.com/articles/a-complete-list-of-music-symbols-with-their-meaning.html
>
> Here I try to repost the link Son provided by clicking "Link"-button and
> inserting it:
>
> http://www.buzzle.com/articles/a-complete-list-of-music-symbols-with-their-meaning.html
> <http://www.buzzle.com/articles/a-complete-list-of-music-symbols-with-their-meaning.html>
>
>
> -Harm
>
>
>
> --
> View this message in context: 
> http://lilypond.1069038.n5.nabble.com/Link-to-A-Complete-List-of-Music-Symbols-With-Their-Meaning-tp201880p201907.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

All there, afaict.
So I suspect a user error.

-Harm

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


Re: Link to "A Complete List of Music Symbols With Their Meaning"

2017-04-03 Thread Thomas Morley-2
This is a test posting via the nabble-interface.

Below the quoted message:


Son_V wrote
> Maybe useful for someone (I hope)
> Should it be multilanguage...
> 
> http://www.buzzle.com/articles/a-complete-list-of-music-symbols-with-their-meaning.html

Here I try to repost the link Son provided by clicking "Link"-button and
inserting it:

http://www.buzzle.com/articles/a-complete-list-of-music-symbols-with-their-meaning.html

  


-Harm



--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Link-to-A-Complete-List-of-Music-Symbols-With-Their-Meaning-tp201880p201907.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


Re: Conflict with "poet" and "Composer"

2017-03-30 Thread Thomas Morley
2017-03-30 22:51 GMT+02:00 Son_V :
> Hi, I've tried to use your solution, bu I didn't got a working file; if I
> send it to you, may you work on it to obtain what I would?


Hi,

first, please make clear whom you adress. You likely mean me, at least
I think so.

And no, I'll not work on your file, but we could discuss the method
how you could integrate a suggestion you received into your file.

But we should agree _which_ suggestion you want to test. I posted four
different ones.
Which of them?

Cheers,
  Harm

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


Re: Conflict with "poet" and "Composer"

2017-03-30 Thread Thomas Morley
2017-03-30 20:43 GMT+02:00 Son_V :
> Hi,
> if the field in "poet = " is too long, the words mix over the words of the
> field "composer = ".
>
> How can I get rid of this? Thanks.

The default bookTitleMarkup (see titling-init.ly) prints poet and
composer in one line.

Basically like: \markup fill-line { "poet" "composer" }

Thus, long words/expressions collide:

\markup \fill-line {
"long"
"looger"
}


You have several possibilities to tackle this:
(1) Break the expressions in two or more lines as suggested by Abraham
(2) Try a smaller fontsize

\header {
  title = "Jesu Rex admirabilis"
  poet = \markup \fontsize #-1 "Simone Verovio (1575 – 1607) - dal
'Diletto Spirituale'"
  composer = \markup \fontsize #-1 "Attrib. Giovanni Pierluigi da
Palestrina (1525 ca. – 1594)"

  tagline = "24 marzo 2017"
}

\markup \null

(3) Try a narrow font

\header {
  title = "Jesu Rex admirabilis"
  poet =
\markup
  \override #'(font-name . "Times New Roman,")
  "Simone Verovio (1575 – 1607) - dal 'Diletto Spirituale'"
  composer =
\markup
  \override #'(font-name . "Times New Roman,")
  "Attrib. Giovanni Pierluigi da Palestrina (1525 ca. – 1594)"

  tagline = "24 marzo 2017"
}

\markup \null

(4) Redefine bookTitleMarkup

myBookTitleMarkup =\markup {
\override #'(baseline-skip . 3.5)
\column {
  \fill-line { \fromproperty #'header:dedication }
  \override #'(baseline-skip . 3.5)
  \column {
\fill-line {
  \huge \larger \larger \bold
  \fromproperty #'header:title
}
\fill-line {
  \large \bold
  \fromproperty #'header:subtitle
}
\fill-line {
  \smaller \bold
  \fromproperty #'header:subsubtitle
}
%% changed from here
\fill-line {
  \large \bold \fromproperty #'header:instrument
}
\fill-line {
  \fromproperty #'header:poet
  \null
}
\fill-line {
  \null
  \fromproperty #'header:composer
}
%% until here
\fill-line {
  \fromproperty #'header:meter
  \fromproperty #'header:arranger
}
  }
}
  }

\paper {
  bookTitleMarkup = \myBookTitleMarkup
}

\header {
  title = "Jesu Rex admirabilis"
  poet = "Simone Verovio (1575 – 1607) - dal 'Diletto Spirituale'"
  composer = "Attrib. Giovanni Pierluigi da Palestrina (1525 ca. – 1594)"
  instrument = "whatever-instrument/voice"

  tagline = "24 marzo 2017"
}

\markup \null

HTH,
  Harm

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


Re: Repeat slur?

2017-03-30 Thread Thomas Morley
2017-03-30 10:02 GMT+02:00 Andrew Bernard :

> Better, using laissezVibrer in combination with the nifty \extendLV function
> (from Thomas Morely if I recall).

Well, I uploaded
http://lsr.di.unimi.it/LSR/Item?id=794
to demonstrate usage of LaissezVibrerTie in alternatives, but
'extendLV' itself  is taken from
http://lsr.di.unimi.it/LSR/Item?id=715
Originally written by Robin Bannister.

Cheers,
  Harm

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


Re: Rootless slash chords, 2017 edition

2017-03-29 Thread Thomas Morley
2017-03-28 19:49 GMT+02:00 Thomas Morley :
> 2017-03-28 0:39 GMT+02:00 Dmitry :

>> - in Chord_name_engraver::process_music, track repeating root parts of
>> slash chords and pass NIL pitches to a chordNameFunction in case of
>> repetition. Everything should be similar to handling chordChanges,
>> however this time we should remember and compare whole chord
>> structures, not markup.

>
> %% Tries to compare the relevant parts of the markups for current and previous
> %% chord.
> %%
> %% Probably it would be far easier to compare actual pitches

Below some code actually tracking and comparing pitches.
The bass-only feature can be switched on/off.
One limitation persists, inversions are not recognized, see third example.

\version "2.19.57"

#(define (define-translator-property symbol type? description)
  (if (not (and (symbol? symbol)
(procedure? type?)
(string? description)))
  (ly:error "error in call of define-translator-property"))
  (if (not (equal? (object-property symbol 'translation-doc) #f))
  (ly:error (_ "symbol ~S redefined") symbol))

  (set-object-property! symbol 'translation-type? type?)
  (set-object-property! symbol 'translation-doc description)
  symbol)

#(for-each
  (lambda (x)
(apply define-translator-property x))
`(
  (dropEqualRoot
   ,boolean?
   "To be used in @code{ChordName}-context.  If set @code{#t}, successive
chords, which differ only in their bass, will have only this bass printed.")
   ))

#(define (test-engraver ctx)
  (let ((prev '())
(notes '())
(chord-name-grobs '()))
(make-engraver
  (listeners
 ((note-event engraver ev)
   (set! notes (cons (ly:prob-property ev 'music-cause) notes
  (acknowledgers
 ((chord-name-interface engraver grob source-engraver)
(set! chord-name-grobs (cons grob chord-name-grobs
  ((stop-translation-timestep translator)
 (let* (;; not sure yet, whether 'sorted-notes' is needed and should
;; replace 'notes' in 'current-bass+elts'
;(sorted-notes
;  (sort
;notes
;  (lambda (n1 n2)
;(ly:pitchmarkup (caar current-bass+elts) #f)
 (set! prev current-bass+elts)
 (set! chord-name-grobs '())
 (set! notes '(
  ((finalize translator)
 (set! prev '())

%
%%
%% EXAMPLES
%%
%

\paper {
  indent = 0
  ragged-right = ##f
}

\layout {
  \context {
  \Score
  \override RehearsalMark.self-alignment-X = #LEFT
  }
  \context {
\Staff
\accidentalStyle forget
  }
  \context {
\ChordNames
dropEqualRoot = ##t
\consists \test-engraver
  }
}

%%%
%% I
%%%

\markup
\rounded-box \fill-line { "Various tests" }

tstI =
\chordmode {
c4:m/e c:m c:m/+g c:m/fes c/fes c/d c:7/d c:7/+g d e e:m f:m f:m f
}
<<
  \new ChordNames \tstI
  \new Staff \tstI
>>

%%%
%% II
%%%

\markup
\rounded-box \fill-line { "Test switching on/off via \"dropEqualRoot\"" }

tstII =
\chordmode {
\mark "dropEqualRoot = ##t in \\layout"
c4
c/f
c:m7
c:m7/+bes
c:m7
c:m7/cis
r2
\break
\set dropEqualRoot = ##f
\mark "\\set dropEqualRoot = ##f"
c4
c/f
c:m7
c:m7/+bes
c:m7
c:m7/cis
r2
\break
\unset dropEqualRoot
\mark "\\set dropEqualRoot = ##t"
c4
c/f
c:m7
c:m7/+bes
c:m7
c:m7/cis
r2
}
<<
  \new ChordNames  \tstII
  \new Staff \tstII
>>

%%%
%% III
%%%

\markup
\rounded-box \fill-line {
  \column {
"Limitation:"
 \wordwrap-string
 %% jEdit highlighting is not smart enough, thus the strange line-break ...
 #"Here the \"root
\"-part is never dropped, because the main-chords are always different, which
can't be observed in ChordNames, though.
All chords but the last are inversions!"
  }
}

tstIII =
\chordmode {
c:m7
c:m7/bes
c:m7/g
c:m7/ees
c:m7/+bes
}
<<
  \new ChordNames  \tstIII
  \new Staff \tstIII
>>

HTH,
  Harm

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


Re: \RemoveEmptyStaves don't work as I would to

2017-03-28 Thread Thomas Morley
Hi Son,

about minimal examples, see my comments below. ;)


2017-03-28 21:48 GMT+02:00 Son_V :
> neither \\RemoveAllEmptyStaves ..
>
> This is my try for a Minimum example, sorry if I failed to make it smaller:
>
> \version "2.19.26"
> \layout {
>   \context {
> \Score

no need for skipBars

> skipBars = ##t
> %\RemoveEmptyStaves
>   }
> }
> PartPOneVoiceOne =  \relative g' {

no need for
clef "treble" \key c \major \numericTimeSignature\time 4/4
it's mostly the default, or suoerfluous for a minimal
Also too many notes/rests.

>   \clef "treble" \key c \major \numericTimeSignature\time 4/4 g1 | % 2
>   g1 \break | % 3
>   R1*2 \bar "|."
> }
>
> PartPTwoVoiceOne =  \relative b' {

same here

>   \clef "treble" \key c \major \numericTimeSignature\time 4/4 R1*2
>   \break | % 3
>   b1 | % 4
>   b1 \bar "|."
> }
>
>

For a minimal no complete score-definition, (unless the problem would
be in there)

> % The score definition
> \score {
>   <<
> \new Staff <<
>   \set Staff.instrumentName = "Voce"
>   \set Staff.shortInstrumentName = "Vo."
>   \context Staff <<
> \context Voice = "PartPOneVoiceOne" { \PartPOneVoiceOne }
>   >>
> >>
> \new Staff <<
>   \set Staff.instrumentName = "Soprano"
>   \set Staff.shortInstrumentName = "S."
>   \context Staff <<
> \context Voice = "PartPTwoVoiceOne" { \PartPTwoVoiceOne }
>   >>
> >>
>   >>
>   }

Remaining minimal with solution,

\layout {
  \context {
\Staff
\RemoveEmptyStaves
  }
}

<<
  \new Staff { g'1 \break R1 }
  \new Staff { R1 \break b'1 }
>>

RemoveEmptyStaves needs to be applied in a Staff-context, examples in the NR

Cheers,
  Harm

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


Re: Rootless slash chords, 2017 edition

2017-03-28 Thread Thomas Morley
2017-03-28 0:39 GMT+02:00 Dmitry :
> Hi,
>
> There's been a long standing feature request:
>
> https://sourceforge.net/p/testlilyissues/issues/3909/
>
> #3909 a feature to disable the chord root name printing - just print
> the slash and inversion
>
> Over the years, it has been addressed more or less. Time to give it
> another try?
>
> In a few words, we need a mechanism to suppress printing repeated root
> chord name over a progression of slash chords. That means, we'd like to
> see this:
>
> F#min9 /F /E /D#
>
> instead of this:
>
> F#min9 F#min9/F F#min9/E F#min9/D#
>
> The latter is much less readable, occupies more space and bloats the
> score.
>
> To say this feature is demanded in jazz means say nothing! I've
> recently started working on a bunch of jazz scores, and the very first
> piece features three (!) different progressions with changing bass
> notes, like the above. OK, there is a well-known hack that uses
> \whiteout: http://lsr.di.unimi.it/LSR/Item?id=776
>
> Unfortunately, for the real-life scores it is simply a no-go. It
> requires a chord exception for each and every rootless slash chord, it
> messes up MIDI output (as slash chords are not recognized in chord
> exceptions), not to mention that it produces unclean output.
>
> There is another workaround from 2011: http://www.mail-archive.com/lily
> pond-user%40gnu.org/msg67087.html
> Needless to say, it doesn't work in 2017 :) but I've managed to fix it.
> Here we go,
>
> #(define (rootless-chord-names in-pitches bass inversion context)
>(ignatzek-chord-names `(,(ly:make-pitch 0 0 0) ,(ly:make-pitch 0 0
> 0)) bass inversion context))
>
> #(define (empty-namer pitch lower?) (make-simple-markup ""))
>
> retainChordNoteNamer =
> \applyContext
>   #(lambda (context)
>  (let ((rn (ly:context-property context 'chordRootNamer)))
>(ly:context-set-property! context 'chordNoteNamer rn)))
>
> rootless = {
>   \retainChordNoteNamer
>   \once \set chordNameFunction = #rootless-chord-names
>   \once \set chordRootNamer = #empty-namer
> }
>
> After that, one can use \rootless as follows:
>
> fis2:m7.9 \rootless fis4:m7.9/f \rootless fis4:m7.9/e \rootless
> fis1:m7.9/dis
>
> This produces perfect output, but the code is ugly as hell. What I'm
> doing here is basically the following:
> - kill off chordRootNamer, but retain chordNoteNamer;
> - after that, the root note note wouldn't be printed, but the suffix
> (like m9, etc.) would be. To suppress it, we supply a
> proxy chordNameFunction that would guarantee a suffix-less chord.
>
> It should be easy to convert this one-shot semantics to something like
> \rootlessOn and \rootlessOff. In fact, it would be nice if mainstream
> Lilypond had something similar to "\set chordChanges = ..." but for
> slash chords; but of course nobody would like to see ugly hacks like
> the above in the mainstream :)
>
> Off the top of my head, I could propose the following solution:
>
> - inside Scheme code for chord name functions ({ignatzek,banter,jazz}-
> chord-names), allow for NIL "pitches" argument. That should mean
> "produce output for bass note only, omitting everything before the
> slash";
> - in Chord_name_engraver::process_music, track repeating root parts of
> slash chords and pass NIL pitches to a chordNameFunction in case of
> repetition. Everything should be similar to handling chordChanges,
> however this time we should remember and compare whole chord
> structures, not markup.
>
> What do you think?
>
> Cheers,
> Dmitry



Hi Dmitry,

below my approch.
I'm afraid you'll not have problems to break it...
Comments inline.

\version "2.19.57"

%% Tries to compare the relevant parts of the markups for current and previous
%% chord.
%%
%% Probably it would be far easier to compare actual pitches in the
%% chordNameFunction as delivered there, but 'lastChord' returns only a markup
%% not pitches.
#(define (test-engraver ctx)
  (let ((prev '()))
(make-engraver
  (acknowledgers
((chord-name-interface engraver grob source-engraver)
   ;; As of the 'ignatzek-chord-names'-procedure:
   ;; 'current' will always be a list, as well as '(last current)'
   ;; So it seems safe to apply list-modifying procedures to them.
   ;; Ofcourse this may change, when 'ignatzek-chord-names' is changed
   ;; or a different chordNameFunction is used.
   (let* ((current (ly:grob-property grob 'text))
  (current-string-lists
(split-list-by-separator
  (filter
(lambda (arg)
  (and (string? arg) (not (string-null? arg
(flatten-list current))
  (lambda (x) (string=? x "/"
  (prev-string-lists
(split-list-by-separator
  (filter
(lambda (arg)
  (and (string? arg) (not (string-null? arg
   

Re: LSR down?

2017-03-27 Thread Thomas Morley
2017-03-27 9:24 GMT+02:00 Malte Meyn :
>
>
> Am 27.03.2017 um 02:30 schrieb Andrew Bernard:
>> LSR still down as at 0030 UTC here in Australia.
>>
>> Andrew
>
> No time zone problems here so http://lsr.di.unimi.it/LSR/Snippet?id=1007
> shows up correctly but the search gives no results:
> http://lsr.di.unimi.it/LSR/Search?q=notehead



Hi all,

I had reported the problem.

Seba thinks it's fixed now (for now).
My own testings were successful.

May I ask for feedback whether it works out there as well?

Cheers,
 Harm

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


Re: Determine if a stem is present

2017-03-27 Thread Thomas Morley
2017-03-27 11:38 GMT+02:00 Urs Liska :
> Hi all,
>
> I want to know if a given notehead has a stem attached. Obviously even
> whole notes do have a stem object, but with zero extent.
>
> I've found the following calculation to be reliable, but I can't imagine
> it has to be so complicated:
>
> (if (or (= +inf.0 (car stem-y-extent))
> (= -inf.0 (car stem-y-extent))
> (= +inf.0 (cdr stem-y-extent))
> (= -inf.0 (cdr stem-y-extent)))
>
> (with stem-y-extent being the Y-extent property of the stem object).
>
> I think there should be some property I can ask directly about this? But
> I didn't find any suspicious entry for Stem or stem-interface.
>
> Any suggestions?
> Urs

interval-sane?

exp.:

(interval-sane? (ly:stencil-extent empty-stencil X))
--> #f

Maybe grob::is-live? may help as well, didn't test that.


HTH,
  Harm

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


Re: LSR down?

2017-03-26 Thread Thomas Morley
2017-03-26 11:15 GMT+02:00 Thomas Morley :
> 2017-03-26 8:51 GMT+02:00  :
>> It's down for me. http://lsr.di.unimi.it/LSR/Snippet?id=1007 says something
>> about timezones (CEST in unrecognized). While the search page works, the
>> results are empty.
>
> I informed the LSR admin about it.
>
> Cheers,
>   Harm

LSR should be up again.

Many thanks to Seba!

Cheers,
  Harm

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


Re:

2017-03-26 Thread Thomas Morley
2017-03-26 22:57 GMT+02:00  :
> You're setting options on the TabStaff while in the Staff context. Since
> there is no TabStaff context at the moment, one is temporarily created. You
> could fix it by setting the properties in a \with {} block on the TabStaff
> insteadd.

Which is the most common way.
To be complete, sometimes it has advantages to use applyOutput:

solo =
  \relative c' {
\applyOutput TabStaff
  #(lambda (g c1 c2) (ly:context-set-property! c1 'minimumFret 1))
\applyOutput TabStaff
  #(lambda (g c1 c2) (ly:context-set-property! c1 'restrainOpenStrings #t))

c8   f e e d c b a
  }

\new Staff \solo

\new TabStaff \solo



Note the settings for _Tab_Staff in 'solo' never affect the standalone Staff.


Cheers,
  Harm


> On 03/26/17 22:49, Rob Torop wrote:
>>
>> I'm finding that when I use a TabStaff and also set some properties
>> (either or both of minimumFret and restrainOpenStrings), my first line
>> has an extra TabStaff!  What can I do to get rid of it? Thanks!
>>
>> Here's what it looks like:
>>
>> Screen Shot 2017-03-26 at 4.46.59 PM.png
>>
>> And here's the code that generated this:
>>
>> \version "2.19"
>> \language "english"
>>
>> solo = \relative c' {
>>
>> % Either of both of the two settings will cause an extra "TAB" staff
>> to be rendered
>>  \set TabStaff.minimumFret=#1
>>  \set TabStaff.restrainOpenStrings = ##t
>>
>>  c8   f e ef df c bf af
>> }
>>
>> \score {
>>   <<
>>  \new Staff\solo
>>  \new TabStaff  \solo
>>>>
>> }
>>
>>
>>
>>
>> ___
>> 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

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


Re: LSR down?

2017-03-26 Thread Thomas Morley
2017-03-26 8:51 GMT+02:00  :
> It's down for me. http://lsr.di.unimi.it/LSR/Snippet?id=1007 says something
> about timezones (CEST in unrecognized). While the search page works, the
> results are empty.

I informed the LSR admin about it.

Cheers,
  Harm

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


Re: Unusual beaming for piano music

2017-03-25 Thread Thomas Morley
2017-03-25 22:01 GMT+01:00 Juan Cristóbal Cerrillo :
> Hello Harm,
>
> If you use two voices as Jeffery suggested and adjust the Stem.beaming
> parameters it seems that the following is not needed.
> Am I correct or is there something I’m missing?

Hi Juan,

I think you've merged the best of the so far posted codes.

> On Mar 25, 2017, at 6:38 AM, Thomas Morley  wrote:
>
>   %% This one is really ugly, because the values are hardcoded
>   %% Every slight change in layout will cause a new round of try-and-error
> :(
>   %% Currently I see no convincing method to automate it.
>   \once \override Beam.after-line-breaking =
>   #(lambda (grob)
>  ;; the (commented) line below prints the list to terminal
>  ;; c/p this list and change the values until they fit your needs
>  ;(pretty-print (ly:grob-property grob 'beam-segments))
>  (ly:grob-set-property! grob 'beam-segments
>'(((vertical-count . 0)
>   (horizontal 55.65 . 85.5911087716535))
>  ((vertical-count . 1)
>   (horizontal 55.65 . 74.7368967716535))
>  ((vertical-count . 1)
>   (horizontal 76.9068967716535 . 78.8368967716535))
>  ((vertical-count . 1)
>   (horizontal 80.5068967716535 . 85.5911087716535))
>  ((vertical-count . 2)
>   (horizontal 55.65 . 58.3142607716535))
>  ((vertical-count . 2)
>   (horizontal 61.1842607716535 . 62.34926077165349))
>  ((vertical-count . 2)
>   (horizontal 73.5718967716535 . 74.7368967716535))
>  ((vertical-count . 2)
>   (horizontal 76.9068967716535 . 78.8368967716535))
>  ((vertical-count . 2)
>   (horizontal 80.5068967716535 . 82.4368967716535
>   )
>
>
>
> best,
>
> jc
>
> %%example
>
> \version "2.19.57"
>
>
> stemBeams =
> #(define-music-function (parser location l1 l2)(list? list?)
>#{
>  \once \override Stem.beaming = #(cons l1 l2)
>#})
>
>
> \layout {
>   \override NoteHead.stem-attachment = #'(0 . 0)
>   \context {
> \Score
> proportionalNotationDuration = #(ly:make-moment 1/64)
> \override SpacingSpanner.uniform-stretching = ##t
>   }
> }
>
> \new PianoStaff <<
>   \new Staff = "up"
>   \with { \override VerticalAxisGroup.staff-staff-spacing.padding = 4 }
>   <<
> {
>   \cadenzaOn
>   \stemUp
>   \once \override Beam.positions = #'(8 . 8)
>   b''!16[
>   \stemBeams #'(0) #'(0 1)
>   \times 4/5 { dis'' cis' dis'' b'! \stemBeams #'(0 1) #'(0) f''! }
>   \stemBeams #'(0) #'(0 1)
>   \times 4/5 { d' f''! bes' f''! \stemBeams #'(0 1) #'(0) gis' }
>   \stemBeams #'(0) #'(0 1)
>   b'!
>   \stemBeams #'(0 1) #'(0)
>   g''!
>   \change Staff = "down"
>   dis''!16]
> }
> \\
> {
>   s2
>   s8.
>   \once \override Beam.positions = #'(-5 . -5)
>   \once \override Score.NoteColumn. X-offset = -1.2

I'm still puzzled why the overrides for Stem.beaming sometimes need
postive sometimes negative values.
Displaying beam-segments shows only 0,1,2 for vertical-count, i.e positives.


\once \override Beam.after-line-breaking =
#(lambda (grob)
   (pretty-print (ly:grob-property grob 'beam-segments)))

>   \stemBeams #'(0 1 2) #'(0 1)
>   \stemDown
>   \once \hide Rest
>   \stemBeams #'() #'(0 1 2)
>   r32[
>   \stemBeams #'(0 1 2) #'(0 1)
>   fis'''!32
>   \change Staff = "down"
>   \stemUp
>   \stemBeams #'(-1 0) #'(-2 -1 0 )
>   gis''!32
>   \change Staff = "up"
>   \stemDown
>   \stemBeams #'(-2 -1 ) #'(-2 -1  )
>   a'''!16 cis'''! cis'''!
>   \stemBeams #'(0 1 2) #'(0)
>   a'''!32
>   \change Staff = "down"
>   \stemUp
>   \stemBeams #'(0) #'(-2 -1 0)
>   dis'''!32
>   \change Staff = "up"
>   \stemDown
>   \stemBeams #'(-1 0 1) #'(-1)
>   g'''!
>   \change Staff = "down"
>   \stemUp
>   \stemBeams #'(0) #'(-2 -1 0)
>   cis''' !
>   \change Staff = "up"
>   \stemDown
>   bes'''! fis'''!16]
> }
>>>
>
>   \new Staff = "down" {
> s2 s8 s8
> \times 4/5 {  gis''16[ dis''! gis''! ais'' b''!] }
> \once \override Stem.length = #18
> dis'''!
> s8
>   }
>>>

Cheers,
  Harm

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


Re: Unusual beaming for piano music

2017-03-25 Thread Thomas Morley
2017-03-24 22:25 GMT+01:00 Thomas Morley :

>
>
> 2017-03-24 2:13 GMT+01:00 Andrew Bernard :
>
>> Hi All,
>>
>>
>>
>> I have an unusual beaming situation in the piano work I am setting. The
>> composer I work with is fussy (very) about his visual gestures in notation
>> and it is incumbent on me to reproduce the beaming seen in the attached
>> image. The issue I am having difficulty with is where the beam for the
>> spanned group goes from up to down with no break – at the point where the
>> “treble^8” clef is introduced. Are there any smart solutions to such a
>> situation?
>>
>>
>>
>> I can ask to have this notated differently, but it would go against
>> various large scale structural patterns in the music. [Yes, we know it does
>> not follow engraving rules 😊]  So a technical lilypond solution would
>> be great.
>>
>>
>>
>> Andrew
>>
>
>
> Sorry to say, I usually throw away scores where the composer obfuscates
> things.
>

Anyway, here my attempt, some heavy ugliness in it, though, (see comments
inline)

\version "2.19.57"

stemBeams =
#(define-music-function (l1 l2)(list? list?)
#{
  \once \override Stem.beaming = #(cons l1 l2)
#})


\layout {
  \override NoteHead.stem-attachment = #'(0 . 0)
  \context {
\Score
proportionalNotationDuration = #(ly:make-moment 1/24)
\override SpacingSpanner.uniform-stretching = ##t
  }
}

\new PianoStaff <<
\new Staff = "up"
  \with { \override VerticalAxisGroup.staff-staff-spacing.padding = 4 }
  {
  \cadenzaOn
  \stemUp
  \once \override Beam.positions = #'(8 . 8)
  b''!16[
  \stemBeams #'(0) #'(0 1)
  \times 4/5 { dis'' cis' dis'' b'! \stemBeams #'(0 1) #'(0) f''! }
  \stemBeams #'(0) #'(0 1)
  \times 4/5 { d' f''! bes' f''! \stemBeams #'(0 1) #'(0) gis' }
  \stemBeams #'(0) #'(0 1)
  b'!
  \stemBeams #'(0 1) #'(0)
  g''!
  \change Staff = "down"
  dis''!16]

  %% This one is really ugly, because the values are hardcoded
  %% Every slight change in layout will cause a new round of try-and-error
:(
  %% Currently I see no convincing method to automate it.
  \once \override Beam.after-line-breaking =
  #(lambda (grob)
 ;; the (commented) line below prints the list to terminal
 ;; c/p this list and change the values until they fit your needs
 ;(pretty-print (ly:grob-property grob 'beam-segments))
 (ly:grob-set-property! grob 'beam-segments
   '(((vertical-count . 0)
  (horizontal 55.65 . 85.5911087716535))
 ((vertical-count . 1)
  (horizontal 55.65 . 74.7368967716535))
 ((vertical-count . 1)
  (horizontal 76.9068967716535 . 78.8368967716535))
 ((vertical-count . 1)
  (horizontal 80.5068967716535 . 85.5911087716535))
 ((vertical-count . 2)
  (horizontal 55.65 . 58.3142607716535))
 ((vertical-count . 2)
  (horizontal 61.1842607716535 . 62.34926077165349))
 ((vertical-count . 2)
  (horizontal 73.5718967716535 . 74.7368967716535))
 ((vertical-count . 2)
  (horizontal 76.9068967716535 . 78.8368967716535))
 ((vertical-count . 2)
  (horizontal 80.5068967716535 . 82.4368967716535
  )


  \once \override Beam.positions = #'(-5 . -5)
  \once \override Score.NoteColumn. X-offset = -1.2
  \stemBeams #'(0 1 2) #'(0 1)
  \change Staff = "up"
  \stemDown
  fis'''!32[
  \change Staff = "down"
  \stemUp

  %% Remark
  %% I don't understand those strange values for Stem.beaming following
below
  %% and the need to set them in first place at all
  %% Causing the need to correct some with the override for 'beam-segments
above
  \stemBeams #'(0 1) #'(-1 0 1)
  gis''!32
  \change Staff = "up"
  \stemDown
  \stemBeams #'(-1 0 1) #'(-1 0 )
  a'''!16 cis'''! cis'''!
  \stemBeams #'(0 1 2) #'(0)
  a'''!32
  \change Staff = "down"
  \stemUp
  \stemBeams #'(0) #'(-2 -1 0)
  dis'''!32
  \change Staff = "up"
  \stemDown
  \stemBeams #'(-1 0 1) #'(-1)
  g'''!
  \change Staff = "down"
  \stemUp
  \stemBeams #'(0) #'(-2 -1 0)
  cis''' !
  \change Staff = "up"
  \stemDown
  bes'''! fis'''!16]
}

\new Staff = "down" {
s2 s4 s32
\times 4/5 {  gis''16[ dis''! gis''! ais'' b''!] }
dis'''!
s8
}
>>

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


Re: Unusual beaming for piano music

2017-03-24 Thread Thomas Morley
2017-03-24 2:13 GMT+01:00 Andrew Bernard :

> Hi All,
>
>
>
> I have an unusual beaming situation in the piano work I am setting. The
> composer I work with is fussy (very) about his visual gestures in notation
> and it is incumbent on me to reproduce the beaming seen in the attached
> image. The issue I am having difficulty with is where the beam for the
> spanned group goes from up to down with no break – at the point where the
> “treble^8” clef is introduced. Are there any smart solutions to such a
> situation?
>
>
>
> I can ask to have this notated differently, but it would go against
> various large scale structural patterns in the music. [Yes, we know it does
> not follow engraving rules 😊]  So a technical lilypond solution would be
> great.
>
>
>
> Andrew
>

Hi Andrew,

I've a hard time understanding what the composer wants to tell me (the
probable performer) at this point. For me it looks the dis has two
different duration-indications at the same stem: two beams at top and three
more below.

The only way to make sense of it would to assume a polyphonic situation.
This idea came me after 10 minutes of thinking about it...
Now I give up, obviously I'm not the man for such things, at the end of a
hard weeks work.

Sorry to say, I usually throw away scores where the composer obfuscates
things.

Nevertheless, a hint (no idea whether it will be really helpful):

{
b'16^[
\once \override Stem.beaming = #(cons (list 0  1) (list 0))
g''16
\once \override Stem.beaming = #(cons (list 0  1) (list 3 4 5))
dis'16
fis''32]
}



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


Re: tuplet full length at breaks with large time signatures

2017-03-21 Thread Thomas Morley
2017-03-21 22:12 GMT+01:00 Juan Cristóbal Cerrillo :
> Hello everyone,
>
> I’m working on a score with large time signatures.  I’ve created a specific 
> context for this purpose.  However, overriding 
> TimeSignature.break-align-symbol causes problems with full length tuplets at 
> breaks.  Please compare bars 3 and 4 in the following example. The bracket 
> should ideally extend the same in both bars, but in bar 4 it is much shorter 
> because of the break.  The same happens in bar 8 but not in bar 12.
> How can I achieve this?
> Any help would be greatly appreciated.
>
> All best,
>
> jc
>
> \version "2.18.2"
>
> \paper {
>   ragged-bottom = ##t
>   ragged-right = ##t
> }
>
> \layout {
>   \context {\type "Engraver_group"
> \consists "Time_signature_engraver"
> \consists "Axis_group_engraver"
> \name "TimeSig"
> \alias "Staff"
> \override TimeSignature.style = #'numbered
> \override TimeSignature.font-size = #6
> \override TimeSignature.break-align-symbol = #'staff-bar
> \override TimeSignature.X-offset =
> #ly:self-alignment-interface::x-aligned-on-self
> \override TimeSignature.self-alignment-X = #CENTER
>
>   }
>   \context {\Score
> \accepts TimeSig
>   }
>   \context {\StaffGroup
> \accepts TimeSig
>   }
>   \context {\Staff
> \remove "Time_signature_engraver"
> tupletFullLength = ##t
> \override TupletBracket.full-length-padding = -1
>   }
> }
>
> music = \relative c''
> {
>   \tupletUp
>   \repeat unfold 3 {
> \time 4/4
> \tuplet 5/4 {
>   c2 c c4
> }
> \time 3/4
> \tuplet 5/3 {
>   c4 c2. c4
> }
> \time 4/4
> \tuplet 5/4 {
>   c2 c c4
> }
> \time 4/4
> \tuplet 5/4 {
>   c2 c c4
> }
> \break
>   }
> }
>
> \score {
>   \new StaffGroup
>   <<
> \new TimeSig
> \new Staff \music
> \new Staff \music
>   >>
> }



Hi,

how about below?

\version "2.19.57"

#(define (at-line-end? grob)
;; Thanks to David Nalesnik
   (let* ((col (ly:item-get-column grob))
  (ln (ly:grob-object col 'right-neighbor))
  (col-to-check (if (ly:grob? ln) ln col)))
 (and (eq? #t (ly:grob-property col-to-check 'non-musical))
  (= -1 (ly:item-break-dir col-to-check)

\paper {
  ragged-bottom = ##t
  ragged-right = ##t
}

\layout {
  \context {
\type "Engraver_group"
\consists "Time_signature_engraver"
\consists "Axis_group_engraver"
\name "TimeSig"
\alias "Staff"
\override TimeSignature.style = #'numbered
\override TimeSignature.font-size = #6
\override TimeSignature.break-align-symbol = #'staff-bar
\override TimeSignature.X-offset =
#ly:self-alignment-interface::x-aligned-on-self
\override TimeSignature.self-alignment-X = #CENTER
%% Adjust extension of the TimeSig, otherwise it interferes with other items
%% TODO is this the best method?
%%  Check whether moving for half X-extent is possible/cheaper
\override TimeSignature.stencil =
#(lambda (grob)
   (let* ((stil (ly:time-signature::print grob))
  (stil-center (interval-center (ly:stencil-extent stil X
 (ly:make-stencil
   (ly:stencil-expr stil)
   (cons stil-center stil-center)
   (ly:stencil-extent stil Y
  }
  \context {\Score
\accepts TimeSig
  }
  \context {\StaffGroup
\accepts TimeSig
  }
  \context {
\Staff
\remove "Time_signature_engraver"
tupletFullLength = ##t
%% shorten the length of the TupletBracket at line-end, _iff_
%% tupletFullLength is set true
\applyContext
  #(lambda (ctx)
 (ly:context-pushpop-property ctx 'TupletBracket 'after-line-breaking
   (lambda (g)
 (if (and (at-line-end? (ly:spanner-bound g RIGHT))
  (->bool (ly:context-property ctx 'tupletFullLength)))
 (ly:grob-set-property! g 'shorten-pair
   (cons 0
 (+ (/ (ly:staff-symbol-staff-space g) 2)
(ly:staff-symbol-line-thickness g
  }
}

music = \relative c''
{
  \tupletUp
  \repeat unfold 3 {
\time 4/4
\tuplet 5/4 {
  c2 c c4
}
\time 3/4
\tuplet 5/3 {
  c4 c2. c4
}
\time 4/4
\tuplet 5/4 {
  c2 c c4
}
\time 4/4
\tuplet 5/4 {
  c2 c c4
}
\break
  }
}

\score {
  \new StaffGroup
  <<
\new TimeSig
\new Staff \music
\new Staff \music
  >>
}

Cheers,
  Harm

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


Re: Entering (lute) tablature

2017-03-19 Thread Thomas Morley
2017-03-19 22:41 GMT+01:00 David Kastrup :

> Given how annoying I found the process of figuring out the notes from a
> tablature source, I am somewhat surprised that nobody considers this
> aspect of the example I posted worth commenting on.

Speaking only for me, probably because I am a classical guitarist,
I'm used to decipher many sorts of historic tablatures.
Mostly italian and french tablatures. The tablature used by Luis
Milan. Alfabeto Italiano, etc.
Not to mention german tablature, though I never understood german
tablature, or more precisely I never _wanted_ to...

Studying those deeply, gives me a better feeling how to perform the
music, with regard to note-durations, voices, polyphony, etc

As you write yourself:

> Of course, getting good notes out requires _more_ than this since the
> tablature only shows note starts, not note ends.  That makes it easy to
> enter everything as one voice, but in a proper note rendition one would
> want to let a number of notes have longer note values and use multiple
> voices.

As a performer I'm not very interested in modern typeset tablatures.
Ofcourse I'm aware many people are. I mostly do tablature work, when
answering user-requests on the list, lol.
So I'm sure your "tab-input-mode" will find lots of enthusiastic users.

Best,
  Harm

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


Re: Entering (lute) tablature

2017-03-19 Thread Thomas Morley
2017-03-18 23:36 GMT+01:00 David Kastrup :
>
> Well, lute tablature has the obvious advantage(?) to be using letters
> instead of fret numbers.
>
> I went totally annoyed over entering the first few measures of the
> following tablature appended as PDF
>
>
>
> so I finally decided that this wasn't working for me.
>
> So here is a sketch of entering this score by tab:
>
>
>
> Pretty sure I entered stuff wrong here (there is some programming error,
> too) and probably did not decipher all of the tab correctly.  Anybody
> wanting to proofread?
>
> At any rate, at least for lettered tabs this is a somewhat cure entry
> method (of course, the "letters" start over since the order is
> a b c d e f g a' b' c' d' ...).
>
> Should something like this, though likely more robust against bad
> entries, be part of LilyPond's standard tool chest?
>
> --
> David Kastrup



Hi David,

I didn't proofread.
Though some observations.

(1)
Why not

"|" = \bar "|"

instead of

content = #(map-some-music
(lambda (m)
 (and (music-is-of-type? m 'bar-check)
  #{ \bar "|" #}))
content)

(2)
A seven string tablature is hard to read, imho.
Why not use 'additionalBassStrings'. I would print "0" below sixth string here.

(3)
I tried to boil down the programming error. Minimal:

\new Score \with { defaultBarType = "" } { c'1. }

It's already present in 2.14.2.
2.12.3 doesn't print an error. No clue if the error isn't there for
this version or if it's not recognized and printed to the terminal.


I'd need to have a far closer look at the 'tabtranslate', before I
could say anything relevant about this function.


Cheers,
  Harm

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


Re: Accessing a grob from within a music function

2017-03-16 Thread Thomas Morley
2017-03-16 22:51 GMT+01:00 Thomas Morley :
> 2017-03-16 14:23 GMT+01:00 Urs Liska :
>> Hi,
>>
>> I'm trying to write a function to push a note column like this:
>>
>> pushLeftBroken =
>> #(define-music-function ()()
>>#{
>>  \once \override NoteColumn.X-offset = 3
>>#})
>>
>> But I need to make that "3" depend on some characteristics of the actual
>> note column. Basically I need the width of the note column, including
>> attached accidentals.
>>
>> I know how to get to the accidental(s) within a note column, but if I'm
>> not mistaken there's no actual grob inside that.
>>
>> Probably music-function isn't the right approach?
>>
>> What I need is a way to say something like
>>
>> \once \override NoteColumn.X-offset = #(+ 3
>> extent-of-all-accidentals-in-the-note-column)
>>
>> Any ideas?
>> TIA
>> Urs
>
>
>
> Hi Urs,
>
> here my thoughts about the topic so far.
> Although I'm afraid it will not help, because it has to be done
> before-line-breaking.
>
> wanted-value = 20
>
> {
> c'1( \break
>   \override NoteColumn.before-line-breaking =
>   #(lambda (nc)
>   ;; TODOs
>   ;; add fall-backs if certain grobs are not present, i.e
>   ;; (DotColumn, Arpeggio, AccidentalPlacement)
> (let* ((dot-col (ly:note-column-dot-column nc))
>(acc-placement (ly:note-column-accidentals nc))
>(common-ref
>  (ly:grob-common-refpoint nc acc-placement X))
>(x-length-of-accs
>  (interval-length
>(ly:relative-group-extent
>  (map last (ly:grob-object acc-placement 'accidental-grobs))
>  common-ref
>  X
>
>(for-each
>  (lambda (el)
>(ly:grob-translate-axis!
>  el
>  (+ x-length-of-accs wanted-value)
>  X))
>  (filter
>(lambda (g) (ly:grob? g))
>(list
>  acc-placement
>  dot-col
>  nc)
>
>
>   2)\arpeggio ^"foo"
> }
>
> Cheers,
>   Harm

Probably:

{
c'1( \break
  \override NoteColumn.after-line-breaking =
  #(lambda (nc)
 (ly:grob-translate-axis! (ly:grob-parent nc X) 5 X)
 ;; uncomment for viewing
 ;(ly:grob-set-property!
 ;  (ly:grob-parent nc X)
 ;  'stencil
 ;  ly:paper-column::print)
   )


  2)\arpeggio ^"foo"
}

Not tested beyond the above example, though.

Cheers,
  Harm

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


Re: Accessing a grob from within a music function

2017-03-16 Thread Thomas Morley
2017-03-16 14:23 GMT+01:00 Urs Liska :
> Hi,
>
> I'm trying to write a function to push a note column like this:
>
> pushLeftBroken =
> #(define-music-function ()()
>#{
>  \once \override NoteColumn.X-offset = 3
>#})
>
> But I need to make that "3" depend on some characteristics of the actual
> note column. Basically I need the width of the note column, including
> attached accidentals.
>
> I know how to get to the accidental(s) within a note column, but if I'm
> not mistaken there's no actual grob inside that.
>
> Probably music-function isn't the right approach?
>
> What I need is a way to say something like
>
> \once \override NoteColumn.X-offset = #(+ 3
> extent-of-all-accidentals-in-the-note-column)
>
> Any ideas?
> TIA
> Urs



Hi Urs,

here my thoughts about the topic so far.
Although I'm afraid it will not help, because it has to be done
before-line-breaking.

wanted-value = 20

{
c'1( \break
  \override NoteColumn.before-line-breaking =
  #(lambda (nc)
  ;; TODOs
  ;; add fall-backs if certain grobs are not present, i.e
  ;; (DotColumn, Arpeggio, AccidentalPlacement)
(let* ((dot-col (ly:note-column-dot-column nc))
   (acc-placement (ly:note-column-accidentals nc))
   (common-ref
 (ly:grob-common-refpoint nc acc-placement X))
   (x-length-of-accs
 (interval-length
   (ly:relative-group-extent
 (map last (ly:grob-object acc-placement 'accidental-grobs))
 common-ref
 X

   (for-each
 (lambda (el)
   (ly:grob-translate-axis!
 el
 (+ x-length-of-accs wanted-value)
 X))
 (filter
   (lambda (g) (ly:grob? g))
   (list
 acc-placement
 dot-col
 nc)


  2)\arpeggio ^"foo"
}

Cheers,
  Harm

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


Re: Using a tick as a bar line and vertically repositioning it

2017-03-14 Thread Thomas Morley
2017-03-14 23:05 GMT+01:00 Joseph N. Srednicki :
> Thanks so much. Your suggestion works fine!

Glad it works for you.
Please don't forget to reply to all, so that others know as well. ;)

Cheers,
  Harm
>
> -Original Message-
> From: Thomas Morley [mailto:thomasmorle...@gmail.com]

> You can't without redefining make-tick-bar-line.
> Does below already fits your needs?
>
> \relative c {
>
>   \time 2/4
>   c' c
>   \once \override Staff.BarLine.hair-thickness = 15
>   \once \override Staff.BarLine.bar-extent = #'(-1 . 1)
>   \bar "|"
>   c c \bar "|."
>
> }
>
> Cheers,
>   Harm
>

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


Re: Using a tick as a bar line and vertically repositioning it

2017-03-14 Thread Thomas Morley
2017-03-14 19:57 GMT+01:00 Joseph N. Srednicki :
> Hello:
>
>
>
> Can someone help with an answer that I cannot find by searching the Lilypond
> documentation?
>
>
>
> In some plainsong settings in the Hymnal 1982, a vertical tick represents a
> bar line.
>
>
>
> See the following tiny example.
>
>
>
> \version "2.19.54"
>
> \relative c {
>
>   \time 2/4
>
>   c' c \bar"'" |
>
>   c c \bar "|."
>
> }
>
>
>
> In this example, the tick appears on the f line about middle c.
>
>
>
> How would I code this so that I can vertically position the tick appear in
> the middle line of the staff and make it bold?


You can't without redefining make-tick-bar-line.
Does below already fits your needs?

\relative c {

  \time 2/4
  c' c
  \once \override Staff.BarLine.hair-thickness = 15
  \once \override Staff.BarLine.bar-extent = #'(-1 . 1)
  \bar "|"
  c c \bar "|."

}

Cheers,
  Harm

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


Re: Find ties enclosed in slur (while overriding stencil)

2017-03-14 Thread Thomas Morley
2017-03-14 11:52 GMT+01:00 Urs Liska :
> Hi,
>
> I'm trying to determine if a slur includes ties in order to do some
> layout calculations.
>
> I'm overriding a stencil and have retrieved the slur's 'note-columns.
> Now I want to know if any of these note-columns (or enclosed note heads
> has a tie attached to it.
>
> I see that NoteColumn has a note-heads property. However, accessing
> these note heads and then asking for their ly:grob-object  NAME 'ties
> returns empty lists only.
>
> So what is the proper way to assess all the note columns within a slur
> and retrieve any included ties?
> The information I actually need is the note head's staff position and
> the tie's direction.
>
> Any suggestions?
> Urs



Hi Urs,

not an elaborated code, maybe a starting-point, though.

{
\override Slur.stencil =
#(lambda (grob)
  (let* ((ncs (ly:grob-object grob 'note-columns))
 (nhs
   (append-map
 (lambda (nc)
   (ly:grob-array->list (ly:grob-object nc 'note-heads)))
 (ly:grob-array->list ncs

  (pretty-print
(map
  (lambda (nh)
(map
  (lambda (ev)
(ly:prob-property ev 'name))
  (ly:prob-property
(ly:prob-property
  (ly:grob-property nh 'cause)
  'music-cause)
'articulations)))
  nhs))
  (ly:slur::print grob)))

c'1(~
c'
d'~
d'
e'
f'
g')
a'
}

Cheers,
  Harm

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


Re: Problem with bar numbers

2017-03-14 Thread Thomas Morley
Hi Don,

2017-03-14 9:11 GMT+01:00 Don Gingrich :
> OK, I'll start by saying that I'm doing some things that
> are wrong as far as musical purists are concerned,
> but there *is* a reason.
>
> I'm typesetting scores for folk dance music sets.
> Typically, (but not exclusively) music for folk dance
> consists of an 8 bar 'A' part and an 8 bar 'B' part.
>
> It is often written with an anacrusis at the start of
> both the A and B parts. And the A part ends with
> a bar with the value of time - (A anacrusis)
> The B part may also start with its own anacrusis.
> The two anacrusii will almost always have the same
> duration and the final bar will be similar in duration
> to the A part ending.
>
> The reason that it gets written this way is that
> dances require varying numbers of bars of music.
> But always a multiple of the A/B part which is
> commonly 8 bars. To make things easier for the
> dancers, the tune may be played with different
> numbers of repetitions of the A and B parts.
> A good band will endeavour to finish a dance section
> at the end of the B part so that the new couple
> always begin on the first time through the A part
> of either the current tune or a new one.
>
> This also explains the AABBx2 markup
>
> So it breaks the rules of music theory, but there is
> a reason.
>
> I've translated XML files and they generally end up
> with sN*M to fill out the anacrusis and terminal
> bars. It works but it's ugly since it adds horizontal
> space  that is unwanted. So I've been using
> \partial and copping the warnings since it looks
> better. (It's just the "programmer" in me that doesn't
> like code that "compiles" with warnings.)
>
> What would be nice is either an allowed alternative
> partial or a variant of the s code that says
> "ignore this many beats" .
>
> The other problem is that the bar numbers get
> screwed up with these anacrusii that aren't supposed
> to be there.
>
> If it were up to me, I'd re-number at the start of each tune,
> but I'm working to someone else's preferred appearance
> which he achieves with Finale. I'm getting close but
> the bar numbers are defeating me. I tried getting
> a number on every bar. and thought that I had the
> correct command in:
>
>  \set Score.barNumberVisibility = #(every-nth-bar-number-visible 1)

The correct way is to override BarNumber.break-visibility, preferable in layout:

\layout {
  \context {
\Score
\override BarNumber.break-visibility = ##(#f #t #t)
  }
}


> But I still only get numbers at the left side of the staff.
>
> I thought about a bunch of big rests, but then there wouldn't
> have been as many bars. Sorry it's such a big example. It's
> actually 6 tunes across 2 pages with a D.S al Fine at the
> finish of the sixth one.

Well, I didn't understand what you want instead.
Maybe play with
\set Timing.measureLength = #(ly:make-moment )
See NR for examples.

Cheers,
  Harm

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


Re: Repeating cross staff tremolo

2017-03-13 Thread Thomas Morley
2017-03-14 1:06 GMT+01:00 Allen Wu :

>
> Hey Guys,
>
> I was trying the example of crossing staff tremolo, but I found it
> difficult to repeat the same one to the next.  Can someone tell me what did
> I do wrong?
>
> Thanks,
> Allen
>
>
> %Here is my code:
>
> upper = {s4 s4}
>
^
You should see this warning:
warning: cannot find context to switch to

The upper-context ends to early, try:
upper = { s1 }

>
> lower = \relative c''' {
>   \voiceOne
>   \repeat tremolo 8 {32 \change Staff = "up" \voiceTwo }
> %Works
>
>   \voiceOne \change Staff = "down"
>   \repeat tremolo 8 {32 \change Staff = "up" \voiceTwo }
> %Wrong
> }
>
>
> \new PianoStaff <<
>   \new Staff = "up"   \upper
>   \new Staff = "down" \lower
> >>
>

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


Re: Composing music functions

2017-03-12 Thread Thomas Morley
2017-03-12 22:46 GMT+01:00 Morten Lemvigh :
> Hi,
>
> I'm trying to create some tools for setting choir pieces. I have run against
> a problem where I have a music function that needs the result of another
> music function. That other function uses a Lilypond code block, so it takes
> both parser and location. For reasons I don't understand, I cannot get this
> to work. Lilypond gives me a:
>
>   Wrong type to apply: #>
>
>
> I have tried to create a small toy example to show what I want to achieve:
>
> rest-around = #(define-music-function (parser location music ) (ly:music?)
>   #{ r4 $music r4 #})
>
> restful-choir = #(define-music-function (parser location music) (ly:music?)
>   (let ((rest-around (rest-around parser location music)))
>#{
>  <<
>\new Voice { \voiceOne \transpose c g $rest-framed }

rest-framed is not defined see terminal-output:

error: GUILE signaled an error for the expression beginning here
   \new Voice { \voiceOne \transpose c g $
  rest-framed }
Unbound variable: rest-framed


>\new Voice { \voiceTwo $rest-framed }
>  >>
>#}))
>
>
> music =  { c' d' e' }
>
> \score {
>   \new Staff { \restful-choir \music }
> }
>
> I have run into this problem a couple of times, the current problem I'm
> trying to solve is: I have a list of music an I am trying to map each item
> of the list with a function that creates a staff with the music. Afterwards
> they should be combined as 'SimultaneousMusic. I would like to use Lilypond
> code blocks where I think it is clearer than the Scheme counterpart.
>
> Is there something obvious I am doing wrong,

You did not post your lily-version ;)

> or am I perhaps completely off
> on this approach...?
>
> Best regards,
> Morten

This works for newer devel-versions:

\version "2.19.56"

rest-around = #(define-music-function (music ) (ly:music?)
  #{ r4 $music r4 #})

restful-choir = #(define-music-function (music) (ly:music?)
  (let ((rest-framed (rest-around music)))
   #{
 <<
   \new Voice { \voiceOne \transpose c g $rest-framed }
   \new Voice { \voiceTwo $rest-framed }
 >>
   #}))


music =  { c' d' e' }

\score {
  \new Staff { \restful-choir \music }
}


Cheers,
  Harm

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


Re: empty-stencil versus point-stencil (was "Re: Text *in* score - Stopped staves - Horizontal spacing")

2017-03-11 Thread Thomas Morley
2017-03-11 15:36 GMT+01:00 Kieren MacMillan :
> Hi David,
>
 \markup \with-dimensions #empty-interval #empty-interval
>>>
>>> I prefer
>>> \markup \with-dimensions-from \null
>>
>> Different thing.  \null corresponds to a point-stencil (single-point
>> intervals), the first one corresponds to an empty-stencil (empty intervals).
>
> Thanks for the clarification!
>
>
> I have three questions on this topic:
>
>
> 1. Will ‘point-stencil’ still be unseen? Or does it literally output 1 point 
> [which could be seen at a high enough magnification]?

Always unseen, afaict.

Also, regard:
#(pretty-print
  (list
(ly:stencil-extent point-stencil X)
(ly:stencil-extent empty-stencil X)
empty-interval
(interval-length '(0 . 0))
(interval-length empty-interval)))

>
>
> 2. [Sometimes…? All the time…?] When I use
>
> \mark \markup \with-dimensions #empty-interval #empty-interval[**]
>
> the log gives
>
> warning: RehearsalMark has empty extent and non-empty stencil
>
> But output is as expected, and no other use of [**] seems to throw the same 
> error.

Same for \tempo.
In more invasive stencil overrides you may notice it more frequently ...

> Is there a better way to make my RehearsalMark markup not interact with the 
> spacing engine?

That I don't know.

>
> 3. I’ve tried to simplify
>
> \with-dimensions #empty-interval #empty-interval
>
> by making it a tweak like
>
> nodim = -\tweak \with-dimensions #empty-interval #empty-interval \etc
>
> But every combination of that which I’ve tried hasn’t worked. What is the 
> correct incantation, so that I can later say
>
>c’-\nodim \markup “foo”
>
> or
>
>c’-\markup \nodim “foo"


One possibility:

nodim-markup = \markup \with-dimensions #empty-interval #empty-interval \etc
\markup { \nodim "foo" }

See "Changes"

Cheers,
  Harm

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


Re: \repeatTie on a single note in a chord

2017-03-09 Thread Thomas Morley
2017-03-09 23:05 GMT+01:00 Malte Meyn :
>
>
> Am 09.03.2017 um 22:25 schrieb Thomas Morley:
>>
>> Another possibility to fake it:
>>
>> {
>>   \override LaissezVibrerTie.head-direction = #RIGHT
>>   < b d'^\laissezVibrer >
>> }
>
> This looks like the source of the bug should be easily found.
> LaissezVibrerTies and RepeatTies are basically the same thing except for
> the names and directions, aren’t they?

Nope.
Different stencil-drawing-procedures.
There may be a reason for that difference, though, I don't know.

Cheers,
  Harm

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


Re: \repeatTie on a single note in a chord

2017-03-09 Thread Thomas Morley
2017-03-09 17:47 GMT+01:00 Malte Meyn :
>
>
> Am 09.03.2017 um 17:35 schrieb Mojca Miklavec:
>> Should I file a bug report?
>
> I think so. Minimal example could look like this (I use \displayMusic to
> show that the RepeatTieEvent is there):
>
> \version "2.19.56"
>
> \displayMusic 



Another possibility to fake it:

{
  \override LaissezVibrerTie.head-direction = #RIGHT
  < b d'^\laissezVibrer >
}

mySingleRepeatTie = \tweak head-direction #RIGHT \laissezVibrer

{
  < b d'^\mySingleRepeatTie >
}

Cheers,
  Harm

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


Re: Determine the page position of a system

2017-03-08 Thread Thomas Morley
2017-03-08 10:15 GMT+01:00 Urs Liska :
> Hi all,
>
> I'd be interested in knowing the exact position of all systems in a
> score. What I'd like to achieve is write out an auxiliary file
> containing information about the musical moment and the vertical
> position of each system. I know about the moment but not about the page
> position. [1]
>
> The goal is to retrieve the current measure when clicking anywhere in a
> score in Frescobaldi. The overall goal is then to be able to sync the
> rendered score, the input, and a manuscript displayed in the Manuscript
> Viewer, which would be terrific to have.
>
> Which property/ies would I have to read out from which objects at what
> time (in which callback)?
>
> Thanks for any suggestions
> Urs
>
> [1] A fallback solution would be to use an approach like
> lilypond-book-preamble to produce the score as a sequence of individual
> files. That would of course also allow the exact linking of a click to a
> system. But I'd prefer to have that functionality independently from
> such far-reaching (and limiting) conditions.



Hi Urs,

if I understand correctly
http://lilypond.1069038.n5.nabble.com/intercepting-implicit-explicit-page-breaks-td194196.html#a194198
may give you a starting-point.

There I read barnumbers, but if you look into 'lines' you may be able
to grab the info you want.
Though its really post-processing and therefore may be too late ...

Cheers,
  Harm

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


Re: Using italic font for TextScript messes up \dynamic display

2017-03-03 Thread Thomas Morley
2017-03-03 3:43 GMT+01:00 kmg :
> I'm using custom font of which I have only regular italic variant; while it
> makes expression text look good, it also makes dynamics made in \markup
> appear like they were typed in this font instead with my music font.
>
>
> MWE (somewhat):
>
> \version "2.19.55"
> ...
> c\sfz-\markup { \italic "cresc." } %works
> c-\markup { \dynamic "sfz" \italic "cresc." } %sfz is displayed in
> TextScript font instead of music font
> ...
>
> How it looks like; left = \dynamic in \markup, right = note\dynamic -
> http://i.imgur.com/N0QodeO.png
>
> Is there a way to set it so \dynamics will display actual glyph from my
> music font? If you're wondering about the font, I bought it, so I'm kinda
> limited to only regular italic variant; besides - if it's rendering the
> TextScript font anyway, it would look bad when paired with actual music font
> dynamic glyph... which is weird, because it ~should~ render music font
> always, right? When using default TextScript font, it works perfectly, so I
> assume there's a problem having only one variant of the this font (regular
> italics).
>
> As a workaround I'm using #(make-dynamic-script) when using combined
> dynamics, or \musicglyph; it's troublesome to adjust following text every
> time and messing with overrides though. Also, \musicglyph is nice for single
> letter + text, but it fails when doing combined dynamics. Found out that
> using \markup { \dynamic p \override #'(font-name . "font") \italic "text" }
> works too, but it would've been great if it worked out of the box. Thanks
> for your suggestions guys.
>
> Pozdrawiam,
> Krzysztof Gutowski


Hi Krzysztof,

I've no good idea what works for you under which circumstances and
what you really want.
This may be a language issue. As a non-native speaker myself I tend to
put in my posts compilable, (and where needed) commented code,
demonstrating the problem.
In other words, I'd prefer less descripting text but more code ;)

That said, if I guess your intends correctly the following may help:

#(define-markup-command (dynamic layout props arg)
  (markup?)
  (interpret-markup
   layout
   (prepend-alist-chain 'font-name #f
 (prepend-alist-chain 'font-encoding 'fetaText props)) arg))

{
  \override TextScript.font-name = "Purisa"
  c\sfz-\markup { \italic "cresc." }
  c-\markup { \dynamic  "sfz" \italic "cresc." }
}

Cheers,
  Harm

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


Re: Is there any way to use dynamics as prefixes?

2017-02-28 Thread Thomas Morley
2017-02-28 20:37 GMT+01:00  :
> On 02/28/17 20:14, David Kastrup wrote:

>> But if you prefer the latter, just start your music file with
>>
>> "("=<>(
>
>
> What is this, Perl?


Nope.
See declarations-init.ly for the original:
"(" =  #(make-span-event 'SlurEvent START)

David's suggestion simply redefines it. See the output of:

%% original
"(" =  #(make-span-event 'SlurEvent START)

\void \displayMusic (
\void \displayLilyMusic (


%% redefined
"("=<>(

\void \displayMusic (
\void \displayLilyMusic (

Cheers,
  Harm

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


Re: Is there any way to use dynamics as prefixes?

2017-02-28 Thread Thomas Morley
Hi,

2017-02-28 19:53 GMT+01:00  :
> I think it's rather weird that you write `c'4\ff d'` instead of `\ff c'4
> d'`. Other constructs such as `\tempo` and `\mark` are before the notes they
> affect - why aren't dynamics?

Here's a little misunderstanding. \mark and \tempo are music-functions
not affecting a certain note directly, whereas dynamics and slurs are
indeed part of the 'articulations property of a 'NoteEvent.

Why postfix-syntax?
It's a design-decision, made long time before I was around here.
Maybe others can comment on this.

> For a more practical example, playing the same thing multiple times with
> different dynamics with prefix dynamics would be easy:
>
> ```
> notes = {c'4 d' e' f'}
>
> \mp
> \notes
> \notes
> \ff
> \notes
> ```
>
> Doing the same with suffix dynamics would be rather messy - especially not
> adding any dynamic mark at the second instance.

Try:
notes = { c'4 d' e' f' }

{
  <>\mp
  \notes
  \notes
  <>\ff
  \notes
}

>
> This also applies to slurs - `(c'4 d' e' f')` is a lot clearer to me than
> `c'4( d' e' f)`.

You'll get used to it very soon.

> (This is the first time I ever use a mailing list, so please tell me if I'm
> doing anything horribly wrong.)

If you have concerns about your behaviour on this list, I recommend to read:
http://www.catb.org/~esr/faqs/smart-questions.html

Cheers,
  Harm

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


Re: \ottava without bracket

2017-02-28 Thread Thomas Morley
2017-02-28 16:09 GMT+00:00 David Nalesnik :
> Hi Andrew,
>
> On Mon, Feb 27, 2017 at 6:52 PM, Andrew Bernard
>  wrote:
>> Hi David,
>>
>> This is excellent and useful. Also works, of course, when using something
>> like \set Staff.ottavation = "8".
>>
>> Why not make this a snippet in LSR?
>>
>
> Sure, I will look it at some more, and submit.
>
> Ideally, I'd like to add something to the codebase.
>
> Best,
> David


Hi David,

I was working on a patch introducing ottavaText as a context-property.
Maybe we could coordinate or at least avoid doing work twice.

I'll attach what I've done so far.
It's not finished yet: I'd like to polish it and add entries in NR and
Changes, probably worth a regtest as well.

Cheers,
  Harm

P.S.
Did you notice
https://sourceforge.net/p/testlilyissues/issues/5064/#23bb
?
From dfa574353db72775a028f172da6f5c5009c5f69d Mon Sep 17 00:00:00 2001
From: Thomas Morley 
Date: Tue, 28 Feb 2017 18:48:27 +
Subject: [PATCH] Introduce context-property ottavaText

---
 ly/engraver-init.ly   |  7 +++
 scm/define-context-properties.scm |  2 ++
 scm/define-music-callbacks.scm| 13 +++--
 3 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/ly/engraver-init.ly b/ly/engraver-init.ly
index 693f9eb..41665df 100644
--- a/ly/engraver-init.ly
+++ b/ly/engraver-init.ly
@@ -768,6 +768,13 @@ automatically when an output definition (a @code{\\score} or
   topLevelAlignment = ##t
 
   timing = ##t
+
+  ottavaText =
+#'((2 . "15ma")
+   (1 . "8va")
+   (0 . #f)
+   (-1 . "8vb")
+   (-2 . "15mb"))
 }
 
 
diff --git a/scm/define-context-properties.scm b/scm/define-context-properties.scm
index 75f1807..dd362fe 100644
--- a/scm/define-context-properties.scm
+++ b/scm/define-context-properties.scm
@@ -494,6 +494,8 @@ any effect the note would have had on accidentals in other voices.")
 
  (ottavation ,markup? "If set, the text for an ottava spanner.
 Changing this creates a new text spanner.")
+ (ottavaText ,list? "An alist containing pairs of ottava-number and markup.
+Used to get the text for @code{OttavaBracket}.")
  (output ,ly:music-output? "The output produced by a score-level
 translator during music interpretation.")
 
diff --git a/scm/define-music-callbacks.scm b/scm/define-music-callbacks.scm
index 5cc1db1..d8150cb 100644
--- a/scm/define-music-callbacks.scm
+++ b/scm/define-music-callbacks.scm
@@ -77,12 +77,13 @@ to be used by the sequential-iterator"
 (list (context-spec-music
(make-apply-context
 (lambda (context)
-  (let ((offset (* -7 octavation))
-(string (assoc-get octavation '((2 . "15ma")
-(1 . "8va")
-(0 . #f)
-(-1 . "8vb")
-(-2 . "15mb")
+  (let* ((offset (* -7 octavation))
+ (ottava-label-list
+   (ly:context-property context 'ottavaText))
+ (string
+   (if (pair? ottava-label-list)
+   (assoc-get octavation ottava-label-list)
+   #f)))
 (set! (ly:context-property context 'middleCOffset) offset)
 (set! (ly:context-property context 'ottavation) string)
 (ly:set-middle-C! context
-- 
2.1.4

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


Re: "Hide" the tagline

2017-02-27 Thread Thomas Morley
2017-02-27 14:04 GMT+01:00 Urs Liska :
>
>
> Am 27.02.2017 um 13:26 schrieb David Kastrup:
>> Urs Liska  writes:
>>
>>> Am 27.02.2017 um 13:08 schrieb Simon Albrecht:
 Am 27.02.2017 um 12:42 schrieb Urs Liska:
> Hi all,
>
> I'm looking for a way to "externally" hide the tagline, i.e. by either
> making it transparent or colouring it white.
>
> The "problem" is that I don't want to do it in the tagline markup
> definition itself but by injecting some code when invoking LilyPond. The
> intention is to write a wrapper script that hides the tagline of an
> arbitrary given score without affecting the layout.
 Maybe you can invoke something like
 #(define hide-tagline #t)
 through the -e command line option,
 write a markup command transparent-cond which applies the \transparent
 command to its argument depending on the value of ̀hide-tagline'
 and use that to wrap the tagline markup in bookTitleMarkup.

>>> I think that's too intrusive and imposes too many assumptions about the
>>> input file. What I need is a solution to take an arbitrary input file
>>> and compile it without a tagline.
>>>
>>> It's ok to insert something in the input file but it should be, well,
>>> non-intrusive.
>> I see the option
>>
>>-dinclude-settings=$LILYPOND_GIT/scripts/auxiliar/NoTagline.ly
>>
>> in scripts/auxiliar/make-regtest-pngs.sh
>>
>
> Unfortunately this doesn't help as it only adds a \header { tagline = ##f }
>
> This would at least require me ti ensure that I place the command
> *after* any header blocks in the input file. Additionally it's
> equivalent to \omit and not to \hide (so it may change the layout if
> someone creates a tagline with some vertical extent.
>
> Urs


Hi Urs,

I stored the code below in atest-50.ly

\version "2.19.52"

%% needed, see -e option in Usage-doc
%% a warning will be printed:
%% imported module (guile-user) overrides core binding
`%module-public-interface'
#(use-modules (guile-user))

#(let* ((paper-tagline
  (if (module? (ly:output-def-scope $defaultpaper))
  (module-ref (ly:output-def-scope $defaultpaper) 'tagline #f)
  #f))
(header-tagline
  (if (module? $defaultheader)
  (module-ref $defaultheader 'tagline #f)
  #f)))

  (if (and header-tagline (defined? 'transparent?) (->bool transparent?))
  (module-define! $defaultheader 'tagline
(markup #:with-color red header-tagline)))

  (if (and paper-tagline (defined? 'transparent?) (->bool transparent?))
  (ly:output-def-set-variable! $defaultpaper 'tagline
(markup #:with-color red paper-tagline

The file to be compiled with hidden tagline is atest-49.ly

With the following commandline I've succeeded:
lilypond -e '(define transparent? #t)' -dinclude-settings=atest-49.ly
-o atest-49 atest-50.ly

For now the tagline is set red, replace it with tranparent.
Ofcourse you would need to set pathes correctly.


HTH,
  Harm

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


<    11   12   13   14   15   16   17   18   19   20   >