Re: Making espressivo longer

2019-01-22 Thread Thomas Morley
Am Di., 22. Jan. 2019 um 22:45 Uhr schrieb Valentin Villenave
:
>
> On 1/22/19, Andrew Bernard  wrote:

> > There's a scale function in the archives from Harm, but I wonder if there
> > is a mechanism built in to 2.19.82 and so on?
>
> I assume you’re referring to
> https://lists.gnu.org/archive/html/lilypond-user/2013-04/msg00375.html
> https://sourceforge.net/p/testlilyissues/issues/3315/
> (a.k.a. "please remember I'm not a programmer" -> rrright.)

Simply true ...

Best,
  Harm

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


Re: fingering

2019-01-21 Thread Thomas Morley
Hi Gianmaria,

> Using your old code to draw a circle around finger number on the left of the 
> note today I found a problem. When I use "\omit Fingering" the compilation 
> report me the error:
>
> programming error: Infinity or NaN encountered

Has nothing to do with my code, you rather detected a serious bug, imho.
See:
{
  \set fingeringOrientations = #'(left)
  \override Fingering #'stencil = ##f
  
}

I just wrote a bug-report about it.
https://www.mail-archive.com/bug-lilypond@gnu.org/msg42634.html

Sorry to be of not more help,
  Harm

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


Re: output one bar at a time (midi and png)

2019-01-19 Thread Thomas Morley
Am Sa., 19. Jan. 2019 um 13:05 Uhr schrieb Ted Walther :
>
> I'm just getting back into lilypond after a ten year absence.  Can you 
> suggest some search terms?

Simply looking for video gives several hits:
https://lists.gnu.org/archive/cgi-bin/namazu.cgi?query=video=Search=lilypond-user

Cheers,
  Harm

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


Re: Ligatures, lyrics, and other arcana

2019-01-19 Thread Thomas Morley
Am Sa., 19. Jan. 2019 um 02:40 Uhr schrieb Mark Probert :
>
> Hi, again.
>
> I'm getting out of my depth here but is it possible
> to set lyrics to mensural ligatures? I can't seem to
> get the following to work.

You define
verba = \lyricmode { 4 2 4  4 2  4 4 }
i.e. naked durations in lyricmode.
This comes out as note-events, see:
\void \displayMusic \verba

Put in the text you wish.


> Also, following the example [1] I don't seem to be
> able to get the ligature-flexa to work (2.19.82/OSX).
> I've tried quite a few flexa-widths but nothing seems
> to work...
>
> TIA  .. mark.
>
> [1]
> http://lilypond.org/doc/v2.18/Documentation/notation/typesetting-mensural-music#white-mensural-ligatures
>
> ---
> chant = \relative c { \clef bass
> \set Score.timing = ##f
> \set Score.defaultBarType = "-"
>
> \[ c\maxima b\longa a\maxima \]
> \[ c\maxima
>\override NoteHead.ligature-flexa = ##t
>\once \override NoteHead.flexa-width = #10
>f,\longa \]
> \[ c'\maxima a\maxima \]
> }
> verba = \lyricmode { 4 2 4  4 2  4 4 }
>
> \score {
>   \new Staff <<
> \new Voice  = "melody" \chant
> \new Lyrics = "one"   \lyricsto melody \verba
>   >>
>   \layout {
> \context { \Staff
>\remove "Time_signature_engraver"
>\override NoteHead.style = #'baroque
> }
> \context { \Voice
> \remove "Ligature_bracket_engraver"
> \consists "Mensural_ligature_engraver"
> }
>   }
> }
> ---

In mensural-ligature-engraver.cc there's the comment about "ligature-flexa"
  /*
flexa requested, check whether allowed:
- there should be a previous note
- both of the notes must be of brevis shape
  (i.e. can't be maxima or flexa;
  longa is forbidden as well - it's nonexistent anyway)
- no compulsory flexa for the next note,
  i.e. it's not an ultimate descending breve
  */

Strictly following it, the second one below shouldn't be possible:

chant = \relative c {
  \clef bass
  \set Score.timing = ##f
  \set Score.defaultBarType = "-"

  \[ c\breve
 \override NoteHead.ligature-flexa = ##t
 \once \override NoteHead.flexa-width = #30
 \once \override NoteHead.color = #red
 f,\breve \]
  \[ c'\longa
 \override NoteHead.ligature-flexa = ##t
 \once \override NoteHead.flexa-width = #30
 \once \override NoteHead.color = #red
 f,\breve \]
}

\score {
  \new Voice  = "melody" \chant
  \layout {
\context { \Staff
   \remove "Time_signature_engraver"
   \override NoteHead.style = #'baroque
}
\context { \Voice
\remove "Ligature_bracket_engraver"
\consists "Mensural_ligature_engraver"
}
  }
}

But I'm running out of my depth for both, ancient music (what may
occur and what not) and cc-knowledge.

Maybe others may be of more help.



Cheers,
  Harm

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


Re: output one bar at a time (midi and png)

2019-01-19 Thread Thomas Morley
Am Sa., 19. Jan. 2019 um 08:53 Uhr schrieb Ted Walther :
>
> Beautiful, thank you.  Is there a way to make the MIDI output go to a 
> separate file for each page of output?
>
> On Fri, 18 Jan 2019 at 10:16, Valentin Villenave  
> wrote:
>>
>> On 1/18/19, Ted Walther  wrote:
>> > Is there some simple way I can have lilypond put each bar (and its
>> > corresponding midi) into separate files?  Then I can use standard software
>> > to join them together.
>>
>> You could do that… or LilyPond can do it for you:
>> http://lilypond.org/doc/v2.19/Documentation/notation/page-breaking#one_002dline-page-breaking
>>
>> Cheers,
>> V.

Hi Ted,

there was already some work put up to create videos with lilypond.
Search the archives for it.
No need to reinvent the wheel. ;)

Cheers,
  Harm

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


Re: Maxima...

2019-01-19 Thread Thomas Morley
Hi Mark,

Am Sa., 19. Jan. 2019 um 02:32 Uhr schrieb Mark Probert :

> However, being a newbie to this package, when I
> have a problem, or a perceived problem, I can either ask
> on this forum or not.

Nothing wrong with asking on this list.
Pretty often some weaknesses or eaven bugs become known in the code or
documentation this way.

> My post is about a non-intuitive
> feature--Why the rest and not the note?--that is not clearly
> documented ("If you need a maxima/large use Baroque note heads,
> there is no maxima notes in the standard set").

Well, it _is_ documented, imho
http://lilypond.org/doc/v2.19/Documentation/notation/writing-rhythms
starts with
"The durations of notes are entered using numbers and dots. The number
entered is based on the reciprocal value of the length of the note.
For example, a quarter note is designated using the numerical value of
4 as it is a 1/4 note, a half note using 2, an eighth using 8 and so
on. Durations as short as 128 notes can be entered but shorter values,
while possible, can only be entered as beamed notes. [1] Also see
Beams.

For notes longer than a whole use the \longa – double breve – and
\breve commands. A note with the duration of a quadruple breve is
possible using the \maxima command but is only supported within
ancient music notation. See Ancient notation. "

Isn't it sufficient for _usage_?

If reasons for decisions would be discussed/explained the docs would
blow up more and more.

In short, maxima-notes don't happen in _modern_ notation, thus no need
to implement a glyph for it. But Rest or MultiMesureRest may occur in
arbitrary length. In modern notation they are printed assembling
shorter glyphs or as a beam-like line with MultiMeasureRestNumber:
{
  \compressFullBarRests
  R1*7
  R1*16
  %% other input, same outcome
  R\maxima *2
}

So I'm fine with the design-decision.

Otoh, I would have expected
http://lilypond.org/doc/v2.19/Documentation/notation/note-head-styles
would show a maxima where available and a remark (or something
similar) where not.
I'll think about how to improve this...


Cheers,
  Harm

[1]
This is not exactly true for current versions. See:
http://lists.gnu.org/archive/html/lilypond-user/2018-02/msg00640.html

For future versions there will be shorter values than 128 available.
https://sourceforge.net/p/testlilyissues/issues/5277/

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


Re: Appoggiatura before barline

2019-01-18 Thread Thomas Morley
Am Sa., 19. Jan. 2019 um 02:03 Uhr schrieb Andrew Bernard
:
>
> Hi Harm,
>
> I have been using this heavily thanks to David K for a very long time. 
> Although it may be a cheat, it works just fine. I see no drawbacks. What is 
> the downside here?

Hi Andrew,

Spacing is a little off. The R1 is not really centered:

  {
R1
\appoggiatura { \bar "" d''8 \bar "|" } c''4 r2.
  }
That's what I remember directly, not sure whether there is more.


Cheers,
  Harm

>
> Andrew
>
>
> On Sat, 19 Jan 2019 at 07:15, Thomas Morley  wrote:
>>
>>
>> you could try to use David K's cheat:
>>
>> {
>>   R1
>>   %% default
>>   \appoggiatura d''8 c''4 r2.
>>   %% cheated
>>   \appoggiatura { \bar "" d''8 \bar "|" } c''4 r2.
>> }
>>
>> It has it's own drawbacks, though.
>>
> ___
> 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: How to define some context statements

2019-01-18 Thread Thomas Morley
Am Fr., 18. Jan. 2019 um 11:01 Uhr schrieb Werner Arnhold
:
>
> Dear list,
>
> I often need to have Midi output with different volume or instruments in
> some voices. Here an example:
>
> \version "2.18.2"
>
> global = {
>   \key c \major
>   \time 4/4
> }
>
> soprannoten = \relative c'' {
>   g e e2 f4 d d2
> }
>
> altnoten = \relative c'' {
>   c2 g g2 b4 f
> }
>
> \score {
>   \new ChoirStaff <<
> \new Staff <<
>   \set Staff.instrumentName = #"Sopran"
>   \new Voice = "sopran" <<
> \set midiInstrument = #"flute"
> \global
> \soprannoten
>   >>
> >>
> \new Staff <<
>   \set Staff.instrumentName = #"Alt"
>   \new Voice = "alt" <<
> \set midiInstrument = #"violin"
> \global
> \altnoten
>   >>
> >>
>   >>
>   \layout{}
>   \midi{
> \tempo 4 = 80
>   \context {
> \Staff
> \remove "Staff_performer"
>   }
>   \context {
> \Voice
> \consists "Staff_performer"
>   }
>   }
> }
>
> This works fine. Now I tried to separate the "\context" parts in the
> midi section like
>
> verschiedene_stimmen = {
>   \context \Staff \remove "Staff_performer"
>   \context \Voice \consists "Staff_performer"
> }
>
> score {
> .
> .
> .
>   \midi{
> \verschiedene_stimmen
>   }
> }
>
> Lilypond complains about unvalid escape sequence "\Staff" at the Place
> of the definition, unexpected "\remove" and so on. That happens even if
> I do not call the defined macro in the midi section.
>
> What will be the reason and how can I make it better. I intend to
> collect such often used constructs in a separate file.
>
> Thanks in advance!
>
> Werner

Hi Werner,

looking at your example, there is no need to move "Staff_performer" at all.
Just set midiInstrument in Staff, You could do so with \set Staff.midiInstrument
But this is done better in \with { ... }, otherwise it may happen you
meet issue 34 in some cases. Same for instrumentName.

Only if you have more than one Voice per Staff moving
"Staff_performer" would make sense.

To store the settings in a callable variable you could do:

\version "2.18.2"

soprannoten = \relative c'' {
  g e e2 f4 d d2
}

altnoten = \relative c'' {
  c2 g g2 b4 f
}

verschiedene_stimmen_midi = \midi {
  \context { \Staff \remove "Staff_performer" }
  \context { \Voice \consists "Staff_performer" }
}

\score {
  \new ChoirStaff <<
\new Staff <<
  \new Voice = "sopran" \with { midiInstrument = #"flute" }
{ \voiceOne \soprannoten }
  \new Voice = "alt" \with { midiInstrument = #"violin" }
{ \voiceTwo \altnoten }
>>
  >>
  \layout{}
  \midi {
\verschiedene_stimmen_midi
%% needs to be called after 'verschiedene_stimmen_midi'
\tempo 4 = 80
  }
}

HTH,
  Harm

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


Re: Appoggiatura before barline

2019-01-18 Thread Thomas Morley
Am Fr., 18. Jan. 2019 um 19:14 Uhr schrieb Urs Liska :
>
> Is there any convenient and semantically acceptable way of engraving an
> appoggiatura (or other grace notes) *before* the barline? I know that
> usually one is pointed to \afterGrace to achieve something like that but
> that seems semantically problematic. I produced the attached image using
> a bunch of extra-offset overrides and a drastic \shape - which is
> inconvenient.
>
> Thanks for any ideas.
> Urs

Hi Urs,

you could try to use David K's cheat:

{
  R1
  %% default
  \appoggiatura d''8 c''4 r2.
  %% cheated
  \appoggiatura { \bar "" d''8 \bar "|" } c''4 r2.
}

It has it's own drawbacks, though.


Cheers,
  Harm

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


Re: Scheme function returning \book

2019-01-15 Thread Thomas Morley
Am Mi., 16. Jan. 2019 um 00:14 Uhr schrieb David Kastrup :
>
> Lukas-Fabian Moser  writes:
>
> > Hi David,
> >> \test apparently expects a string argument.
> >
> > Aaargh, sorry, stupid me, and stupid copy'n'paste error. So, another try:
> >
> > \version "2.19.82"
> >
> > test = #(define-scheme-function (suffix) (string?)  #{
> >   \book {
> > \bookOutputSuffix #suffix
> > \score {
> >   d4
> > }
> >   }
> > #} )
> >
> > \test "surname"
> >
> > (still) causes a "Bad expression type" error.
>
> Ah, well.  Turns out that copying the code for \xxx here where \xxx was
> a book identifier was not really a good idea before anybody figures out
> and defines the difference between a book and a bookpart.  Currently it
> is not viable to distinguish them.
>
> \book { \test "surname" }
>
> could conceivably just close its eyes and say "ok, let's treat it as a
> book rather than a bookpart" but doesn't.  Does anybody have an idea
> what is supposed to distinguish a book from a bookpart outside of actual
>
> \book {
>   \bookpart { ... } }
>
> usage?

For layout vs paper we have is-layout vs is-paper.
Couldn't we set some variable/property like is-book/is-bookpart for
book vs bookpart
?

Cheers,
  Harm

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


Re: Ambitus per voice and Ez_numbers_engraver

2019-01-13 Thread Thomas Morley
Well, I'm still confused what you're after...

Am So., 13. Jan. 2019 um 13:43 Uhr schrieb Gloops :

> Hello Harm!
> Sorry, I did not express myself well!
> I want to go through "Ez_numbers_engraver_harm"
> to convert NoteHead to a number and display AmbitusNoteHead directly.
> I do not want (if possible) to go through "brew-ez-stencil" ...
> Gilles
>
> 
>
> 

>From the images, something like below?

#(define-public (note-head::brew-ez-no-head-stencil grob)
  (let* ((pitch (ly:event-property (event-cause grob) 'pitch))
 (pitch-index (ly:pitch-notename pitch))
 (note-names (ly:grob-property grob 'note-names))
 (pitch-string (if (and (vector? note-names)
(> (vector-length note-names) pitch-index))
   (vector-ref note-names pitch-index)
   (string
(integer->char
 (+ (modulo (+ pitch-index 2) 7)
(char->integer #\A))
 (staff-space (ly:staff-symbol-staff-space grob))
 (line-thickness (ly:staff-symbol-line-thickness grob))
 (font-size (ly:grob-property grob 'font-size 0))
 (radius (* (magstep font-size) (/ (+ staff-space line-thickness) 2)))
 (letter
   (make-fontsize-markup
 font-size
 (make-center-align-markup (make-vcenter-markup pitch-string)

(ly:stencil-translate-axis
 (grob-interpret-markup grob letter)
 radius
 X)))


#(define Ez_numbers_engraver_harm
   (make-engraver
(acknowledgers
 ((note-head-interface engraver grob source-engraver)
  (let* ((context (ly:translator-context engraver))
 (tonic-pitch (ly:context-property context 'tonic))
 (tonic-name (ly:pitch-notename tonic-pitch)))
(if (grob::has-interface grob 'ambitus-interface)
(let* ((details (ly:grob-property grob 'details))
   (ez-numbers (assoc-get 'ez-numbers details #f)))
  (if ez-numbers
  (ly:grob-set-property! grob 'after-line-breaking
(lambda (grob)
  (let* ((grob-pitch
  (ly:event-property (event-cause grob) 'pitch))
 (grob-name (ly:pitch-notename grob-pitch))
 (delta (modulo (- grob-name tonic-name) 7))
 (note-names
  (make-vector 7 (number->string (1+ delta
 (stencil-proc
   (assoc-get
 'stencil-proc
 details
 ;; fall-back:
 note-head::brew-ez-stencil)))
(ly:grob-set-property! grob 'note-names note-names)
(ly:grob-set-property! grob 'font-family 'sans)
(ly:grob-set-property! grob 'font-series 'bold)
(ly:grob-set-property! grob 'stencil
  (if (procedure? stencil-proc)
  (stencil-proc grob)
  point-stencil)))

(let* ((grob-pitch
(ly:event-property (event-cause grob) 'pitch))
   (grob-name (ly:pitch-notename grob-pitch))
   (delta (modulo (- grob-name tonic-name) 7))
   (note-names
(make-vector 7 (number->string (1+ delta)
  (ly:grob-set-property! grob 'note-names note-names

easyAmbitusHeadsOn = \override AmbitusNoteHead.details.ez-numbers = ##t

\score {
  \new Staff <<
\new Voice \with {

} \relative c'' {
\key f \major
  \override Ambitus.X-offset = #2.0
  \voiceOne
  \easyHeadsOn
  c4 a d e
  f2
}
\new Voice \with {

} \relative c' {
  \voiceTwo
  \easyHeadsOn
  es4 f g  as
  b1
}
  >>
  \layout {
ragged-right = ##t
\context {
  \Voice
  \consists \Ez_numbers_engraver_harm
  \consists "Ambitus_engraver"
%% Choose the font-size
  \override AmbitusNoteHead.font-size = -3
%% Choose the procedure to create the "ez-stencil"
%% Possible is currently:
%% note-head::brew-ez-no-head-stencil
%% or
%% note-head::brew-ez-stencil
%% Which is the fall-back as well (if details.stencil-proc is unset/commented)
%% An unsuitable setting here will result in point-stencil
  \override AmbitusNoteHead.details.stencil-proc =
#note-head::brew-ez-no-head-stencil
  \easyAmbitusHeadsOn
}
  }
}

HTH,
  Harm

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


Re: Problem with german umlauts and with mapping text to notes

2019-01-13 Thread Thomas Morley
Am So., 13. Jan. 2019 um 17:48 Uhr schrieb Klaus Ethgen
:
>
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA512
>
> Hi Thomas,
>
> Am So den 13. Jan 2019 um 16:10 schrieb Thomas Morley:
> > Please enter in terminal:
> > lilypond scheme-sandbox
> >
> > A guile-prompt will open, then do there:
> > (version)
> >
> > Please post what you get.
>
> > lilypond scheme-sandbox
>
>GNU LilyPond 2.19.80
>»/usr/share/lilypond/2.19.80/ly/scheme-sandbox.ly« wird verarbeitet
>Analysieren...
>GNU Guile 2.0.14
>Copyright (C) 1995-2016 Free Software Foundation, Inc.
>
>Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
>This program is free software, and you are welcome to redistribute it
>under certain conditions; type `,show c' for details.
>
>Enter `,help' for help.
>scheme@(#{ g1033}#)> (version)
>$1 = "2.0.14"
>scheme@(#{ g1033}#)>
>
> > I have a certain suspect...
>
> ... Hope that helps.


Well, it helps me to analyse the problem:
LilyPond 2.19.80 is in _no_ regard prepared to work with guile
versions higher than guile-1.8.8

Best you can do is to install LilyPond from our precompiled installer.

OTOH, it _is_ possible to compile LilyPond with guilev2, but you'll
experience a heavy slow down and probably undected bugs.
Don't rely on such a compilation for serious work.
Any help for the guilev2 migration is highly welcome, though!
If you consider doing so, I could demonstrate how to get started.

Cheers,
  Harm

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


Re: Problem with german umlauts and with mapping text to notes

2019-01-13 Thread Thomas Morley
Sending this again, because google or firefox or whatever buggy
program messed up the mail-adress

Am So., 13. Jan. 2019 um 16:10 Uhr schrieb Thomas Morley
:
>
> Am So., 13. Jan. 2019 um 15:41 Uhr schrieb Klaus Ethgen

see:

> :
> >
> > -BEGIN PGP SIGNED MESSAGE-
> > Hash: SHA512
> >
> > Hi Lukas,
> >
> > Am So den 13. Jan 2019 um 15:01 schrieb Lukas-Fabian Moser:
> > [Charset problem]
> > > This is strange, because I can't reproduce the problem here. On my (Linux
> > > Mint) machine, the German umlauts are displayed fine without any change in
> > > your document.
> >
> > Hmm.. I just installed it on Gentoo linux and the posts before suggests
> > something about missing fonts.
> >
>
> Please enter in terminal:
> lilypond scheme-sandbox
>
> A guile-prompt will open, then do there:
> (version)
>
> Please post what you get.
>
> I have a certain suspect...
>
> Cheers,
>   Harm

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


Re: Problem with german umlauts and with mapping text to notes

2019-01-13 Thread Thomas Morley
Am So., 13. Jan. 2019 um 15:41 Uhr schrieb Klaus Ethgen
:
>
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA512
>
> Hi Lukas,
>
> Am So den 13. Jan 2019 um 15:01 schrieb Lukas-Fabian Moser:
> [Charset problem]
> > This is strange, because I can't reproduce the problem here. On my (Linux
> > Mint) machine, the German umlauts are displayed fine without any change in
> > your document.
>
> Hmm.. I just installed it on Gentoo linux and the posts before suggests
> something about missing fonts.
>

Please enter in terminal:
lilypond scheme-sandbox

A guile-prompt will open, then do there:
(version)

Please post what you get.

I have a certain suspect...

Cheers,
  Harm

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


Re: Altering page numbers

2019-01-12 Thread Thomas Morley
Am Sa., 12. Jan. 2019 um 20:44 Uhr schrieb Kieren MacMillan
:
>
> Hi Harm,
>
> > You could go for:
> >
> > #(define-markup-command (bookpart-page-number layout props) ()
> >(let ((first-page-number (ly:output-def-lookup layout 
> > 'first-page-number))
> >  (page-number (chain-assoc-get 'page:page-number props 0)))
> >  (interpret-markup layout props
> >(number-format
> >  (ly:output-def-lookup layout 'page-number-type)
> >  (1+ (- page-number first-page-number))
>
> Thanks! I’ll study your solution as part of my Scheme education.  =)

Not much scheme here...
You need to know LilyPond's 'number-format'-procedure exists at all.
And how to get 'page-number-type, but that's a minor problem (some as
for 'first-page-number).

>
> > Though, what about the table-of-content?
> > Right now I've not a good idea what should be printed if several
> > bookparts have equal page-numbers.
>
> That’s almost more of an editorial choice than a technical one, no? If for 
> some reason I want the score for my Opera In Three Acts to have per-act page 
> numbers, then I will end up with a TOC that looks something like
>
>   Act One
> Aria 1  I-1
> Aria 2  I-22
>
> Act Two
>Aria 3  II-1
>Aria 4  II-9
>
> etc.
>
> The Dover reprints of Bach works often include per-sub-collection numbering 
> alongside the main page numbering, e.g.
>
> 1 [1], 2 [2], … 25 [25], 26 [1], 27 [2], … 124 [99], 125 [1], 126 [2], …
>
> In musical theatre scores, it’s also useful to have double numbering (e.g.,
> page-number-within-entire-score [page-number-within-this-song]

Well, I'll think about the problem...

Thanks,
  Harm

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


Re: Altering page numbers

2019-01-12 Thread Thomas Morley
Am Sa., 12. Jan. 2019 um 19:37 Uhr schrieb Kieren MacMillan
:

> %%%  SNIPPET BEGINS
> \version "2.19.80"
>
> #(define-markup-command (bookpart-page-number layout props) ()
> (let ((first-page-number (ly:output-def-lookup layout 'first-page-number))
>   (page-number (chain-assoc-get 'page:page-number props 0)))
>   (interpret-markup layout props (format "~a" (1+ (- page-number
> first-page-number))
[...]

> Evidently, the choice of page number formatting (e.g., roman) doesn’t work, 
> because the bookpart-page-number function assumes/hardcodes the format…

You could go for:

#(define-markup-command (bookpart-page-number layout props) ()
(let ((first-page-number (ly:output-def-lookup layout 'first-page-number))
  (page-number (chain-assoc-get 'page:page-number props 0)))
  (interpret-markup layout props
(number-format
  (ly:output-def-lookup layout 'page-number-type)
  (1+ (- page-number first-page-number))

> but otherwise, I prefer this solution, as it is (to my eye) a more natural 
> way of coding book parts [with individual numbering].

Agreed

>
> I’m going to take the challenge to up my Scheme-fu, by trying to tackle the 
> improvement of the bookpart-page-number function to handle different 
> formatting as giving in \paper variables.
>
> Related: Lily’s entire page-numbering system needs a re-look, so that 
> multi-part, multi-format, maybe-number-reset-but-maybe-not documents can be 
> handled elegantly and with minimal user coding (such as additional functions 
> like yours and mine).

Though, what about the table-of-content?
Right now I've not a good idea what should be printed if several
bookparts have equal page-numbers.

Cheers,
  Harm

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


Re: Ambitus per voice and Ez_numbers_engraver

2019-01-12 Thread Thomas Morley
Am Fr., 11. Jan. 2019 um 10:04 Uhr schrieb Gloops :
>
> Hello Harm
> Thank you for this correction ...
> Is there any way to engrave the ambitus directly without going through
> "note-head :: brew-ez-stencil" in order to avoid the head of the note?
> Gilles

Not sure what you mean.
Probably, set details.ez-numbers #f or easier comment \easyAmbitusHeadsOn
Then Ambitus_engraver is not affected by Ez_numbers_engraver_harm

Cheers,
  Harm

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


Re: Ambitus per voice and Ez_numbers_engraver

2019-01-10 Thread Thomas Morley
Am Mi., 9. Jan. 2019 um 23:38 Uhr schrieb Gloops :
>
> Thank you very much Harm, it works very well now!!!
> Musically
> Gilles

Hi Gilles,

glad you like it.
Though, here one improvement: Settings for 'font-series and
'font-family need to be done _before_ 'stencil. I.e.:

#(define Ez_numbers_engraver_harm
   (make-engraver
(acknowledgers
 ((note-head-interface engraver grob source-engraver)
  (let* ((context (ly:translator-context engraver))
 (tonic-pitch (ly:context-property context 'tonic))
 (tonic-name (ly:pitch-notename tonic-pitch)))
(if (grob::has-interface grob 'ambitus-interface)
(let* ((details (ly:grob-property grob 'details))
   (ez-numbers (assoc-get 'ez-numbers details #f)))
  (if ez-numbers
  (ly:grob-set-property! grob 'after-line-breaking
(lambda (grob)
  (let* ((grob-pitch
  (ly:event-property (event-cause grob) 'pitch))
 (grob-name (ly:pitch-notename grob-pitch))
 (delta (modulo (- grob-name tonic-name) 7))
 (note-names
  (make-vector 7 (number->string (1+ delta)
(ly:grob-set-property! grob 'note-names note-names)
(ly:grob-set-property! grob 'font-family 'sans)
(ly:grob-set-property! grob 'font-series 'bold)
(ly:grob-set-property! grob 'stencil
  (note-head::brew-ez-stencil grob)))

(let* ((grob-pitch
(ly:event-property (event-cause grob) 'pitch))
   (grob-name (ly:pitch-notename grob-pitch))
   (delta (modulo (- grob-name tonic-name) 7))
   (note-names
(make-vector 7 (number->string (1+ delta)
  (ly:grob-set-property! grob 'note-names note-names



Cheers,
  Harm

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


Re: Make dynamic script with long text

2019-01-10 Thread Thomas Morley
Am Do., 10. Jan. 2019 um 15:56 Uhr schrieb Andrew Bernard
:
>
> Hmm. Adding extra-spacing-width seems to work.
>
> ppecrescText = \markup {
>   \normal-text \italic "pp e cresc ..."
> }
> ppecresc = \tweak DynamicText.self-alignment-X #LEFT
> \tweak DynamicText.extra-spacing-width #'(0 . -20)
> #(make-dynamic-script ppecrescText)
>
>
> This idea came from a post from 2017.
>
> https://lists.gnu.org/archive/html/lilypond-user/2017-08/msg00097.html
>
> What's really going on here?
>
>
> Andrew

The general default for DynamicText.extra-spacing-width is '(+inf.0 .
-inf.0), see IR
But in StaffGroup and GrandStaff it is set #f, see IR and/or engraver-init.ly

For the reason:
https://sourceforge.net/p/testlilyissues/issues/621/


So why not reenable thegeneral default? Makes for:

ppecresc = \tweak DynamicText.self-alignment-X #LEFT
\tweak DynamicText.extra-spacing-width #'(+inf.0 . -inf.0)
#(make-dynamic-script ppecrescText)


Cheers,
  Harm

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


Re: Merge_rests_Engraver and dotted rests

2019-01-09 Thread Thomas Morley
Am Mi., 9. Jan. 2019 um 14:28 Uhr schrieb Malte Meyn :
>
>
>
> Am 09.01.19 um 13:39 schrieb Michael Gerdau:
> > Hi list,
> >
> > when merging dotted rests the Merge_rests_Engraver does keep 2 dots. Is 
> > this intentional (and why?) or a bug?
>
> It’s a bug. According to
> https://sourceforge.net/p/testlilyissues/issues/5179/ the second dot
> should be killed.

Fixed with
commit 0d0f3d641939843316bd199ef62de261ce89335f
Author: Thomas Morley 
Date:   Tue Aug 29 10:44:28 2017 +0200

Issue 5179 Let Merge_rests_engraver deal with dotted rests

Compare simple rests by their duration-length, duration-log does
not take possible dots into account.
Superfluous dots are killed with ly:grob-suicide!
Extend reg-test

Available with 2.20.


> But that’s not the only problem with this engraver and dots: Sometimes,
> dots are placed randomly, see
> https://sourceforge.net/p/testlilyissues/issues/5217/

Has nothing to do with the Merge_rests_engraver!
See
https://sourceforge.net/p/testlilyissues/issues/5217/#125c

Cheers,
  Harm

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


Re: Ambitus per voice and Ez_numbers_engraver

2019-01-08 Thread Thomas Morley
Am Di., 8. Jan. 2019 um 14:51 Uhr schrieb Gloops :
>
> Hello!
> Ambitus by voice and Ez_numbers_engraver can not work together?

The problem: Ez_numbers_engraver works on every grob with a
note-head-interface. NoteHeads and AmbitusNoteHead both have this.
Though, at the time this engraver works the pitch of AmbitusNoteHead
is not yet known, thus an error occurs if one tries to rely on this
pitch.

Suggestion:
Do settings for AmbitusNoteHead after-line-breaking, switched on by
the (new introduced) details.ez-numbers-property and let the other
code do as before.

There's wide room for improvements, ofcourse. Nevertheless here the code:

\version "2.19.82"

#(define Ez_numbers_engraver_harm
   (make-engraver
(acknowledgers
 ((note-head-interface engraver grob source-engraver)
  (let* ((context (ly:translator-context engraver))
 (tonic-pitch (ly:context-property context 'tonic))
 (tonic-name (ly:pitch-notename tonic-pitch)))
(if (grob::has-interface grob 'ambitus-interface)
(let* ((details (ly:grob-property grob 'details))
   (ez-numbers (assoc-get 'ez-numbers details #f)))
  (if ez-numbers
  (ly:grob-set-property! grob 'after-line-breaking
(lambda (grob)
  (let* ((grob-pitch
  (ly:event-property (event-cause grob) 'pitch))
 (grob-name (ly:pitch-notename grob-pitch))
 (delta (modulo (- grob-name tonic-name) 7))
 (note-names
  (make-vector 7 (number->string (1+ delta)
(ly:grob-set-property! grob 'note-names note-names)
(ly:grob-set-property! grob 'stencil
  (note-head::brew-ez-stencil grob))
(ly:grob-set-property! grob 'font-family 'sans)
(ly:grob-set-property! grob 'font-series 'bold))

(let* ((grob-pitch
(ly:event-property (event-cause grob) 'pitch))
   (grob-name (ly:pitch-notename grob-pitch))
   (delta (modulo (- grob-name tonic-name) 7))
   (note-names
(make-vector 7 (number->string (1+ delta)
  (ly:grob-set-property! grob 'note-names note-names

easyAmbitusHeadsOn = \override AmbitusNoteHead.details.ez-numbers = ##t


\layout {
  ragged-right = ##t
  \context {
\Voice
\consists \Ez_numbers_engraver_harm
\consists "Ambitus_engraver"
\easyAmbitusHeadsOn
  }
}

\new Staff <<
  \new Voice \with {

  } \relative c'' {
  \key f \major
\override Ambitus.X-offset = #2.0
\voiceOne
\easyHeadsOn
c4 a d e
f2
  }
  \new Voice \with {

  } \relative c' {
\voiceTwo
\easyHeadsOn
es4 f g  as
b1
  }
>>

HTH,
  Harm

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


Re: <>

2019-01-04 Thread Thomas Morley
Am Fr., 4. Jan. 2019 um 13:07 Uhr schrieb Gianmaria Lari
:
>
>
>
> On Fri, 4 Jan 2019 at 11:56, Thomas Morley  wrote:
>>
>> Am Fr., 4. Jan. 2019 um 11:17 Uhr schrieb Gianmaria Lari
>> :
>> >
>> > My apologies, I didn't specify the fact that it is 3/4 time.
>> >
>> > Thomas solution is graphically perfect
>>
>> Well, my suggestion meets the image. Actually, the composers notation
>> is simply wrong, strictly speaking.
>> I've seen it many times, though.
>
>
> Yes it's wrong but I think it is used because it better complies with the 
> need to be easy to write it and to be less "dense" (and then someway easier 
> to read) than traditional/correct way. Maybe the composer could add a small 
> footnote but in my (not expert) opinion it is a very good solution. For 
> example I found ugly and "difficult" to read the bass part of the BWV846 (c 
> major prelude).

Disagreed.

>
>>
>>
>> > but I have to manage the midi output "manually ".
>>
>> I don't care much about midi, why do you do? It's never music.
>
>
> For didactical reason. And for that, it is pretty important.
>
>> [...]For the record, one could do:
>>
>> \layout { \context { \Voice \remove Slur_engraver } }
>>
>> \new Staff \with { \consists Slur_engraver }
>> {
>>   \key aes \major
>>   \clef bass
>>   \time 3/4
>>   <<
>>   aes,2.\=7( \\ { s4 ees2 } \\ s2. \\ { s2 bes4\=7) }
>>   >>
>> }
>>
>> This has serious drawbacks, you'll not happy using it...
>
>
> What's the equal sign? never saw before.

http://lilypond.org/doc/v2.19/Documentation/notation/expressive-marks-as-curves#slurs

>
> What's about this?
>
> \version "2.19.82"
> \score {
>
> {
> \time 3/4 \clef bass \key aes \major
>  << {\hideNotes aes,2.} \\ {\hideNotes s4 ees2} \\ {\hideNotes s2 bes4} \\ 
> {aes,2.*1/3( ees2*1/2 bes4) }>> }
> \layout {}
> \midi {}
> }

A dot is missing.
That's because the two dots are of the two aes2. are joined into one
single dot. Which is hidden by \hideNotes.

Cheers,
  Harm

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


Re: Emboldening articulations

2019-01-04 Thread Thomas Morley
Am Fr., 4. Jan. 2019 um 11:56 Uhr schrieb Andrew Bernard
:
>
> I think I have asked this before in the past, but I don't recall any answers. 
> I know that articulations come from the lilypond font but is there any way to 
> make them bolder, or more emphatic?
>
> There's an LSR for bold tenuto, but I often use ^-^> as a construct and I 
> want both signs bolder, and articulation scripts in general to be stronger in 
> appearance.
>
> Andrew

Hi Andrew,

iirc there's no bold emmentaler.
You could try:

{
\override Script.stencil =
#(lambda (grob)
  (ly:stencil-scale
(ly:script-interface::print grob)
2
2))
c'^-^>
}

Not sure how far it will let you go, though.


Cheers,
  Harm

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


Re: <>

2019-01-04 Thread Thomas Morley
Am Fr., 4. Jan. 2019 um 11:17 Uhr schrieb Gianmaria Lari
:
>
> My apologies, I didn't specify the fact that it is 3/4 time.
>
> Thomas solution is graphically perfect

Well, my suggestion meets the image. Actually, the composers notation
is simply wrong, strictly speaking.
I've seen it many times, though.

> but I have to manage the midi output "manually ".

I don't care much about midi, why do you do? It's never music.

>
> Budanov solution is ok for midi but graphically it's not perfect (slur 
> position is not ok). Here it is the budanov solution:
>
> \version "2.19.82"
> { \time 3/4 \clef bass \key aes \major
>  <<{aes,2.} \\ {s4 ees2} \\ {\hideNotes aes,4(\unHideNotes s4 bes4)}>> }
>
> I will try to fix them :)
> Thanks everybody.
> g.

For the record, one could do:

\layout { \context { \Voice \remove Slur_engraver } }

\new Staff \with { \consists Slur_engraver }
{
  \key aes \major
  \clef bass
  \time 3/4
  <<
  aes,2.\=7( \\ { s4 ees2 } \\ s2. \\ { s2 bes4\=7) }
  >>
}

This has serious drawbacks, you'll not happy using it...

Cheers,
  Harm

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


Re: <>

2019-01-04 Thread Thomas Morley
Am Fr., 4. Jan. 2019 um 10:20 Uhr schrieb Gianmaria Lari
:
>
> The attached image shows a measure of a accordion piece from Bogdan Precz.
>
> I tried to engrave it writing:
>
> <>
>
>
> and it looks fine except for the slur. How can I add the slur?
> Thank you, g.

I'd rather use one voice with scaled durations:

{
  \key aes \major
  \clef bass
   aes,2.*1/3(
   ees2*1/2
   bes4)
}

HTH,
  Harm

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


Re: Lessons to better understand key concepts in Lily Pond?

2019-01-04 Thread Thomas Morley
Am Fr., 4. Jan. 2019 um 01:20 Uhr schrieb Yakir Arbib :

> Would anyone here -- especially those of you who are composers and use
> Lily for contemporary music be willing to give me a few paid private
> lessons over Skype or What'sapp so that we can cover some of the
> features I need to get started with my work?  I predict 4-5 lessons
> should do the trick for an initial very good start for me to be able
> to kick off things by my own.

Hi,

usually this list is very helpful. Posting problems here will likely
return more and better help than any private lesson could do.

Speaking only for myself, I'm not a composer, so I may not be able to
help you in this regard.
And I'll never use Skype or WhatsApp for security concerns.

Though, we also have an IRC-channel. Although low traffic (as far as I
know) you may arrange with someone for a meeting there.
http://lilypond.org/doc/v2.14/Documentation/web/contact


Cheers,
  Harm

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


Re: Error: bad expression type

2019-01-03 Thread Thomas Morley
Am Do., 3. Jan. 2019 um 11:00 Uhr schrieb Vaughan McAlley
:
>
> On Thu, 3 Jan 2019 at 20:26, Andrew Bernard  wrote:
>>
>> Hi Christopher,
>>
>> I can't quite nut this one out, but you can't just have ##f sitting in the 
>> open between scores - it's a bad expression. You can't place in that 
>> location a variable referring to an expression that has a boolean as its 
>> evaluation.
>>
>> You can have markup between scores, so if you make this change it will work:
>>
>> titleFootnotes = \markup { \null }
>>
>
> Even
>
> titleFootnotes = {}
>
> works, which might be a little closer to “nothing” :-)
>
> Vaughan

Hi Christopher,

whenever you call something in a ly-file with \whatever, then this
needs to do one of three things (are there others?):
(1) initiate a markup
 Examples: \markup "whatever", a header finally leads to markup as well, etc
Thus Andrew's suggestion works, although spacing is affected
(2) initiate music
Examples: \new Staff \someMusic, etc
Thus Vaughan's suggestion outputting empty music works, although a
warning may be issued:
warning: no music found in score
(3) do something
Examples: \layout, \score, \paper or calling a void-function, etc

Calling a variable bound to #f at toplevel does nothing of the above listed.

You want to say "if #f do-nothing", actually you say "if #f do-#f"
A method would be to say "if #f do-unspecified". While 2.14 was more
tolerant, *unspecified* will be understood from recent versions.

So you could do:

theFootnotes = ##f
myOtherFootnotes = #*unspecified*

$(if theFootnotes theFootnotes) %% returns unspecified if theFootnotes is #f
\myOtherFootnotes

HTH,
  Harm

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


Re: Flat flared hairpins

2019-01-02 Thread Thomas Morley
Am Mi., 2. Jan. 2019 um 23:21 Uhr schrieb Thomas Morley
:

> \layout {
>   \override Hairpin.stencil = #flat-flared-hairpin
>   \override Hairpin.details.flare-height = 2 %% default is 1
>   \override Hairpin.details.flare-width = 2 %% default is 1
>   \override Hairpin.thickness = 2

Please comment/delete next two lines. I used them for debuggin.

>   \override Hairpin.stencil =
> #(lambda (grob) (box-stencil (flat-flared-hairpin grob) 0 0))
> }

Best,
  Harm

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


Re: Flat flared hairpins

2019-01-02 Thread Thomas Morley
Am Mi., 2. Jan. 2019 um 01:26 Uhr schrieb Andrew Bernard
:
>
> Hi Thomas,
>
> The correction works and all is good. Thanks so much.
>
> An interesting point I discovered. If you use \< for the hairpins, the LEFT, 
> RIGHT settings are correct. but if you use /< they are reversed - but still 
> work fine. A fascinating side effect of the code.

Well, it's coming from 'elbowed-hairpin'. There it's a feature, here
we have to fight against.
Below a code which drops 'elbowed-hairpin',

> [It did have me a bit confused for a while. And of course, in this usage, 
> there is no need for a distinction between \< and \<.]

The code will read whether cresc or decresc is used and place the
flares accordingly. Only in the case you want both flares, you need to
do
\override Hairpin.details.flare-position = #CENTER

Also, see Change-log, doc-string and exmples.

\version "2.19.82"

#(define flat-flared-hairpin
  (lambda (grob)
;; Change-log:
;; (1) Correct scaling of flare-height (for use with 'elbowed-hairpin')
;; (2) - Dropped usage of 'elbowed-hairpin', use 'make-connected-line' directly
;;   No scaling is needed any more
;; - Look at 'grow-direction to choose flares for start or end
;;   Only for getting both flares 'details.flare-position' must be set.

"Is supposed to take a maybe broken Hairpin.
Looking at 'grow-direction, a crescendo gets an opening flare at the end, a
decrescendo gets a closing flare at start.
If details.flare-position is set 0 or CENTER flares are printed at
start and end.
Otherwise a flat line is printed.
The behaviour is determined looking at some sub-properties of 'details:
  - details.flare-position: default is #f
  Remark: can't look at 'grow-direction, because setting it zero causes an
  assertion failure.
  - details.flare-height: height of the flare, numerical value
  default is 1
  TODO: replace with Hairpin.height?
  - details.flare-width: width of the flare, numerical value
  default is 1"
(let* ((orig (ly:grob-original grob))
   (broken-siblings (ly:spanner-broken-into orig))
   (siblings
 (if (pair? broken-siblings)
 broken-siblings
 (list grob)))
   (decresc? (eqv? (ly:grob-property grob 'grow-direction) LEFT))
   (details (ly:grob-property grob 'details))
   (flare-position
 (assoc-get 'flare-position details #f))
   (flare-height
 (assoc-get 'flare-height details 1))
   (flare-width
 (assoc-get 'flare-width details 1))
   (flare-left
 (lambda (g)
   (let* ((stil (ly:hairpin::print g))
  (stil-x-ext (ly:stencil-extent stil X))
  (x-start (car stil-x-ext))
  (stil-y-ext (ly:stencil-extent stil Y))
  (stil-x-length (interval-length stil-x-ext))
  (stil-y-length (interval-length stil-y-ext)))
 (if (and (or (eqv? flare-position 0) decresc?)
  (equal? g (car siblings)))
 (list
   (cons x-start flare-height)
   (cons (+ x-start flare-width) 0))
 (list (cons x-start 0))
   (flare-right
 (lambda (g)
   (let* ((stil (ly:hairpin::print g))
  (stil-x-ext (ly:stencil-extent stil X))
  (x-start (car stil-x-ext))
  (stil-y-ext (ly:stencil-extent stil Y))
  (stil-x-length (interval-length stil-x-ext))
  (stil-y-length (interval-length stil-y-ext)))
 (if (and (or (eqv? flare-position 0) (not decresc?))
  (equal? g (last siblings)))
 (list
   (cons (+ x-start (- stil-x-length flare-width)) 0)
   (cons (+ x-start stil-x-length) flare-height))
 (list (cons (+ x-start stil-x-length) 0))
   (points-list `(,@(flare-left grob) ,@(flare-right grob
  (ly:stencil-add
(make-connected-line points-list grob)
;; TODO:
;;   Overlapping stencils, a problem?
;;   Would it be less expensive to draw the missing lines separately?
(ly:stencil-scale (make-connected-line points-list grob) 1 -1)



%% EXAMPLES


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

mus = { c'1\> \break cis' \break d' dis'\! }

musII = { c'1\< cis' d' dis'\! }

musIII = { c'1\< \break cis' \break d'\! }

\layout {
  \override Hairpin.stencil = #flat-flared-hairpin
  \override Hairpin.details.flare-height = 2 %% default is 1
  \override Hairpin.details.flare-width = 2 %% default is 1
  \override Hairpin.thickness = 2
  \override Hairpin.stencil =
#(lambda (grob) (box-stencil (flat-flared-hairpin grob) 0 0))
}

{
  \set 

Re: Defining radius of circle that encircles text

2019-01-02 Thread Thomas Morley
Am Mi., 2. Jan. 2019 um 22:41 Uhr schrieb Sam Bivens :
>
> Happy New Year to everyone reading!
>
> Please see the attached MWE; how can I specify the radius of the circled
> text? Using `\circle 2` results in differently sized circles based on
> the circled text, but when I specify the radius with `\draw-circle`, I
> somehow can't manage to center the text inside the circle. This has to
> be a very simple fix that's right under my nose, but somehow nothing
> I've tried works.
>
> Or, perhaps there's another option that someone might share; that would
> work, as well.
>
> Thanks!
>
> Sam

Hi,

if you use \draw-circle, then the resulting cirlce will have extents
in X-axis: [-radius +radius], in Y-axis [-radius +radius]
Ensure the content which you want to put in the circle is centered as
well, i.e. use \vcenter \halign #CENTER

\markup { \combine \draw-circle #1.5 #.1 ##f \vcenter \halign #CENTER "2" }

HTH,
  Harm

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


Re: Custom tabulature for Shamisen

2019-01-01 Thread Thomas Morley
Am Di., 1. Jan. 2019 um 18:04 Uhr schrieb Christian Zollner
:
>
> Hello list!
>
> I need to write tabulatures for me and my girlfriend. I am playing
> violin and she is playing Shamisen. I am new to Lilypond but generally
> programming language affine, so I learned everything quickly up until now.
>
> The problem with Shamisen tabulatures is that it doesn't just count up
> from 1 - 12 for every octave but numbers the consecutive tones like
> this: [0,1,2,3,#,4,5,6,7,8,9,b,10,11,12,13,1#,14,15,16,17,18]. Is there
> a way to use this list instead of just counting up from 1 - n on a
> tabulature?
>
> Thank you for your help,
> Christian

Hi,

not sure I understand.
Like below?

\version "2.19.82"

\layout {
  \context {
\Score
tablatureFormat =
  #(lambda (context string-number fret-number)
(let* ((my-signs
'(0 1 2 3 "#" 4 5 6 7 8 9 "b" 10 11 12 13 "1#" 14 15 16 17 18))
   (ls-length (length my-signs))
   (my-sign
 (if (> fret-number (1- ls-length))
 fret-number
 (list-ref my-signs fret-number
 (if (integer? fret-number)
 (make-vcenter-markup
   (format #f "~a" my-sign ))
 (fret-number-tablature-format context string-number fret-number
  }
}

\new TabVoice
  \relative e' {
e f fis g gis a ais b c cis d dis e f fis g gis a ais b c cis
  }


Cheers,
  Harm

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


Re: Flat flared hairpins

2019-01-01 Thread Thomas Morley
Am Di., 1. Jan. 2019 um 04:05 Uhr schrieb Andrew Bernard
:
>
> Hi Harm,
>
> I am greatly in your debt. This is really excellent, and you have picked up 
> exactly what  I need. Using it, I have found that when having a hairpin that 
> crosses a line break (my main original question) the flare height is set 
> incorrectly. It's quite hard to see in your example, but it's there if you 
> look hard, and it's very apparent in my score. Is it possible to correct that?
>
> Andrew
>

Hi Andrew,

yep, I overlooked it.
Below should return correctly. Though, now 'flat-flared-hairpin'
delivers a list of scaled number-pairs, 'elbowed-hairpin' uses them
and does it's own scaling and finally all is nice, hopefully ...
Doing such scaling twice bugs me, probably one should drop
'elbowed-hairpin' and develop a different tool for your use-case.

Anyway here the current code:

#(define flat-flared-hairpin
  (lambda (grob)
;; change-log: correct scaling of flare-height
"Is supposed to take a maybe broken Hairpin.
Prints a flat line, probably with flares at start/end.
The behaviour is determined looking at some sub-properties of 'details:
  - details.flare-position: whether flares at start/end are printed
  possible values are -1, 0, -1 or LEFT, CENTER, RIGHT
  (default is 0 or CENTER, meaning flares at start and end)
  Remark: can't look at 'grow-direction, because setting it zero causes an
  assertion failure.
  - details.flare-height: height of the flare, numerical value
  default is 1
  TODO: replace with Hairpin.height?
  - details.flare-width: width of the flare, numerical value
  default is 1

  TODO: default 'elbowed-hairpin' takes the provided point-list as
percentages, leading to not constant width/height of the flares.
Below some calculations are done to warrant canstant width/height.
This means such calculations are done twice, here and in
'elbowed-hairpin'
Probably develop a different tool. "
(let* ((orig (ly:grob-original grob))
   (broken-siblings (ly:spanner-broken-into orig))
   (siblings
 (if (pair? broken-siblings)
 broken-siblings
 (list grob)))
   (details (ly:grob-property grob 'details))
   (flare-position
 (assoc-get 'flare-position details 0))
   (flare-height
 (assoc-get 'flare-height details 1))
   (flare-width
 (assoc-get 'flare-width details 1))
   (flare-left
 (lambda (g)
   (let* ((stil (ly:hairpin::print g))
  (stil-x-ext (ly:stencil-extent stil X))
  (stil-y-ext (ly:stencil-extent stil Y))
  (stil-x-length (interval-length stil-x-ext))
  (stil-y-length (interval-length stil-y-ext)))
 (if (and (or (zero? flare-position) (eqv? -1 flare-position))
  (equal? g (car siblings)))
 (list
   (cons 0 (/ (* 2 flare-height) stil-y-length))
   (cons (/ flare-width stil-x-length) 0))
 '((0 . 0))
   (flare-right
 (lambda (g)
   (let* ((stil (ly:hairpin::print g))
  (stil-x-ext (ly:stencil-extent stil X))
  (stil-y-ext (ly:stencil-extent stil Y))
  (stil-x-length (interval-length stil-x-ext))
  (stil-y-length (interval-length stil-y-ext)))
 (if (and (or (zero? flare-position) (eqv? 1 flare-position))
  (equal? g (last siblings)))
 (list
   (cons (- 1 (/ flare-width stil-x-length))  0)
   (cons 1 (/ (* 2 flare-height) stil-y-length)))
 '((1 . 0)))
  (elbowed-hairpin `(,@(flare-left grob) ,@(flare-right grob)) #t


Happy new year,
  Harm

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


Re: Flat flared hairpins

2018-12-31 Thread Thomas Morley
Am Mo., 31. Dez. 2018 um 06:01 Uhr schrieb Andrew Bernard
:
>
> Line break continuation code in lilypond has always been outside my grasp and 
> skill level.

Can you describe what exactly is the problem?
Maybe we can improve the Extending Manual.

Cheers,
  Harm

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


Re: Flat flared hairpins

2018-12-31 Thread Thomas Morley
Am Mo., 31. Dez. 2018 um 06:01 Uhr schrieb Andrew Bernard
:
>
> I need some special flat, flared ended hairpins to indicate pulsing in a 
> string quartet I am setting for a friend. So far, I managed to adapt a 
> textspanner to do the job. It's fiddly but OK. However, because I use a 
> custom graphic path markup for the spanner, the code does not deal with line 
> breaks. It's best to refer to the attached image to see what I mean. I'll put 
> my code here. Would anybody be willing to help out on this? Line break 
> continuation code in lilypond has always been outside my grasp and skill 
> level.
>
> Alternatively, if there is a more nice way to achieve this, I'd be really 
> grateful to hear it.
>
> Andrew

Hi Andrew,

here my attempt:

\version "2.19.82"

#(define flat-flared-hairpin
  (lambda (grob)
"Is supposed to take a maybe broken Hairpin.
Prints a flat line, probably with flares at start/end.
The behaviour is determined looking at some sub-properties of 'details:
  - details.flare-position: whether flares at start/end are printed
  possible values are -1, 0, -1 or LEFT, CENTER, RIGHT
  (default is 0 or CENTER, meaning flares at start and end)
  Remark: can't look at 'grow-direction, because setting it zero causes an
  assertion failure.
  - details.flare-height: height of the flare, numerical value
  default is 1
  TODO: replace with Hairpin.height?
  - details.flare-width: width of the flare, numerical value
  default is 1
  Remark: default 'elbowed-hairpin' takes the provided point-list as
  percentages, leading to not constant widths of the flares.
  Below some calculations are done to warrant canstant width"
(let* ((orig (ly:grob-original grob))
   (broken-siblings (ly:spanner-broken-into orig))
   (siblings
 (if (pair? broken-siblings)
 broken-siblings
 (list grob)))
   (details (ly:grob-property grob 'details))
   (flare-position
 (assoc-get 'flare-position details 0))
   (flare-height
 (assoc-get 'flare-height details 1))
   (flare-width
 (assoc-get 'flare-width details 1))
   (flare-left
 (lambda (g)
   (let* ((stil (ly:hairpin::print g))
  (stil-x-ext (ly:stencil-extent stil X))
  (stil-x-length (interval-length stil-x-ext)))
 (if (and (or (zero? flare-position) (eqv? -1 flare-position))
  (equal? g (car siblings)))
 (list
   (cons 0 flare-height)
   (cons (/ flare-width stil-x-length) 0))
 '((0 . 0))
   (flare-right
 (lambda (g)
   (let* ((stil (ly:hairpin::print g))
  (stil-x-ext (ly:stencil-extent stil X))
  (stil-x-length (interval-length stil-x-ext)))
 (if (and (or (zero? flare-position) (eqv? 1 flare-position))
  (equal? g (last siblings)))
 (list
   (cons (- 1 (/ flare-width stil-x-length))  0)
   (cons 1 flare-height))
 '((1 . 0)))
  (elbowed-hairpin `(,@(flare-left grob) ,@(flare-right grob)) #t



%% EXAMPLES


\paper { ragged-right = ##f }

mus = { c'1\< \break cis' \break d' dis'\! }

musII = { c'1\< cis' d' dis'\! }

musIII = { c'1\< \break cis' \break d'\! }

\layout {
  \override Hairpin.stencil = #flat-flared-hairpin
  \override Hairpin.details.flare-height = 2 %% default is 1
  \override Hairpin.details.flare-width = 2 %% default is 1
}

{
  \set Staff.instrumentName = "TEST 1"
  \override Hairpin.details.flare-position = #LEFT %% or -1
  \mus
}

{
  \set Staff.instrumentName = "TEST 2"
%  \override Hairpin.details.flare-position = #CENTER %% or 0 or let it unset
  \mus
}

{
  \set Staff.instrumentName = "TEST 3"
  \override Hairpin.details.flare-position = #RIGHT %% or 1
  \mus
}


{
  \set Staff.instrumentName = "TEST 4"
  \musII
}

{
  \set Staff.instrumentName = "TEST 5"
  \override Hairpin.to-barline = ##f
  \override Hairpin.after-line-breaking = ##t
  \musIII
}


HTH,
  Harm

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


Re: Flat flared hairpins

2018-12-31 Thread Thomas Morley
Am Mo., 31. Dez. 2018 um 10:43 Uhr schrieb Malte Meyn :
>
>
>
> Am 31.12.18 um 09:58 schrieb Andrew Bernard:
> >
> > Why do you have to use cadr and not cdr on the ly:grob-set-property
> > line? Isn't the broken part the second item in a list of two items? How
> > to understand this?
>
> In Scheme, a list is a pair, containing the head/car (first element of
> the list) and tail/cdr (sublist of all other elements). A list
> containing only one element is a pair of that element and an empty list '().
>
> '(1 2 3 4 5)
> is the same as
> '(1 . (2 . (3 . (4 . (5 . ()
>
> So the car of the list above is 1, the cdr is '(2 3 4 5). If you want to
> get the 2, you have to take the car of '(2 3 4 5). And cadr is short for
> “car of cdr”.

Or use 'second' a srfi-1-procedure, which provided by LilyPond as
default: (second '(1 2 3))
Or 'list-ref': (list-ref '(1 2 3) 1) NB first element of a list is at
position zero.


Cheers,
  Harm

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


Re: How to auto print empty measures?

2018-12-28 Thread Thomas Morley
Am Sa., 29. Dez. 2018 um 00:58 Uhr schrieb Thomas Morley
:
>
> Am Fr., 28. Dez. 2018 um 22:28 Uhr schrieb Philip Bergwerf
> :
> >
> > When working with Lilypond I want Lilypond to print the empty measures from
> > every instrument, like how Denemo is doing by default. For example: instr. 1
> > has 10 measures of music. I want lilypond to print the empty measures of all
> > staffs in the project. Is there a way to reach this? How?
> >
> > Cheers, Philip Bergwerf
>
> No idea why you want this...
>
> Probably:
>

Or even:

skp =
#(define-music-function (mus)(ly:music?)
  #{ \new Staff \new Devnull $mus #})

> skp =
> #(define-music-function (mus)(ly:music?)
>   #{
> \new Staff
> <<
>   \new Devnull $mus
>   #(skip-of-length mus)
> >>
>   #})
>
> \skp
> \relative {
> \time 3/4
> d'2 c4
> \break
> \time 2/4
> e2
> \bar "||"
> }
>
>
> Works at Voice level only. Ofcourse spacing will be completely different.
>
>
> Cheers,
>   Harm

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


Re: How to auto print empty measures?

2018-12-28 Thread Thomas Morley
Am Fr., 28. Dez. 2018 um 22:28 Uhr schrieb Philip Bergwerf
:
>
> When working with Lilypond I want Lilypond to print the empty measures from
> every instrument, like how Denemo is doing by default. For example: instr. 1
> has 10 measures of music. I want lilypond to print the empty measures of all
> staffs in the project. Is there a way to reach this? How?
>
> Cheers, Philip Bergwerf

No idea why you want this...

Probably:

skp =
#(define-music-function (mus)(ly:music?)
  #{
\new Staff
<<
  \new Devnull $mus
  #(skip-of-length mus)
>>
  #})

\skp
\relative {
\time 3/4
d'2 c4
\break
\time 2/4
e2
\bar "||"
}


Works at Voice level only. Ofcourse spacing will be completely different.


Cheers,
  Harm

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


Re: Jianpu

2018-12-27 Thread Thomas Morley
Am Do., 27. Dez. 2018 um 21:03 Uhr schrieb MING TSANG :

> Dear Paul and David
>
> I don't know the code. Appreciate if either one of you can help to resolve
> the tie problem for jianpu.
>

Hi,

my knowledge about Jianpu is zero.
Though, how _should_ it look? Like the attached png?
If so why not replacing the Tie with a Slur? At least this was how I
created the image.

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


Re: Scheme question

2018-12-25 Thread Thomas Morley
Am Di., 25. Dez. 2018 um 21:19 Uhr schrieb Jacques Menu :
>
> Hello folks,
>
> I don’t succeed in using ‘#:concat’ to compute the second argument to 
> ‘#(:note’ in the following Scheme code, where HERE occurs.
>
> What should I use instead? The aim is to use half the value of ‘den’ instead 
> of 4 in the previous line.
>
> Thanks for your help!
>
> JM
>
> --
>
>
> #(define-public (format-time-sig-dotted-note-horizontally grob)
>(let* ((frac (ly:grob-property grob 'fraction))
>   (num (if (pair? frac) (car frac) 4))
>   (den (if (pair? frac) (cdr frac) 4))
>   (m (markup #:override '(baseline-skip . 0.5)
>#:line (#:number (number->string (/ num 3))
>  #'"/"
>  #:override '(style . default)
>  #:raise 0.6 (#:note (number->string den) UP)
>
>  #:raise 0.6 (#:note #'"4." UP)
>  #:raise 0.6 (#:note (#:concat #'"4" #'".") 
> UP) ;; HERE
>  )
> )
>   )
>   )
>  (grob-interpret-markup grob m)))
>
>  Starting lilypond 2.19.82 [NotesInTimeSignatureExample.ly]...
> Processing 
> `/Users/menu/Documents/LaTeX/PartitionsLilypond/NotesInTimeSignatureExample.ly'
> Parsing...
> Interpreting music...[8]
> Preprocessing graphical 
> objects.../Applications/LilyPond.app/Contents/Resources/share/lilypond/current/scm/markup-macros.scm:368:18:
>  In procedure car in expression (car expr):
> /Applications/LilyPond.app/Contents/Resources/share/lilypond/current/scm/markup-macros.scm:368:18:
>  Wrong type (expecting pair): "4"
> Exited with return code 1.

Hi,

in scheme-syntax don't prepend strings with a #-sign:
$(markup (#:note "4." UP))

concat-markup expects a markup-list, thus place parens correctly:
$(markup (#:concat ("4" ".")))

Though, note-markup expects a string (in 2.19.82), thus below does not
work, but the error-message is helpful:
$(markup (#:note (#:concat ("4" ".")) UP))
->
fatal error: make-note-markup: Invalid argument in position 1.
Expect: string, found: (#
((# "4") (# "."))).

You need to create a simple string, here some methods:
$(markup (#:note (string-concatenate '("4" ".")) UP))
$(markup (#:note (string-append "4" ".") UP))
$(markup (#:note (format #f "~a~a" "4" ".") UP))
$(markup (#:note (format #f "~a." "4") UP))
$(markup (#:note (format #f "~a." 4) UP))


HTH,
  Harm

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


Re: How to make italian tablature

2018-12-25 Thread Thomas Morley
Am Di., 25. Dez. 2018 um 11:35 Uhr schrieb Mario Moles
:
>
> Hi lilyponders!
>
> I need to make a transcription from italian lute tablature (Francesco 
> Spinacino).
>
> It is the reverse of the lilypond tabstaff: the first string is the sixth and 
> the sixth is the first.
>
> How to?
>
> Thanks

Hi,

you can set some context-properties:
stringTunings
tablatureFormat
stringOneTopmost

Here some LSR-snippets:

"Let TabStaff print the topmost string at bottom"
http://lsr.di.unimi.it/LSR/Item?id=1014

"Baroque lute tablature" http://lsr.di.unimi.it/LSR/Item?id=920

"Tablature layout for viol music" http://lsr.di.unimi.it/LSR/Item?id=848

HTH,
  Harm

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


Re: Engraving chord names in Linux

2018-12-23 Thread Thomas Morley
Am Fr., 21. Dez. 2018 um 17:54 Uhr schrieb Jogchum Reitsma
:
>
> Hi list,
>
> I use lilypond 2.18 on OpenSuse Tumbleweed (the rolling distro from Suse). On 
> that combination, displaying chord names in .pdf-form gives error messages 
> grom ghostscript (gs) in the transition from a .ps-file to a .pdf-file. When 
> for example the snippet from 
> http://lilypond.org/doc/v2.18/Documentation/learning/notes-and-chords.nl.html 
> is fed to lilypond, with logging set to its maximum,, the last messages are:
>
> Opmaakuitvoer naar `Akkoorden.ps'...
> [/usr/share/fonts/truetype/CenturySchL-Roma.otf]
> [/usr/share/fonts/truetype/Roboto-Regular.ttf]
> [/usr/share/lilypond/2.18.2/ps/music-drawing-routines.ps]
> [/usr/share/lilypond/2.18.2/ps/lilyponddefs.ps]
> Converting to `./Akkoorden.pdf'...
> Aanroepen van 'gs -dSAFER -dDEVICEWIDTHPOINTS=595.28 
> -dDEVICEHEIGHTPOINTS=841.89 -dCompatibilityLevel=1.4 -dNOPAUSE -dBATCH -r1200 
> -sDEVICE=pdfwrite -sOutputFile=./Akkoorden.pdf -c.setpdfwrite 
> -fAkkoorden.ps'...
>
> GPL Ghostscript 9.26 (2018-11-20)
> Copyright (C) 2018 Artifex Software, Inc.  All rights reserved.
> This software comes with NO WARRANTY: see the file PUBLIC for details.
> Error: /invalidfont in --glyphshow--
> Operand stack:
>1.7072   43.7677   -7.0809   D
> Execution stack:
>%interp_exit   .runexec2   --nostringval--   --nostringval--   
> --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   
> --nostringval--   false   1   %stopped_push   2029   1   3   %oparray_pop   
> 2028   1   3   %oparray_pop   2009   1   3   %oparray_pop   1868   1   3   
> %oparray_pop   --nostringval--   %errorexec_pop   .runexec2   --nostringval-- 
>   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   0 
>   --nostringval--   %repeat_continue   --nostringval--
> Dictionary stack:
>--dict:960/1684(ro)(G)--   --dict:0/20(G)--   --dict:114/200(L)--
> Current allocation mode is local
> Current file position is 946206
> GPL Ghostscript 9.26: Warning: 'loca' length 13 is greater than numGlyphs 1 
> in the font Roboto-Regular.
> GPL Ghostscript 9.26: Unrecoverable error, exit code 1
>
> Generating the .ps-file goes withjout warning, but if one opens that .ps in a 
> viewer, one does ee the triangle above  the fist bar (between the last 2 
> quarter notes), but no chord names.
>
> The .pdf-file is not generated by gs.
>
> The snippet reads as follows:
>
> \version "2.18.2"
>
> melody = \relative c' {
>   \clef treble
>   \key c \major
>   \time 4/4
>
>   f4 e8[ c] d4 g
>   a2 ~ a
> }
>
> harmonies = \chordmode {
>   c4:m f:min7 g:maj c:aug
>   d2:dim b:sus
> }
>
> \score {
>   <<
> \new ChordNames {
>   \set chordChanges = ##t
>   \harmonies
> }
> \new Staff \melody
>   >>
>   \layout{ }
>   \midi { }
> }
>
> When I comment out the two lines in the chormode section, everything is OK.
>
> What can be/can I do to display chord names?
>
> regards, Jogchum Reitsma

Hi,

how comes you're using 2.18.2 with Ghostscript 9.26?
This ly-version is released with Ghostscript 8.70.

You're problem sounds like missing fonts (the triangle is drawn, not
from a font).

I was not able to reproduce your problem, although I've build 2.18.2
from the stable/2.18-branch with Ghostscript 9.27.



Sorry to be of not more help,
  Harm

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


Re: LilyPond can't engrave 16 pages of music

2018-12-22 Thread Thomas Morley
Am Sa., 22. Dez. 2018 um 12:10 Uhr schrieb David Kastrup :
>
> Thomas Morley  writes:
>
> > Am Sa., 22. Dez. 2018 um 02:46 Uhr schrieb Ben :
> >> Did you experience the same wait times?
> >
> > It lasted ~40minutes (I didn't observed the time exactly)
> >
> > I think:
> > most of the time is spend in calculating spacing/line-/page-breaks.
>
> Recently Werner committed a few fixes of typos with possibly ugly
> consequences in the area of page breaking, so it might be worthwhile
> crosschecking with current master.

I've redone testings with the OP's original code, i.e.

{
  \time 4/4
  \repeat unfold 1000 { c4 d e f } % TEN PAGES of music
  \repeat unfold 1000 { f1 } % + SIX MORE PAGES of music
  \repeat unfold 1000 { c4 d e f } % BUT WHEN ADDING MORE PAGES, fail NOW
}

Using 2.19.82 (from the installer) and 2.21.0 out of 915799cad7
musicexp.py: Use python 2.4 syntax.

Always restarting the computer after each test.

For 2.19.82 it's finished after 28m4,740s
For 2.21.0 after 24m50,214s

Memory-usage seems to be similar.
I didn't oberve a difference in the final pdfs


Cheers,
  Harm

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


Re: LilyPond can't engrave 16 pages of music

2018-12-22 Thread Thomas Morley
Am Sa., 22. Dez. 2018 um 02:46 Uhr schrieb Ben :

> What are your system specs? I can compile the file on my Linux Mint x64 
> laptop with 16GB of RAM, rockin' an 8th gen i7 but it took about 10 minutes 
> almost. That seems very very slow.

Well, I have a weak laptop. In the past I had some fast and powerfull
laptops. All died after far too short time, with broken motherboard. I
was told it makes no sense to repair.
So I was very upset and decided not to buy such an expensive machine
again. I now have one which was offered as a machine for starters. LOL
The lifetime of this laptop already beats the ones from all previous
powerful machines together.

That said, I've two processors behaving like four
Intel(R) Pentium(R) CPU  N3510  @ 1.99GHz
and
4 GB RAM

Using LilyPond-2.19.82 on Ubuntu 18.04 64-bit

> Did you experience the same wait times?

It lasted ~40minutes (I didn't observed the time exactly)

I think:
most of the time is spend in calculating spacing/line-/page-breaks.
The OP's examples contains most simple 4th and whole notes, nothing
else. So LilyPond has no hints and only a few limitations while
calculating spacing/line-/page-breaks.
Afaict, the only limitation is: no (page)break mid-measure.
But in real life scores there are usually a lot of limitations,
because bars contain more notes (making it impossible to put too many
of them in one line) or all sorts of spanners (Beams, Hairpins, etc),
all influence the penalties for line/page-breaks.
In the current example close to all is equal. So LilyPond calculates
the best option and calculates and calculates and ...
So our very powerful engine draws circles.

To verify my guess, I excluded automatic breaks and did them all
manually (breaks are not really optimal, now 26 pages with a lonely
system on last page is retunred. It makes no sense to do the needed
fine tuning for such an example)

\layout {
  \autoBreaksOff
}

\new Staff
  <<
{
  \time 4/4
  \repeat unfold 1000 { c4 d e f } % TEN PAGES of music
  \repeat unfold 1000 { f1 } % + SIX MORE PAGES of music
  \repeat unfold 1000 { c4 d e f } % BUT WHEN ADDING MORE PAGES, fail NOW
}
{
  \repeat unfold 25
{ \repeat unfold 12 { \repeat unfold 8 { s1 } \break } \pageBreak }
}
  >>

Finished in 1m15,290s
With very little memory usage.


Cheers,
  Harm

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


Re: LilyPond can't engrave 16 pages of music

2018-12-21 Thread Thomas Morley
Am Sa., 22. Dez. 2018 um 00:48 Uhr schrieb Reggie :
>
> I am trying to understand theoretically why this is failing. It's only 16
> pages. I am a minimalist composer so as a test I tried this extreme
> situation. But yet I don't quite agree rather that it's that extreme. It's
> only 16 pages and LilyPond crashes.
>
> \version "2.19.82"
> {
>   \time 4/4
>   \repeat unfold 1000 { c4 d e f } % TEN PAGES of music
>   \repeat unfold 1000 { f1 } % + SIX MORE PAGES of music
>   \repeat unfold 1000 { c4 d e f } % BUT WHEN ADDING MORE PAGES, fail NOW
> }
>
> wHY?
>
> Preprocessing graphical objects...terminate called after throwing an
> instance of 'std::bad_alloc'
>   what():  std::bad_alloc
> Exited with return code 6.

Works here, returning a 25-pages pdf.

I'm on Ubuntu-18.04 64-bit

Cheers,
  Harm

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


Re: synchronization of feathered beams

2018-12-21 Thread Thomas Morley
Am Fr., 21. Dez. 2018 um 23:18 Uhr schrieb Reggie :

>
> Is there a way in LilyPond to simply add a beam line without changing the
> time or anything else behind the elements? I mean, visually say I had a c16
> feather beam measure that had all the math and checks OK. But I wanted 3
> lines for my feather beams. Can you add a "extra" beam line without having
> it impact anyy other elements? In score music.

Well, yes, it's possible, you can always rewrite the stencil, but it
would mean far more work than scaling durations.

> That would help me because I
> am slower than you with math.

I don't see a problem here.

Say you have an 8th: { \time 1/8 c''8[] }
This code creates a single 8th note with a one beam-segments

Now we want an equal lasting note with two beam-segmants.
So write the half duration, i.e. c''16 and double the it's length: {
\time 1/8 c''16*2[] }
Or use \scaleDurations: { \time 1/8 \scaleDurations 2 c''16[] }

Same for three beam-segments: { \time 1/8 \scaleDurations 4 c''32[] }

etc
Note, if \scaleDurations should be applied to more than one note, {
and } are needed.
Other examples are in the NR

Cheers,
  Harm

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


Re: synchronization of feathered beams

2018-12-21 Thread Thomas Morley
Am Fr., 21. Dez. 2018 um 19:26 Uhr schrieb Reggie :
>
> Thomas Morley-2 wrote
> > \featherDurations changes durations, nothing more!! It does not change
> > spacing on it's own.
> > The changed spacing is more a side-effect. Doing note-spacing is a
> > very involved process, durations are only one element of the
> > calculation.
> >
> > So I ensure you \featherDuarations will _always_ affect the
> > _durations_ of it's argument, though, whether the resulting spacing is
> > really what you desire? Probably/likely/sometimes not.
> >
> >> I wouldn't even know how to make this function besides. Sorry.
> >
> > Well, there are some good coders on the list ;)
> > Not sure, if I'll have the time to give it a try ...
> >
> > Cheers,
> >   Harm
> >
> > ___
> > lilypond-user mailing list
>
> > lilypond-user@
>
> > https://lists.gnu.org/mailman/listinfo/lilypond-user
>
> Harm this is very important you just solved the mystery :)) Sort of. It
> sounds like you just admitted that the spacing out of feather beamed
> duration notes is not always going to work correctly,

Nah, I tried to explain how featherDurations works, nothing else, (and
I may very well be corrected by others with deeper knowledge).

Durations are modified.
The spacing is tackled by the spacing engine, which needs to look at a
plethora of things, surely, among them are durations, but that's not
all...

As an example.
Say you have 4 16th.
Should they be spaced equally? I'd say, depends...

You can't do it equal here:
{
  \set fingeringOrientations = #'(left)
  \set stringNumberOrientations = #'(left)
  16  q q
}

And what's "correctly"?

Admittedly Gould is a strong argument. But in my experience every
other day a user shines up here wanting to do things _(s)he_ likes it
and not like any reference book.

> but the durations
> themselves WILL. Well, according to Gould, it's pretty obvious that feather
> beams need to be spaced out according to the tempo of the feathers, always.
> So, there's no way in LilyPond as of today function wise that simply put
> makes feather beams spaced out correctly according to standard engraving
> rules. Wow.
>
> I would hope beg love for someone to write a function that simply put spaced
> out notes according to the speed of the feathers. Finale Sibelius do this
> for years now. Hack yes but doable every time it works. What's LilyPond work
> around for this? Assume you want to engrave correctly and have your feather
> beams spaced out as they slow or speeden up, how can you do it? manually
> tweak space between notes it seems? Yikes :))
>
> Do you think it's even possible to write a function to automatically space
> according to the feather beam length and duration?

As said, likely it's possible.
Speaking only for myself, I doubt I've the time to try.

Cheers,
  Harm

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


Re: feathered beam calculations

2018-12-21 Thread Thomas Morley
Am Fr., 21. Dez. 2018 um 20:10 Uhr schrieb Reggie :
>
> Aaron Hill wrote
> > Given the current implementation, it would be necessary to use an
> > approximate rational like 50/63 as the moment in order to get 'f' to be
> > half of 'c'.  Why that number?  Well, it's a close approximation to the
> > irrational cube root of one half.  We determine this exact value by
> > taking the desired ratio (1/2) and raising it to the reciprocal of the
> > number of scaling steps between the first and last notes (three, in this
> > case, which becomes the fraction 1/3).  (1/2)^(1/3) is about 0.7937; and
> > 50/63 is roughly 0.79365.
> >
> > But before we get lost in the murky details of whether the implemented
> > behavior is right or the documentation is right, let us circle back
> > around to a key point that I feel has not been stressed enough.
> >
> > This means your score really should be bar check clean *before* you ever
> > use \featherDurations.
> >
> > I said earlier we would talk about bar checks *within* the feathered
> > sequence of notes.  Consider the following addition to our example:
> >
> >  << { r64 \featherDurations #(ly:make-moment 2/1)
> >   { c32*127/14[ d e f g a | b] } }
> > { r64 \featherDurations #(ly:make-moment 2/1)
> >   { c32*63/12[ d e f g a] } | b1 }
> > { r64 { c64 d32 e16 f8 g4 a2 } | b1 } >>
> >
> > You'll see that the 'b' is included within the beamed notes.  Because we
> > now have seven notes covering the period of two measures less one 64th,
> > we had to adjust our scaling fraction to 127/14.  However, what is most
> > important is that \featherDurations fixes the timing of the notes to
> > allow the inside bar check to pass.  Omit it, and you'll see that the
> > bar check fails.  But also try changing the 2/1 moment to anything else,
> > and the bar check will also fail.
> >
> > What we have here is a very fragile element in the score that can be
> > easily avoided by never requiring any note (apart from the first) within
> > a feathered sequence to align to anything else.  The final 'b' above
> > should properly be outside the feathered sequence (or possibly start a
> > new sequence of its own).  In this way, the math to ensure all of the
> > sequences have the right lengths can be done completely independent of
> > \featherDurations.
> >
> > Hopefully some of this will be helpful.
> >
> > -- Aaron Hill
> >
> > ___
> > lilypond-user mailing list
>
> > lilypond-user@
>
> > https://lists.gnu.org/mailman/listinfo/lilypond-user
>
> Aaron that makes sense but only if you have failed bar checks before
> feathering. Let's say you have a perfect score with no fails. And now you
> want to simply insert feather beamed notes only in one measure but have them
> spaced out according to the speed accelerando ritard as standard. How do you
> even begin to know what math * * * * you should be doing when there is no
> math to do in the first place??? NO bar check math because everything is
> already fine. Why can't you just spread out the notes according to how
> feathers are supposed to? Prove me please. Here look.
>
>
> \relative c'
> {
>
>   \override Beam.grow-direction = #LEFT
>   \featherDurations #(ly:make-moment 2/1)
>   c32[ d e f g f e f d f g f d e d f] c4~c | c1 |
> }
>
>
> My CODE has no errors. And yet the 2/1 does NOT space out any notes at ALL
> it's just normal beamed notes with fancy feathers. What math do I need how
> does one even know what math to use since there are no bar bad checks? See?
> :))

Well, try to reread Aaron's message (as he suggested), you may stumble across:
"
[Side note: Harm made a slight mistake in his example usage.  If you
want to feather a sequence of notes, you must put those notes in curly
braces.  Omitting the braces in the example above will result in no
feathering, as only the first note will be passed to the function.]
"

Aaron's correct ofcourse. And now you made the same mistake.  ;)
The argument of featherDurations needs to be enclosed with { and }, at
least if you want featherDurations be applied to sequential music.
(and I can't imagine a case where one wouldn't want to do so)

Cheers,
  Harm

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


Re: synchronization of feathered beams

2018-12-21 Thread Thomas Morley
Am Fr., 21. Dez. 2018 um 17:51 Uhr schrieb Reggie :
>
> Thomas Morley-2 wrote
> > Meanwhile I think you didn't understand that feathered beams, done with
> > \override Beam.grow-direction = #RIGHT
> > and
> > \featherDurations
> > are _independant_ from each other. See:
> >
> > \version "2.19.82"
> >
> > {
> >   r2..
> >   \featherDurations #(ly:make-moment 1 2)
> >   { c''32[ 32 32 32 32 32 32 32] } r2..
> > }
> >
> > The old message you quoted previously, explains already that
> > \featherDurations changes the durations of the notes.
> > With those changed durations LilyPonds spacing engine may insert
> > different spacings between those notes.
> > Ofcourse things like barchecks fail if applied to the _unchanged_ notes.
> >
> > So it seems to me your problem has _nothing_ to do with feathered
> > Beams but with featherDurations and it's consequences.
> >
> > Probably don't use featherDurations at all, but use a custom function
> > to space the note-columns, only for the visible output, without
> > changing their durations (midi would not reflect any
> > accelerando/rallentando then ofcourse).
> >
> >
> > Cheers,
> >   Harm
> >
> > ___
> > lilypond-user mailing list
>
> > lilypond-user@
>
> > https://lists.gnu.org/mailman/listinfo/lilypond-user
>
> Harm I don't use MIDI so a custom function could work great yes for visual
> spacing. But please bear with me on this for a second. If the durations
> command already spaces them out then why doesn't this work *every* time? I
> understand both commands are independent yes thank you. But I presumed that
> I needed durations to space out the notes correctly like Gould and
> publishing houses all over do.
>
> Why would I need a custom function to do what featherdurations does if I'm
> misunderrstanding?

\featherDurations changes durations, nothing more!! It does not change
spacing on it's own.
The changed spacing is more a side-effect. Doing note-spacing is a
very involved process, durations are only one element of the
calculation.

So I ensure you \featherDuarations will _always_ affect the
_durations_ of it's argument, though, whether the resulting spacing is
really what you desire? Probably/likely/sometimes not.

> I wouldn't even know how to make this function besides. Sorry.

Well, there are some good coders on the list ;)
Not sure, if I'll have the time to give it a try ...

Cheers,
  Harm

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


Re: synchronization of feathered beams

2018-12-21 Thread Thomas Morley
Am Fr., 21. Dez. 2018 um 17:18 Uhr schrieb Reggie :
>
> Thomas Morley-2 wrote
> > Am Fr., 21. Dez. 2018 um 15:21 Uhr schrieb Reggie 
>
> > reegistoop@
>
> > :
> >
> >> It's impossible to have feather
> >> beams cross barlines and look correect why is this?
> >
> > ??
> >
> > What's wrong with:
> >
> > \version "2.19.82"
> >
> > {
> >   r2..
> >   \override Beam.grow-direction = #RIGHT
> >   c'32[ \repeat unfold 6 c'' c'] r2..
> > }
> >
> > Cheers,
> >   Harm
> >
> > ___
> > lilypond-user mailing list
>
> > lilypond-user@
>
> > https://lists.gnu.org/mailman/listinfo/lilypond-user
>
> Also, as I earlier mentioned over and over, the bar lines fail. Your example
> does not work unless you ignore bar checks. Why needing to be this way is
> silly to me :)

Well, repeating the same over and over again, although several people
declared not to know exactly what you're, after is not likely
increasing the chance to be understood.

Meanwhile I think you didn't understand that feathered beams, done with
\override Beam.grow-direction = #RIGHT
and
\featherDurations
are _independant_ from each other. See:

\version "2.19.82"

{
  r2..
  \featherDurations #(ly:make-moment 1 2)
  { c''32[ 32 32 32 32 32 32 32] } r2..
}

The old message you quoted previously, explains already that
\featherDurations changes the durations of the notes.
With those changed durations LilyPonds spacing engine may insert
different spacings between those notes.
Ofcourse things like barchecks fail if applied to the _unchanged_ notes.

So it seems to me your problem has _nothing_ to do with feathered
Beams but with featherDurations and it's consequences.

Probably don't use featherDurations at all, but use a custom function
to space the note-columns, only for the visible output, without
changing their durations (midi would not reflect any
accelerando/rallentando then ofcourse).


Cheers,
  Harm

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


Re: synchronization of feathered beams

2018-12-21 Thread Thomas Morley
Am Fr., 21. Dez. 2018 um 15:21 Uhr schrieb Reggie :

> It's impossible to have feather
> beams cross barlines and look correect why is this?

??

What's wrong with:

\version "2.19.82"

{
  r2..
  \override Beam.grow-direction = #RIGHT
  c'32[ \repeat unfold 6 c'' c'] r2..
}

Cheers,
  Harm

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


Re: Formatting part of a header property

2018-12-17 Thread Thomas Morley
Am Mo., 17. Dez. 2018 um 21:36 Uhr schrieb David Kastrup :
>
> Thomas Morley  writes:
>
> > Am Mo., 17. Dez. 2018 um 21:20 Uhr schrieb David Kastrup :
> >>
> >> Thomas Morley  writes:
> >
> >> > The idea:
> >> >
> >> > #(define-markup-command (wordwrap-field layout props symbol)
> >> >   (symbol?)
> > [doc-string dropped]
> >> >   (let* ((m (chain-assoc-get symbol props)))
> >> > (cond ((string? m)
> >> >(wordwrap-string-markup layout props m))
> >> >   ((markup-list? m)
> >> >(wordwrap-markup layout props m))
> >> >   ((markup? m)
> >> >(interpret-markup layout props m))
> >> >   (else empty-stencil
> >
> >> BTW, I am not convinced of the string/markup differentiation since a
> >> string _is_ a simple markup.  This is sort of icky.
> >
> > Well, work on this one is not finished ...
> >
> > Though, every string is a simple markup, yes, thus it's checked first.
> > Why do you think it's icky?
>
> Because a string is formatted/treated _differently_ from a markup.

Ok, so how to do it differently?

Probably:
for a string use 'wordwrap-string'
for a markup-list use 'wordwrap' (or 'wordwrap-lines' ?)

But what to do for a markup? Return empty-stencil?
Or...?

Do you have any suggestion?

Thanks,
  Harm

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


Re: feathered beam calculations

2018-12-17 Thread Thomas Morley
Am Mo., 17. Dez. 2018 um 22:13 Uhr schrieb Reggie :
>
> Thomas Morley-2 wrote
> > Am Mo., 17. Dez. 2018 um 14:52 Uhr schrieb Reggie 

> > Scale durations:
> >
> > \relative d {
> >   \clef bass
> >   \override Beam.grow-direction = #RIGHT
> >   \featherDurations #(ly:make-moment 3/4)
> > c16*4/3[ d e]
> > c32*2*4/3[ d e]
> > c64*4*4/3[ d e]
> > c128*8*4/3[ d e] |
> >   \revert Beam.grow-direction
> >   cis1 |
> > }

> Harm can you show how you got the math I haven't a clue how you would have
> known how to do it. Can you show your math please for us thank you.

{
  \time 1/4
  b16*4 | % i.e. 1/16 lasts 1/4
  b16*4/3 b b | % b16*4 is 1/4, so b16*4/3 is a third of 1/4
  %% similar for 1/32,
  b32*2 %{is 1/16%} *4 |
  b32*2*4/3 b b |
  %% etc
}

HTH,
  Harm

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


Re: feathered beam calculations

2018-12-17 Thread Thomas Morley
Am Mo., 17. Dez. 2018 um 14:52 Uhr schrieb Reggie :

> How do you change the amount of "beams" you feather when
> the amount of notes is example 3. You need to just forget it? 3  beams are
> not possible?
>
> \relative d {
>   \clef bass
>   \time 4/4
>   d2 e4
>   \override Beam.grow-direction = #RIGHT
>   \featherDurations #(ly:make-moment 3/4)
>   {
> \once \override TupletNumber.stencil = ##f
> \tuplet 3/4 { c16[ d e] } |
>   }
>   \revert Beam.grow-direction
>   cis1 |
> }

Scale durations:

\relative d {
  \clef bass
  \override Beam.grow-direction = #RIGHT
  \featherDurations #(ly:make-moment 3/4)
c16*4/3[ d e]
c32*2*4/3[ d e]
c64*4*4/3[ d e]
c128*8*4/3[ d e] |
  \revert Beam.grow-direction
  cis1 |
}

HTH,
  Harm

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


Re: Formatting part of a header property

2018-12-17 Thread Thomas Morley
Am Mo., 17. Dez. 2018 um 21:20 Uhr schrieb David Kastrup :
>
> Thomas Morley  writes:

> > The idea:
> >
> > #(define-markup-command (wordwrap-field layout props symbol)
> >   (symbol?)
[doc-string dropped]
> >   (let* ((m (chain-assoc-get symbol props)))
> > (cond ((string? m)
> >(wordwrap-string-markup layout props m))
> >   ((markup-list? m)
> >(wordwrap-markup layout props m))
> >   ((markup? m)
> >(interpret-markup layout props m))
> >   (else empty-stencil

> BTW, I am not convinced of the string/markup differentiation since a
> string _is_ a simple markup.  This is sort of icky.

Well, work on this one is not finished ...

Though, every string is a simple markup, yes, thus it's checked first.
Why do you think it's icky?

Cheers,
  Harm

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


Re: Formatting part of a header property

2018-12-17 Thread Thomas Morley
Am Mo., 17. Dez. 2018 um 19:21 Uhr schrieb Br. Samuel Springuel
:
>
> On 2018-12-17 12:08 PM, David Kastrup wrote:
> > Uh, anything wrong with the obvious
> >
> >custom = \markup { PRAELUDIUM I \italic { italicized text } Back to 
> > normal }
> >
> > ?
> It works in the MWE I posted, but not in my original use case (the
> contents of the field disappear entirely.  After some further
> exploration the problem seems to be that I'm making use of
> `\wordwrap-field` rather than `\fromproperty` (a necessity due to the
> fact that the contents of this field can get rather long).

\wordwrap-field only works for strings, otherwise an empty stencil is returned.
Though, there was a bit discussion on devel recently.
http://lilypond.1069038.n5.nabble.com/Let-wordwrap-field-and-justify-field-take-non-strings-td217729.html
I then started work on a patch. Up to now not published (still work in
progress and not sure when I'll have the time to continue).

The idea:

#(define-markup-command (wordwrap-field layout props symbol)
  (symbol?)
  #:category align
  "Wordwrap the data which has been assigned to @var{symbol}.

@lilypond[verbatim,quote]
\\header {
  title = \"My title\"
  myText = \"Lorem ipsum dolor sit amet, consectetur adipisicing
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.\"
}

\\paper {
  bookTitleMarkup = \\markup {
\\column {
  \\fill-line { \\fromproperty #'header:title }
  \\null
  \\wordwrap-field #'header:myText
}
  }
}

\\markup {
  \\null
}
@end lilypond"
  (let* ((m (chain-assoc-get symbol props)))
(cond ((string? m)
   (wordwrap-string-markup layout props m))
  ((markup-list? m)
   (wordwrap-markup layout props m))
  ((markup? m)
   (interpret-markup layout props m))
  (else empty-stencil



\book {
   \paper {
 indent = 0\mm
 scoreTitleMarkup = \markup {
   \fill-line {
 \null
 \fontsize #4 \bold \wordwrap-field #'header:piece
   }
 }
   }
   \header { tagline = ##f }
   \score {
 { s1 }
 \header {
   piece = \markup { PRAELUDIUM I \italic { italicized text } Back
to normal }
 }
   }
 }

Seems to work.


Cheers,
  Harm

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


Re: Problem with accidentals.ly and Lilypond 2.19.82

2018-12-15 Thread Thomas Morley
Am Fr., 14. Dez. 2018 um 17:12 Uhr schrieb Luca Danieli :
>
> Hi Thomas,
>
> your analysis has been very good.
> I have almost solved the issue.
> I just don't know what's the glyph name for the SEMI-SHARP and SEMI-FLAT
>
> In the following code, I should add the ones for SEMI-SHARP and SEMI-FLAT.
> Do you know what's the name of the glyph? I already tried (e.g. SEMI-SHARP) 
> "accidentals.semi-sharp", "accidentals.semisharp" and 
> "accidentals.sharp.semi".

Well, you change the note-names, scales, accidental-glyphs etc. So
it's up to you to decide which glyph you want to assign to a which
alteration.
Available are:
http://lilypond.org/doc/v2.19/Documentation/notation/the-emmentaler-font#accidental-glyphs

Cheers,
  Harm

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


Re: [Lyric+Chords project] required engravers

2018-12-15 Thread Thomas Morley
Am Fr., 14. Dez. 2018 um 17:57 Uhr schrieb Kieren MacMillan
:
>
> Hi Harm,
>
> > Any idea how to tackle:
> > (1) ligatures
> > \lyricmode { f -- i }
>
> Can you give me a real world situation — in a "regular" score (i.e., with 
> notes) — in which you would want both a ligature *and* chords on both 
> elements of the ligature? I can’t comprehend what that would look like…
>
> Thanks,
> Kieren.

Hi Kieren,

I can't imagine such a score either, though isn't it the challenge to
transform a score with chords/notes/lyrics there into a leadsheat?
Then you may have hyphenated text in such a score which should be
transformed into one word in the text of a leadsheet.

Look at the german children song:
https://cdn.familie.de/bilder/die-affen-rasen-durch-den-wald-1200-235512.jpg

In the last meaure of second line the chords could be done like
E/E   E/BE/Gis  E/E
Af -- fen -- ban -- de
(No ligature, every syllable with it's own chord-symbol)

In a leadsheet I'd then expect
E/E E/B E/Gis E/E
Affenbande
with ligature at "ff" and reasonable distributed chord-symbols.

Or are my expextations wrongly?


Cheers,
  Harm

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


Re: [Lyric+Chords project] required engravers

2018-12-14 Thread Thomas Morley
Am Fr., 14. Dez. 2018 um 04:09 Uhr schrieb Kieren MacMillan
:
>
> Hello all,
>
> I’m trying to develop a Lilypond lyrics+chords [only] framework, and am 
> trying to understand the "cleanest" possible starting point.
>
> The final goal: Given a set of lyrics (either with “inline” durations, or 
> durations contained in a melody variable) and a set of chords (with 
> durations), Lilypond should automatically output a lyric+chord sheet similar 
> to what can be seen in the attached screenshot.

Hi Kieren,

here:
https://lists.gnu.org/archive/html/lilypond-user/2018-12/msg00147.html
I expressed my doubts it will ever work.

I don't have a clue how to deal with those issues, but I'd love to be
proofed wrong.

Any idea how to tackle:

(1) ligatures
\lyricmode { f -- i }

(2) short syllables, both with chords

<<
  \new ChordNames \chordmode { c:7 g:13 }
  \new Lyrics \lyricmode { I -- o }
>>

?

Cheers,
  Harm

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


Re: Problem with accidentals.ly and Lilypond 2.19.82

2018-12-13 Thread Thomas Morley
Am Do., 13. Dez. 2018 um 23:11 Uhr schrieb Luca Danieli :

> What it did was to replace the line #(ly:parser-set-note-names parser 
> pitchnames)
> with #(ly:parser-set-note-names pitchnames)

convert-ly, correctly applied, would have done it for you ;)

> So I have got the same problem of before. Some accidentals are replaced with 
> a X. Don't know how to solve it.

Well, first I made an experiment.
I included your code and tried to compile the most simple:

{ ceseh1 }

With 2.18.2 and 2.19.82 (converted)

In both version I get:
warning: Could not find glyph-name for alteration -3/4
2.18.2 is done with this warning
2.19.82 additionally prints some dummy accidental

> Am I the only one to have this problem?

Likely, but I have a hard time imagening your file ever worked:

Obviously you took
http://lsr.di.unimi.it/LSR/Item?id=786
and changed it.
But while defining your pitchnames in 'arrowedPitchNames', you use
alterations like
(* FLAT 3/2)
(/ FLAT 2)
(/ SHARP 2)
(* SHARP 3/2)
There is no corresponding entry in 'arrowGlyphs' for those alterations, though.
Thus LilyPond-2.19.82 does not find any accidental-glyph to print,
warns you and (to make it more obvious) it prints the dummy instead.

Create additional entries in 'arrowGlyphs' for the alterations listed
above and it should work.

Cheers,
  Harm

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


Re: Problem with accidentals.ly and Lilypond 2.19.82

2018-12-13 Thread Thomas Morley
Am Do., 13. Dez. 2018 um 21:59 Uhr schrieb Luca Danieli :
>
> Thank you David.
> I tried to you convert-ly, but I got the following error:
>
> >convert-ly: error: accidentals.ly: Unable to determine version.  Skipping
>
> what can I do?

Then there is no \version-statement in the file.
Insert the version it was originally was created for, probably temporary.
Or do
convert-ly --from=2.18.2 --to=2.19.82 file.ly
Note, this will only show what would be changed . To actually do it, add -e

Anyway, you can't expect much effect on guile-code, although I think
we have a convert rule whch eliminates superfluos 'parser'-arguments
for 2.19.


> Luca Danieli  writes:
>
> > Hi there.
> >
> > I have got a problem. In my score, I have included the library 
> > accidentals.ly
> > With Lilypond 2.19.82 I have the error:
> >
> >
> > 163:2<0>: error: GUILE signaled an error for the expression beginning here
> >
> > #
> >
> > (ly:parser-set-note-names parser pitchnames)
> >
> > If I change the line #(ly:parser-set-note-names parser pitchnames)
> > with #(ly:parser-set-note-names pitchnames)
> >
> > the program compiles, but some notes present a X instead of the
> > correct accidental.

Well, first try convert-ly.
If it's not sufficient. You need to post your accidental.ly, otherwise
nobody can help.

And please, _no_ inline images. Attach them, link to them, but not inline.
Meanwhile I've got notifications from more and more companies dropping
any plain text, doing _all_ via html:
It lookes all bright and shiny like one brothel door next to more of
them. The content is hidden, though. Going on my nerves.
Thus I decided to disable _any_ html in mails.
So I can't see inline images, and I will not allow them being displayed, again.


Cheers,
  Harm

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


Re: score-lines-markup-list in Lyrics?

2018-12-12 Thread Thomas Morley
Am Mi., 12. Dez. 2018 um 09:53 Uhr schrieb David Kastrup :
>
> David Kastrup  writes:
>
> > Thomas Morley  writes:
> >
> >> Hi all,
> >>
> >> this works:
> >>
> >> \version "2.19.82"
> >>
> >> tst = \markuplist \italic #(make-list 2 "buzz")
> >>
> >> <<
> >>   \new Staff { R1 \break R1 }
> >>   \new Lyrics \lyricmode { $@tst }
> >>>>
> >>
> >> This doesn't work:
> >>
> >> tstA =
> >> \markuplist \score-lines { \repeat unfold 80 a'16 }
> >>
> >> <<
> >>   \new Staff { R1 \break R1 }
> >>   \new Lyrics \lyricmode { $@tstA }
> >>>>
> >>
> >>
> >> I have some vague thoughts why it refuses to work, though I can't
> >> really word them ...
> >
> > A list of markups is only one possible form of a markup list.
> > Obviously™ a markup command call cannot be a list of markups since the
> > call is only done when typesetting and then a list of stencils (not of
> > markups) is getting produced.
> >
> >> Anyway, is it somehow doable?
> >
> > Lyrics would need to accept markup lists.  That's not readily possible
> > since the number of stencils produced is only known at the time of
> > calling the markup list command (during iteration) and the length of a
> > music expression is often needed before.
> >
> > So I don't readily see how this could be reliably done.
>
> Unreliably, one could produce sequential music with a elements-callback
> field producing lyrics elements from individual \stencil markups.  The
> stencil list would be produced at time of iteration by the
> elements-callback, and the length callback would be made to return some
> nonsense or approximation.
>
> --
> David Kastrup

Hi David,

thanks for the insights.
Background is:
https://lists.gnu.org/archive/html/lilypond-user/2018-12/msg00199.html

Well, hopefully my disclaimer is sufficient ...

Thanks,
  Harm

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


Re: Line-breaking with non-aligned barlines - again!

2018-12-12 Thread Thomas Morley
Am Di., 11. Dez. 2018 um 13:56 Uhr schrieb David Sumbler :

> This may well be the answer I need for my full score.  But now that you
> have introduced me to "strict-note-spacing" etc., I am again wondering
> whether there might perhaps be a way of getting Lilypond to make 2
> separate calculations of spacing, one for the harpsichord and another
> for the rest of the orchestra; or, in the case of my small example, one
> for the top stave and one for the bottom.  Perhaps this can be done by
> modifying the stavesFound variable, but I have little idea of how to go
> about this.

I doubt.

Here a hack, hackish as hackish could be. with the need to do a
plethora of manual adjustments. Fragile like hell and with a lot of
limitations.
And _very_ expensive. You'll experience a slow-down even in the small example.
I can't recommend to use it --- but, well, here you are (also, see
inline comments):

\version "2.19.82"

\paper {
  %% indent needs to be zero
  indent = 0
}

#(define val -1)

sc =
\score {
  {
\repeat unfold 20 { a'16 b' c' d'' }
\break
\repeat unfold 4 { a'16 b' c' d'' }
  }
  \layout {
  %% indent needs to be zero
indent = 0
\omit Score.BarNumber
  }
}

m = {
  \time 2/4 b4 b
  \time 3/8 b4 b8
  \time 6/8 b4. b4 b8
  \break
  \time 5/8 b2 b8
  \time 2/4 \repeat unfold 8 b16
  \break
  \time 8/8 b1 b
}


<<
  \new Staff
\with {
  %% Probably needs to be adjusted
  \override VerticalAxisGroup.staff-staff-spacing =
#'((basic-distance . 12)
   (minimum-distance . 18)
   (padding . 1))
}
\m
  \new Lyrics
\lyricmode {
  \override LyricText.after-line-breaking =
#(lambda (grob)
  (set! val (1+ val))
  (let* ((paper-score
   (ly:score-embedded-format
 sc
 (ly:grob-layout grob)))
  (pap-sys-vector
(ly:paper-score-paper-systems paper-score))
  (pap-sys-ls
(vector->list pap-sys-vector))
  (pap-sys-stils
  (map
(lambda (pap-sys)
  (ly:prob-property pap-sys 'stencil))
pap-sys-ls)))
  (ly:grob-set-property! grob 'stencil (list-ref pap-sys-stils val

  %% Likely this has to be repeated frequently with adjusted values
  \override LyricText.before-line-breaking =
#(lambda (grob) (ly:grob-translate-axis! grob -8.6 X))

  %% Always need to adjust the duration, it needs to be the duration
  %% of the line of music above (or below)
  \withMusicProperty #'duration #(ly:make-duration 3 0 13)
  "foo"
  \withMusicProperty #'duration #(ly:make-duration 3 0 9)
  "foo"
  \withMusicProperty #'duration #(ly:make-duration 3 0 16)
  "foo"
}
  \new Staff \m
>>


Cheers,
  Harm

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


score-lines-markup-list in Lyrics?

2018-12-11 Thread Thomas Morley
Hi all,

this works:

\version "2.19.82"

tst = \markuplist \italic #(make-list 2 "buzz")

<<
  \new Staff { R1 \break R1 }
  \new Lyrics \lyricmode { $@tst }
>>

This doesn't work:

tstA =
\markuplist \score-lines { \repeat unfold 80 a'16 }

<<
  \new Staff { R1 \break R1 }
  \new Lyrics \lyricmode { $@tstA }
>>


I have some vague thoughts why it refuses to work, though I can't
really word them ...

Anyway, is it somehow doable?


Cheers,
  Harm

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


Re: Line-breaking with non-aligned barlines - again!

2018-12-10 Thread Thomas Morley
Am Mo., 10. Dez. 2018 um 18:25 Uhr schrieb David Sumbler :
>
> To recap:
>
>3 days ago I wrote (with this subject line) that I have a passage to
>set where one instrument (harpsichord) plays 8 bars in 4/4 time,
>consisting mainly of semiquavers (sixteenths).  It has to be played
>in strict time at its own tempo (4 = 108), which is quicker than the
>rest of the orchestra is playing.
>
>Although the harpsichord part must appear in the score, it is
>important that it is clear that it doesn't "fit" with the other
>instruments.  It starts at a common barline, but thereafter it does
>its own thing, so the positioning of the notes in the score is
>merely a suggestion of what is going on: in performance it won't
>necessarily fit precisely as it is shown in the score, but it is not
>expected to.
>
>By using scaled durations etc. I can get roughly the effect I want.
>But is it spoiled by one thing: there is a 4/4 time signature in all
>instruments (including the harpsichord) at the beginning of the
>passage, but there are also a couple of further time changes in the
>orchestra only.  It is easy enough to prevent these from appearing
>in the harpsichord part; but because Lilypond synchronises
>everything vertically (just as one wants it to 99.99% of the time)
>it ruins the effect.  This is because there is a large gap between
>successive notes in the harpsichord to allow for the time signature
>displayed in all the other staves.
>
> I have not had any suggestions as to how I might get Lilypond to set
> the harpsichord part without regard to the spacing on the other lines;
> this strongly suggests that, as I suspected, it can't be done!
> (Although if anyone knows otherwise, I'd be glad to hear about it.)

Well, you could try like below, but it has it's own short-comings:

\version "2.19.82"


\paper {
  ragged-right = ##f
}

harps = {
  \time 2/4
  \scaleDurations 8/11 {
b16[ b b b] b[ b b b] \bar "|" \noBreak b[ b b \bar ""
  }
  \noBreak
  \override Staff.TimeSignature.stencil = ##f
  \time 3/8
  \scaleDurations 3/4 {
b16] b[ b b b] \bar "|" \noBreak b[ b b \bar ""
  }
  \noBreak
  \time 5/8
  \scaleDurations 10/13 {
b16] b[ b b b] \bar "|" \noBreak  b[ b b b] b[ b b b]
  }
}

\score { \new Staff { \time 2/4 \repeat unfold 32 b16 } }

\score { \new Staff { \harps } }

\score {
  <<
\new Staff { \harps }
\new Staff {
  \time 2/4 b4 b |
  \time 3/8 b4 b8 |
  \time 5/8 b4 b b8 |
}
  >>
  \layout {
\context {
  \Score
  \remove "Timing_translator"
  \remove "Default_bar_line_engraver"
  %% !
  \override SpacingSpanner.strict-note-spacing = ##t
}
\context {
  \Staff
  \consists "Timing_translator"
  \consists "Default_bar_line_engraver"
}
  }
}

I'm not really convinced, thus I didn't post this before...

Cheers,
  Harm

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


Re: custom multiple bar number markup function

2018-12-10 Thread Thomas Morley
Am Mo., 10. Dez. 2018 um 11:37 Uhr schrieb Thomas Morley
:
>
> Am Mo., 10. Dez. 2018 um 06:18 Uhr schrieb Flaming Hakama by Elaine
> :
>
> > I'm basically unsure about every step here:
> >
> > Is there such a thing as "the default measure number markup function"?
>
> Yes, look into engraver-init.ly, there you'll find for "Score":
> barNumberFormatter = #robust-bar-number-function
> barNumberFormatter is a context-property, which is set to the
> procedure 'robust-bar-number-function'
>
> robust-bar-number-function is defined in translation-functions.scm
>
> >
> > Can I specify another function to be used instead of the
> > default measure number markup function, and if so, how?
>
> Yes - see below
>
> > Can I invoke this new measure number markup function on an as-needed basis--
> > not replace the default measure number markup function, since I would use 
> > that
> > everywhere other than the places I explicitly specify to use the new one?
>
> You would need to replace the default by the customized function and
> re-enable the default afterwards.
>
> >
> > Can I supply this function with a number-type argument?
>
> Sure.
>
> > Within my new measure number markup function, how can I access the current 
> > measure number?
>
> It's internally delivered, see the the 'barnum'-argument of
> 'robust-bar-number-function'
>
> > Within my new measure number markup function, how can I add numbers?
>
> Simple addition
>
> > Within my new measure number markup function How can I turn a number into 
> > markup?
>
> Convert into string.
>
> > Here is pseudocode, of what I thought the function might look like.
> > It doesn't work because, among other things,
> > * I don't know how to convert a number to a markup.
>
> See above
>
> > * I don't know how to override the default measure number markup function.
>
> Set the context-property 'barNumberFormatter' to the new procedure.
>
> > * The syntax of "let" is also confusing (I have to enclose everything
> > in another set of parens just to have scope where the variable is defined?)
>
> Well, I'd recommend to work through a guile/scheme tutorial.
>
> \version "2.19.82"
>
> #(define (double-bar-number increase-amount)
>   (lambda (barnum measure-pos alt-number context)
>#{
> \markup
>   \override #'(baseline-skip . 2)
>   \center-column {
>  #(number->string (+ increase-amount barnum))
>  #(robust-bar-number-function barnum measure-pos alt-number context)
>}
>#}))

Likely better to use the default procedure for both, making for:

#(define (double-bar-number increase-amount)
  (lambda (barnum measure-pos alt-number context)
   #{
\markup
  \override #'(baseline-skip . 2)
  \center-column {
 #(robust-bar-number-function
(+ increase-amount barnum) measure-pos alt-number context)
 #(robust-bar-number-function
barnum measure-pos alt-number context)
   }
   #}))
>
> \layout {
>   \context {
> \Score
> \override BarNumber.break-visibility = ##(#f #t #t)
>   }
> }
>
> % bass part
> \score {
> \relative c {
> \clef bass
> c1 | 1 | 1 | 1 | \break
> \set Score.barNumberFormatter = #(double-bar-number 4)
> \repeat volta 2 {
> \bar "[|:"
> b1 | 1 | 1 | 1
> \bar ":|]"
> } \break
> \set Score.barNumberFormatter = #robust-bar-number-function
> \set Score.currentBarNumber = #13
> e1 | 1 | 1 | 1 |
> }
> }
>
>
> Cheers,
>   Harm

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


Re: single bar wanted after repeat volta

2018-12-10 Thread Thomas Morley
Am Mo., 10. Dez. 2018 um 18:30 Uhr schrieb Veronika Neumann
:
>
> Hello,
>
>
> please have a look at the attached pdf file. I want the circled bar to
> be a single bar. I also included the lilypond file.
>
>
> Many thanks in advance!
>
>
> Veronika Neuman

Hi Veronika,

several possibilities:

%% Via \override Staff.BarLine.glyph-name
\score {
  <<
\relative c' {
  \key d \major

  \repeat volta 2 {
e2 r |
\set Score.repeatCommands = #(list (list 'volta "1., 3."))
R1
\set Score.repeatCommands = #'((volta #f) (volta "2., 4.") end-repeat)
r2
\set Score.repeatCommands = #'((volta #f))
r8 d4. |
\once \override Staff.BarLine.glyph-name =  "|"
  }
  d1 d1 \bar "|."
}
  >>
}

%% via \repeat { } \alternative { {} {} }
\score {
  <<
\relative c' {
  \key d \major

  \repeat volta 2 {
e2 r |
  }
  \alternative {
{
  \set Score.repeatCommands = #(list (list 'volta "1., 3."))
  R1
}
{
  \set Score.repeatCommands = #'((volta #f) (volta "2., 4.") end-repeat)
  r2
  \set Score.repeatCommands = #'((volta #f))
  r8 d4. |
}
  }
  d1 d1
  \bar "|."
}
  >>
}

%% all manually
\score {
  <<
\relative c' {
  \key d \major

\set Score.repeatCommands = #'(start-repeat)
e2 r |
\set Score.repeatCommands = #(list (list 'volta "1., 3."))
R1
\set Score.repeatCommands = #'((volta #f) (volta "2., 4.") end-repeat)
r2
\set Score.repeatCommands = #'((volta #f))
r8 d4. |
  d1 d1 \bar "|."
}
  >>
}


HTH,
  Harm

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


Re: custom multiple bar number markup function

2018-12-10 Thread Thomas Morley
Am Mo., 10. Dez. 2018 um 06:18 Uhr schrieb Flaming Hakama by Elaine
:

> I'm basically unsure about every step here:
>
> Is there such a thing as "the default measure number markup function"?

Yes, look into engraver-init.ly, there you'll find for "Score":
barNumberFormatter = #robust-bar-number-function
barNumberFormatter is a context-property, which is set to the
procedure 'robust-bar-number-function'

robust-bar-number-function is defined in translation-functions.scm

>
> Can I specify another function to be used instead of the
> default measure number markup function, and if so, how?

Yes - see below

> Can I invoke this new measure number markup function on an as-needed basis--
> not replace the default measure number markup function, since I would use that
> everywhere other than the places I explicitly specify to use the new one?

You would need to replace the default by the customized function and
re-enable the default afterwards.

>
> Can I supply this function with a number-type argument?

Sure.

> Within my new measure number markup function, how can I access the current 
> measure number?

It's internally delivered, see the the 'barnum'-argument of
'robust-bar-number-function'

> Within my new measure number markup function, how can I add numbers?

Simple addition

> Within my new measure number markup function How can I turn a number into 
> markup?

Convert into string.

> Here is pseudocode, of what I thought the function might look like.
> It doesn't work because, among other things,
> * I don't know how to convert a number to a markup.

See above

> * I don't know how to override the default measure number markup function.

Set the context-property 'barNumberFormatter' to the new procedure.

> * The syntax of "let" is also confusing (I have to enclose everything
> in another set of parens just to have scope where the variable is defined?)

Well, I'd recommend to work through a guile/scheme tutorial.

\version "2.19.82"

#(define (double-bar-number increase-amount)
  (lambda (barnum measure-pos alt-number context)
   #{
\markup
  \override #'(baseline-skip . 2)
  \center-column {
 #(number->string (+ increase-amount barnum))
 #(robust-bar-number-function barnum measure-pos alt-number context)
   }
   #}))

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

% bass part
\score {
\relative c {
\clef bass
c1 | 1 | 1 | 1 | \break
\set Score.barNumberFormatter = #(double-bar-number 4)
\repeat volta 2 {
\bar "[|:"
b1 | 1 | 1 | 1
\bar ":|]"
} \break
\set Score.barNumberFormatter = #robust-bar-number-function
\set Score.currentBarNumber = #13
e1 | 1 | 1 | 1 |
}
}


Cheers,
  Harm

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


Re: Raising fingerings

2018-12-09 Thread Thomas Morley
Am So., 9. Dez. 2018 um 17:18 Uhr schrieb Emilio Millan :
>
> I'm using fingerings for some above-the-staff harmonica notation. They are
> working well for this purpose but there is one bit of fine tuning I'd like
> to do if possible. In the example below, the fingerings are well-placed but
> the "G4" and "A4" are a bit higher to appropriately avoid the note stems. Is
> there a way to increase the default distance between the top of the staff
> and the fingerings so that "C4" through "E5" would all be colinear?


Add
\override Fingering.staff-padding = 1.5
and adjust the numerical value at taste

Cheers,
   Harm

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


LSR-snippet "Add wings to all repeat barlines (simple version)"

2018-12-09 Thread Thomas Morley
To the author of the LSR-snippet "Add wings to all repeat barlines
(simple version)"
http://lsr.di.unimi.it/LSR/Item?u=1=1055

Many thanks for your snippet.

Though, I think it duplicates "Changing the default bar lines"
http://lsr.di.unimi.it/LSR/Item?id=964
which is in our snippets-manual as well:
http://lilypond.org/doc/v2.19/Documentation/snippets-big-page#staff-notation-changing-the-default-bar-lines

Thus, I tend to delete your snippet. Agreed?

One hint for further LSR-contributions:
The LSR always runs stable versions, currently 2.18.2
so \time #'(2 3) 5/8 would have been needed, instead of \time 2,3 5/8

Thanks,
  Harm

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


Re: Generate staff-less chord and lyrics sheet

2018-12-09 Thread Thomas Morley
Am Sa., 8. Dez. 2018 um 10:08 Uhr schrieb Johan Vromans :
>
> On Thu, 6 Dec 2018 21:15:43 +0100, Annette Kusma 
> wrote:
>
> > The output should look something like this:
> >
> > C   F C
> > Mary had a little lamb
> >  F   G  C
> > Its fleece was white as snow
> >
> > I could simply write my sheet in some office programme,
>
> Instead of trying to abuse office programs, why not take a look at
> https://www.chordpro.org ?

I doubt the initial request will ever work sufficiently with LilyPond.

Well, it's possible to eleminate the hyphen and the space it creates,
yes, but ligatures are not possible.
It's the same as in markup, regard
\markup \override #'(word-space . 0) \line { f i }

If one "joins" the texts, in markup one could do \markup \concat { f i
}, then for LyricText you would need to "join" the duration as well.
How to place ChordName then?

Evenwithout Hyphen
<<
  \new ChordNames \chordmode { c4:7 c:7.13 }
  \new Devnull { c' c' }
  \new Lyrics \lyricmode { f i }
>>

the manually joined result looks strange in both cases

<<
  \new ChordNames \chordmode { c4:7 c:7.13 }
  \new Devnull { c' c' }
  \new Lyrics \lyricmode { fi2 }
>>

The warning about "staff-affinities should only decrease" may be cured
easily, though

Admittedly even with a text-editing program placing two chords with
extensions over a very short syllable may lead to unsatisfying
results.

So for now I'd like to second Johan pointing to a different program.



Cheers,
  Harm

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


Re: Glissando tweaks in chords

2018-12-08 Thread Thomas Morley
Am Fr., 7. Dez. 2018 um 06:08 Uhr schrieb Peter Crighton
:
>
> On Fri, 7 Dec 2018 at 03:00, Ben  wrote:
>>
>> On 12/6/2018 7:49 PM, Peter Crighton wrote:
>>
>> Hello all,
>>
>> I have the following (reduced) scenario where one voice has a chord with a 
>> glissando in it and I want to tweak both glissandos differently. Is it 
>> possible? The second (currently commented out) tweak is never applied even 
>> if I comment out the first tweak.
>>
>> \version "2.19.82"
>> one = \relative c'' {
>>   g2
>>   -\tweak Y-offset #0.25
>>   \glissando a
>> }
>> two = \relative c'' {
>>   \context Voice = "one" {
>> c2
>> % this tweak is never applied
>> % -\tweak Y-offset #-0.25
>> \glissando d
>>   }
>> }
>> \new Staff <<
>>   \new Voice = "one" \one
>>   \two
>> >>
>>
>> Thanks,
>> Peter
>>
>> A while ago, there was a function created that allowed tweaks like you're 
>> asking - I think this is what you are looking for :) It should get you 
>> started.
>>
>> http://lilypond.1069038.n5.nabble.com/How-to-tweak-override-the-individual-Glissando-objects-in-a-chord-td149575.html

This is one of my older codings. As far as adding text to glissandi is
concerned, I use a better coding nowadays, I'll probably out it in LSR
>
>
> Thanks, that helped a lot! I boiled it down to:
>
> \version "2.19.82"
> glissTweak =
>   #(define-music-function (parser location lst)(pair?)
> #{
>   \once \override Glissando #'after-line-breaking =
> #(lambda (grob)
>   (let ((gliss-count (ly:grob-property grob 'glissando-index)))
> (map (lambda (x)
>   (let ((gliss-nmbr (car x))
> (property-value-alist (cdr x)))
> (if (eq? gliss-nmbr gliss-count)
>   (map
> (lambda (y) (ly:grob-set-property! grob (car y) (cdr y)))
> property-value-alist)
>   #f)))
>   lst)))
You may replace the following line:
>   $(make-music 'EventChord 'elements (list (make-music 'GlissandoEvent)))
with
  <>\glissando
or delete it and put \glissando in \one below. Both works.
> #})
>
> one = \relative c'' {
>   \glissTweak #`((0 . ((Y-offset . 0.25)))
>  (1 . ((Y-offset . -0.25
>   g2 a
> }
> two = \relative c'' {
>   \context Voice = "one" {
> c2 d
>   }
> }
> \new Staff <<
>   \new Voice = "one" \one
>   \two
> >>
>
> This is lovely and very flexible and does what I need it to do (and more).
> But I would also be interested in a more minimal version because I usually 
> only care about Y-offsets. Preferably something that wouldn’t remove the 
> \glissandos from the syntax, so I could have something like
>
> \once \override Glissando.Y-offset =
> #(lambda (grob) (and
>   (if (= 0 (ly:grob-property grob 'glissando-index)) '0.25)
>   (if (= 1 (ly:grob-property grob 'glissando-index)) '-0.25)))
> 2\glissando 
>
> if only that would work. It probably won’t be as easy as that. But my Scheme 
> is very modest, and I don’t even know where to begin with something like 
> that. Any ideas?

It doesn't work because the return value is unspecified, if
glissando-index is zero. Try:

{
  \once \override Glissando.Y-offset =
#(lambda (grob)
  (cond
((= 0 (ly:grob-property grob 'glissando-index)) 1.25)
((= 1 (ly:grob-property grob 'glissando-index)) -1.25)
))
  2\glissando 
}
Ofcourse there is no coding yet, if glissando-index is greater than 1.
Btw, there's no need to prepend numbers in guile with a '-sign


Cheers,
  Harm

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


Re: combining/overlaying three or more markups

2018-12-06 Thread Thomas Morley
Am Do., 6. Dez. 2018 um 19:05 Uhr schrieb Kieren MacMillan
:
>
> Hi all,
>
> If I want to "layer" markups, is there a better way than \combine?
>
> If not, does \combine have a magic way to combine three or more markups that 
> doesn’t require chaining it like
>
> \markup \combine \markupA \combine \markupB \markupC
>
> ??
>
> Thanks,
> Kieren.

\overlay

Cheers,
  Harm

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


Re: Fingering vs stem direction

2018-12-05 Thread Thomas Morley
Am Mi., 5. Dez. 2018 um 11:28 Uhr schrieb Pierre Perol-Schneider
:
>
> Thank you Harm, that works fine (no beam/flag at that point).
> Cheers,
> Pierre

Ok, then I put not more work on it.

Glad I could help,
  Harm

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


Re: Fingering vs stem direction

2018-12-05 Thread Thomas Morley
Am Mi., 5. Dez. 2018 um 10:56 Uhr schrieb Pierre Perol-Schneider
:
>
> Thank you Harm,
> In this particular case, there is no chord.
> Cheers,
> Pierre

So why use event-chords and a context-property then?

Wouldn't below work already?

#(define (forced-dir-II grob)
  (let* ((x-parent (ly:grob-parent  grob X))
 (stem (ly:grob-object x-parent 'stem))
 (stem-dir (ly:grob-property stem 'direction)))
(if (= stem-dir 1)
(ly:grob-set-property! grob 'direction UP)
(ly:grob-set-property! grob 'direction DOWN

#(define (forced-dir-II grob)
  (let* ((x-parent (ly:grob-parent  grob X))
 (stem (ly:grob-object x-parent 'stem))
 (stem-dir (ly:grob-property stem 'direction)))
(if (= stem-dir 1)
(ly:grob-set-property! grob 'direction UP)
(ly:grob-set-property! grob 'direction DOWN

{
  \clef "G_8"
  \override Fingering.after-line-breaking = #forced-dir-II
  \override Fingering.staff-padding = #'()
  a4-4
  b-2
  a8-4
  \noBeam
  b-2
  a8-4[
  b-2]
}

How should it behave with flags and beams?


Cheers,
  Harm

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


Re: Fingering vs stem direction

2018-12-05 Thread Thomas Morley
Am Mi., 5. Dez. 2018 um 10:26 Uhr schrieb Pierre Perol-Schneider
:
>
> Hi All,
>
> I'm looking for a function that'll do:
>
> {
>   \clef "G_8"
>   \override Fingering.staff-padding = #'()
>   4
>   
> }
>
> As a first step, I've tried to adapt Harm's function found here: 
> http://lilypond.1069038.n5.nabble.com/position-text-opposite-stem-direction-td51758.html#a51759
> without succes:
>
> %% After Harm:
> #(define (forced-dir grob)
>   (let* ((x-parent (ly:grob-parent  grob X))
>  (elts (ly:grob-object x-parent 'elements))
>  (grob-name (lambda (x) (assq-ref (ly:grob-property x 'meta) 'name)))
>  (stems (filter (lambda (x) (eq? 'Stem (grob-name x)))
> (ly:grob-array->list elts)))
>  (stem (list-ref stems 0))
>  (stem-dir (ly:grob-property stem 'direction)))
>
> (if (= stem-dir 1)
> (ly:grob-set-property! grob 'direction up)
> (ly:grob-set-property! grob 'direction down
>
>
> {
>   \clef "G_8"
>   \set fingeringOrientations = #'(forced-dir)
>   \override Fingering.staff-padding = #'()
>   4
>   
> }
>
> Thanks in advance for any help,
> Cheers,
> Pierre
>

Hi Pierre,

this will not work here for several reasons.
Can't look deeper into it right now (have to run for my regular job).
Probably in the evening.

Though, how do you want the fingerings, if you have real chords (more
than one note)?

Cheers,
  Harm

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


Re: Schenker graph example

2018-12-03 Thread Thomas Morley
And I have absolutely no idea why your image is in my reply :(((
I didn't see it, I didn't attach it. Wtf

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


Re: Not Nice Review of the LilyPond

2018-12-02 Thread Thomas Morley
Am So., 2. Dez. 2018 um 19:47 Uhr schrieb Sandro Santilli :
>
> On Sun, Dec 02, 2018 at 04:53:58PM +0100, Thomas Morley wrote:
> >
> > The proposed _ly-syntax_ is
> > \parenthesize 
> > \parenthesize #'left 
> > \parenthesize #'right 
> > No parens.
>
> To be honest I still find that syntax hard to understand.
> Replace the 3  with A B and C, how would the
> above code render those chords ?
>
> I'm guessing it would be:
>
> A ( B C )

No.

>
> But if that's the case, what is the initial \parenthesize for ?

Try it out ;)

The basic problem is that we have no possibility to draw parentheses
around a section of sequential music, but we can parenthesize single
events, with the parenthesize-command.


So now you have the situation to need some functionality doing what
you want _and_ you need to tell LilyPond about it.

Let's do some very fundamental brainstorming.
First: Which syntax would you prefer to tell LilyPond she should draw brackets?
As an example let's take two chord: A B
And two commands: openBracket and closeBracket.
In the end (A B) should be printed, leading to four theoretical syntax
possibilities:
1)  openBracket A  closeBracket B
2)  openBracket A B closeBracket
3)  A openBracket closeBracket B
4)  A openBracket B closeBracket

The chosen syntax will have consequences. here some of them:
ad 1) This is the syntax you know from the code you use or from my
coding or from most of the workarounds which were created over the
years.
Meaning openBracket and closeBracket are usually commands/functions
doing something with their argument.
These commands and functions are usually overrides or context-settings.
ad 2) This is infix style and general deprecated in LilyPond, although
there's still a single excption, but if you search the NR for infix
you'll notice the remark about dropping this style entirely.
ad 3) I assume we agree this would be weird.
ad 4) This is post fix style and could work only if the commands
initiate something for A and B. One possibility would be a spanner and
the commands would have to be used as post-events. Like \startTextSpan
and \stopTextSpan.
Probably one could think of something at the lines of how fingerings
are printed (left or right), but I guess it would be more complicated.

To summarize:
1) and 4) remain.
Most codings tackling this problem used the 1) syntax. Although 4) is
doable I believe, at least as a spanner, I don't know any attempt
following this route, though

What do you prefer?
Tbh, I don't see any other possibility.

Apart from my LSR-snippet which I linked to already. Did you try it out?

>
> Note I used code found in
> http://lists.gnu.org/archive/html/lilypond-user/2016-10/msg00574.html
> which has similar hard-to-understand syntax, I used as such:
>
> | g2:6 \leftParen bes2:dim5 |
> a4:m7 \rightParen d2:7
>
> Guess how it is rendered ?
> For obscure reason,

see above

> the right paren goes _after_
> the d2:7 (which is what I want, but looks weird
> in the source code).
>
> Please note: I love the lilypond and even more the _community_ around
> it, so don't take my observations as destructive as they really don't
> want to be :)
>
> --strk;
>
>

Cheers,
  Harm

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


Re: Not Nice Review of the LilyPond

2018-12-02 Thread Thomas Morley
Am So., 2. Dez. 2018 um 16:34 Uhr schrieb Sandro Santilli :
>
> On Sun, Dec 02, 2018 at 03:26:44PM +0100, Thomas Morley wrote:
> > Am So., 2. Dez. 2018 um 14:01 Uhr schrieb Sandro Santilli :
> > >
> > > Very obscure way to put chords
> > > in parenthesis (I asked yesterday).
> >
> > I beg to differ.
>
> Really ? And right after this statement you post a 36 lines
> snippet of code full of parens ? :P
>
> I know Lilypond is powerful, that's why I still use it, but
> it's hard not to notice how obscure its code is (what is it,
> scheme?)
>
> --strk;

The proposed _ly-syntax_ is
\parenthesize 
\parenthesize #'left 
\parenthesize #'right 
No parens.

Obviously this is not default LilyPond, thus I proposed a _function_
which offers it.
This function is written in guile, the scheme-dialect used by LilyPond
as it's extension-language. Btw, it's the official GNU extension
language.
For _usage_ such snippets are usually stored away somewhere and
included in you actual file.

Ofcourse noone will hinder you to dive into the code of the function
or the source-code in general, but you don't need to if you simply
want to use it.



Cheers,
  Harm

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


Re: Not Nice Review of the LilyPond

2018-12-02 Thread Thomas Morley
Am So., 2. Dez. 2018 um 14:01 Uhr schrieb Sandro Santilli :
>
> On Sun, Dec 02, 2018 at 11:01:36AM +, J Martin Rushton wrote:
>
> > "LilyPond source files appear to be written in a custom programming
> > language whose grammar is never discussed."
> > - I'm afraid this one is bang on target.
>
> Hey, I have the exact same feeling. Very obscure way to put chords
> in parenthesis (I asked yesterday).

I beg to differ.
It's the consequence of entering ChordNames as music and the
possibility to have them in midi, let them display as notes in Staff
etc
To keep those features you may try:

parenthesize =
#(define-music-function (dir arg) ((symbol? #f) ly:music?)

#{
  $(if dir
   #{
   \once \override ParenthesesItem.stencils =
 #(lambda (grob)
(let ((lp (ly:font-get-glyph
(ly:grob-default-font grob)
"accidentals.leftparen"))
  (rp (ly:font-get-glyph
(ly:grob-default-font grob)
"accidentals.rightparen")))
  (cond ((eq? dir 'left)
 (list lp empty-stencil))
((eq? dir 'right)
 (list empty-stencil rp))
(else
  (ly:warning "unknown direction: \"~a\", ignoring" dir)
  (list lp rp)
   #})
%% the defaulr parenthesize
  $(if (memq 'event-chord (ly:music-property arg 'types))
   ;; arg is an EventChord -> set the parenthesize property
   ;; on all child notes and rests
   (for-each
(lambda (ev)
  (if (or (memq 'note-event (ly:music-property ev 'types))
  (memq 'rest-event (ly:music-property ev 'types)))
  (set! (ly:music-property ev 'parenthesize) #t)))
(ly:music-property arg 'elements))
   ;; No chord, simply set property for this expression:
   (set! (ly:music-property arg 'parenthesize) #t))
  $arg
#})


\new ChordNames
  \chordmode {
\override ChordName.stencil =
#(lambda (grob)
  (box-stencil
(ly:text-interface::print grob)
0 0))

  %% default
\parenthesize c1
%% left paren
\parenthesize #'left c:7
%% right paren
\parenthesize #'right d:5+
%% issues a warning and both parentheses are done
\parenthesize #'whatever ees
  }

@ David:
Would this be a useful extension/replacement of our current default
\parenthesize?

Otoh,
it's often requested to enter ChordNames as markup without any nice features.
For this pupose I made
http://lsr.di.unimi.it/LSR/Item?u=1=1057
Currently unapproved (as you see it has a pretty verbose description lol)...
It's usable, though.
You could enter:

  \new ChordMarkup
\lyricmode {
  "C:13" C:alt "C:7.alt" "Gm:7.(b5)/F"
  (C D) [Cm Dm]
}

Getting the attached output

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


Re: Parenthesized second key signature

2018-12-01 Thread Thomas Morley
Am Fr., 30. Nov. 2018 um 12:02 Uhr schrieb Tyler Mitchell :
>
> On Fri, Nov 30, 2018 at 11:09:52AM +0100, Thomas Morley wrote:
> > Probably it's enough to use the music-function-default-arguments,
> > which can be omitted with newer versions, i.e.:
> >
> > alternativeKey =
> > #(define-music-function (parser location p-1 p-2 scale-def)
> >  (ly:pitch? ly:pitch? number-pair-list?)
> > ...
> >
> > Cheers,
> >   Harm
>
> Thanks, that worked perfectly!
>
> Tyler

I've put a revised snippet in the LSR.
Available here:
http://lsr.di.unimi.it/LSR/Item?u=1=1075


Cheers,
  Harm

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


Re: Parenthesized second key signature

2018-11-30 Thread Thomas Morley
Am Fr., 30. Nov. 2018 um 09:19 Uhr schrieb Tyler Mitchell :
>
> On Thu, Nov 29, 2018 at 10:10:16PM +0100, Thomas Morley wrote:
> > Hi,
> >
> > I once made below (here a little lifted up):
> >
> [...snip...]
> >
> > HTH,
> >   Harm
>
> Thanks, Harm, I'll give it a try, but it looks like I'll need to
> get on the -devel branch first. (I quickly attempted it on 2.18.2
> but it didn't work.)

Probably it's enough to use the music-function-default-arguments,
which can be omitted with newer versions, i.e.:

alternativeKey =
#(define-music-function (parser location p-1 p-2 scale-def)
 (ly:pitch? ly:pitch? number-pair-list?)
...

Cheers,
  Harm

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


Re: Protecting against page breaks in markup

2018-11-29 Thread Thomas Morley
Am Do., 29. Nov. 2018 um 23:22 Uhr schrieb David Kastrup :
>
> Thomas Morley  writes:
>
> > Am Do., 29. Nov. 2018 um 11:04 Uhr schrieb Richard Shann
> > :
> >
> >>
> >> As a further point is the term "standard markup objects" well-
> >> documented - does it mean "top-level markups", or what I tend to refer
> >> to as \markup{} blocks?
> >
> > I think what's meant is the difference between \markup and \markuplist
>
> It's worth pointing out that for typographic treatment a toplevel markup
> (namely a markup invoked outside of any other expression) is
> indistinguishable from a markup list with a single element: either are
> processed by calling toplevel-text-handler with a markup list (in case
> of the markup, a list containing just one markup as element).
>
> --
> David Kastrup

You mean what can be observed with below?

\markup \italic "foo-1"
\markup \italic "bar-1"
\markup \italic "buzz-1"

\markuplist \italic { "foo-2" "bar-2" "buzz-2" }

#(newline)
#(display-scheme-music (reverse (ly:parser-lookup 'toplevel-scores)))

=>

(list (list (markup #:italic "foo-1"))
  (list (markup #:italic "bar-1"))
  (list (markup #:italic "buzz-1"))
  (list (markup #:italic "foo-2")
(markup #:italic "bar-2")
(markup #:italic "buzz-2")))


If I add:
\paper {
  ragged-last-bottom = ##f
  markup-markup-spacing.stretchability = 1000
}
and watch the printed output, the single markups are distributed over
the page, while the elements of the markuplist are kept close
together.
Am undecided whether I should have expected it or should be surprised ... lol


Cheers,
  Harm

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


Re: Protecting against page breaks in markup

2018-11-29 Thread Thomas Morley
Hi Richard,

please bear in mind I'm not a native speaker.
Thus work on the docs is pretty difficult for me.

That said:

Am Do., 29. Nov. 2018 um 11:04 Uhr schrieb Richard Shann
:
> On Thu, 2018-11-29 at 09:50 +0100, Thomas Morley wrote:
> > Well, in NR 1.8.1 Writing text one can read about toplevel
> > markup/markuplist:
> > "
> > Separate text
> > ...
> > Separate text blocks can be spread over multiple pages, making it
> > possible to print text documents or books entirely within LilyPond.
> > This feature, and the specific syntax it requires, are described in
> > Multi-page markup.
> > ...
> > "
> >
> > And later
> >
> > "
> > Multi-page markup
> >
> > Although standard markup objects are not breakable, a specific syntax
> > makes it possible to enter lines of text that can spread over
> > multiple
> > pages:
> > "
> >
> > Could you suggest how to improve this?
>
> Yes, I think I can. The presence of the word "Although" in the last-
> quoted paragraph indicates that the writer expected that the fact that
> standard markup objects were not breakable had been documented
> elsewhere.

I think "standard markup" is a little foggy.
Probably:
"Although text objects invoked with \markup are not breakable, ..."

and in NR 1.8.1

Separate text
...

Separate text entered with \markup can't be distributed over multiple
pages, thus a a page break will happen only before or after the whole
text. In extreme cases the text will exceed the paper bottom.
Nevertheless, separate text blocks can be spread over multiple pages,
making it possible to print text documents or books entirely within
LilyPond. This feature, and the specific syntax it requires, are
described in Multi-page markup.


> I suggest
>
> "4.3.2 Page breaking
>
> The default page breaking may be overridden by inserting \pageBreak or
> \noPageBreak commands. "
>
> could become
>
> "4.3.2 Page breaking
>
> By default page breaks may be inserted at bar lines and between top-
> level markups. The default page breaking may be overridden by inserting
> \pageBreak or \noPageBreak commands. "

Quoting a little more from NR:
"The default page breaking may be overridden by inserting \pageBreak
or \noPageBreak commands. These commands are analogous to \break and
\noBreak. They should be inserted at a bar line.
[...]
The \pageBreak and \noPageBreak commands may also be inserted at
top-level, between scores and top-level markups."

Does it not contain all what's needed to know?

>
> As a further point is the term "standard markup objects" well-
> documented - does it mean "top-level markups", or what I tend to refer
> to as \markup{} blocks?

I think what's meant is the difference between \markup and \markuplist


Cheers,
  Harm

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


Re: Parenthesized second key signature

2018-11-29 Thread Thomas Morley
Am Do., 29. Nov. 2018 um 11:57 Uhr schrieb Tyler Mitchell :
>
> I'm trying to figure out how to add a "parenthesized" second key
> signature to my music, something like this:
>
> https://www.ldx.ca/tmp/paren-key-1.png
>
> I experimented with adding two \key commands one after the other,
> but I get the error:
>
> foo.ly:5:9: warning: Two simultaneous key-change events, junking this 
> one
>
> The following comes somewhat close, though there's a bit of an
> undesirable gap between the two key signatures; and I can't figure
> out how to increase the size of the parentheses; and I have to use
> the 'second' key signature throughout to avoid a lot of unneeded
> accidentals; and I wouldn't be able to use a time signature, as it
> would be stuck between these two key signatures.
>
> \version "2.18.2"
>
> \relative c'' {
>   \key a \major
>   \once\override NoteHead.stencil = ##f
>   \once\override Stem.stencil = ##f
>   a4
>   % Doesn't seem to have any effect:
>   \override ParenthesesItem.font-size = #5
>   \parenthesize
>   \key aes \major
>   aes4
> }
>
> \layout { \context { \Staff printKeyCancellation = ##f \remove 
> Time_signature_engraver } }
>
> Any suggestions for how I should approach this?
>
> A "stretch goal" would be to have accidentals handled automatically
> in the same way, eg:
>
> https://www.ldx.ca/tmp/paren-key-2.png
>
> But this seems a bit more involved (and unneeded, at least
> initially).
>
> Many thanks,
> Tyler

Hi,

I once made below (here a little lifted up):

\version "2.19.82"

alternativeKey =
#(define-music-function (p-1 p-2 scale-def)
 (ly:pitch? ly:pitch? number-pair-list?)
#{
  \override Staff.KeySignature.stencil =
   #(lambda (grob)
  (let* ((staff-space (ly:staff-symbol-staff-space grob))
 (line-thickness (ly:staff-symbol-line-thickness grob))
 (th line-thickness)
 (default-stil (ly:key-signature-interface::print grob))
 ;; To avoid programming error @code{(markup #:null)} is returned if
 ;; the scale would not result in a printed KeySignature.
 ;; TODO: add the other scales: ionian, locrian etc
 (stil-to-add
   (grob-interpret-markup grob
 (if (or (and (= (ly:pitch-notename p-2) 5)
  (= (ly:pitch-alteration p-2) 0)
  (eq? scale-def minor))
 (and (= (ly:pitch-notename p-2) 0)
  (= (ly:pitch-alteration p-2) 0)
  (eq? scale-def major)))
 (markup #:null)
 #{
   \markup
 \score {
   { \key $p-2 $scale-def }
   \layout {
 \override Staff.TimeSignature #'stencil = ##f
 \override Staff.Clef #'stencil = ##f
 \override Staff.StaffSymbol #'line-count = #0
 indent = 0
   }
   }
 #})
 ))
 (stil-to-add-x-ext (ly:stencil-extent stil-to-add X))
 (stil-to-add-y-ext (ly:stencil-extent stil-to-add Y)))
(if (< 0 (interval-length stil-to-add-x-ext))
(if (or (and (= (ly:pitch-notename p-1) 5)
 (= (ly:pitch-alteration p-1) 0)
 (eq? scale-def minor))
(and (= (ly:pitch-notename p-1) 0)
 (= (ly:pitch-alteration p-1) 0)
 (eq? scale-def major)))
(bracketify-stencil
  (ly:make-stencil
(ly:stencil-expr stil-to-add)
;; left bracket is to far away
;; trimmed a little
(cons
   (+ (car stil-to-add-x-ext) (* 0.7 staff-space) )
   (cdr stil-to-add-x-ext))
;; adjusting the top and bottom ending of the bracket
(cons
   (+ (car stil-to-add-y-ext) (* 0.2 staff-space))
   (- (cdr stil-to-add-y-ext) (* 0.5 staff-space
  Y th (* 2.5 th) th)
(ly:stencil-combine-at-edge
  default-stil
  X
  RIGHT
  (bracketify-stencil
(ly:make-stencil
  (ly:stencil-expr stil-to-add)
  ;; left bracket is to far away
  ;; trimmed a little
  (cons
 (+ (car stil-to-add-x-ext) (* 0.7 staff-space) )
 (cdr stil-to-add-x-ext))
  ;; adjusting the top and bottom ending of the bracket
  (cons
 (+ (car stil-to-add-y-ext) (* 0.2 staff-space))
 (- (cdr stil-to-add-y-ext) (* 0.5 staff-space
Y th (* 2.5 th) th)
1))
  default-stil)))

  \key $p-1 $scale-def
#})

%%
% EXAMPLES

Re: how to reference paper variables in a music function

2018-11-29 Thread Thomas Morley
Am Do., 29. Nov. 2018 um 09:34 Uhr schrieb Jeff Olson :
>
> I have a complex Mutopia submission that requires different formatting
> for A4 and Letter sized paper (it's too tight on the page to trust
> lilypond's spacing algorithms on the same source without paper specific
> tweaks).
>
> So I'd like to define a music function (see "ifLetter" below) that can
> sense the paper choice and select either of two music definitions
> accordingly.
>
> In the demo below, I'd like to switch output between music-one (one
> system) and music-two (two systems) depending upon which paper size is
> set.  But I'm just guessing about how to reference the documented
> variable "paper-width" to compare to the value 8.5\in.  In the attempt
> below, the condition always evaluates to ##f and produces two systems on
> letter size paper (I want music-one for letter paper).
>
> I'd prefer testing a variable whose value was "letter" (rather than 8.5
> inches) but I couldn't find such a variable documented (paper-size?,
> default-paper-size?).
>
> I've seen ly:output-def-lookup, but that requires a props or layout that
> is not obvious how to access within a music function.
>
> The code below produces the expected results when the condition (eqv?
> 'paper:paper-width (* 8.5 25.4))is rewritten as(eqv? 1 1) or (eqv? 1 2).
>
> BTW, documented spacing examples suggest that the construct (* 8.5 in)
> should be effective in scheme, but I get a compile error indicating that
> "in" is unbound, so I've written in 25.4 as a literal.
>
> BTW2, I've similarly been unable to access the paper variable page-count
> within a music function.
>
> Thx,
> Jeff
> --
> \version "2.18.2"
>
> \paper{
>page-count = #1
>%#(set-paper-size "a4")  %uncomment to test specific paper size
>#(set-paper-size "letter")  %uncomment to test specific paper size
> }
>
> music-one = { a b c d e f g }
> music-two = { a b c d \break e f g }
>
> ifLetter =
> #(define-music-function (parser location musL musE) (ly:music? ly:music?)
> (if (eqv? 'paper:paper-width (* 8.5 25.4)) musL musE )
> )
>
> \score { \ifLetter \music-one \music-two }

There are several paper-variables, ofcourse accessible _in_ \paper:

%% to have access to 'pretty-print' it's not part of \paper but
present in ly-files
#(define pretty-print pretty-print)

\paper {
   page-count = #1
   #(set-paper-size "letter")
   #(pretty-print
  (list
in
page-count
paper-width
papersizename))
}

=> (25.4 1 215.9 "letter")

Looking from elsewhere you need to go for (ly:output-def-lookup
$defaultpaper ...):

#(pretty-print
  (list
(ly:output-def-lookup $defaultpaper 'in)
(ly:output-def-lookup $defaultpaper 'page-count)
(ly:output-def-lookup $defaultpaper 'paper-width)
(ly:output-def-lookup $defaultpaper 'papersizename)))

=> (25.4 () 210.0 "a4")

So your function could be:

\paper {
   page-count = #1
   #(set-paper-size "letter")
}

music-one = { a^"one" b c d e f g }
music-two = { a^"two" b c d \break e f g }

ifLetter =
#(define-music-function (parser location musL musE) (ly:music? ly:music?)
(if (equal? (ly:output-def-lookup $defaultpaper 'papersizename) "letter")
musL musE))

\score { \ifLetter \music-one \music-two }


Cheers,
  Harm

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


Re: Protecting against page breaks in markup

2018-11-29 Thread Thomas Morley
Am Do., 29. Nov. 2018 um 09:33 Uhr schrieb Richard Shann
:
>
> On Wed, 2018-11-28 at 15:45 +0100, Lukas-Fabian Moser wrote:
> > > Sorry, I should have made it clearer that this index is being
> > > automatically generated. Now you point out that there is an
> > > \autoOageBreaksOff, which is what I thought I needed, I realize
> > > that it
> > > wouldn't help - I would need to turn them off and back on between
> > > each
> > > entry in the hope that LilyPond would take advantage of such an
> > > Off/On
> > > sequence to insert a page break in between if needed, which I'm
> > > sure it
> > > wouldn't :(
> >
> > I'm not sure I understand you correctly, but it is perfectly possible
> > to
> > forbid page breaks between arbitrary markup lines:
> yes, that's what I needed to do, and I'm now doing that - it's working
> fine now. What I didn't realize was that Lily will not put page breaks
> inside a \markup {} - Harm pointed this out to me via his \column
> {\line .. \line ...} example, Lily does not break at any of the
> \lines.
> Once he'd tipped me off I looked again at the docs and saw that,
> although they don't quite explicitly say that Lily will not page break
> inside a markup block it is implied by the bit of the docs I quoted
> "The \pageBreak and \noPageBreak commands may also be inserted [...]
> between [...] top-level markups."
> Perhaps the Docs should contain an explicit statement there that no
> automatic breaking will happen inside a \markup {} ...
>
> Richard

Well, in NR 1.8.1 Writing text one can read about toplevel markup/markuplist:
"
Separate text
...
Separate text blocks can be spread over multiple pages, making it
possible to print text documents or books entirely within LilyPond.
This feature, and the specific syntax it requires, are described in
Multi-page markup.
...
"

And later

"
Multi-page markup

Although standard markup objects are not breakable, a specific syntax
makes it possible to enter lines of text that can spread over multiple
pages:
"

Could you suggest how to improve this?


Cheers,
  Harm

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


Re: Protecting against page breaks in markup

2018-11-27 Thread Thomas Morley
Am Di., 27. Nov. 2018 um 16:22 Uhr schrieb Richard Shann
:
>
> I'm creating an index to my scores, in the form of a sequence of
> LilyPond markups (for title, composer, first few bars etc).

What exactly are you doing? An example would be nice.

> It is working well apart from page breaking which can occur mid-entry.
> Is there a way of turning page breaks off and back on around each
> entry?

Well, of course you know about \noPageBreak and \pageBreak.

Probably you can wrap a \column around all the single markups. At
least page-break can then only happen before or after the whole
thingy.
Depends on what you actually (want to) do.

Cheers,
  Harm

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


Re: Comparison of Musescore, Sibelius and Dorico -- would like to add Lilypond

2018-11-26 Thread Thomas Morley
Am Di., 27. Nov. 2018 um 00:16 Uhr schrieb Malte Meyn :

> „Notes, forked stems“ (l. 109)
> → should be „yes (fake: rotated stems or custom lines)“
>

Or like attached pdf.
Most recent code here (if someone's interested)
https://archiv.lilypondforum.de/index.php/topic,1176.msg6932.html#msg6932

Cheers,
  Harm


splayed-stems-07.pdf
Description: Adobe PDF document
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Spacing issue after Mark and TextScript

2018-11-25 Thread Thomas Morley
Am So., 25. Nov. 2018 um 16:09 Uhr schrieb Phil Holmes :
>
> - Original Message -
> From: "David Sumbler" 
>
> > The parameters NonMusicalPaperColumn and suchlike have long been a
> > mystery to me.  If it can be done reasonably succinctly, could you
> > perhaps explain what NonMusicalPaperColumn.keep-inside-line #'() and
> > PaperColumn.keep-inside-line #'() actually do?
> >
> > David
>
>
> The old NR says:
>
> Checking to make sure that text scripts and lyrics are within the margins
> requires additional
> calculations. In cases where slightly faster performance is desired, use
>
> \override Score.PaperColumn #'keep-inside-line = ##f
>
> and
>
> keep-inside-line (boolean)
> If set, this column cannot have objects sticking into the margin.
>
> Hope that makes sense.
>
> --
> Phil Holmes
>

To illustrate what Phil wrote, compile the following code with and
without the relevant overrides:

\score {
  <<
{
  \repeat unfold 16 { c'4 \noBreak }
  \tempo "Allegro molto, ma non troppo"
  c'
  \repeat unfold 31 c'4
}
\new Lyrics \lyricmode {
  \repeat unfold 19 xy
  whateverlongtext
  \repeat unfold 28 xy
}
  >>
  \layout {
\context {
  \Score
  \override NonMusicalPaperColumn.keep-inside-line = #'()
  \override PaperColumn.keep-inside-line = #'()
}
  }
}


Though I think there's a bug somewhere.

Play around with the code below.
I made it so, that you only need to change one numeric value in the
function call, i.e. increase the 0.00 in \addScore #(+ 64.25 0.00)
As soon as 0.01 is chosen the StaffSymbol's extent is increased
although there's really no need for (larger numbers make it more
obvious).
I suspect the extents of TextScript and Mark are _added_, whereas one
should take the _maximum_ of both.
Maybe some confusing happens because TextScript is usually in
PaperColumn's elements whereas the others are in the
NonMusicalPaperColumn's elements, but here I'm really guessing...
Interestingly the value 64.25 is very close to half of the line-width
plus left/right-margin-_default_ (not the scaled left/right-margin).

But here the code for testing:

\version "2.19.82"


%% A boxed stencil with settable width, for Mark and TextScript
#(define (x-var-stil x)
  (box-stencil (ly:make-stencil '() (cons 0 x) '(-1 . 1)) 0 0))

%% A procedure to display StaffSymbol.stencil, line-width,
%% left- and right-margin
#(define print-staff-symbol-stil-length
  (lambda (staff-symbol)
   (format #t
"\n\tStaffSymbol.stencil has length: ~a
\tline-width is: ~a
\tleft-margin is: ~a
\trightmargin is: ~a\n"
 (interval-length
   (ly:stencil-extent (ly:staff-symbol::print staff-symbol) X))
 (ly:output-def-lookup (ly:grob-layout staff-symbol) 'line-width)
 (ly:output-def-lookup (ly:grob-layout staff-symbol) 'left-margin)
 (ly:output-def-lookup (ly:grob-layout staff-symbol) 'right-margin

%% A void function adding a score to current book. The score has a
%% RehearsalMark and a TextScript. Those grobs stencil-width are set by the
%% 'val'-argument.
addScore =
#(define-void-function (val)(number?)
(add-score
#{

\score {
  { \mark \default c'1 _"" \noBreak 1 1 }
  \layout {
  indent = 0
\context {
  \Score
  \omit BarNumber
  \override RehearsalMark.stencil = #(x-var-stil val)
  %\override NonMusicalPaperColumn.keep-inside-line = #'()
  %\override PaperColumn.keep-inside-line = #'()
}
\context {
  \Staff
  \override StaffSymbol.after-line-breaking =
#print-staff-symbol-stil-length
}
\context {
  \Voice
  \textLengthOn
  \override TextScript.stencil = #(x-var-stil val)
}
  }
}
#}))

\addScore #(+ 64.25 0.00)

Anyone with further insights?


Cheers,
  Harm

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


Re: Spacing issue after Mark and TextScript

2018-11-24 Thread Thomas Morley
'
Am Sa., 24. Nov. 2018 um 22:28 Uhr schrieb Thomas Morley
:
>
> Am Fr., 23. Nov. 2018 um 15:28 Uhr schrieb David Sumbler :
> >
> > -Original Message-
> > From: David Sumbler 
> > Reply
> > -To: da...@aeolia.co.uk
> > To: lilypond-user@gnu.org
> > Subject: Spacing issue after Mark and TextScript
> > Date: Wed, 21 Nov 2018 12:24:29 +
> >
> > %%%
> > \version "2.19.81"
> >
> > #(set-global-staff-size 12)
> >
> > indent = #0
> >
> > { \textLengthOn
> >   \time 5/4
> >   r2 r4.
> >   \override Score.RehearsalMark.self-alignment-X = #-1
> >   \override Score.RehearsalMark.font-size = #5
> >   \mark \markup {"After the thirty-third encore, the Emperor arose."}
> >   \hide TextScript
> >   r8\fermata_"m"
> >   r4 |
> > %%%  \noBreak
> >   R4*5 | R4*5 | R4*5 |
> > }
> > %%%
> >
> > When the above is compiled, the spacing for notes/rests after the Mark
> > and TextScript is increased.  This becomes even more obvious if
> > \noBreak is uncommented: the final crotchet rest of the first bar and
> > the whole bar rest of the second now take up so much horizontal space
> > that the line runs outside of the right-hand margin, as is shown in the
> > attached image.  Meanwhile the rests at the start of the first bar are
> > squashed together to make room for the unnecessary empty spaces later
> > in the line.  Things are restored to normal after a line break.
> >
> > If I remove either the RehearsalMark or the TextScript, the problem
> > disappears.  The purpose of the textscript is to prevent the crotchet
> > rest appearing before the "Mark" is finished.
> >
> > I have used the same kind of structure in numerous other places in this
> > piece without problems, and despite nearly a day of experimentation I
> > can't see why this case behaves differently.  (There are reasons for
> > presenting these texts as Marks rather than Text attached to a rest,
> > but they are not relevant to the problem.)
> >
> > Any suggestions?  Is there perhaps a way of resetting the spacing
> > parameters to something sensible?
> >
> > David
> >
> > -Original Message-
> > From: Pedro Pessoa 
> > To: lilypond-user@gnu.org
> > Subject: Re: Spacing issue after Mark and TextScript
> > Date: Wed, 21 Nov 2018 09:26:42 -0700 (MST)
> >
> > Hey David. Not sure if I got how you want it to be, but - with the
> > \nobreak
> > uncommented) - if you add tree more m's to the TextScript, it produces
> > something which looks right. Don't know why.
> >
> > Pessoa
> >
> > mailing_Spacing_issue_after_Mark_and_TextScript.png
> > <
> > http://lilypond.1069038.n5.nabble.com/file/t5699/mailing_Spacing_issue_after_Mark_and_TextScript.png>
> >
> > --
> >
> >
> > True - it looks as if the spacing text (the ""-s) needs to be as
> > far as possible exactly the same length as the TextScript.
> >
> > But add even one more "m" and the right-hand end of the staff is again
> > noticeably beyond the right margin.
> >
> > And even with the "correct" number of "m"s, so that the end of the line
> > appears in (roughly?) the right place, the rests at the beginning of
> > the line are ridiculously compressed together.  The space give to the
> > crotchet rest at the end of the bar is far greater than that allowed
> > for the dotted crotchet earlier in the same bar.
> >
> > Does anyone have any idea what is going on here?
> >
> > David
>
> I noticed with version 2.12.3 the output is as desired.
>
> Then I identified the first commit which changes the behaviour. First
> bad commit is:
>
> commit 53db923e715126eb9463220526b4838fbfd3dad4
> Author: Andrew Hawryluk 
> Date:   Sat Jan 15 13:42:03 2011 -0700
>
> Change keep-inside-line defaults to true.
>
> As discussed in Issue #1470, the default should be changed so that
> good layout with a slight performance hit is the default.
>
> https://sourceforge.net/p/testlilyissues/issues/1470/
> https://codereview.appspot.com/4243041/
> Which is LilyPond-version 2.13.52
>
>
> Tbh, I never noticed bad behaviour caused by this patch before.
> I suspect something rotten is present elsewhere, though I've no clue
> what it might be or where to look...
>
>
> Nevertheless, you could revert the settings done by this patch globally with:
>
> \layo

Re: Spacing issue after Mark and TextScript

2018-11-24 Thread Thomas Morley
Am Fr., 23. Nov. 2018 um 15:28 Uhr schrieb David Sumbler :
>
> -Original Message-
> From: David Sumbler 
> Reply
> -To: da...@aeolia.co.uk
> To: lilypond-user@gnu.org
> Subject: Spacing issue after Mark and TextScript
> Date: Wed, 21 Nov 2018 12:24:29 +
>
> %%%
> \version "2.19.81"
>
> #(set-global-staff-size 12)
>
> indent = #0
>
> { \textLengthOn
>   \time 5/4
>   r2 r4.
>   \override Score.RehearsalMark.self-alignment-X = #-1
>   \override Score.RehearsalMark.font-size = #5
>   \mark \markup {"After the thirty-third encore, the Emperor arose."}
>   \hide TextScript
>   r8\fermata_"m"
>   r4 |
> %%%  \noBreak
>   R4*5 | R4*5 | R4*5 |
> }
> %%%
>
> When the above is compiled, the spacing for notes/rests after the Mark
> and TextScript is increased.  This becomes even more obvious if
> \noBreak is uncommented: the final crotchet rest of the first bar and
> the whole bar rest of the second now take up so much horizontal space
> that the line runs outside of the right-hand margin, as is shown in the
> attached image.  Meanwhile the rests at the start of the first bar are
> squashed together to make room for the unnecessary empty spaces later
> in the line.  Things are restored to normal after a line break.
>
> If I remove either the RehearsalMark or the TextScript, the problem
> disappears.  The purpose of the textscript is to prevent the crotchet
> rest appearing before the "Mark" is finished.
>
> I have used the same kind of structure in numerous other places in this
> piece without problems, and despite nearly a day of experimentation I
> can't see why this case behaves differently.  (There are reasons for
> presenting these texts as Marks rather than Text attached to a rest,
> but they are not relevant to the problem.)
>
> Any suggestions?  Is there perhaps a way of resetting the spacing
> parameters to something sensible?
>
> David
>
> -Original Message-
> From: Pedro Pessoa 
> To: lilypond-user@gnu.org
> Subject: Re: Spacing issue after Mark and TextScript
> Date: Wed, 21 Nov 2018 09:26:42 -0700 (MST)
>
> Hey David. Not sure if I got how you want it to be, but - with the
> \nobreak
> uncommented) - if you add tree more m's to the TextScript, it produces
> something which looks right. Don't know why.
>
> Pessoa
>
> mailing_Spacing_issue_after_Mark_and_TextScript.png
> <
> http://lilypond.1069038.n5.nabble.com/file/t5699/mailing_Spacing_issue_after_Mark_and_TextScript.png>
>
> --
>
>
> True - it looks as if the spacing text (the ""-s) needs to be as
> far as possible exactly the same length as the TextScript.
>
> But add even one more "m" and the right-hand end of the staff is again
> noticeably beyond the right margin.
>
> And even with the "correct" number of "m"s, so that the end of the line
> appears in (roughly?) the right place, the rests at the beginning of
> the line are ridiculously compressed together.  The space give to the
> crotchet rest at the end of the bar is far greater than that allowed
> for the dotted crotchet earlier in the same bar.
>
> Does anyone have any idea what is going on here?
>
> David

I noticed with version 2.12.3 the output is as desired.

Then I identified the first commit which changes the behaviour. First
bad commit is:

commit 53db923e715126eb9463220526b4838fbfd3dad4
Author: Andrew Hawryluk 
Date:   Sat Jan 15 13:42:03 2011 -0700

Change keep-inside-line defaults to true.

As discussed in Issue #1470, the default should be changed so that
good layout with a slight performance hit is the default.

https://sourceforge.net/p/testlilyissues/issues/1470/
https://codereview.appspot.com/4243041/
Which is LilyPond-version 2.13.52


Tbh, I never noticed bad behaviour caused by this patch before.
I suspect something rotten is present elsewhere, though I've no clue
what it might be or where to look...


Nevertheless, you could revert the settings done by this patch globally with:

\layout {
  \context {
\Score
\override NonMusicalPaperColumn.keep-inside-line = #'()
\override PaperColumn.keep-inside-line = #'()
  }
}

This may have some unwanted effects, though.
Less invasive would be:

#(set-global-staff-size 12)

indent = #0

{ \textLengthOn
  \time 5/4
  r2 r4.

  \overrideProperty Score.NonMusicalPaperColumn.keep-inside-line #'()
  \overrideProperty Score.PaperColumn.keep-inside-line #'()
  \override Score.RehearsalMark.self-alignment-X = #-1
  \override Score.RehearsalMark.font-size = #4
  \mark \markup {"After the thirty-third encore, the Emperor arose."}
  \hide TextScript
  r8\fermata_"m"
  r4 |
  \noBreak
  R4*5 | R4*5 | R4*5 |
}


HTH,
  Harm

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


Re: v2.19.82 documentation unusable?

2018-11-23 Thread Thomas Morley
Am Do., 22. Nov. 2018 um 23:49 Uhr schrieb Patrick Karl :
>
> I have lately been trying to move from v2.19.81 to 2.19.82.  The biggest 
> problem I see at this early stage is that
>  v2.19.82 documentation is apparently dependent upon a new font, 
> Emmentaler-20.  Or at least I
> get an error message such as:
>
> Cannot find or create the font Emmentaler-20. Some characters may not display 
> or print correctly.
>
> or
>
> Cannot find or create the font TeXGyroSchola-Regular. Some characters may not 
> display or print correctly.
>
> I have downloaded the pdf version of the documentation.  I’m running OS X 
> 10.11.6 on a mac pro and a macbook pro.
>
> Does anyone have any helpful information here?  Does any of the documentation 
> address this problem, which I have not encountered in the past (I’ve been 
> running LilyPond since 2.14).

It's a known problem, see full discussion here:
http://lilypond.1069038.n5.nabble.com/PDF-docs-for-2-19-82-broken-missing-fonts-td214202i20.html

Phil, David, any news about it?


Cheers,
  Harm

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


Re: Getting context-definiton, while being in applyContext

2018-11-18 Thread Thomas Morley
Am So., 18. Nov. 2018 um 22:16 Uhr schrieb David Kastrup :
>
> Thomas Morley  writes:
>
> > As a side-effect of this thread I learned that doing
> > whatever = \context Staff \applyContext #(lambda (ctx) ...)
> > will affect Staff _and_ all it's alias. Furthermore it can be put as
> > is into \with or \layout or directly into music.
>
> All with different effect.  In \with, it will affect the current
> context, no questions asked.  In \layout (or \midi), it will affect
> _all_ context definitions of the respective output definition having an
> alias to Staff .

Which is intended, at least it's what I'd want.

> Directly in music, it will walk the hierarchy upwards
> until finding a context aliased to Staff and will affect only that.

Not sure whether this may cause problems in some situations, although
I expect only rare cases.

I think I'll add the workaround to the issue, there is none atm.
For guitarists it's a common problem, I wonder why not more people
complained about it over the years. This issue is 10 years old!

Cheers,
  Harm

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


Re: Getting context-definiton, while being in applyContext

2018-11-18 Thread Thomas Morley
Am So., 18. Nov. 2018 um 21:15 Uhr schrieb David Kastrup :
>
> Thomas Morley  writes:
>
> > Am So., 18. Nov. 2018 um 20:40 Uhr schrieb David Kastrup :
> >
> >> Just do
> >>
> >> (eq? ctx (ly:context-find ctx 'Staff))
> >>
> >> --
> >> David Kastrup
> >
> > I did not even consider to use ly:context-find. The description says:
> > Find a _parent_ of context that has name or alias name. Return #f if not 
> > found.
> > So I expected it could return
> > Staff as parent of Voice
> > StaffGroup as parent of Staff
> > Score as parent of StaffGroup
> >
> > Similar to
> > Function: ly:context-parent context
> > Return the parent of context, #f if none.
> > Although this one returns a tree of contexts not even a single parent.
> > At least for me this was a surprise.
> >
> > Is my understanding of parents with contexts entirely wrong ...?
>
> Probably not.  I remembered that the function was there.  I read the doc
> string and said "huh?".  I read the C++ code and said "WTF?".  And then
> I pretended that this was totally obvious to make me look smart.

Rofl

> In my
> defense, I did not write that doc string (at least I hope so).
>
> "Find a parent" does not make a lot of sense considering that each
> context has at most one parent.
>
> It's more like "Find among the chain of successive direct parents
> starting with the context itself".

Indeed.

> Some of our doc strings are not particularly helpful.

Very true.

> At least the
> function itself is.

Indeed.

Some background:
Today I was beaten by
https://sourceforge.net/p/testlilyissues/issues/556/
"fingeringOrientations affects cross-voices arpeggio"
which is still present with 2.21.0
and tried to find a workaround.

As a side-effect of this thread I learned that doing
whatever = \context Staff \applyContext #(lambda (ctx) ...)
will affect Staff _and_ all it's alias. Furthermore it can be put as
is into \with or \layout or directly into music.
So I don't need to restrict it to Staff-like contexts anymore, this is
now built-in. :)

But here the code:

correctConnectedArpeggio =
  \context Staff
  \applyContext
#(lambda (ctx)
   (let* ((x-offs '())
  (mom '()))
 (ly:context-pushpop-property ctx 'Arpeggio 'before-line-breaking
   (lambda (grob)
 (if (negative? (ly:grob-property grob 'direction))
 (let ((grob-mom (grob::when grob))
   (x-off-proc (ly:grob-property-data grob 'X-offset)))
   (set! x-offs
 (if (equal? grob-mom mom)
 (cons (x-off-proc grob) x-offs)
 '()))
   (set! mom (grob::when grob))
   (if (pair? x-offs)
   (ly:grob-set-property!
 grob
 'X-offset
 ;; Mmmh, is using the arbitrary 10 sufficient?
 (apply min 10 (drop x-offs 1))

melody = \relative c'' {
  \voiceOne
  \set fingeringOrientations = #'(left)
  2\arpeggio
  \set fingeringOrientations = #'(right)
  \arpeggio
  \set fingeringOrientations = #'(up)
  1\arpeggio
}

bass = \relative c' {
  \voiceTwo
  \set fingeringOrientations = #'(left)
  2\arpeggio
  \set fingeringOrientations = #'(right)
  \arpeggio
  \set fingeringOrientations = #'(down)
  1\arpeggio
}

\score {
  \context Staff \with {
\consists "Span_arpeggio_engraver"
\correctConnectedArpeggio
  }
  <<
\set Staff.connectArpeggios = ##t
\context Voice = "melody" { \melody }
\context Voice = "bass"   { \bass   }
  >>
}


Thanks,
  Harm

P.S.
  You _are_ smart :))

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


Re: Getting context-definiton, while being in applyContext

2018-11-18 Thread Thomas Morley
Am So., 18. Nov. 2018 um 20:40 Uhr schrieb David Kastrup :

> Just do
>
> (eq? ctx (ly:context-find ctx 'Staff))
>
> --
> David Kastrup

I did not even consider to use ly:context-find. The description says:
Find a _parent_ of context that has name or alias name. Return #f if not found.
So I expected it could return
Staff as parent of Voice
StaffGroup as parent of Staff
Score as parent of StaffGroup

Similar to
Function: ly:context-parent context
Return the parent of context, #f if none.
Although this one returns a tree of contexts not even a single parent.
At least for me this was a surprise.

Is my understanding of parents with contexts entirely wrong ...?

Anyway, the following works very nicely:

foo =
  \applyContext
#(lambda (ctx)
   (let* ((ctx-name (ly:context-name ctx)))
 (if (eq? ctx (ly:context-find ctx 'Staff))
 (format #t "\n\tI'm in a staff-like context: ~a" ctx-name)
 (format #t "\n\tWrong here in: ~a" ctx-name

\score {
  <<
\new StaffGroup R1
\new Staff R1
\new TabStaff R1
\new DrumStaff R1
\new ChoirStaff R1
  >>
  \layout {
  \context Staff \foo
\context {
  \StaffGroup
  \foo
}
\context {
  \ChoirStaff
  \foo
}
  }
}

Thanks,
  Harm

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


Re: Getting context-definiton, while being in applyContext

2018-11-18 Thread Thomas Morley
Am So., 18. Nov. 2018 um 19:19 Uhr schrieb David Kastrup :
>
> Thomas Morley  writes:
>
> > Hi,
> >
> > consider the code below. I'd like to restrict usage to Staff-like
> > contexts, i.e. Staff, Tab- and DrumStaff, etc would be ok, but
> > container-contexts like StaffGroup, etc should lead to return '().
> >
> > Pseudo-code:
> >
> > \new Staff(Group)
> >   \with {
> > \applyContext
> >  #(lambda (context)
> >(if 
> >;; Do something, if we are in a Staff-like context
> >;;   Multiple Bottom-contexts may happen
> >(lambda (x) ...)
> >;; Do nothing if we are are in container-contexts like 
> > ChoirStaff,
> >;; StaffGroup, etc
> >'()
> >)
> >   }
> > { c''1 }
> >
> > I thought the  could be "Do I have the Staff_symbol_engraver?"
> > Though, how to code?
> > \applyContext
> >  #(lambda (context)
> >(ly:context-def-lookup context 'consists))
> > does not work, because 'context' is not a context-definition.
> >
> > Any hint how to proceed would be great.
>
> Why don't you check whether they have a Staff alias?  Basically if
> looking up 'Staff returns the context itself.
>
> --
> David Kastrup

You mean like below?

foo =
  \applyContext
#(lambda (ctx)
   (let* ((ctx-name (ly:context-name ctx))
  (staff-ctx-def (ly:output-find-context-def $defaultlayout 'Staff))
  (staff-like? (assoc-get ctx-name staff-ctx-def #f)))

   (if staff-like?
   (format #t "\n\tI'm in a staff-like context: ~a" ctx-name)
   (format #t "\n\tWrong here in: ~a" ctx-name

\score {
  <<
\new StaffGroup R1
\new Staff R1
\new TabStaff R1
\new DrumStaff R1
\new ChoirStaff R1
  >>
  \layout {
  \context Staff \foo
\context {
  \StaffGroup
  \foo
}
\context {
  \ChoirStaff
  \foo
}
  }
}

Thanks,
  Harm

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


Re: Getting context-definiton, while being in applyContext

2018-11-18 Thread Thomas Morley
Am So., 18. Nov. 2018 um 18:23 Uhr schrieb Thomas Morley
:
>
> Hi,
>
> consider the code below. I'd like to restrict usage to Staff-like
> contexts, i.e. Staff, Tab- and DrumStaff, etc would be ok, but
> container-contexts like StaffGroup, etc should lead to return '().
>
> Pseudo-code:
>
> \new Staff(Group)
>   \with {
> \applyContext
>  #(lambda (context)
>(if 
>;; Do something, if we are in a Staff-like context
>;;   Multiple Bottom-contexts may happen
>(lambda (x) ...)
>;; Do nothing if we are are in container-contexts like ChoirStaff,
>;; StaffGroup, etc
>'()
>)
>   }
> { c''1 }
>
> I thought the  could be "Do I have the Staff_symbol_engraver?"
> Though, how to code?
> \applyContext
>  #(lambda (context)
>(ly:context-def-lookup context 'consists))
> does not work, because 'context' is not a context-definition.
>
> Any hint how to proceed would be great.
>
>
> Thanks,
>   Harm

To answer my own question
(ly:output-find-context-def $defaultlayout (ly:context-name context))
will return an alist of context-defs for current context and all the aliases.

To checking for the engraver in the relevant context-def is trivial now.

Cheers,
  Harm

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


Getting context-definiton, while being in applyContext

2018-11-18 Thread Thomas Morley
Hi,

consider the code below. I'd like to restrict usage to Staff-like
contexts, i.e. Staff, Tab- and DrumStaff, etc would be ok, but
container-contexts like StaffGroup, etc should lead to return '().

Pseudo-code:

\new Staff(Group)
  \with {
\applyContext
 #(lambda (context)
   (if 
   ;; Do something, if we are in a Staff-like context
   ;;   Multiple Bottom-contexts may happen
   (lambda (x) ...)
   ;; Do nothing if we are are in container-contexts like ChoirStaff,
   ;; StaffGroup, etc
   '()
   )
  }
{ c''1 }

I thought the  could be "Do I have the Staff_symbol_engraver?"
Though, how to code?
\applyContext
 #(lambda (context)
   (ly:context-def-lookup context 'consists))
does not work, because 'context' is not a context-definition.

Any hint how to proceed would be great.


Thanks,
  Harm

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


Re: Attaching images to posts

2018-11-18 Thread Thomas Morley
Am So., 18. Nov. 2018 um 08:36 Uhr schrieb Andrew Bernard
:
>
> What is the approved and recommend way to attach images for small examples to 
> posts in this list?
>
> In the past I have just made an attachment to the post,

Please continue to do so.
Speaking only for myself, frequently I don't see inline images here.
Sometimes there is some hint an image could be there, then I have to
look into the archives, which is tedious. Sometimes there is nothing
at all...

Though, I think I'm not the only one refusing to allow inline-images generally.

> but it occurred to me that may not be the best thing to do.

Why do you think so?

Huge images shoul be uploaded elsewhere and then linked to anyway.


Cheers,
  Harm

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


Re: markup column with baseline-skip relative to font size

2018-11-17 Thread Thomas Morley
Am Sa., 17. Nov. 2018 um 12:03 Uhr schrieb Thomas Morley
:

> Default \center-column does not adjust baseline-skip according to the
> grobs font-size.
> Below I wrote 'center-column-fontsize-adjusted-baseline-skip' (you
> should probably rename it, lol), which does so. Modeled after how
> \fontsize deals with baseline-skip.

And this causes a huge glitch.
'center-column-fontsize-adjusted-baseline-skip' is not compatible with
\fontsize, baseline-skip would be tackled twice ...

One could circumvent it by refusing to use /fontsize, but \magnify
#(magstep ).

Well, I'll should rethink the whole matter


Cheers,
  Harm

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


<    4   5   6   7   8   9   10   11   12   13   >