Re: Ossia at the first line of a PianoStaff

2022-02-17 Thread Knute Snortum
On Thu, Feb 17, 2022 at 4:01 PM Jean Abou Samra  wrote:
>
> Le 18/02/2022 à 00:43, Knute Snortum a écrit :
> > On Thu, Feb 17, 2022 at 11:32 AM Jean Abou Samra  wrote:
> > Thanks, that gets rid of the brace.  Is there any way to get rid of
> > the bar span that connects the ossia staff to the piano staff?
>
>
>
> Alright, I was too focused on the bracket. I'm tired, so I may
> be missing a simpler solution, but this should do:
>
> \version "2.22.1"
>
>
> ossia = \markup \small \italic "ossia"
>
> \layout {
>\context {
>  \Score
>  \remove System_start_delimiter_engraver
>}
>\context {
>  \PianoStaff
>  \name InnerPianoStaff
>}
>\context {
>  \PianoStaff
>  \accepts InnerPianoStaff
>  systemStartDelimiter = #'SystemStartBar
>}
> }
>
>
> <<
>\new Staff = "ossia" \with {
>  \remove "Time_signature_engraver"
>  \hide Clef
>  \hide BarLine
>  \override BarLine.allow-span-bar = ##f
>  \override KeySignature.stencil = ##f
>  \magnifyStaff #2/3
>}
>\relative {
>  \stopStaff
>  s1
>  \key c \minor
>  \startStaff ees'4^\ossia g8 f ees2*1/2 \stopStaff
>  s4 s1*2
>  \startStaff g4 ees8 f g2*1/2 \stopStaff
>}
>\new PianoStaff \new InnerPianoStaff <<
>  \new Staff = "upper" \relative {
>\key c \minor
>c'4 b c2
>ees4 f ees2
>g4 aes g2 % \break
>c4 b c2 \break
>g4 aes g2
>ees4 d c2
>  }
>  \new Staff = "lower" \relative {
>\key c \minor
>\repeat unfold 24 { \clef bass c4 }
>  }
>>>
>  >>

Thanks, that looks great!  I hope you're reading this after a good
night's sleep.

--
Knute Snortum



Re: Add text to score without affecting spacing

2022-02-17 Thread Jean Abou Samra

Le 17/02/2022 à 22:58, Kieren MacMillan a écrit :

Hi Jean,


By the way: pedantically, I would recommend

Thanks for that.


Basically, \null leads to point-stencil, which has
the extent '(0 . 0) on both axes -- a single-point
interval. That's small, but not totally empty.
empty-interval is '(+inf.0 . -inf.0) which is truly
empty, and this is the extent of empty-stencil on
both axes.

I've found interesting failures when using empty-stencil, e.g., this snippet 
based on a David K suggestion:

%%%  SNIPPET BEGINS
\version "2.23.4"

ignoreH =
\propertyTweak horizontal-skylines ##f
\propertyTweak extra-spacing-width #empty-interval
\etc

ignoreV =
\propertyTweak vertical-skylines ##f
\propertyTweak extra-spacing-height #empty-interval
\etc

ignore = \ignoreH \ignoreV \etc

{
   c'4-\ignore _\f
%  c'4-\ignore ^\markup "test"  %%  uncomment to see failure
}
%%%  SNIPPET ENDS

Sometime it's very hard to know what to use in Lilypond… 




Uh-oh.

https://gitlab.com/lilypond/lilypond/-/merge_requests/1216

Here the failure is caused by the skylines set to
##f. The error only occurs when the script is positioned
up (“^”), so you can work around it until the fix appears
in a release by changing the position indicator to “_”
(it will still give warnings though). Depending on your
taste and how hardly you want the overrides to remove
the object's presence in spacing, you could even set
X-extent/Y-extent to #empty-interval rather than
extra-spacing-width/extra-spacing-height (the 2.23.6
documentation has a new section on horizontal spacing
with an example that illustrates the difference, see
http://lilypond.org/doc/v2.23/Documentation/notation/spacing-between-adjacent-columns).
That also gives warnings, also taken care of by the
linked merge request.

Cheers,
Jean




Re: Ossia at the first line of a PianoStaff

2022-02-17 Thread Jean Abou Samra

Le 18/02/2022 à 00:43, Knute Snortum a écrit :

On Thu, Feb 17, 2022 at 11:32 AM Jean Abou Samra  wrote:
Thanks, that gets rid of the brace.  Is there any way to get rid of
the bar span that connects the ossia staff to the piano staff?




Alright, I was too focused on the bracket. I'm tired, so I may
be missing a simpler solution, but this should do:

\version "2.22.1"


ossia = \markup \small \italic "ossia"

\layout {
  \context {
    \Score
    \remove System_start_delimiter_engraver
  }
  \context {
    \PianoStaff
    \name InnerPianoStaff
  }
  \context {
    \PianoStaff
    \accepts InnerPianoStaff
    systemStartDelimiter = #'SystemStartBar
  }
}


<<
  \new Staff = "ossia" \with {
    \remove "Time_signature_engraver"
    \hide Clef
    \hide BarLine
    \override BarLine.allow-span-bar = ##f
    \override KeySignature.stencil = ##f
    \magnifyStaff #2/3
  }
  \relative {
    \stopStaff
    s1
    \key c \minor
    \startStaff ees'4^\ossia g8 f ees2*1/2 \stopStaff
    s4 s1*2
    \startStaff g4 ees8 f g2*1/2 \stopStaff
  }
  \new PianoStaff \new InnerPianoStaff <<
    \new Staff = "upper" \relative {
  \key c \minor
  c'4 b c2
  ees4 f ees2
  g4 aes g2 % \break
  c4 b c2 \break
  g4 aes g2
  ees4 d c2
    }
    \new Staff = "lower" \relative {
  \key c \minor
  \repeat unfold 24 { \clef bass c4 }
    }
  >>
>>


Best,
Jean




Re: Ossia at the first line of a PianoStaff

2022-02-17 Thread Knute Snortum
On Thu, Feb 17, 2022 at 11:32 AM Jean Abou Samra  wrote:
>
> Le 17/02/2022 à 19:01, Knute Snortum a écrit :
> > I have another problem that I'd love help with.  (Sorry for all the
> > questions lately.)
> >
> > The piece of music I'm working on is a piano piece with several ossia
> > bars.  I've been researching how to do this and I've come across a
> > problem I can't fix.  If the ossia bar is the first bar of a new line,
> > the PianoStaff brace and bar span are attached.  In the middle of the
> > staff all is fine.
> >
> > I've attached the code to produce the problem and an image of what it
> > produces.  Any help would be greatly appreciated.
>
>
>
> The most low-tech fix would be to move the ossia context
> out of the PianoStaff:
>
> \version "2.22.1"
>
> ossia = \markup \small \italic "ossia"
>
>
> <<
>\new Staff = "ossia" \with {
>  \remove "Time_signature_engraver"
>  \hide Clef
>  \hide BarLine
>  \override BarLine.allow-span-bar = ##f
>  \override KeySignature.stencil = ##f
>  \magnifyStaff #2/3
>}
>\relative {
>  \stopStaff
>  s1
>  \key c \minor
>  \startStaff ees'4^\ossia g8 f ees2*1/2 \stopStaff
>  s1*2
>  \startStaff g4 ees8 f g2*1/2 \stopStaff
>}
>\new PianoStaff <<
>  \new Staff = "upper" \relative {
>\key c \minor
>c'4 b c2
>ees4 f ees2
>g4 aes g2 % \break
>c4 b c2 \break
>g4 aes g2
>ees4 d c2
>  }
>  \new Staff = "lower" \relative {
>\key c \minor
>\repeat unfold 24 { \clef bass c4 }
>  }
>>>
>  >>

Thanks, that gets rid of the brace.  Is there any way to get rid of
the bar span that connects the ossia staff to the piano staff?

--
Knute Snortum


Re: Add text to score without affecting spacing

2022-02-17 Thread Kieren MacMillan
Hi Jean,

> By the way: pedantically, I would recommend

Thanks for that.

> Basically, \null leads to point-stencil, which has
> the extent '(0 . 0) on both axes -- a single-point
> interval. That's small, but not totally empty.
> empty-interval is '(+inf.0 . -inf.0) which is truly
> empty, and this is the extent of empty-stencil on
> both axes.

I've found interesting failures when using empty-stencil, e.g., this snippet 
based on a David K suggestion:

%%%  SNIPPET BEGINS
\version "2.23.4"

ignoreH =
   \propertyTweak horizontal-skylines ##f
   \propertyTweak extra-spacing-width #empty-interval
   \etc

ignoreV =
   \propertyTweak vertical-skylines ##f
   \propertyTweak extra-spacing-height #empty-interval
   \etc

ignore = \ignoreH \ignoreV \etc

{
  c'4-\ignore _\f
%  c'4-\ignore ^\markup "test"  %%  uncomment to see failure
}
%%%  SNIPPET ENDS

Sometime it's very hard to know what to use in Lilypond… 

— Kieren


Re: Naming midi files

2022-02-17 Thread Mark Probert


Thank you, everyone, especially to David for the study code. All this 
info is greatly appreciated!

 .. mark. 



Re: Add text to score without affecting spacing

2022-02-17 Thread Valentin Petzel
Hello Jean,
thank you for that insight. I have been using \with-dimension #'(0 . 0) #'(0 . 
0) on RehearsalMark grobs so far.

The use case here is generation of playing animation. Basically I am using an 
engraver to print information about the current position into the score, which 
is then output to svg from which then this information is extracted.

It works quite fine for now, I might post a link to an example (as long as 
nobody feels threatened by my horrible playing). The only nagging problem I 
have is that font output is not optimal with the SVG output (like the lack of 
otf features).

Best regards,
Valentin

17.02.2022 22:25:26 Jean Abou Samra :

> Le 10/02/2022 à 01:08, Kieren MacMillan a écrit :
>> \markup \with-dimensions-from \null "foobar"
> 
> 
> By the way: pedantically, I would recommend
> 
> \markup \with-dimensions #empty-interval #empty-interval "foobar"
> or
> \markup \with-dimensions-from \stencil #empty-stencil "foobar"
> or
> \markup \with-outline #empty-stencil "foobar"
> over
> \markup \with-dimensions-from \null "foobar"
> 
> Because the dimensions of \null can still matter in some cases.
> Here's one that comes to mind:
> 
> \version "2.22.1"
> 
> \markup \column {
>   a b c
>   \with-dimensions-from \null d
>   e f g
> }
> 
> \markup \vspace #2
> 
> \markup \column {
>   a b c
>   \with-dimensions #empty-interval #empty-interval d
>   e f g
> }
> 
> 
> Basically, \null leads to point-stencil, which has
> the extent '(0 . 0) on both axes -- a single-point
> interval. That's small, but not totally empty.
> empty-interval is '(+inf.0 . -inf.0) which is truly
> empty, and this is the extent of empty-stencil on
> both axes.
> 
> Best,
> Jean



Re: Add text to score without affecting spacing

2022-02-17 Thread Jean Abou Samra

Le 10/02/2022 à 01:08, Kieren MacMillan a écrit :

\markup \with-dimensions-from \null "foobar"



By the way: pedantically, I would recommend

\markup \with-dimensions #empty-interval #empty-interval "foobar"
or
\markup \with-dimensions-from \stencil #empty-stencil "foobar"
or
\markup \with-outline #empty-stencil "foobar"
over
\markup \with-dimensions-from \null "foobar"

Because the dimensions of \null can still matter in some cases.
Here's one that comes to mind:

\version "2.22.1"

\markup \column {
  a b c
  \with-dimensions-from \null d
  e f g
}

\markup \vspace #2

\markup \column {
  a b c
  \with-dimensions #empty-interval #empty-interval d
  e f g
}


Basically, \null leads to point-stencil, which has
the extent '(0 . 0) on both axes -- a single-point
interval. That's small, but not totally empty.
empty-interval is '(+inf.0 . -inf.0) which is truly
empty, and this is the extent of empty-stencil on
both axes.

Best,
Jean




Re[2]: Splitting voices

2022-02-17 Thread E Appeldoorn

Thanks Lukas, I would never have figured that out.

-- Origineel bericht --
Van: "Lukas-Fabian Moser" 
Aan: "E Appeldoorn" ; "Lilypond" 


Verzonden: 17-2-2022 22:08:09
Onderwerp: Re: Splitting voices


Hi Erik,

I have a score consisting of 5 strings. Near the end all instrument 
voices (except the bass) split into two. The top voice being a solo, 
and the bottom one the rest. I have managed this for one voice, but 
can't figure out how to add second violin, viola, and cello in the 
same manner, then adding the single line bass below that. Here's what 
I created.
All voices would need to be in the main group, Any help would be much 
appreciated.

How about:

\version "2.22.1"

\layout {
  indent = 20
  short-indent = 15
  \context {
\Score
\RemoveAllEmptyStaves
  }
}

\new StaffGroup <<
  \new GrandStaff \with {
instrumentName = "Vln. I"
shortInstrumentName = "Vln. I"
  }
  <<
\new Staff \with {
  shortInstrumentName = solo
} \relative {
  s1*6
  c'1 d e d
}
\new Staff \relative {
  c''1 | c | b | a | g | f | \break
  \set Staff.shortInstrumentName = tutti
  g | f | e | d
}
  >>

  \new GrandStaff \with {
instrumentName = "Vln. II"
shortInstrumentName = "Vln. II"
  }
  <<
\new Staff \with {
  shortInstrumentName = solo
} \relative {
  s1*6
  c'1 d e d
}
\new Staff \relative {
  c''1 | c | b | a | g | f | \break
  \set Staff.shortInstrumentName = tutti
  g | f | e | d
}
  >>

  \new GrandStaff \with {
instrumentName = "Vla"
shortInstrumentName = "Vla"
  }
  <<
\new Staff \with {
  \clef alto
  shortInstrumentName = solo
} \relative {
  s1*6
  c'1 d e d
}
\new Staff \with { \clef alto } \relative {
  c''1 | c | b | a | g | f | \break
  \set Staff.shortInstrumentName = tutti
  g | f | e | d
}
  >>
  \new Staff \with {
\clef bass
instrumentName = "Bassi"
shortInstrumentName = "Vc/Cb"
  }
  \relative {
c1 d e d c d e d c d
  }
>>

Lukas


Re: Add text to score without affecting spacing

2022-02-17 Thread Jean Abou Samra

Le 16/02/2022 à 15:26, Kieren MacMillan a écrit :

Hi Aaron,


There are a number of grobs that normally have no visual representation. You 
could attach your content there

This is really clever!
Can you imagine *any* possible downside to this approach?



I think it depends on the use case. For debugging, this is just
perfect.  For adding text positioned manually, I would use something
else.  LilyPond has its own debugging hooks that use this method (such
as ly:paper-column::print) so the two will interfere if you try to use
these hooks. Also, I wouldn't consider the position of such internal objects
super stable; for example it might simplify the code at some point to
make the reference point of the last NonMusicalPaperColumn in the line
placed on the left like all other NonMusicalPaperColumns, and not on
the right like it is currently. Another thing to consider is that you
cannot have several pieces of text on several layers with this method.
For text that ends up in the actual score, I would use the good old
method <>^\markup \with-dimensions #empty-interval #empty-interval ...


Cheers,
Jean




Re: Splitting voices

2022-02-17 Thread Lukas-Fabian Moser

Hi Erik,

I have a score consisting of 5 strings. Near the end all instrument 
voices (except the bass) split into two. The top voice being a solo, 
and the bottom one the rest. I have managed this for one voice, but 
can't figure out how to add second violin, viola, and cello in the 
same manner, then adding the single line bass below that. Here's what 
I created.
All voices would need to be in the main group, Any help would be much 
appreciated.


How about:

\version "2.22.1"

\layout {
  indent = 20
  short-indent = 15
  \context {
    \Score
    \RemoveAllEmptyStaves
  }
}

\new StaffGroup <<
  \new GrandStaff \with {
    instrumentName = "Vln. I"
    shortInstrumentName = "Vln. I"
  }
  <<
    \new Staff \with {
  shortInstrumentName = solo
    } \relative {
  s1*6
  c'1 d e d
    }
    \new Staff \relative {
  c''1 | c | b | a | g | f | \break
  \set Staff.shortInstrumentName = tutti
  g | f | e | d
    }
  >>

  \new GrandStaff \with {
    instrumentName = "Vln. II"
    shortInstrumentName = "Vln. II"
  }
  <<
    \new Staff \with {
  shortInstrumentName = solo
    } \relative {
  s1*6
  c'1 d e d
    }
    \new Staff \relative {
  c''1 | c | b | a | g | f | \break
  \set Staff.shortInstrumentName = tutti
  g | f | e | d
    }
  >>

  \new GrandStaff \with {
    instrumentName = "Vla"
    shortInstrumentName = "Vla"
  }
  <<
    \new Staff \with {
  \clef alto
  shortInstrumentName = solo
    } \relative {
  s1*6
  c'1 d e d
    }
    \new Staff \with { \clef alto } \relative {
  c''1 | c | b | a | g | f | \break
  \set Staff.shortInstrumentName = tutti
  g | f | e | d
    }
  >>
  \new Staff \with {
    \clef bass
    instrumentName = "Bassi"
    shortInstrumentName = "Vc/Cb"
  }
  \relative {
    c1 d e d c d e d c d
  }
>>

Lukas


Splitting voices

2022-02-17 Thread E Appeldoorn
I have a score consisting of 5 strings. Near the end all instrument 
voices (except the bass) split into two. The top voice being a solo, and 
the bottom one the rest. I have managed this for one voice, but can't 
figure out how to add second violin, viola, and cello in the same 
manner, then adding the single line bass below that. Here's what I 
created.
All voices would need to be in the main group, Any help would be much 
appreciated.

Erik

\version "2.22.1"

\score {
  <<
\new PianoStaff \relative c'' {
  \set PianoStaff.instrumentName = \markup { tutti Vln.I}
  \set PianoStaff.shortInstrumentName = \markup { Vln.I}
  \new Staff {
c1 | c | b | a | g | f | \break % intro
<<
  {
 \set Staff.shortInstrumentName = \markup { solo }
c1 | d | e | d |
  }
  \new Staff {
\once \omit Staff.TimeSignature
  \set Staff.shortInstrumentName = \markup { others}
g1 | f | e | d |
  }
>>
  }
}
  >>
}

Re: Possible bug: Grace note at the beginning makes instrumentName disappear?

2022-02-17 Thread Valentin Petzel
Hello Thomas,

in your case using a with block is definitely the best option. One can also 
solve such issues by adding a skip column before the main beat like this

\new Staff << {\set Staff.instrumentName = #"abc" \grace s} \new Voice \grace c 
c >>

which can be useful with stuff like tempo in a global block (this can cause 
some headache with multiple voices or staves if on starts on a grace, as get 
the tempo both before the grace as well after the grace).

Cheers,
Valentin

17.02.2022 08:46:32 Thomas Scharkowski :

> Thank you David for this lesson, I appreciate it a lot.
> Thomas
> 
>> Am 16.02.2022 um 18:50 schrieb David Kastrup :
>> 
>> Thomas Scharkowski  writes:
>> 
>>> Grace note at the beginning makes instrumentName disappear:
>>> macOs 12.1
>>> LilyPond 2.23.6
>>> 
>>> -- 
>>> \version "2.23.6"
>>> 
>>> GraceVoice =  \new Voice
>>> {
>>> \grace
>>> c'8  b4
>>> }
>>> 
>>> GraceStaff = \new Staff
>>> <<
>>> \set Staff.instrumentName = "Grace"
>>> \GraceVoice
> 
>>> 
>>> \score {
>>> \GraceStaff
>>> }
>>> 
>>> NoGraceVoice = \new Voice
>>> {
>>> b4
>>> }
>>> 
>>> NoGraceStaff = \new Staff
>>> <<
>>> \set Staff.instrumentName = "NoGrace"
>>> \NoGraceVoice
> 
>>> 
>>> \score {
>>> \NoGraceStaff
>>> }
>>> 
>> 
>> No, it doesn't.  \grace c'8 occurs before the beat, \set
>> Staff.instrumentName occurs on the beat and consequently has no effect
>> on the already created Staff.
>> 
>> You probably want to write
>> 
>> \new Staff \with { instrumentName = ... } ...
>> 
>> in order to have instrumentName exist from the beginning of the
>> context's life-time rather than from its first beat (which may be later
>> in the case of grace notes).
>> 
>> -- 
>> David Kastrup



Re: Naming midi files

2022-02-17 Thread David Wright
On Thu 17 Feb 2022 at 21:43:09 (+1100), Mark Probert wrote:
> [ ] wrote:
> >> It’s not that simple, since in the example all the scores are in the 
> >> same book.
> > 
> > It is that simple.
> > Put the score in one book and the midis separate books and done.
> > 
> My understanding is a \midi{} block is contained within a \score{} 
> block.
> 
> The structure I have is
> 
> \book foo
>  \bookpart bar
>   \score
>\midi => foo.mid
>  \bookpart baz
>   \score
>\midi => foo-1.mid
> 
> How do I separate the \midi from the \score putting the score into a 
> \book and the \midi into separate books?

To some extent, it depends what you're using the midis for.
My two uses are proof-reading by ear, and teach-tapes.

I always set the score and midis separately, placing all the
notes into variables. Thus:

\header { …
miditempo = { …
\paper { …
global = { …
soprano = \relative { …
alto = \relative { …
tenor = \relative { …
bass = \relative { …
\include "Midi-satb.ily" % midis made here
sopranotext = \lyricmode { …
altotext = \lyricmode { …
tenortext = \lyricmode { …
basstext = \lyricmode { …
\score { % typesettng here
  \new ChoirStaff <<
\new Staff <<
  \clef treble \global
  \new Voice { \soprano }
  \addlyrics { \sopranotext }
>>
 …
  >>
  \layout { }
}

I've attached Midi-sab.ily (as it's smaller), and I have versions
for any arrangement I've set, from "cs" (click and single voice)
to "satbsatbp" (skeleton piano accompaniment). They call in turn
trivial files like:

Midi-hi-soprano.ily:
\new Staff { \midihighlight { \soprano } }

Midi-back-alto.ily:
\new Staff { \midibacking { \alto } }

and the definitions are in Midi-bits.ily (attached).

In a multi-section work, the midi filenames don't collate well,
so my lilypond shell script calls _Midirename_ to read through
the run's log file and renumber all the midi files for each
section with a 2-digit sequence number (bash function).

Typical teach-tape for one voice of an opening section attached.

Cheers,
David.
\version "2.19.49" % 2017-12-21

\book {
  \bookOutputSuffix "tutti__"
  \score {
\unfoldRepeats
<<
  \global
  \include "Midi-hi-soprano.ily"
  \include "Midi-hi-alto.ily"
  \include "Midi-hi-bass.ily"
>>
\midi {
  \miditempo
}
  }
}

\book {
  \bookOutputSuffix "soprano_"
  \score {
\unfoldRepeats
<<
  \global
  \include "Midi-hi-soprano.ily"
  \include "Midi-back-alto.ily"
  \include "Midi-back-bass.ily"
>>
\midi {
  \midinodyn
  \miditempo
}
  }
}

\book {
  \bookOutputSuffix "alto_"
  \score {
\unfoldRepeats
<<
  \global
  \include "Midi-back-soprano.ily"
  \include "Midi-hi-alto.ily"
  \include "Midi-back-bass.ily"
>>
\midi {
  \midinodyn
  \miditempo
}
  }
}

\book {
  \bookOutputSuffix "bass_"
  \score {
\unfoldRepeats
<<
  \global
  \include "Midi-back-soprano.ily"
  \include "Midi-back-alto.ily"
  \include "Midi-hi-bass.ily"
>>
\midi {
  \midinodyn
  \miditempo
}
  }
}
\version "2.19.49" % 2018-12-23

miditempo = "" % default in case it's missing

miditutti = {
  \set Staff.midiInstrument = #"oboe"
  \set Staff.midiMinimumVolume = #0.0
  \set Staff.midiMaximumVolume = #1.0
} % with dynamics

midihighlight = {
  \set Staff.midiInstrument = #"clarinet"
  \set Staff.midiInstrument = #"oboe"
  \set Staff.midiMinimumVolume = #0.9
  \set Staff.midiMaximumVolume = #1.0
  \set Staff.midiPanPosition = #LEFT
}

midibacking = {
  \set Staff.midiInstrument = #"bassoon"
  \set Staff.midiMinimumVolume = #0.2
  \set Staff.midiMaximumVolume = #0.4
  \set Staff.midiPanPosition = #RIGHT
}

midiclick = {
  \set Staff.midiInstrument = #"woodblock"
  \set Staff.midiMinimumVolume = #1.0
  \set Staff.midiMaximumVolume = #1.0
  \set Staff.midiPanPosition = #RIGHT
}

midiaccomp = {
  \set Staff.midiInstrument = #"acoustic grand"
  \set Staff.midiMinimumVolume = #1.0
  \set Staff.midiMaximumVolume = #1.0
  \set Staff.midiPanPosition = #RIGHT
}

midinodyn = \midi {
  \context {
\Staff
\remove Dynamic_performer
  }
}
function _Midirename_ {
[ -z "$1" ] && printf '%s\n' "Usage:${FUNCNAME[0]} 
file-of-midi-filenames
for internal use only, it renames the midi files generated by lilypond
whose names are in the file, making them all sort in the correct order.
The first midi generated in each score should contain __, which 
increments
the sequence number, starting at 00. The score's other midis get that 
number.
Note that the Perl rename command (file-rename) must be available." >&2 
&& return 1
[ ! -r "$1" ] && printf '%s\n' "$1 not found!" >&2 && return 1
[ ! -r /usr/bin/file-rename ] && printf '%s\n' "Perl's rename command 
(file-rename) not found!" >&2 && return 1
local Unique="$(mktemp "${Uniquetrash:-/tmp}"/"${FUNCNAME[0]}"-"$(date 
+%s)"-)"
grep -e '^MIDI output to `' "$1" | sed -e 

Re: LilyPond 2.23.6 released

2022-02-17 Thread Jean Abou Samra




Le 17/02/2022 à 09:08, Thomas Scharkowski a écrit :

I did GUILE_AUTO_COMPILE=1 lilypond file.ly - there was not much of change 
afterwards: MSDM.ly still needed 24“ compared to 10“ with MacPorts.


You did see all the logging output with warnings about 'possibly
unbound variables' and stuff?

If so, that's strange and disappointing.

Jean




Re: Ossia at the first line of a PianoStaff

2022-02-17 Thread Jean Abou Samra

Le 17/02/2022 à 19:01, Knute Snortum a écrit :

I have another problem that I'd love help with.  (Sorry for all the
questions lately.)

The piece of music I'm working on is a piano piece with several ossia
bars.  I've been researching how to do this and I've come across a
problem I can't fix.  If the ossia bar is the first bar of a new line,
the PianoStaff brace and bar span are attached.  In the middle of the
staff all is fine.

I've attached the code to produce the problem and an image of what it
produces.  Any help would be greatly appreciated.




The most low-tech fix would be to move the ossia context
out of the PianoStaff:

\version "2.22.1"

ossia = \markup \small \italic "ossia"


<<
  \new Staff = "ossia" \with {
    \remove "Time_signature_engraver"
    \hide Clef
    \hide BarLine
    \override BarLine.allow-span-bar = ##f
    \override KeySignature.stencil = ##f
    \magnifyStaff #2/3
  }
  \relative {
    \stopStaff
    s1
    \key c \minor
    \startStaff ees'4^\ossia g8 f ees2*1/2 \stopStaff
    s1*2
    \startStaff g4 ees8 f g2*1/2 \stopStaff
  }
  \new PianoStaff <<
    \new Staff = "upper" \relative {
  \key c \minor
  c'4 b c2
  ees4 f ees2
  g4 aes g2 % \break
  c4 b c2 \break
  g4 aes g2
  ees4 d c2
    }
    \new Staff = "lower" \relative {
  \key c \minor
  \repeat unfold 24 { \clef bass c4 }
    }
  >>
>>


If you not keen on doing this, here is another solution:

\version "2.23.6"

ossia = \markup \small \italic "ossia"

#(set-object-property! 'system-start-exclude 'backend-type? boolean?)

\layout {
  \context {
    \PianoStaff
    \override SystemStartBrace.before-line-breaking =
  #(lambda (grob)
 (ly:grob-set-object! grob
  'elements
  (ly:grob-list->grob-array
   (filter
    (lambda (g)
  (not (eq? #t (ly:grob-property g 
'system-start-exclude
    (ly:grob-array->list (ly:grob-object 
grob 'elements))

 \override SystemStartBrace.collapse-height = #0
  }
}


<<
  \new PianoStaff <<
    \new Staff = "ossia" \with {
  \remove "Time_signature_engraver"
  \hide Clef
  \hide BarLine
  \override BarLine.allow-span-bar = ##f
  \override KeySignature.stencil = ##f
  \magnifyStaff #2/3
  \override StaffSymbol.system-start-exclude = ##t
    }
    { \stopStaff s1*6 }

    \new Staff = "upper" \relative {
  \key c \minor
  c'4 b c2
  <<
    { ees4 f ees2 }
    \context Staff = "ossia" {
  \key c \minor
  \startStaff ees4^\ossia g8 f ees2*1/2 \stopStaff
    }
  >>
  g4 aes g2 % \break
  c4 b c2 \break
  <<
    { g4 aes g2 }
    \context Staff = "ossia" {
  \key c \minor
  \startStaff g4 ees8 f g2*1/2 \stopStaff
    }
  >>
  ees4 d c2
    }

    \new Staff = "lower" \relative {
  \key c \minor
  \repeat unfold 24 { \clef bass c4 }
    }
  >>
>>


The latter requires a development version due to ly:grob-list->grob-array
being a recent addition.

Best,
Jean




Re: Red dot before all notes

2022-02-17 Thread Jean Abou Samra

Hi,

One thing you may not be aware of is that when you reply
to an existing thread, the reply appears in the same thread
for others, even if you change the title. I saw your message
under "Box around MeasureCounter". It is better to start
a new topic instead.


Le 17/02/2022 à 19:21, Rajesh Baskar a écrit :


Hi,

I'm trying to get a red dot placed before each note. I have tried 
using \tweak and


\set fingeringOrientations = #'(left)

\finger  \markup \with-color "#FF" "."

But nothing seems to give the desired results.

The below image is what I'm trying to get.


\version "2.22.0" \include "english.ly" \header { tagline = "" } 
\score {\new Staff \with {\remove "Time_signature_engraver" } {\set 
Staff.midiInstrument = #"Acoustic Grand Piano" \key c \major \time 5/1 
\clef treble c'1 d' e' f' g' \bar "||"} \layout { } \midi { \tempo 4 = 
168}}


Thanks for all the help,





This works for me:

\version "2.22.1"

{
  \set fingeringOrientations = #'(left)
  
}

Perhaps you forgot the chord <>? It is necessary to be
able to use fingeringOrientations (see
https://lilypond.org/doc/v2.23/Documentation/notation/inside-the-staff#fingering-instructions).

I'd adjust the formatting a bit and use a real dot sign:

\version "2.22.1"

{
  \set fingeringOrientations = #'(left)
  "dots.dot">

}

Best,
Jean





Red dot before all notes

2022-02-17 Thread Rajesh Baskar

Hi,

I'm trying to get a red dot placed before each note. I have tried using 
\tweak and


\set fingeringOrientations = #'(left)

\finger  \markup \with-color "#FF"  "."

But nothing seems to give the desired results.

The below image is what I'm trying to get.


\version "2.22.0" \include "english.ly" \header { tagline = "" } \score 
{\new Staff \with {\remove "Time_signature_engraver" } {\set 
Staff.midiInstrument = #"Acoustic Grand Piano" \key c \major \time 5/1 
\clef treble c'1 d' e' f' g' \bar "||"} \layout { } \midi { \tempo 4 = 
168}}


Thanks for all the help,

Raj





Ossia at the first line of a PianoStaff

2022-02-17 Thread Knute Snortum
I have another problem that I'd love help with.  (Sorry for all the
questions lately.)

The piece of music I'm working on is a piano piece with several ossia
bars.  I've been researching how to do this and I've come across a
problem I can't fix.  If the ossia bar is the first bar of a new line,
the PianoStaff brace and bar span are attached.  In the middle of the
staff all is fine.

I've attached the code to produce the problem and an image of what it
produces.  Any help would be greatly appreciated.

--
Knute Snortum
\version "2.22.1"

ossia = \markup \small \italic "ossia"

<<
  \new PianoStaff <<
\new Staff = "ossia" \with {
  alignAboveContext = "upper"
  \remove "Time_signature_engraver"
  \hide Clef
  \hide BarLine
  \override BarLine.allow-span-bar = ##f
  \override KeySignature.stencil = ##f
  \magnifyStaff #2/3
}
{ \stopStaff s1*6 }

\new Staff = "upper" \relative {
  \key c \minor
  c'4 b c2
  <<
{ ees4 f ees2 }
\context Staff = "ossia" {
  \key c \minor
  \startStaff ees4^\ossia g8 f ees2*1/2 \stopStaff
}
  >>
  g4 aes g2 % \break
  c4 b c2 \break
  <<
{ g4 aes g2 }
\context Staff = "ossia" {
  \key c \minor
  \startStaff g4 ees8 f g2*1/2 \stopStaff
}
  >>
  ees4 d c2
}

\new Staff = "lower" \relative {
  \key c \minor
  \repeat unfold 24 { \clef bass c4 }
}
  >>
>>


Re: 2,23,6 markFormatter change?

2022-02-17 Thread Jean Abou Samra
> Le 17/02/2022 18:09, Paul Scott  a écrit :
> 
> 
> 2.23.6
> 
> I have been using the following definition for many years:
> 
> CircleNumberMark = {
> \set Score.markFormatter = #format-mark-circle-numbers
> }
> 
> I now get:
> 
> warning: cannot find property type-check for `markFormatter'
> (translation-type?). perhaps a typing error?
> 
> from one score where I may have made an unknown change but also from a
> score which hasn't changed
> 
> I have looked at the 2,23,6 changes.
> 
> TIA for any ideas before I do extensive problem solving,
> 
> Paul



When a newer version doesn't work, first of all,
try to run convert-ly to fix your file automatically.

Best,
Jean



2,23,6 markFormatter change?

2022-02-17 Thread Paul Scott

2.23.6

I have been using the following definition for many years:

CircleNumberMark = {
  \set Score.markFormatter = #format-mark-circle-numbers
}

I now get:

warning: cannot find property type-check for `markFormatter' 
(translation-type?).  perhaps a typing error?


from one score where I may have made an unknown change but also from a 
score which hasn't changed


I have looked at the 2,23,6 changes.

TIA for any ideas before I do extensive problem solving,

Paul





Re: Naming midi files

2022-02-17 Thread Lukas-Fabian Moser

Folks,

Am 17.02.22 um 11:48 schrieb Xavier Scheuer:

> If I have a book that is structured something like below, then LP
> produces two midi files: foo.midi and foo-1.midi.
>
> Is there a way I can coerce the names into "bar.midi" and "baz.midi"
> within LP? Or is this something best down externally?

Works for books (bookOutputName), not for bookpart or score.

There is a feature request to implement it (and some people offered 
$100 and 30€ bounty for this enhancement).

https://gitlab.com/lilypond/lilypond/-/issues/3154


Ian Hulin started working on that issue, but it seems there's sad news 
that never actually reached the LilyPond community (at least I couldn't 
find a mention on either -user or -devel):


https://www.justgiving.com/remember/174876/Ian-Hulin

I didn't know him personally, but judging from 
https://github.com/ian-hulin, it seems that page is for the same Ian 
Hulin who contributed to LilyPond. His last messages on -devel are from 
October 2014.


Lukas




Re: Naming midi files

2022-02-17 Thread Leo Correia de Verdier
You would have to structure your files and variables differently, for instance 
something like (in pseudocode):

— foo.ly
\include "bar.ily"
\include ”baz.ily”

\book {
  \bookpart {
\header {
  title = "Bar One"
}
\score {
  \barMusic
  \layout{}
} 
  }
  \bookpart {
\header {
  title = "BaZ"
}
\score {
  \bazMusic
  \layout{}
}
  }
}

\book {
  \bookOutputName "bar"
  \score {
\barMusic
\midi {}
  }
}

\book {
  \bookOutputName "baz"
  \score {
\bazMusic
\midi {}
  }
}

— bar.ily
barMusic = %music
— baz.ily
bazMusic = %music



> 17 feb. 2022 kl. 11:43 skrev Mark Probert :
> 
> You wrote:
>>> It’s not that simple, since in the example all the scores are in the 
>>> same book.
>> 
>> It is that simple.
>> Put the score in one book and the midis separate books and done.
>> 
> My understanding is a \midi{} block is contained within a \score{} 
> block.
> 
> The structure I have is
> 
> \book foo
> \bookpart bar
>  \score
>   \midi => foo.mid
> \bookpart baz
>  \score
>   \midi => foo-1.mid
> 
> How do I separate the \midi from the \score putting the score into a 
> \book and the \midi into separate books?
> 
> Thanks,
> ..m.




Re: Naming midi files

2022-02-17 Thread Xavier Scheuer
On Thu, 17 Feb 2022 at 09:37, Mark Probert  wrote:
>
>
> Hi.
>
> If I have a book that is structured something like below, then LP
> produces two midi files: foo.midi and foo-1.midi.
>
> Is there a way I can coerce the names into "bar.midi" and "baz.midi"
> within LP? Or is this something best down externally?

Hello,

Works for books (bookOutputName), not for bookpart or score.

There is a feature request to implement it (and some people offered $100
and 30€ bounty for this enhancement).
https://gitlab.com/lilypond/lilypond/-/issues/3154

Cheers,
Xavier

-- 
Xavier Scheuer 


Re: Naming midi files

2022-02-17 Thread Mark Probert
You wrote:
>> It’s not that simple, since in the example all the scores are in the 
>> same book.
> 
> It is that simple.
> Put the score in one book and the midis separate books and done.
> 
My understanding is a \midi{} block is contained within a \score{} 
block.

The structure I have is

\book foo
 \bookpart bar
  \score
   \midi => foo.mid
 \bookpart baz
  \score
   \midi => foo-1.mid

How do I separate the \midi from the \score putting the score into a 
\book and the \midi into separate books?

Thanks,
 ..m.

Re: Naming midi files

2022-02-17 Thread Leo Correia de Verdier
It’s not that simple, since in the example all the scores are in the same book.

> 17 feb. 2022 kl. 09:58 skrev Michael Gerdau :
> 
>> If I have a book that is structured something like below, then LP
>> produces two midi files: foo.midi and foo-1.midi.
>> Is there a way I can coerce the names into "bar.midi" and "baz.midi"
>> within LP? Or is this something best down externally?
> [example code snipped]
> 
> RTFM: 
> https://lilypond.org/doc/v2.22/Documentation/notation-big-page#output-file-names
> 
> \bookOutputSuffix
> and
> \bookOutputName
> 
> are your friends.
> 
> HTH,
> Michael
> -- 
> Michael Gerdau   email: m...@qata.de
> GPG-keys available on request or at public keyserver
> 




Re: Naming midi files

2022-02-17 Thread Michael Gerdau

It’s not that simple, since in the example all the scores are in the same book.


It is that simple.
Put the score in one book and the midis separate books and done.
Or that is how I understand the manual.

Kind regards,
Michael
--
 Michael Gerdau   email: m...@qata.de
 GPG-keys available on request or at public keyserver



Re: Naming midi files

2022-02-17 Thread Michael Gerdau

If I have a book that is structured something like below, then LP
produces two midi files: foo.midi and foo-1.midi.

Is there a way I can coerce the names into "bar.midi" and "baz.midi"
within LP? Or is this something best down externally?

[example code snipped]

RTFM: 
https://lilypond.org/doc/v2.22/Documentation/notation-big-page#output-file-names


\bookOutputSuffix
and
\bookOutputName

are your friends.

HTH,
Michael
--
 Michael Gerdau   email: m...@qata.de
 GPG-keys available on request or at public keyserver



Re: Slur in different voices

2022-02-17 Thread Leo Correia de Verdier
Hi Mark!

Generally I work around this using hidden notes or notes with hidden stems. In 
your example I think you want a tie rather than a slur (since it’s a held 
note), but they both work in the same way with regard to voices. 

In your example it could look like:

\version "2.22"

lowerA = \new Voice \relative c'
{ \voiceOne
 s2 \once \hideNotes b2~ | b2 f2\rest |
}

lowerB = \new Voice \relative c
{ \voiceTwo
 f2\rest b2 | c,2 s2 |
}

 \new Staff <<
\clef bass
\lowerA
\lowerB
 >>

Best
/Leo

> 17 feb. 2022 kl. 00:24 skrev Mark Probert :
> 
> 
> Hi.
> 
> I have a score that, in the piano, has a slur crossing voices (in the 
> example the slur would end up with the B being held for a 4 count). 
> There is a note in the LP manual saying that slurs must all stay in the 
> same voice, so is there a work-around for this kind of thing?
> 
> Many thanks!
> 
> .. mark.
> 
> < code >-
> \version "2.22"
> 
> global = {
>  \key c \major
>  \time 4/4
> }
> 
> %%% --
> %%% piano
> %%%
> upperA = \new Voice \relative c'
> { \voiceOne
>  s1 | s1
> }
> 
> upperB = \new Voice \relative c'
> { \voiceTwo
>  s1 | s1
> }
> 
> lowerA = \new Voice \relative c'
> { \voiceThree
>  s1 | b2 f2\rest |
> }
> 
> lowerB = \new Voice \relative c
> { \voiceFour
>  f2\rest b2 | c,2 s2 |
> }
> 
> 
> %%% -
> %%% staves
> %%%
> \score {
>  <<
>\new PianoStaff <<
>  \new Staff <<
>   \clef treble
>   \global
>   \upperA
>   \upperB
>>> 
>  \new Staff <<
>   \clef bass
>   \global
>   \lowerA
>   \lowerB
>>> 
>>> 
>>> 
>  \layout{}
> }
> 




Naming midi files

2022-02-17 Thread Mark Probert


Hi.

If I have a book that is structured something like below, then LP 
produces two midi files: foo.midi and foo-1.midi. 

Is there a way I can coerce the names into "bar.midi" and "baz.midi" 
within LP? Or is this something best down externally?

Thanks again

 ..mark.

-- foo.ly
\include "bar.ily"
\include "baz.ily"
--
-- bar.ily
\bookpart {
  \header {
title = "Bar One"
  }
  \score {
% music
\layout{}
\midi{}
  }
}
--
-- baz.ily
\bookpart {
  \header {
title = "BaZ"
  }
  \score {
% music
\layout{}
\midi{}
  }
}
--



Re: LilyPond 2.23.6 released

2022-02-17 Thread Thomas Scharkowski
I did GUILE_AUTO_COMPILE=1 lilypond file.ly - there was not much of change 
afterwards: MSDM.ly still needed 24“ compared to 10“ with MacPorts.

Thomas

> Am 17.02.2022 um 00:45 schrieb Jean Abou Samra :
> 
> Le 16/02/2022 à 15:37, Thomas Scharkowski a écrit :
>> Hi all,
>> 
>> I installed this version today, everything seems to work.
>> It might be of interest that the MacPorts version of 2.23.6 runs around 
>> three times faster on my MacBookPro M1, macOs 12.1
>> 
>> Carver Missa compile times are 28,6“ and 10,3“ MacPorts version.
>> 
>> Thomas
> 
> 
> A certain slowdown is expected -- these binaries don't have
> Guile bytecode for LilyPond's .scm files yet. This should
> be added eventually before we make a full switch.
> 
> In the meanwhile, try compiling once with
> 
>   GUILE_AUTO_COMPILE=1 lilypond file.ly
> 
> That will take longer and give you zillions of warnings, but
> your LilyPond should get faster after that. It would be
> interesting if you could report the timing.
> 
> Best,
> Jean
> 
>