Re: Disable all padding and collision around markup

2024-05-19 Thread Kieren MacMillan
Hi Knute,

>> There are ways to "disable the padding" (a.k.a. have the spacing engine 
>> ignore the TextScript). However, it might be just as easy — or maybe 
>> even easier? — to simply tweak the X-offset and Y-offset rather than 
>> using extra-offset:
> The extra-offset happens late in the rendering process, so the other grobs 
> can't adjust to its movement like they do with X- and Y-offset.

Exactly!  :)
— Kieren
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: Cry for help - lost plot ....

2024-05-18 Thread Kieren MacMillan
Hi Giles,

> Just like that? Just like that! Wow!

Eventually, one gets tired of how often Lilypond wows you…
Nice to see you’re not there yet.  ;)

— K
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: Cry for help - lost plot ....

2024-05-18 Thread Kieren MacMillan
Hi Giles,

> though being able to put multiple columns side by side without them thinking 
> they were continuous music would be even more awesome, and very elegant imho

Like this?

%%%  SNIPPET BEGINS
\version "2.24.3"

\layout {
  \context {
\Score
\override RehearsalMark.padding = #3
  }
}

\markup {
  \fill-line {
\score { { \mark "ON079-1a-_01" \key c\major \time 9/8 a''8 b''8 a''8 g''4 
e''8 d''4 d''8 } }
\score { { \mark "ON079-1a-_02" \key c\major \time 9/8 a'8 a'8 a'8 d''4 
d''8 e''8 f''8 g''8 } }
\score { { \mark "ON079-1a-_03" \key c\major \time 9/8 a''8 b''8 a''8 g''4 
e''8 d''4 f''8 } }
  }
}
%%%  SNIPPET ENDS

Cheers,
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: Cry for help - lost plot ....

2024-05-18 Thread Kieren MacMillan
Hi Giles,

Are you looking for something like this?

%%%  SNIPPET BEGINS
\version "2.24.3"

\paper {
  score-system-spacing.padding = #6
}

\layout {
  indent = 0
  ragged-right = ##f
  \context {
\Score
\override RehearsalMark.padding = #3
  }
}

\score {
  { \mark "ON079-1a-_01" \key c\major \time 9/8 a''8 b''8 a''8 g''4 e''8 d''4 
d''8 }
}
\score {
  { \mark "ON079-1a-_02" \key c\major \time 9/8 a'8 a'8 a'8 d''4 d''8 e''8 f''8 
g''8 }
}
\score {
  { \mark "ON079-1a-_03" \key c\major \time 9/8 a''8 b''8 a''8 g''4 e''8 d''4 
f''8 }
}
%%%  SNIPPET ENDS

> I think my fundamental problem is I don't understand why this, below, isn't 
> an example of the sequential model (isn't it "one music")

This “works”:

%%%  SNIPPET BEGINS
\version "2.24.3"

\score {
  {
\mark "ON079-1a-_01" \key c\major \time 9/8 a''8 b''8 a''8 g''4 e''8 d''4 
d''8 
\mark "ON079-1a-_02" \key c\major \time 9/8 a'8 a'8 a'8 d''4 d''8 e''8 f''8 
g''8 
\mark "ON079-1a-_03" \key c\major \time 9/8 a''8 b''8 a''8 g''4 e''8 d''4 
f''8 
  }
  \layout { }
  \midi { }
}
%%%  SNIPPET ENDS
[Of course, this introduces a whole bunch of other issues… but it “works”!]

> - can you tell me what Lilypond is objecting to? 

Your \score block contains about two dozen music expressions.  ;)
Wrapping that whole chunk in {} reduces it to a single music expression.

Hope that helps!
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: Footnotes for the entire bar

2024-05-16 Thread Kieren MacMillan
Hi there,

> I want to create footnotes which attach to a specified bar or just a 
> particular time

Did you try attaching it to a mark? e.g.

%%%  SNIPPET BEGINS
\version "2.25.11"

\paper {
  tagline = ##f
}

fn_ossia =
#(define-music-function (os music) (pair? ly:music?)
  #{
  \once \override Score.Footnote.annotation-line = ##f
  \footnote \default #os \markup {
\italic "Ossia:"
\score {
  \new Staff \with {
%% Magnification, removing unnecessary elements, ...
  } { #music }
  \layout {
%% If any of those were set in a higher-level \layout
ragged-right = ##t
ragged-last = ##t
ragged-bottom = ##t
ragged-last-bottom = ##t
indent = 0
  }
}
  } Score.RehearsalMark
  #})

{
  \fn_ossia #'(1 . 3) { c'1 } \mark \markup \null
  c''1
  \fn_ossia #'(1 . 3) { d'1 } \mark \markup \null
  f'1
}
%%%  SNIPPET ENDS

Hope this helps!
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: Scoop (jazz notation)

2024-05-14 Thread Kieren MacMillan
Hi Tim,

> I have been looking for a way to write "scoops", a fairly common effect in 
> saxophone jazz.

Have you searched the list archive?
e.g., https://lists.gnu.org/archive/html/lilypond-user/2024-04/msg00125.html

Hope that helps!
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: Naming lines of music

2024-05-14 Thread Kieren MacMillan
Hi Giles,

> The \mark command is centred. Can text be formatted to be left aligned (and 
> smaller)? Is there an initialisation parameter I can change to set its 
> default alignment?

I can’t test what v2.18 does (that’s a very old version!), but 2.25.11 
essentially** left-aligns the mark:

%%%  SNIPPET BEGINS
\version "2.25.11"

\layout {
  \context {
\Score
\override RehearsalMark.font-size = #1
\override RehearsalMark.padding = #2.5
  }
}

theMusic = {
  \mark "Boore’s Dance"
  \key d \major
  \time 6/8
  a''4. g''4 d''8
  g''8 e''4. fis''4
  a''4. fis''4 d''8
  g''4 e''8 d''4.
  \bar "|."
}

\score {
  \new Staff \theMusic
}
%%%  SNIPPET ENDS


1. Note the context block I added, to [globally] adjust the font size of the 
RehearsalMark.

2. I prefer typographer’s quotes, so I changed the apostrophe in “Boore’s”.

3. Conventional coding in the ’Pond is to have a separate line for each measure 
of music, command/tweak, etc., so I recoded your example that way.

** I’m honestly not sure why there is a small discrepancy in the alignment — 
the left edge of the RehearsalMark should be exactly aligned with the left edge 
of the TimeSignature! — but you can adjust that with an extra-offset if it 
bothers you [as much as it bothers me!].

Hope this helps!
Kieren.

p.s.

> Ideally, whatever method arrived at would then create a marker in a MIDI file 
> - \mark does on last but one version of Lilypond, but not on my Windows 8.1, 
> Lilypond "2.18.2" installation

Sorry — definitely can’t help with this! :(
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.



Re: strange chord

2024-05-12 Thread Kieren MacMillan
Hi Werner,

I mean… technically, it’s correct… but yuck.

If I were customizing the name, I would probably have it say Em(addb4).
At the very least it should say Emsusb4.

— Kieren
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: Solving espressivo problem

2024-05-11 Thread Kieren MacMillan
Hi Mats,

> On May 11, 2024, at 11:51 AM, Mats Bengtsson  wrote:
> I would rather do something like the following

I started down that path, but when I saw that the output was

I realized it would take far too much manual tweaking to make it visually 
attractive, whereas my \esp version gives

with only the need to set the self-alignment-X value.

TBH, I also couldn’t remember when \after was added to the code, and since the 
OP had used \version "2.24.3”, I didn’t want to risk it not working for them.  
:)

Cheers,
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.



Re: Solving espressivo problem

2024-05-11 Thread Kieren MacMillan
Hi Morten,

Here’s one approach:

%%%  SNIPPET BEGINS
\version "2.25.11"

esp = \markup \lower #1 \scale #'(1.375 . 1) \musicglyph #"scripts.espr"

stuff = \relative {
   \time 4/4
 r4 b'4 a2-\tweak self-alignment-X #-1.25 _\esp ~
 a2 b4 4(
 c1)-\tweak self-alignment-X #-0.5 _\esp
 b2-\tweak self-alignment-X #-1.125 _\esp d2
 c1-\tweak self-alignment-X #-0.5 _\esp
\bar "|"
}

\score {
   <<
   \new Staff
   \stuff
   >>
}%
%%  SNIPPET ENDS

This requires some manual effort (read: trial and error), but could probably be 
fairly easily automated.

Of course there are many other ways to clothe this particular cat — just 
thought I’d offer one for you to consider!

Best,
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: Spacing of chords on a chord lead sheet

2024-05-10 Thread Kieren MacMillan
Hi Raphael,


> However, the chord names are mono-spaced; they are not spaced according to 
> their durations. So that if, for instance, I  have {ef2 ef4:maj7 ef4:7} then 
> each symbol occupies the same amount of space on the line. The first chord 
> does not occupy double the space of the other two.

Are you sure? Are you using ragged-right = ##f to confirm/test?

For example, the code

%%%  SNIPPET BEGINS
\version "2.25.11"
\language "english"

\layout {
  indent = 0
  line-width = 4\in
  ragged-right = ##f
  \context {
\Score
\remove "Bar_number_engraver"
  }
  \context {
\ChordNames
\consists "Bar_engraver"
\override BarLine.bar-extent = #'(-2 . 2)
  }
}

theChords = \chordmode {
  ef4 ef2:maj7 ef4:7 \break
  ef2 ef4:maj7 ef4:7
}

\new ChordNames \theChords
%%%  SNIPPET ENDS

gives me the output

and clearly there’s a difference in the spacing.

Cheers,
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.



Re: Crammed ChordNames

2024-05-10 Thread Kieren MacMillan
Hi Pierre-Luc,

>> I don’t know… but if you figure out what’s causing it, ***please*** tell me, 
>> because I also often (and “randomly”) get ChordName collisions like this in 
>> my scores, and my workflow is rarely (read: NEVER) luxurious enough for me 
>> to do anything except edition-engraver-tweak the crap out of the score and 
>> move on.
> 
> My goto is usually to pepper the offending part with \allowPageTurn.s
> and check that all 4 editions (letter, letterXL, tablet, tabletXL) are
> ok (git commit -vp && git push && ./doItAll and move on).

The thing is, there’s usually MORE than enough vertical space to allow the 
ChordNames to “float up”, and \allowPageTurn-s [and related] throw off my 
(read: the optimal LOL) layout.

One day maybe I’ll have enough time to really investigate the issue and come up 
with a real solution…

Cheers,
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: Crammed ChordNames

2024-05-10 Thread Kieren MacMillan
Hi Pierre-Luc,

> Why am I so often, (and so randomly) getting crammed ChordNames in Staves ?

I don’t know… but if you figure out what’s causing it, ***please*** tell me, 
because I also often (and “randomly”) get ChordName collisions like this in my 
scores, and my workflow is rarely (read: NEVER) luxurious enough for me to do 
anything except edition-engraver-tweak the crap out of the score and move on.

Cheers,
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: [basic question] how to disable text spanners for the lower staff of a PianoStaff

2024-05-10 Thread Kieren MacMillan
Hi James,

> I've got a piano staff (for guzheng, just notating on two staves), and an 
> "accel." text spanner in a \global var.

Don’t forget to post MWEs, so people who want to help don’t have to conjure 
code themselves.  :)

> Some magic incantation I'm missing...

Not sure why your incantation doesn’t work, but this seems to:

%%%  SNIPPET BEGINS
\version "2.25.11"

global = {
  \override TextSpanner.bound-details.left.text = \markup { \upright "rit." }
  s1\startTextSpan
  s1\stopTextSpan
}
zhengR = { c'1 1 }
zhengL = { c1 c }

 \new PianoStaff \with {
   instrumentName = "古筝"
   shortInstrumentName = "古筝"
 } <<
   \new Staff = "up" << \global \zhengR >>
   \new Staff = "down" \with { \omit TextSpanner } << \clef bass \global 
\zhengL >>
 >>
%%%  SNIPPET ENDS

Hope that helps!
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: Spacing in mensural notation

2024-05-07 Thread Kieren MacMillan
Hi Giles,

> I am new to Lilypond

Welcome!

> I would like to remove the space from around the notes and bunch them up like 
> in the original. I tried a couple of things I found that looked relevant - 
> they're commented out in my snippet - and "\compressEmptyMeasures" but to no 
> avail .

Let’s start here:

%%%  SNIPPET BEGINS
\version "2.25.11"

%\version "2.18.2"

\header {
  title = "Odhekaton"
  composer = "Obrecht"
  piece = "Alto"
}

\layout {
  system-count = 1
  indent = 0.25\in
}

\score {
  <<
\new MensuralVoice = "alto" {
  \override NoteHead.style = #'petrucci
  \omit Score.BarNumber
  \clef "petrucci-c2"
  \time 2/2
%  \override Score.SpacingSpanner.base-shortest-duration = #(ly:make-moment 
1/4)
%  \override Score.SpacingSpanner.strict-note-spacing = ##t
  d'\breve
  c'\breve
  \[ d'1\melisma f'1. \melismaEnd \]
  e'2 d'1 c'1. d'2 e'1 f'2. e'4 f'4 g'4 a'1 g'4 f'4 e'2 d'1 c'2 d'1. c'4 b4 
c'\longa
}
  >>
}
%%%  SNIPPET ENDS

Notes:

1. I added a \layout block with "system-count = 1"; I wasn’t sure if you wanted 
it on one system, but that’s one way of forcing that (and I figured you should 
know about it).

2. By commenting/uncommenting those SpacingSpanner overrides, you’ll see they 
do very little (at least in the one-system layout). If you change the number 
1/4 in the first line to 1/1 or 1/64, you’ll see bigger differences… Maybe one 
of those is closer to what you want, or maybe not?

3. You can adjust the effective duration (and thus horizontal space) of a note 
using a multiplier. Observe what happens when you replace
  \[ d'1\melisma f'1. \melismaEnd \]
with
  \[ d'1*1/8\melisma f'1.*1/8 \melismaEnd \]
This kind of “hack” can be a useful mechanism to get notes closer together.

Hope something in there helps!
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: how difficult would it be to have “auto-correct spacing” (even for just a single measure)?

2024-05-06 Thread Kieren MacMillan
Hi all,

I found something that seems to work!!
Hope this helps someone else.

Best,
Kieren.

%%%  SNIPPET BEGINS
\version "2.25.11"
\language "english"

\layout {
  line-width = 3.5\in
  ragged-right = ##f
}

accidentalNoWidth = \tweak Accidental.extra-spacing-width #empty-interval \etc

\markup "No accidentals:"
\new Staff \with { \remove Accidental_engraver } <<
  \clef bass \key bf \major
  \voices 1,2 <<
{ f8 f g! f f f f a }  \\
{ bf,8 f e-\tweak extra-offset #'(0.05 . 0) _\markup \with-color #red 
\with-dimensions-from \null \draw-line #'(0 . -38) ef d c bf, c }
  >>
>>

\markup "No tweaks:"
\new Staff <<
  \clef bass \key bf \major
  \voices 1,2 <<
{ f8 f g! f f f f a }  \\
{ bf,8 f e ef d c bf, c }
  >>
>>

\markup "Using \accidentalNoWidth:"
\new Staff <<
  \clef bass \key bf \major
  \voices 1,2 <<
{ f8 f \accidentalNoWidth g! f f f f a }  \\
{ bf,8 f \accidentalNoWidth e! \accidentalNoWidth ef d c bf, c }
  >>
>>
%%%  SNIPPET ENDS
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: how difficult would it be to have “auto-correct spacing” (even for just a single measure)?

2024-05-05 Thread Kieren MacMillan
Hi Valentin,

> if you want you could tell Lilypond to ignore Accidentals in spacing

In concept, I love this idea… However it doesn’t work 100%:

%%%  SNIPPET BEGINS
\version "2.25.11"
\language "english"

\layout {
  line-width = 3.5\in
  ragged-right = ##f
}

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

accidentalNoWidth =
\override Accidental.extra-spacing-width =
#(lambda (grob)
  (let ((ext (ly:grob-property grob 'X-extent)))
(display ext)
(cons (interval-length ext) 0)))

\markup "No accidentals:"
\new Staff \with { \remove Accidental_engraver } <<
  \clef bass \key bf \major
  \voices 1,2 <<
{ f8 f g! f f f f a }  \\
{ bf,8 f e-\tweak extra-offset #'(0.05 . 0) _\markup \with-color #red 
\with-dimensions-from \null \draw-line #'(0 . -48) ef d c bf, c }
  >>
>>

\markup "No tweaks:"
\new Staff <<
  \clef bass \key bf \major
  \voices 1,2 <<
{ f8 f g! f f f f a }  \\
{ bf,8 f e ef d c bf, c }
  >>
>>

\markup "Using \accidentalNoWidth:"
\new Staff <<
  \clef bass \key bf \major
  \voices 1,2 <<
{ f8 f \once\accidentalNoWidth g! f f f f a }  \\
{ bf,8 f \once\accidentalNoWidth e! \once\accidentalNoWidth ef d c bf, c }
  >>
>>

\markup "Using \ignore:"
\new Staff <<
  \clef bass \key bf \major
  \voices 1,2 <<
{ f8 f \once \ignore Accidental g! f f f f a }  \\
{ bf,8 f \once \ignore Accidental e! \once \ignore Accidental ef d c bf, c }
  >>
>>
%%%  SNIPPET BEGINS

As you can see:

1. \accidentalNoWidth doesn’t allow the notes to obtain “no accidental” 
spacing, but at least keeps the accidentals uncrushed

2. \ignore allows the notes to obtain “no accidental” spacing, but everything 
gets crushed requiring manual tweaking to reposition;

Is there a way to get the best of both worlds?

Thanks,
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: how difficult would it be to have “auto-correct spacing” (even for just a single measure)?

2024-05-05 Thread Kieren MacMillan
Hi Jean,

> There might be ways to reduce the importance
> of accidentals in the spacing problem

I’ve tried a couple of different ways, but they are all pretty “destructive” 
(e.g., the accidentals are ignored entirely, so they end up on top of each 
other and the noteheads). Hopefully I can find a way!

> It's interesting though that adding
>  \override Score.SpacingSpanner.spacing-increment = 5
> in \layout evens out the spacing a lot.

Yes, it does!

> it might be worth trying to flank that measure with \newSpacingSection
> and give it a different spacing-increment.

That goes a long way towards a solution, but (a) the notes still aren’t 
perfectly even, and (b) I prefer the tighter spacing of the original layout.

Thanks,
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: how difficult would it be to have “auto-correct spacing” (even for just a single measure)?

2024-05-04 Thread Kieren MacMillan
Hi Werner,

> You are aware of https://lsr.di.unimi.it/LSR/Item?id=1154 ?

Oh! I vaguely recall that. Thanks for the reminder.

I believe I applied it to my score, but it didn‘t make a change in m7. It might 
be because of the accidentals…? (See modified snippet acting as MWE, below.) 
Unfortunately modifying the snippet to take accidentals into account is WAY 
above my pay grade.

Thanks,
Kieren.

%%%  SNIPPET BEGINS  %%%
\version "2.25.11"
\language "english"

% Snippet author: Jean Abou Samra 
% Original thread: 
https://lists.gnu.org/archive/html/lilypond-user/2022-11/msg00087.html
%
% This snippet gets rid of uglinesses in note spacing caused by lyrics.
% By default, LilyPond always puts a lyric word exactly centered under
% the note it attaches to. When there is a long lyric word, LilyPond reserves
% space between notes so that there will be no collisions in the lyrics.
% However, this can lead to uneven note spacing. This snippet completely
% removes the presence of lyrics in note spacing so that it is natural
% according to the note lengths, and uses a spacing algorithm that shifts
% lyrics automatically in order to avoid collisions.
%
% Some technical comments follow.
%
% The spacing problem is set up as a quadratic optimization problem. Each
% lyric word has a strength value (by default, all words have a strength
% of 1.0). The demerit associated to a lyric word is s(x-p)², where s
% is the strength, x is the X coordinate and p is the ideal X coordinate
% where the lyric word would be centered on its associated note. An
% acceptable solution is a solution where no lyric words collide. The
% weight of a solution is the sum of the demerits for each of the words.
% Solving the lyric spacing problem means finding an acceptable solution
% of minimal weight.
%
% In practice, words should not touch each other, but maintain a minimum
% distance between each other (controlled by LyricSpace.minimum-distance
% and LyricHyphen.minimum-distance). This is reduced to the form above
% by widening one of the two words for each LyricSpace or LyricHyphen
% grob, by the amount given by the minimum-space property.
%
% The algorithm to solve the lyric spacing problem uses dynamic programming
% and runs in linear time. We add words one by one from left to right. After
% adding each word, the problem given by the words added so far is solved.
% The base case (zero words) is trivial. To add a word, it is very intuitive,
% and not hard to prove, that the following technique works: if adding
% the word at its optimal position produces no collision, then keep it
% there; else, make this word 'push' on its left neighbor and move these
% two words simultaneously to the left until the optimal position for
% these two words together is reached; if this still produces a collision
% then add the third word and consider the three words stuck together, etc.
% Note that once two words have been stuck together, they won't need
% to be taken apart again: they will be adjacent ("stuck") in the final
% configuration.
%
% Written in this form, this algorithm looks quadratic. While probably
% acceptable in usual scores, this might become a problem with 
ly:one-line-breaking.
% However, with a bit of simple algebra, you can see that optimizing for two
% words stuck together (and, by extension, any finite number of words stuck
% together) is equivalent to optimizing for one single (imaginary) combined
% word, of which the length is the sum of the two lengths, the strength is
% the sum of the strengths, and the optimal coordinate is given by a simple
% formula (see the code). Therefore, instead of simultaneously considering
% two words stuck together, you can replace them with just one fresh problem
% variable. At each word added during the algorithm, there is a constant 
processing
% overhead, plus an overhead linear in the number of times a word is newly
% stuck to a group, forming a new group. If you imagine that all words start
% out black, and every word becomes white as soon as its group is stuck to
% the group on the left, it is clear that the total number of "add to group"
% operations is linear in the number of words. At the end, there is a
% step to compute the offset of each word from that of its group, which
% is made linear by caching the offset of a group as soon as it is
% visited. In this way, the total number of operations is linear.
%

% #(ly:set-option 'compile-scheme-code)

#(use-modules (ice-9 match)
  (ice-9 hash-table)
  (oop goops))

%% convenience stuff:

#(define-syntax-rule (transform! lval proc)
   (set! lval (proc lval)))

#(define ->
   (make-procedure-with-setter
(lambda (instance . path)
  (let loop ((instance instance) (path path))
(match path
  ((slot)
   (slot-ref instance slot))
  ((slot . rest)
   (loop (slot-ref instance slot)
 rest)
(lambda (instance . args)
  (let loop ((instance instance) (args args))
 

how difficult would it be to have “auto-correct spacing” (even for just a single measure)?

2024-05-04 Thread Kieren MacMillan
Hi all,

It is difficult to put into words how happy I am using Lilypond. I had to use 
Sibelius for a project last year, and it was pure torture. As the old saying 
[almost] goes: “They’ll have to pry Lilypond out of my cold, dead hands!”

Exhibit A: I’m in data-entry mode (i.e., not concerned about visuals/tweaking 
*at all*), and the screenshot attached is what the top half of the page of my 
octavo score looks like at this moment. Incredible! There are zero [!!] manual 
tweaks on that page — what you see is what comes out “automagically”, based 
solely on Lilypond’s amazing layout engine and my stylesheets.

So obviously what follows is a “first world problem” of the highest order…

If you look at the first measure of the third system, you can see that the note 
spacing is distorted by various things (lyrics, accidentals, etc.). But clearly 
there’s more than enough horizontal room to make those eighth notes absolutely 
even — in fact, that kind of thing is what the majority of my post-data-entry 
tweak time is dedicated to. [Again: When I used Finale , it took hours 
or even days to get from “the data is all in” to looking like this already 
looks… so I’m not complaining!]

I would love to be able to say “Dear Specialized Scheme Engraver: Please take 
measure 7, even out the note-spacing, and make the ‘obvious’ necessary 
adjustments so that everything looks amazing.”

How difficult would such a function/engraver be to design?

Thanks,
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.



Re: The demise of ly:multi-measure-rest::percent

2024-05-03 Thread Kieren MacMillan
Hi Richard,

>> is there a reason you don't use \repeat percent in the first place ?
> It's easier for users of Denemo to have a single piece of LilyPond
> syntax at the place they want to see the "%"

How is this

  \repeat percent 2 { c c c c }

not “a single piece of Lilypond syntax at the place they want to tsee the "%"?

Just curious!
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: slurs problem with voices

2024-05-01 Thread Kieren MacMillan
Hi Robert,

> I tried different approaches but cannot get that slur.

\version "2.25.14"
\language "english"

global = {
  \key ef \minor
  \time 3/4
}

\relative c' {
  \clef treble
  \global
  <<
{ bf'4 cf2 \tweak staff-position #5.1 ~ | 8 8 r8  r8  }
\\
{ d4 d2( | \hideNotes ef8) }
\\
{ s4 \tweak horizontal-shift #1 f gf8 af | s2. }
  >>
}

Note that I also turned your \once \override commands into \tweak commands 
(which feel more natural to me).

> Why is not the first example working?

You placed the slur start parenthesis in the wrong location.  :)

Hope that helps!
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: Frescobaldi?

2024-04-29 Thread Kieren MacMillan
Hi all,

> Fortunately for me, I'm using lualatex already, so that worked. I do indeed 
> lose point-and-click, but it's good to know that if frescobaldi stops working 
> I at least have a backup.

I’ve been considering moving fully to *lula*tex ever since Urs demonstrated his 
lyluatexmp (https://github.com/uliska/lyluatexmp) at the Salzburg conference.

1. Any thoughts about what the optimal package is?

2. Is there any benefit/interest in trying to duplicate the most 
important/useful functionality of Frescobaldi (e.g. two-way point-and-click 
navigation) into a LaTeX-based IDE?

Cheers,
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: Frescobaldi?

2024-04-28 Thread Kieren MacMillan
Hi,

> unfortunately, as I noted above, the problem seems to be that frescobaldi 
> depends on a now-deprecated version of qtwebengine, and without updating it 
> we'll eventually reach a point where it no longer runs.

I understood that. I was responding in particular to Jean’s comment

> NB: I don't own a macOS machine, which of course makes all testing very 
> difficult

but also offering the hardware for use in whatever way it might be helpful 
(e.g., compilation, not just testing).

Cheers,
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: Frescobaldi?

2024-04-28 Thread Kieren MacMillan
Hi all,

>> If there is busy work that needs to be done on the project, I can do that, 
>> but I also don't own a Mac.

I own a bunch of Macs. In fact, right here in my studio I have two late-2014 
Mac Minis with fresh Monterey installs which are completely unused. I also have 
a *really* excellent [fibre] internet connection — it usually hovers near 
900Mbps up and down (though right now it’s only at 200Mbps for some reason?!) — 
and I’m happy to put a machine on a DMZ for external access.

Is there anything, non-programming-wise, I can do to help the cause?

Cheers,
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: PianoPedalBracket.to-barline doesn't always work as expected

2024-04-21 Thread Kieren MacMillan
Hi Werner,

>> Might I suggest that “to-barline” is potentially
>> misleading/confusing…?
> I suggest you file an issue.

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

Cheers,
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: score with dynamic beats

2024-04-12 Thread Kieren MacMillan
Hi Raphael,

> I note that in one solution one uses \remove and in the other \omit to 
> achieve the same thing.
> 
> Is there any prospect of  moving to a situation where only one operator is 
> used to achieve a result, possibly by having a preferred and deprecated 
> options first? This is a general point, not just  restricted to this one case.

I wouldn’t think so…

They are two different — both quite useful — commands, used in different 
contexts/situations:

1. \remove is a general function for eliminating an engraver from a whole 
context (in this example, the Time_signature_engraver from the Staff context).

2. \omit is both a handy short form [when used in the identical location as the 
\remove] as well as a one-off function/action (e.g., \once \omit 
Staff.TimeSignature, used “inline” in a music expression).

Cheers,
Kieren.



My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: PianoPedalBracket.to-barline doesn't always work as expected

2024-04-12 Thread Kieren MacMillan
Hi Mats,

> Exactly the same feature might also be useful for hairpins and other spanner 
> types

Indeed!
I’ll be sure to make the issue I submit a general spanner issue…

Best,
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: score with dynamic beats

2024-04-12 Thread Kieren MacMillan
Hi Gian Paolo,

> how to write a score without time signature and bars placed on request?

Just remove the Time_signature_engraver:

\version "2.25.11"

\language "english"

\layout {
  indent = 0
  ragged-right = ##f
  \context {
\Staff
\remove Time_signature_engraver
  }
}

{
  \key d \major
  \time 5/2
  d'2 d' cs' d'1
  \time 7/2
  b2 d' d' d' cs' d'1
  \time 9/2
  b2 d' d' d' d' e'1 ~ 1
}

> I read the manual but didn't find a solution.

https://lilypond.org/doc/v2.23/Documentation/notation/visibility-of-objects#removing-the-stencil

That should have led you to the equivalent solution:

\version "2.25.11"

\language "english"

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

{
  \omit Staff.TimeSignature
  \key d \major
  \time 5/2
  d'2 d' cs' d'1
  \time 7/2
  b2 d' d' d' cs' d'1
  \time 9/2
  b2 d' d' d' d' e'1 ~ 1
}

Hope that helps,
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: Overriding default text of \f, \p, etc.

2024-04-12 Thread Kieren MacMillan
Hi all,

>> I want to override the default text markup used with commands such as \f, 
>> \p, \mf, etc.
>> However, trying to define f = #(make-dynamic-script ...) doesn't work 
>> because Lilypond interprets f as a note-name.
>> Additionally, how would I be able to change the text while maintaining the 
>> MIDI effect? I tried using \tweak DynamicText.text but it doesn't seem to 
>> override the text...
> This is my file that defines assorted dynamic markups (it's an old lilypond 
> version so I'm sure it can be improved ...

Optimally, dynamics are defined as dynamics not markup:

\version "2.25.11"

%  just dynamics
fzp = #(make-dynamic-script "fzp")
ffzp = #(make-dynamic-script "ffzp")
sfzp = #(make-dynamic-script "sfzp")
sffz = #(make-dynamic-script "sffz")
sfffz = #(make-dynamic-script "sfffz")

% dynamic–dynamic
pdashff = #(make-dynamic-script "p–ff")
mfdashff = #(make-dynamic-script "mf–ff")
fdashp = #(make-dynamic-script "f–p")

%  text+dynamic
piuf = -\tweak self-alignment-X #0.85 #(make-dynamic-script (markup #:concat ( 
#:normal-text #:italic #:fontsize 0.8 "più" #:hspace 0.3 "f" )))
moltoff = -\tweak self-alignment-X #0.8 #(make-dynamic-script (markup #:concat 
( #:normal-text #:italic #:fontsize 0.8 "molto" #:hspace 0.3 "ff" )))

%  examples
\layout { ragged-right = ##f indent = 0 }
{
  c1\fzp
  c1\sfffz
  c1\pdashff
  c1\moltoff
  c1\piuf
}

Hope that helps!
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: PianoPedalBracket.to-barline doesn't always work as expected

2024-04-10 Thread Kieren MacMillan
Hi all,

Might I suggest that “to-barline” is potentially misleading/confusing…?

On the other hand:
end-at-barline, for a pedal coded for release on a note **just after** a 
barline, might be more clearly descriptive of the current behaviour; and
extend-to-barline, for a pedal coded for release on a note **just before** 
a barline, might be more suggestive of the behaviour Maurits was expecting.

Is there any technical reason both of these different-but-related properties 
can’t/shouldn’t be made available?

Cheers,
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: organizing shared libraries

2024-04-04 Thread Kieren MacMillan
Hi Tom,

> Sort of answering my own question, but I figure that you don't get
> much out of creating scheme modules directly, unless they can live
> entirely outside of the lilypond world. Generally it seems better to
> create shared libraries somewhere and include them with
> `--include/-I`.

At the Salzburg conference, Urs Liska and I discussed a framework for having 
modules that one could load independently, which would give a lot of benefits 
over the “include” mechanism. (There’s a bit of a stub in openLilyLib, I 
think…? I’ll go take a look.)

Until something like that is fully functional, you are correct that \include is 
the best mechanism.

Cheers,
Kieren.

> 
> On Wed, Apr 3, 2024 at 2:21 PM Tom Brennan  wrote:
>> 
>> Hello
>> 
>> I'm going through documentation, refamiliarizing myself with Lilypond,
>> and trying to define a process for daily work that I like. One thing
>> I'm pretty sure I'll want is to create a shared library that will live
>> in its own repository. Perhaps more than one.
>> 
>> Looking at [this
>> documentation](https://lilypond.org/doc/v2.24/Documentation/notation/including-lilypond-files),
>> what I think makes sense is to bundle the `*.ly` files into a guile
>> module like `lib.scm`, using something like `ly:parse-init` to import
>> `lib.ly` which would `\include` all the other `*.ly` files, sort of
>> like the way it's done in `lily.scm` for `declarations-init.ly`. And
>> then I would import the guile module that would bootstrap everything
>> like `#(use-modules (special module))` in a particular project.
>> Assuming the guile module makes it into the %load-path.
>> 
>> There's probably a simpler way to do this and I'm just overthinking
>> it. What do other people like doing for shared ly libraries?
>> 
>> Thanks
>> Tom

__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: Snippet: Adding indicators to staves which split after a break

2024-03-25 Thread Kieren MacMillan
Hi Kevin,

> I have two questions about this snippet:

You forgot to include the snippet or a link! :)
But I assume you mean 
https://lilypond.org/doc/v2.25/Documentation/snippets/vocal-music_003a-adding-indicators-to-staves-which-get-split-after-a-break

> The easy question. The fourth line of the snippet reads:
>(PI_OVER_180 (/ (atan2 1 1) 34))
> Surely that “34” should be “45”.

Did you try changing it?  ;)

> The more difficult question. This snippet adds two arrows to the bar line at 
> the end of the staff. I have a case where there is a key change at the end of 
> the staff where I'd like to put the indicator, and so the bar line is not at 
> the end of the staff. The snippet dutifully adds arrows to the bar line, 
> which conflict with the new key signature. Is there a way to move the arrows 
> to the end of the staff, rather than on the bar line?

I have a modified version (included below) which handles TimeSignature — you 
can likely adjust it to handle KeySignature as you want it to!

Hope this helps!
Kieren.

p.s. It would be amazing if this were more automatic (i.e., it handled all 
possible end-of-staff grobs/situations), adjustable (e.g., had parameters for 
arrow angle, padding, etc.), and built into Lilypond basecode — I just don’t 
have time to climb the various learning curves and put together a patch 
currently.  :(
_

  SNIPPET BEGINS
\version "2.25.11"

\layout {
  \context {
\Score
\remove Bar_number_engraver
  }
}

#(define-markup-command (arrow-at-angle layout props angle length fill)
  (number? number? boolean?)
  (ly:stencil-rotate
(interpret-markup layout props
  (markup #:concat (#:draw-line (cons length 0)
#:hspace -0.1
#:arrow-head X RIGHT fill)))
angle -1 0))

arrowUpMarkup = \markup \concat { \hspace #0.375 \override #'(thickness . 1.5) 
\arrow-at-angle #30 #(sqrt 4) ##t }
arrowDownMarkup = \markup \concat { \hspace #0.375 \override #'(thickness . 
1.5) \arrow-at-angle #-30 #(sqrt 4) ##t }

staffSplitMarkup =
\markup
  \with-dimensions #'(0 . 0) #'(0 . 0)
  \combine
\raise #0.4 \arrowUpMarkup
\lower #0.4 \arrowDownMarkup

staffSplit = #(define-music-function (grob-name) (string?)
  #{ { \once \override Staff.$grob-name #'stencil =
  #(grob-transformer 'stencil (lambda (grob orig)
(if (= LEFT (ly:item-break-dir grob))
  (ly:stencil-combine-at-edge
orig X RIGHT
(grob-interpret-markup grob staffSplitMarkup)
(if (equal? "TimeSignature" grob-name) 0.5 0))
  orig)))
\break } #} )

staffConvergeDown = #(define-music-function (grob-name) (string?)
  #{ { \once \override Staff.$grob-name #'stencil =
  #(grob-transformer 'stencil (lambda (grob orig)
(if (= LEFT (ly:item-break-dir grob))
  (ly:stencil-combine-at-edge
orig X RIGHT
(grob-interpret-markup grob #{
  \markup
\with-dimensions #'(0 . 0) #'(0 . 0)
\arrowDownMarkup #})
(if (equal? "TimeSignature" grob-name) 0.5 0))
  orig)))
\break } #} )

staffConvergeUp = #(define-music-function (grob-name) (string?)
  #{ { \once \override Staff.$grob-name #'stencil =
  #(grob-transformer 'stencil (lambda (grob orig)
(if (= LEFT (ly:item-break-dir grob))
  (ly:stencil-combine-at-edge
orig X RIGHT
(grob-interpret-markup grob #{
  \markup
\with-dimensions #'(0 . 0) #'(0 . 0)
\arrowUpMarkup #})
(if (equal? "TimeSignature" grob-name) 0.5 0))
  orig)))
\break } #} )


upper = {
  c'1 \break
  c'1 \staffConvergeDown "BarLine" \break
  c'1 \staffConvergeDown "TimeSignature" \time 3/2 \break
  c'1.
}

lower = {
  c'1 \break
  c'1 \staffConvergeUp "BarLine" \break
  c'1 \staffConvergeUp "TimeSignature" \break
  c'1. \break
}

\new ChoirStaff <<
  \new Staff \upper
  \new Staff \lower
>>
  SNIPPET ENDS
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: nested \set ?

2024-03-25 Thread Kieren MacMillan
Hi Werner,

> LilyPond provides `\temporary` and `\revert` to set a grob property
> temporarily, and afterwards the value of the grob property is the same
> as before.
> 
> Is there a similar possiblity for `\set` (or something usable in
> Scheme)?  I guess not, but I couldn't find this documented
> somewhere...

\once certainly works:

  SNIPPET BEGINS
\version "2.25.11"

\paper { indent = 0\in left-margin = 1\in }

music = {
  \override Staff.InstrumentName.padding = 2
  \set Staff.shortInstrumentName = "actual"
  c'1 \break c'1
  \once \set Staff.shortInstrumentName = "temp" \break
  c'1 \break
  c'1
}

\score { \music }
  SNIPPET ENDS

Not sure why \temporary wouldn’t/shouldn’t, although I must admit I couldn’t 
find the right incantation…

Cheers,
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: ragged-bottom and spacing for individual pages

2024-03-20 Thread Kieren MacMillan
Hi Paul,

> 1. How can I cause an individual page other than the last page of a score to 
> have ragged-bottom?

As far as I know, you can’t… To fake that behaviour, I usually just inject an 
appropriately-sized blank markup below the last system I want on a given page 
(attached to anything in that system, e.g., the last BarLine).

Hope that helps!
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: Time measurement

2024-03-15 Thread Kieren MacMillan
Hi Jean,

> To get 2-digit precision on the number of seconds, you can simply replace
> 
> (format #f "~as" (round rest))
> 
> with
> 
> (format #f "~,2fs" rest)
> 
> in the format-time function.
> 
> For seconds:frames at 24 frames/second, replace format-time with
> 
>   (define (format-time seconds)
> (let* ((minutes (euclidean-quotient seconds 60))
>(rest (euclidean-remainder seconds 60))
>(seconds (euclidean-quotient rest 1))
>(rest (euclidean-remainder rest 1)))
>   (string-append (if (zero? minutes) "" (format #f "~a:" minutes))
>  (format #f "~a:~a" seconds (round (* rest 24))

Fantastic!

For future readers: for 0 minutes, 2 seconds, and 8 frames, the formatting 
above will return "2:8". If you [like me] would prefer "0:02:08", then use

  (string-append (format #f "~d:" minutes)
 (format #f "~2,'0d:~2,'0d" seconds (round (* rest 24))

Thanks again, Jean!
Another “wow” feature to show my colleagues who are still toiling away in 
lesser engraving apps.  ;)

Cheers,
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: Time measurement

2024-03-15 Thread Kieren MacMillan
Hi Lukas,

I love that we have two custom engravers to compare and learn from!
Thank you so much for this solution — looking forward to analyzing it when I 
have a moment.

Best,
Kieren.

> On Mar 14, 2024, at 5:54 PM, Lukas-Fabian Moser  wrote:
>> “This sounds like a job for… Custom Engraver!!”  :)
> It sure does.

__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: Time measurement

2024-03-15 Thread Kieren MacMillan
Hi Jean,

As always… remarkable.

One question: How hard would it be to have this output more precise timings 
(e.g., 1/4 or 1/10th or 1/100th of a second, or SMPTE timecode in 
minutes:seconds:frames)? I could imagine this being *very* useful for 
film/video/media composers.

Thanks!
Kieren.

> On Mar 14, 2024, at 5:45 PM, Jean Abou Samra  wrote:
> 
>> “This sounds like a job for… Custom Engraver!!”  :)
> 
> \version "2.24.2"
> 
> #(define (Custom_engraver!! context)
>   (define (format-time seconds)
> (let ((minutes (euclidean-quotient seconds 60))
>   (rest (euclidean-remainder seconds 60)))
>   (string-append (if (zero? minutes) "" (format #f "~am" minutes))
>  (format #f "~as" (round rest)
>   (let ((wholes-per-minute 15)
> (last-time ZERO-MOMENT)
> (total-time 0)
> (marks '()))
> (make-engraver
>  ((process-music engraver)
>   (let* ((new-time (ly:context-current-moment context))
>  (time-delta (ly:moment-main (ly:moment-sub new-time last-time)))
>  (new-wholes-per-minute
>(and=> (ly:context-property context 'tempoWholesPerMinute #f)
>   ly:moment-main)))
> (set! total-time
>   (+ total-time (* 60 (/ time-delta wholes-per-minute
> (set! last-time new-time)
> (when new-wholes-per-minute
>   (set! wholes-per-minute new-wholes-per-minute
>  (acknowledgers
>   ((text-mark-interface engraver grob source-engraver)
>(set! marks (cons grob marks
>  ((process-acknowledged engraver)
>   (for-each (lambda (grob)
>   (when (assq-ref (ly:grob-property grob 'details) 'time-mark)
> (ly:grob-set-property! grob 'text (format-time 
> total-time
> marks)
>   (set! marks '())
> 
> \layout {
>  \context {
>\Score
>\consists #Custom_engraver!!
>  }
> }
> 
> timeMark = \tweak details.time-mark ##t \tweak color "red" \textEndMark 
> "Abracadabra"
> 
> {
>  c'1
>  \timeMark
>  \tempo 4 = 120
>  c'4 8. 16 2
>  \timeMark
>  \tempo 4 = 180
>  c'2 2
>  \timeMark
>  \repeat unfold 180 c'4
>  \timeMark
> }
> 

__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: Time measurement

2024-03-14 Thread Kieren MacMillan
Hi Matthew,

> Is there any easy way to find out the time in seconds from the start of a
> score to a specified point, corresponding to the timing of the MIDI
> output?  I can count measures and do math on the tempo, but that's
> less than ideal in the face of multiple tempo changes.  Another idea would
> be to just cut the score at the desire point and then measure the length
> of the MIDI output file.  I can already manually examine the MIDI output,
> find the desired point in the music, and record its timing, but that's
> a fair bit of work.
> 
> I only really need to do this for a few points, a few times, and I just
> want to know the numbers, not necessarily typeset them.  But a more
> automated method along the lines of a \midiTime markup that would actually
> typeset the time to that point automatically, would be fun too.

“This sounds like a job for… Custom Engraver!!”  :)
K
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: Question about voltas and repeats

2024-03-12 Thread Kieren MacMillan
Hi Lucas,

I was told by people with a far deeper understanding of Lilypond’s than mine 
that trying to abstract the volta map is undesireable — it should be explicitly 
included in every music expression that it intersects with.

Cheers,
Kieren.

> On Mar 12, 2024, at 7:00 PM, Lucas Cavalcanti  wrote:
> 
> Hello. I've been thinking about Lilypond's usage on parts: for one musician 
> (for example, the singer singing the melody) I'd like to give them a score 
> containing voltas using the repeat and volta commands; for another musician 
> (for example, the drummer) I'd like to give them a score with no repeats and 
> voltas. I know that if I'd like to create a full-band score (i.e a grid) I 
> can use the \unfoldRepeats at every variable, creating one straight through 
> score. 
> 
> However, is it possible to create something like a "Tempo Map" of sorts? Like 
> a part/variable that gives instructions to the master grid to create repeats 
> and voltas without the need to create new parts?
> 
> My objective is to figure out a way to create independent grid scores from 
> musician part scores. To give a singer one straight, 6 pages score, to give a 
> drummer a 1 page score and to give the conductor a 4 page score.
> Is that possible?
> 
> Best regards, Lucas.
> 

__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: Omit TupletNumber problem

2024-03-12 Thread Kieren MacMillan
Hi Ralph,

> I cannot figure out how to revert or reverse "\omit TupletNumber". "\once 
> \omit TupletNumber" does, in fact omit only the next tuplet number. However, 
> if I use "\omit TupletNumber", it omits all folowing tuplet numbers, and I 
> cannot find a command to restore the tuplet numbers. Any suggestions would be 
> appreciated.

On the doc page

https://lilypond.org/doc/v2.23/Documentation/notation/visibility-of-objects#removing-the-stencil

you’ll find the \undo \omit construct. So in your case, you would use

  \undo \omit TupletNumber

Hope that helps!
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: Question regarding ChordNames

2024-03-12 Thread Kieren MacMillan
Hi John,

> I've got a guitar leadsheet that displays the guitar chord G# as Ab.

That’s definitely weird… On my machine, this displays G# as G# and Ab as Ab:

\version "2.25.11"
\language "english"

gsharp = \chordmode { gs1 }
aflat = \chordmode { af1 }

<<
 \new ChordNames { \gsharp }
 \gsharp
>>

<<
 \new ChordNames { \aflat }
 \aflat
>>

Maybe post a MWE, so people can more easily diagnose the issue.

Cheers,
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: Schenkerian slurs and framework

2024-03-07 Thread Kieren MacMillan
Hi Ben,

> I read the 2005 article in the Linux journal about making schenkerian graphs, 
> and I feel like it covered everything except one type of slur. I think I've 
> heard it called a swan slur before. It's a slur that hooks around a note. In 
> this picture it's the slur connecting the e flat in the bass to the second b 
> flat. 
> https://i0.wp.com/johnhalle.com/wp-content/uploads/2020/08/image-3.png?ssl=1
> I feel like I need one more point to modify in the bezier curve to get it to 
> hook around like that. Is that possible?

I feel like I was able to accomplish it without that… let me see if I can find 
the code I used.

> Also, while searching for an answer to this I saw reference to a LilySchenker 
> framework but I can't find any more info about it, probably because there's 
> some famous person named Lily Schenker... Anyone have more info on that?

I was the one building that… let me see if I can find the code I used.  :)

Best,
Kieren
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: [HELP] RemoveAllEmptyStaves not working.

2024-03-06 Thread Kieren MacMillan
Hi Lucas,

> I've used the RemoveAllEmptyStaves command to remove (obviously) the 
> unnecessary staffs. However, the drumkit doesn't get removed like it should.
> The drumkit staff is independent by itself; it is not part of a group staff. 
> It is, however, a DrumStaff.
> I've looked at the documentation (Hiding Staves) and found a similar 
> situation (the double bass not being removed). However, the D.B was not 
> removed because it was part of a section/group staff. Adding injury to the 
> cause, I was not able comprehend the use of "Keep_alive" commands.

It’s a little “nuclear”, but…

\layout {
  \context {
\Score
\RemoveAllEmptyStaves
  }
}

[Note the \Score rather than \Staff]

Hope that helps!
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: Make D.S. and Coda objects RED

2024-03-03 Thread Kieren MacMillan
Hi Laurie,

> When I copied your layout block into my score (2.25.12) I get this error
> error: syntax error, unexpected SYMBOL, expecting '='
>   CodaMark 
>color = "tomato"

Sorry… didn’t test. Should have been

\layout {
  \context {
\Score
\compressEmptyMeasures
\override MultiMeasureRest.expand-limit = #2
\override CodaMark.color = "tomato"
\override SegnoMark.color = "tomato"
\override SectionLabel.color = "tomato"
% \override RehearsalMark.color = "tomato"
\override JumpScript.color = "tomato"
rehearsalMarkFormatter = #format-mark-box-alphabet
  }
}

Best,
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: extracting a single “vocal line” (including lyrics) from multiple variables

2024-03-02 Thread Kieren MacMillan
Hi Simon,

> you can quote lyrics perfectly well. It’s just that of course the quoting 
> logic is based on durations, so I think explicit durations are unavoidable

Ah! That makes sense.
Despite the extra work, it’s probably QUITE worth it in my larger projects.

Thanks!
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: Make D.S. and Coda objects RED

2024-03-01 Thread Kieren MacMillan
Hi all,

> I put them in the "global" section of my creation:
> 
> global = {
>  \time 2/2
>  \tempo 4=200
>  \compressEmptyMeasures\override MultiMeasureRest.expand-limit = #2
>  \override Score.CodaMark.color = "tomato"
>  \override Score.SegnoMark.color = "tomato"
>  \override Score.SectionLabel.color = "tomato"
>  %\override Score.RehearsalMark.color = "tomato"
>  \override Score.JumpScript.color = "tomato"
>  \set Score.rehearsalMarkFormatter = #format-mark-box-alphabet
> }

If this is a thing you do regularly, you might want to build an include file 
(e.g., Score_init.ily) and do this:

\layout {
  \context {
\Score
\compressEmptyMeasures
MultiMeasureRest.expand-limit = #2
CodaMark.color = "tomato"
SegnoMark.color = "tomato"
SectionLabel.color = "tomato"
% RehearsalMark.color = "tomato"
JumpScript.color = "tomato"
rehearsalMarkFormatter = #format-mark-box-alphabet
  }
}

and then just 

\include "Score_init.ily"

in your main files.

Hope this helps!
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: extracting a single “vocal line” (including lyrics) from multiple variables

2024-02-29 Thread Kieren MacMillan
Hi Simon,

> huge respect for the kind of projects you are doing :)

Thanks — I need all the [psychological] help I can get!  LOL

> Answering these questions is difficult because they can depend a lot on the 
> specifics of the music and any solution can become cumbersome because of only 
> a little instance that doesn’t fit the schematic.

Of course.

> A few thoughts:
> 
> Trying out \partcombine quickly made me avoid it until absolutely necessary, 
> but maybe it becomes manageable with clever and experienced use of 
> \partCombineApart and friends. In choral pieces, I often use a single 
> variable that contains all the lyrics, tagged depending on who does and 
> doesn’t use which part and then filtered in the score setup. I believe that 
> it makes a key difference to use both \keepWithTag _and_ \removeWithTag like 
> this:
> 
> 
> text = \lyricmode {
>   \tag A { on -- ly al -- to }
>   \tag nA { ev’ -- ry -- one ex -- cept al -- to }
> }

#mindblown

Why didn’t I think of using set theory?!
THANK YOU! That hint alone makes your response gold.

>> 2. \addQuote everything and then \quoteDuring the appropriate sections? n.b. 
>> I believe lyrics aren’t quoteable (right?)…
> I haven’t tried quoting lyrics, but I’ve often used a hybrid approach: quotes 
> in the music, lyrics managed with tags.

Right.

I didn’t see an issue/request for quoting lyrics, so I added one 
(https://gitlab.com/lilypond/lilypond/-/issues/6700) and we’ll see how the 
discussion goes.  :)

Thanks!
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: Moving turn above slur

2024-02-27 Thread Kieren MacMillan
Hi Ralph,

> I cannot figure out how to move the turn above the slur in the following MWE:

%%%
\version "2.24.2"
\language "english"

tune = 
\relative c'' {
  c8.-\tweak avoid-slur #'outside \turn[( d16) f8. g16] a8.[ f16 g8.( a16]) |
  
}

\score {
  \tune
}
%%%

Hope that helps!
Kieren.


extracting a single “vocal line” (including lyrics) from multiple variables

2024-02-27 Thread Kieren MacMillan
Hi all,

So… In the musical I’m currently co-writing (and solo-engraving!), I’ve got a 
bunch of different variables for the various vocal lines, e.g.

Frogs_Sammy_notes = { … }
Frogs_Sammy_lyrics = \lyricmode { … }
Frogs_Michael_notes = { … }
Frogs_Michael_lyrics = \lyricmode { … }
Frogs_chorus_upper_notes = { … }
Frogs_chorus_upper_lyrics = \lyricmode { … }
Frogs_chorus_lower_notes = { … }
Frogs_chorus_lower_lyrics = \lyricmode { … }

Depending on the final output (e.g., full score vs. piano/conductor vs. 
choral/vocal etc.), these may be combined in different ways [a 
process/workflow/toolchain which I would love to simplify/optimize in the very 
near future!].

The immediate issue I have is that in March, I’m going in to a recording studio 
with some players (guitar, bass, and drums) to collaboratively arrange/build 
the band music. I want to provide the players with some sort of part to play 
from, and they said a lead sheet (i.e., marks + chords + vocals + lyrics) would 
be fine. I’d love to be able to tag different parts of the different variables 
(notes and lyrics) and compile a single line they can follow.

Here’s my question:

In terms of efficiency (e.g., compilation time) and complexity (q.v., code 
maintenance) would it be better to:

1. \tag the various sections in question and then try to combine them (using 
\partcombine?) into a single vocal line; or

2. \addQuote everything and then \quoteDuring the appropriate sections? n.b. I 
believe lyrics aren’t quoteable (right?)…

or maybe there’s a 3, 4, 5…? (e.g., a custom engraver?)

Thanks for any ideas/advice!
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: Rousseau's boustrophedon notation [but OT, really]

2024-02-24 Thread Kieren MacMillan
Hi Aaron,

Rather incredibly, I had never heard of the word “boustrophedon” and this is 
the second reference in just under a week! The first time was when someone 
asked me (last week) whether there was a perfect rhyme for “anthropomorphic” — 
the only one I could find was “boustorphic” (which derives from the same root 
as boustrophedon).

I know about the frequency illusion bias (a.k.a. Baader–Meinhof phenomenon), 
but I honestly don’t think this is that.  :)

Cheers,
Kieren.

> On Feb 23, 2024, at 4:55 PM, Aaron Hill  wrote:
> 
> Just read a side note on Wikipedia about a supposed "boustrophedon" notation. 
>  The citation does not link to the image in question, which is an unfortunate 
> oversight.  I was curious whether this approach applied only to Rousseau's 
> numeric notation or if it was intended to work with standard notation.  I 
> suspect his numeric notation is more vulnerable to misreading as it would be 
> harder to jump from the end of one line to the beginning of the next.
> 
> It seems like LilyPond could theoretically support this by alternately 
> reflecting every other system, assuming the intention is to mirror image all 
> symbols in the right-to-left systems.
> 
> Does anyone have more details about this?



Re: 5th anniversary conference? :)

2024-02-23 Thread Kieren MacMillan
Hi Mike!

> I live in Toronto, in the Annex.  I'd love to help organize something here if 
> there's interest. I'm right
> close to the  University of Toronto campus.

1. Let’s keep this discussion going, and see if it actually gains traction!

2. I teach in the Annex (Randolph College) three times a week — we should grab 
lunch/tea/pints some day.  :)

Cheers,
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: Brackets (and more) in text spanners?

2024-02-20 Thread Kieren MacMillan
Hi,

> I want to set a text spanner with an ending bracket.

https://lilypond.org/doc/v2.25/Documentation/snippets/expressive-marks_003a-creating-text-spanners

Hope that helps!
Kieren
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: small notes for different lyrics

2024-02-18 Thread Kieren MacMillan
Hi Robert,

> adding smalls notes or different rhythms for different lyrics. Just add a 
> second voice and change the note’s sizes? Or is it there a proper way to do 
> so?

Looks like nobody answered this, so let me give you one solution (which is 
exactly what you suggested in your question):

%%%   SNIPPET BEGINS
\version "2.25.11"

\layout {
  line-width = 4\in
  indent = 0
  ragged-right = ##f
}

theNotes = {
  f'4 4 4 g'
  r4 \voices 1,2 <<
\context Voice = "main" { \voiceOne a'-> r4^\> g'8 \noBeam 8\! }
\\
\new Voice = "extra" { \magnifyMusic 0.75 { \voiceTwo \tweak 
NoteColumn.force-hshift #1.5 a'4 g' ~ \hideNotes g' } }
  >>
}

theLyrics = \lyricmode {
  \repeat unfold 4 { \skip 8 }
  nicht hast ge
}
extraLyrics = \lyricmode {
  \override LyricText.font-shape = #'italic
  \override LyricText.X-offset = #-1
  al -- drig __
}

<<
  \new Staff \new Voice = "main" \theNotes
  \addlyrics \theLyrics
  \new Lyrics \lyricsto "extra" \extraLyrics
>>
%%%  SNIPPET ENDS

I don’t know of a more “proper” way to do this — maybe someone else will 
contribute a better (or at least another) answer.

Hope that helps!
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: 5th anniversary conference? :)

2024-02-15 Thread Kieren MacMillan
Hey all,

>> I was just waxing nostalgic about that fabulous Salzburg conference in 2020, 
>> and noted that in Jan 2025 — just under a year from now! — it will have been 
>> five years since we got together, talked music/notation, and raised [more 
>> than] a few pints together.
>> Any chance for a repeat? :)
> 
> Would be great. Count me as "will try to come if it gets organized".

As I said back then, I’d be more than happy to organize a conference here in 
Toronto… but we decided that too many people would have to travel this 
direction over the Atlantic. It really does seem to be most efficient to hold 
this kind of gathering in Europe somewhere.

Cheers,
Kieren
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: How to to a Lyrics extender line?

2024-02-14 Thread Kieren MacMillan
Hi Michael,

Why not

verseC = \lyricmode { \repeat unfold 4 { \skip 8 } lu __ _
  \markup \null \repeat unfold 3 { \skip 8 } lu __ _ }

?

Hope that helps!
Kieren
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




5th anniversary conference? :)

2024-02-13 Thread Kieren MacMillan
Hello, Pond!

I was just waxing nostalgic about that fabulous Salzburg conference in 2020, 
and noted that in Jan 2025 — just under a year from now! — it will have been 
five years since we got together, talked music/notation, and raised [more than] 
a few pints together.

Any chance for a repeat? :)

Just throwing it out into the Universe.
— Kieren
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: Rest space in between fugue's voices

2024-02-10 Thread Kieren MacMillan
Hi George,

[n.b. I’ve cc'ed the list, as per standard practice in the Lilypond community.]

> Thank you very much! It worked perfectly just by inserting "\tweak X-offset 
> #1" before the 16th rest in my original code

Oh, great! I didn’t think to try only that tweak.

> I didn't quite understand the reasons for changing \voiceFour and \voiceOne 
> in the tenor part

Lilypond’s \voiceX commands automatically set a lot of parameters (default 
stem/tie/slur direction, etc.) according to where the voice “sits” on the 
staff; the odd-numbered voices (\voiceOne, \voiceThree, etc.) act as if they 
are “on top” (so stems/ties/slurs go up), while even-numbered voices 
(\voiceTwo, \voiceFour, etc.) act as if they are “underneath” (stems/ties/slurs 
down, etc.).

When the tenor voice is in the lower staff, it is on top, so \voiceOne makes 
the most sense (because there are only two voices); when it moves to the upper 
staff, it is (at least in your example) on the bottom, so \voiceFour makes the 
most sense (because \voiceTwo is already taken by the alto).

> why was the use of  " \tweak staff-position -4" necessary.

I tried that first to force the rest into the right vertical position; then I 
tweaked the X-offset to move it horizontally. I didn’t realize that if I had 
just done the X-offset *first*, Lilypond would Do The Right Thing™ (well, of 
*course* it does!), and so the staff-position tweak was ultimately unnecessary.

Cheers,
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: Rest space in between fugue's voices

2024-02-10 Thread Kieren MacMillan
Hi George,

> Currently, I am transcribing Bach's Fantasia and Fugue in a minor (BWV 904), 
> but I am dealing with a rest collision between the fugue voices on measure 
> 69. Specifically, on the 4th beat I have not found a way to give distance 
> between the a' from the alto and the 16th rest from the tenor.

How about:

tenor = \relative d' {
  \override NoteHead.color = #red \override Stem.color = #red \override 
Beam.color = #red \override Rest.color = #red
  \change Staff = "up"
  \voiceFour
  d8 e f d a'4 r8 d, |
  bes'4 r8 d, a'4 \tweak staff-position -4 \tweak X-offset #1 r16 g f e   |
  d e f d 
}

In general, I tend to trust Lilypond’s \voiceX commands and tweak anything that 
doesn’t work as hoped/expected, rather than manually overriding stem and tie 
directions and so on. (Obviously, when the tenor returns to the lower staff, 
you’d want to issue a \voiceOne command!)

Hope that helps,
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: [large/complex projects] where should transpositions go?

2024-02-07 Thread Kieren MacMillan
Hi Martin,

> For quite a long time now I'm relying heavily on openlilylib's auto-transpose 
> module. In my experience it does play nicely together with the 
> edition-engraver.

Oh, goodness… I think you may have shared this on the list before, but I didn’t 
quite understand how cool and powerful it was/is!

> One caveat is its abuse of the \transposition command, which might throw 
> things off if you need midi output. But I don't do midi, so I wouldn't know...

I outputted MIDI, and it clearly doesn’t work as expected.
That *may* be a problem for me at some point in the future, but isn’t right now.

> Attached is a silly little example I whacked together to make sure I wasn't 
> going to tell some nonsense.

I jacked it up a bit — threw a few preliminary “curve balls” at it (e.g., 
separated global data into a variable, added an “internal” key change with 
“injected” transpositions around it, etc.) — and it handled them like a pro:

  SNIPPET BEGINS
\version "2.25.10"
\language "english"

\include "oll-core/package.ily"

\loadModule oll-misc.pitch.auto-transpose
\loadPackage notation-fonts
\loadPackage edition-engraver

\addEdition test

\consistToContexts #edition-engraver Score.Staff.Voice

\editionMod test 4 0/4 trans.pose.Voice \transposition bf
\editionMod test 8 0/4 trans.pose.Voice \transposition a

\layout {
  \context {
\Score
\editionID ##f trans
  }
}

global = {
  \key d \major
  s1*5
  \key f \major
  s1*5
}

theNotes = {
  \repeat unfold 5 { d'1 }
  \repeat unfold 5 { f'1 }
}

\score {
  \new Staff
\with { \editionID pose \autoTranspose }
{ << \global \theNotes >> \fine }
  \layout {}
  \midi {}
}
  SNIPPET ENDS

I’m 100% going to be using this in my framework — thank you so much!!!
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: Score overruns page. Bug or something I did?

2024-02-06 Thread Kieren MacMillan
Hi Jakob,

In m25, T1 has 5 beats. Is that correct?

– Kieren


Re: [large/complex projects] where should transpositions go?

2024-01-30 Thread Kieren MacMillan
Hi Simon,

> I’d like to share two approaches I’ve developed for such issues.

Thanks for all this!

> Firstly, I couldn’t take time to study your setup and how that makes these 
> approaches viable or not—sorry for that.

No worries — I recognize it’s a lot for anyone to try to wrap their head around 
if they’re not already in it to begin with.

> Secondly, if possible, I always try to use vanilla LilyPond tools

Me, too!

> I prefer using tags as far as they may take me over using the editionEngraver

Me, too! I just: (a) consider the Edition-Engraver to fall under the “vanilla 
Lilypond” rubric in the same way as other bespoke Scheme code does; and (b) 
have a lower limit than other people on how far tags “optimally go”.  ;)

> I prefer complicated \include setups with Scheme conditionals over using 
> make. This is in an attempt to improve maintainability and reduce overhead.

100%. 

>> I don’t believe quoted music can be transposed directly (i.e., you need to 
>> create a second, pre-transposed, quotation)
> What I’ve started doing after running into this problem is for example
> 
> sop = { %{soprano music%} }
> \addQuote "sop" \sop
> \addQuote "sop8vb" \transpose c c, \sop

Yes, that’s what I do (cf. “you need to create a second, pre-transposed, 
quotation”). I just wish it didn’t require that.

> Recently I even put this into my standard include files to avoid having that 
> third (or more) lines from the example:

That’s quite useful, actually. Thanks! (I really need to get more sugar in my 
Lilypond “diet”… I’m just working so hard on so many things that I never seem 
to have time to sit back and refine the sugar. )

> Another technique is this:
> 
> %%% from my library/ly-utility.ily file
> musicFunctionDummy = #(define-music-function (mus) (ly:music?) mus)
> 
> addToplevelMusicFunctions =
> #(define-scheme-function (names) (symbol-list-or-symbol?)
>(let* ((name-list (if (list? names) names (list names)))
>   (lookup-function
>(lambda (name) (let ((fn (ly:parser-lookup name)))
> (if (equal? fn '())
> (begin
>  (ly:warning "Cannot find music function
> ~a to add to toplevel functions.\n" name)
>  musicFunctionDummy)
> fn
>   (fn-list (map lookup-function name-list)))
>  (set! toplevel-music-functions
>(append fn-list toplevel-music-functions
> %%%
> 
> Example usage:
> 
> %%%
> transposer = \transpose g f \etc
> enharmonicsChooser = \keepWithTag #'originalSpelling \etc
> \addToplevelMusicFunctions transposer,enharmonicsChooser
> %%%

Currently I’m neither quite sure how this works, nor if/how it might be useful 
to me… but I appreciate the example, and will look into it!

Thanks,
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: [large/complex projects] where should transpositions go?

2024-01-29 Thread Kieren MacMillan
Hi Valentin,

I’m… a bit gobsmacked.

> I think with large projects it is a good idea to establish a nice data flow. 

Agreed.

> Basically your code does different things. For one thing you have musical 
> data, 
> for another thing you have formatting of said data, and then you also have 
> functions and stuff.

Still on the same page with you.

> Depending on your particular needs you can create you own way of specifying 
> data, layouts, stylesheets and such, and the cleaner you can separate these 
> the better you will be able to transparently do complex things.

100%

>> 1. Should I have one output file per score, or use \book? I assume if it’s
>> multiple files, and I want to keep them synchronized, I would want to use
>> make (or similar) to trigger a compilation of all of them at once?
> 
> Depends on what you want.

Okay, I figured as much.  ;)

>> 2. Am I <<>>-ing the \global at the best spot(s)?
> You could also add \global once in a toplevel DevNull

Now *that* is a use of DevNull I’ve never considered (or even seen) before.
Fascinating!

> With such small differences it might be useful to notate chords by voices << 
> ... >> instead.

I love this idea!

> Here is a sketch demonstrating a few concepts of how you could specify data 
> and have custom music function make sense of it

Here’s where my gob got smacked. If I understand correctly what you’ve done 
here — and TBH it will still take me a little time and testing to fully get my 
head around exactly how it’s working and the full scope/applicability — this 
approach is exactly the level of abstraction and reuse/adjustability I need.

Thank you so much! I’ll get back to you if I have any questions.

Best,
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: [large/complex projects] where should transpositions go?

2024-01-29 Thread Kieren MacMillan
Hi Timothy,

> If I have understood Kieren correctly, he wants the option to configure his 
> score with a part either sung by a tenor voice at written pitch, or a treble 
> voice one octave higher.

Correct.

> The attached files illustrate a couple of suggestions that might help.
>   • Set up new contexts (TrebleStaff, TenorStaff) that automatically 
> insert the right clef, and transpose the notes up an octave in the 
> TrebleStaff.
>   • Use a tag group that is adjusted to build the various styles of 
> score, while keeping the definition of the scores fixed.

This is a very interesting approach, which I will consider seriously for many 
of the applications I have. In particular, it is superior to my current 
“manually insert \transpose commands all over the place“ method. (And, p.s., I 
love the small but important abstractions you also implemented, like \KMTags — 
every reduction in duplication helps in such a complex/complicated structure!)

The one constraint/situation this might not handle is when the 
transposition/octavation happens *mid-system*. I could, of course, just accept 
that I always have to end a system and French the staves appropriately… but at 
this stage of investigation, I want to know all of my options, and the 
pros/cons of each approach.

Many thanks for this solution!
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




[large/complex projects] where should transpositions go?

2024-01-27 Thread Kieren MacMillan
Hi all,

So… At the bottom of this email, I’ve included a somewhat-M W E of something 
I’m wrestling with around all this stuff. You’ll see I have a ScoreMarks.ily 
file (one of many \includes, but needed here because the structure of the vc 
and pc are slightly different!), a notes.ily file (with all the note-code), and 
output files.

There are *so* many variables on the input side in this industry (musical 
theatre): show version (cuts, etc.), voicing (different characters can be 
played by people singing in different clefs), chorus voicing (SATB? just SA?), 
etc. I’m trying to come up with a structure/workflow/plan that gives me maximum 
control and flexibility with minimum complexity (all terms relative, 
obviously!).

Questions:

1. Should I have one output file per score, or use \book? I assume if it’s 
multiple files, and I want to keep them synchronized, I would want to use make 
(or similar) to trigger a compilation of all of them at once?

2. Am I <<>>-ing the \global at the best spot(s)?

3. Compare the voicing of m3 in the SATB and SA voicings: mm1-2 are different, 
but m3 is the same. How can I do this kind of thing with the least amount of 
code duplication? I don’t believe quoted music can be transposed directly 
(i.e., you need to create a second, pre-transposed, quotation); I can’t see how 
to inject a transposition (e.g., using the Edition-Engraver) into a specific 
part of a score/variable; I really don’t want to have to break every variable 
into multiple subvariables to handle every difference between voicings (nor do 
I want to have complete duplicates, one per voicing!); etc.

Given Lilypond’s current powers and limitations, what’s my best path forward? 
At this point, even a high-level discussion would be really appreciated: As you 
can probably imagine, the number of permutations and combinations are ganging 
up on me, and I can’t grapple with them all myself.

Thanks,
Kieren.


\version "2.25.10"
\language "english"

\paper { tagline = ##f ragged-bottom = ##t indent = 0 }


%%%  ScoreMarks.ily

\layout {
  \context {
\type "Engraver_group"
\name ScoreMarks
keepAliveInterfaces = #'( metronome-mark-interface )
rehearsalMarkFormatter = #format-mark-box-alphabet
\consists "Axis_group_engraver"
\override VerticalAxisGroup.staff-affinity = #DOWN
\override VerticalAxisGroup.nonstaff-relatedstaff-spacing =
#'((basic-distance . 3) (minimum-distance . 3) (padding . 1.5))
\consists "Metronome_mark_engraver"
\override MetronomeMark.Y-offset = #0
\override MetronomeMark.outside-staff-priority = #50
\override MetronomeMark.break-align-symbols =
  #'(left-edge staff-bar clef time-signature key-signature)
\override MetronomeMark.non-break-align-symbols =
  #'(paper-column-interface)
\consists "Mark_engraver"
\override RehearsalMark.Y-offset = #0
\override RehearsalMark.outside-staff-priority = #100
\override RehearsalMark.break-align-symbols =
  #'(left-edge staff-bar clef time-signature key-signature)
\override RehearsalMark.self-alignment-X = #CENTER
\override RehearsalMark.extra-spacing-width = #'(-0.5 . 0.5)
\consists "Text_spanner_engraver"
\override TextSpanner.font-size = #2
\consists "Time_signature_engraver"
\override TimeSignature.stencil = #point-stencil
  }
  \context {
\Staff
\consists "Staff_collecting_engraver"
  }
  \context {
\Score
\remove "Metronome_mark_engraver"
\remove "Mark_engraver"
\accepts ScoreMarks
  }
}


%%%   notes.ily

global = {
  \tempo "Fast"
  \key c \major
  s1
  \tag #'full { s1 }
  \bar "||"
  \key d \major
  s1
  \bar "|."
}

Michael_notes = {
  \tag #'Michael-treble { \clef treble }
  \tag #'Michael-tenor { \clef "treble_8" }
  c'4 4 4 4
  \tag #'full { g4 4 a4 4 }
  d4 4 4 4
}

chorus_notes = {
  \tag #'satb {
4 4 4 4
\tag #'full { 4 4 4 4 }
4 4 4 4
  }
  \tag #'sa {
4 4 4 4
\tag #'full { 4 4 4 4 }
4 4 4 4
  }
}

theChords = \chordmode {
  c1
  \tag #'full { g2 a }
  d1
}

acc_notes_upper = {
  c''4 4 4 4
  \tag #'full { g'4 4 a'4 4 }
  d'4 4 4 4
}
acc_notes_lower = {
  \clef bass
  c4 4 4 4
  \tag #'full { g,4 4 a,4 4 }
  d,4 4 4 4
}


%%%  full.ly (i.e., full version, Michael at pitch)

vox =
  <<
\new Staff \new Voice << \global \Michael_notes >>
\new Staff \new Voice << \global \chorus_notes >>
%%  there would potentially be a lot of other vocal/choral parts in this 
blob
  >>

vc =
  <<
\new ScoreMarks \global
\new ChordNames \theChords
\vox
  >>

pc =
  <<
\new ScoreMarks \global
\vox
\new PianoStaff <<
  \new Staff << \global \acc_notes_upper >>
  \new ChordNames \theChords
  \new Staff << \global \acc_notes_lower >>
>>
  >>

\markup "Vocal/Choral Score, Full Version, Michael tenor-clef, SATB chorus"
\score {
  \keepWithTag #'(Michael-tenor satb full) \vc
}

\markup "Piano/Conductor Score, Full Version, 

Re: [large/complex projects] conditional header values and/or book name

2024-01-27 Thread Kieren MacMillan
 Hi Sam,

Thanks for these thoughts!

> I'm not sure if this fits under your umbrella of having a single top level 
> file, but what about this?
> 
>  song-FV.ly
> definedVariables = data
> \include song.ily
> 
>  song-SV.ly
> definedVariables = data
> \include song.ily
> 
>  song.ily
> \include [.ily files containing the notes, edition-engraver tweaks, etc.]

Different versions will share some tweaks and also have individual/unshared 
tweaks, so I can’t quite tell yet whether this structure would be sufficient 
(never mind optimal).

> \header {
>   [header parameters shared by both versions]
>   [differing header parameters defined in global variables]
> }
> 
> \score {
>   [contexts built from variables defined in \include-d files]
> }
> 
> 
> Optionally, you could use the output names and book blocks so that you can 
> compile the whole work from a FullVersion.ly and ShortVersion.ly which are 
> basically a series of includes of the applicable songs.

The full book (e.g. “Piano/Conductor Score” will definitely be a series of 
includes of applicable songs. I’m trying to figure out how to structure all 
this with the least amount of duplication (in note code, tweak code, and score 
code).

Thanks,
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: [large/complex projects] conditional header values and/or book name

2024-01-23 Thread Kieren MacMillan
Hi Timothy,

> How about setting up some Scheme variables that are later used to build 
> variants of the score?

OOO I like this!

There are some further complications coming up that might render this 
unfeasible/impractical… but it’s a great suggestion, and I can definitely see 
where to use it in some of my less complex and/or complicated projects and 
workflows.

Thanks!
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




[large/complex projects] conditional header values and/or book name

2024-01-22 Thread Kieren MacMillan
Hi all,

I have a big engraving use case — I’m neck-deep in an example of it right now! 
— and I’m hoping to do some brainstorming towards an optimal 
structure/toolchain/workflow, so any thoughts are appreciated.

One of the things I do most often is compose for musical theatre. Because of 
the way that particular industry works, there is a very large and complex set 
of inputs and outputs. I’m hoping to refine my tools and process(es) to give me 
the most flexible output options with the least effort and friction on the 
input side. 

There might be a large number of posts under this “rubric”, but I’ll keep it to 
one question per thread.

So without further ado…


QUESTION #1:

Let’s say I have a song which appears identically in both the “Full Version” 
and “Short Version” of the musical. The number of the song/cue within the show 
might change, but it might not — for example, the opening number would likely 
be #1 in both versions, but the finale could be #25 in the Full version and #17 
in the Short Version. And furthermore, for this specific question, let’s say I 
need to output one file per song (as opposed to a complete score containing the 
whole show).

If I’d prefer not to involve make (or similar extra-Lilypond tools) in my 
solution, is there any way to improve on simply having a single “top-level” 
(score-generating) file structured as follows:

%%  START FILE CONTENTS
\include [.ily files containing the notes, edition-engraver tweaks, etc.]

final_score =
  <<
[contexts built from variables defined in \include-d files]
  >>

\header {
  [header parameters shared by both versions]
}

\book {
  \bookOutputName "MySong_full"
  \header {
[header parameters specific to the Full Version, e.g., song number]
  }
  \score { \final_score }
}

\book {
  \bookOutputName "MySong_short"
  \header {
[header parameters specific to the Short Version, e.g., song number]
  }
  \score { \final_score }
}
%%  END FILE CONTENTS

Is there a more efficient construct where the book name and header variables 
could be “injected” or “conditionalled” in? Or is that just overcomplicating 
this particular problem-space? (n.b., In future questions, the problem-space is 
naturally more complicated without any help from me!)

Thanks,
Kieren.


Re: Question about \include options

2024-01-08 Thread Kieren MacMillan
Hi John,

On the main webpage (https://lilypond.org/doc/v2.23/Documentation/web/index), 
when you use the search box (in the top nav bar), and type #f (no quotes or 
anything), do you not get the “Types of Properties” link within the first few 
hits (it’s the third when I search)?

Thanks,
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: Question about \include options

2024-01-08 Thread Kieren MacMillan
Hi all,

> A pity, since this is clearly explained on
> https://lilypond.org/doc/v2.24/Documentation/learning/types-of-properties.html

That’s the first hit when I search!  :)
K
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: Question about \include options

2024-01-08 Thread Kieren MacMillan
Hi John,

> My larger concern is with the ability to find these details with limited 
> knowledge about LP; as a relative novice.  I wrote a longer reply to the list 
> about this but, in short, I wouldn't have likely found this bit about #t #f 
> without referrals.  Seems I should have been able to search for them but it 
> didn't succeed.  I'd like to help figure out why it didn't succeed.

If you do a web search for

lilypond "#f"

is the very first hit not sufficiently helpful?

Cheers,
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: Help with Measure Numbers

2024-01-07 Thread Kieren MacMillan
Hi Karen,

> I need all measures numbered in this score - for some reason, the first 
> measure number in each line is being printed twice:

Just add/configure the Bar_number_engraver at the Score level — see snippet 
below.

Hope this helps!
Kieren.

% Version 1.0
% Last edit:  January 7, 2024
%
% The source code is covered by the Creative
% Commons Attribution-NonCommercial license,
% http://creativecommons.org/licenses/by-nc/2.5/
% Attribution:  Karen S. Billings CAGO
%

\version "2.22.1"
\include "english.ly"
ignore = \override NoteColumn.ignore-collision = ##t
\layout { indent = 0.0\cm }

\paper {
  #(define top-margin (* 0.5 in))
  #(define line-width (* 6.5 in))
  #(define bottom-margin (* 1.0 in))
  top-system-spacing.basic-distance = #10
  score-system-spacing.basic-distance = #10
  system-system-spacing.basic-distance = #17
  last-bottom-spacing.basic-distance = #10
  score-markup-spacing.basic-distance = #15
  ragged-bottom = ##t
}

% #(set-global-staff-size 24)

harmony = \chordmode {
  % Insert chords if needed
}
Melody = \relative c'' {
  \clef treble
  \key c \major
  \autoBeamOn
  \numericTimeSignature
  \time 4/4
  R1*4
  \bar "||" \break
  a4 a c c e, a a2
  c,4 e d c8 b a2 a2
  \bar "|."
}

Words = \lyricmode {
  _ _ _ _ _ _ _
}


UpperOne = \relative c'' {
  \clef treble
  \key c \major
  \numericTimeSignature
  \stemUp
  \time 4/4
  \repeat unfold 4 { 4  2 }
  c4 b8 a b2 a1
  a8 b 4 4 g a1
}

UpperTwo = \relative c' {
  \clef treble
  \key c \major
  \numericTimeSignature
  \stemDown
  \time 4/4
  \repeat unfold 4 { e8 e e e e2 }
  e8 e e4 d2
  c8 d e4 d2
  e8 f e4 d2
  4 d e2
}

LowerOne = \relative c' {
  \clef bass
  \key c \major
  \numericTimeSignature
  \time 4/4
  \stemUp
  a1 a a a
  a1 a a a
}
LowerTwo = {
  \clef bass
  \key c \major
  \numericTimeSignature
  \stemDown
  \time 4/4
}


\score {
  <<
%\new ChordNames {
%  \set chordChanges = ##t
%  \harmony
%}
\new Staff
\new Voice = "mel" \Melody
\new Lyrics \lyricsto mel \Words
\new PianoStaff <<
  \new Staff = "Upper"  <<
\new Voice = "UpperOne" \UpperOne
\new Voice = "UpperTwo" \UpperTwo
  >>
  \new Staff = "Lower" <<
\new Voice = "LowerOne" \LowerOne
\new Voice = "LowerTwo" \LowerTwo
  >>
>>
  >>
  \layout {
ragged-last = ##f
ragged-right = ##f
\context {
  \Score
  \consists "Bar_number_engraver"
  barNumberVisibility = #(every-nth-bar-number-visible 1)
  \override BarNumber.break-visibility = #end-of-line-invisible
}
\context {
  \Lyrics
  \override LyricSpace.minimum-distance = #0.8
  \override LyricText.font-size = #+1.2
  \override VerticalAxisGroup.minimum-Y-extent = #'(-1 . 1)
  \override VerticalAxisGroup.
  nonstaff-relatedstaff-spacing.padding = #1.5
  \override VerticalAxisGroup.
  nonstaff-unrelatedstaff-spacing.padding = #1.5
}
  }
}

__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: Manually control note spacing?

2024-01-05 Thread Kieren MacMillan
Hi Robert,

> Don't worry, found out how to do it:
> 
> \version "2.18.2"
> \header {tagline = ""}
> {
>\numericTimeSignature
>\textLengthOn
>\override Staff.padding = #3
>\time 4/4
>a'4\mordent -\tweak staff-padding #4 ^"Mordent"
>a'4\upmordent -\tweak staff-padding #4 ^"Upper Mordent"
>   a'4\downmordent -\tweak staff-padding #4 ^"Lower Mordent"
> }

I don’t think the \override is doing what you think/hope it’s doing…?

Anyway, while the \tweak approach does the job, this might be more efficient:

\version "2.18.2"

\header {
  tagline = ##f
}

{
   \numericTimeSignature
   \textLengthOn
   \override TextScript.staff-padding = #4
   \time 4/4
   a'4\mordent ^"Mordent"
   a'4\upmordent ^"Upper Mordent"
   a'4\downmordent ^"Lower Mordent"
}

Note also that I changed your tagline = "" to tagline = ##f, so that it truly 
takes up no space.

Hope this helps!
Kieren.


Re: Unable to align lyric to rests (with MWE)

2024-01-03 Thread Kieren MacMillan
Aloha John,

> Here's the one I've been working on.  Maybe it's just wrong.

At the very least, it’s lazy and unclear engraving.

The convention in a case like this is something closer to the following:

\version "2.25.10"

global = {
  \time 4/4
  \key b \major
  \tempo 4=80
}

mel =  \relative c' {
  \global
  r4 << \context Voice = "melody" { \voiceOne s8 fis8 } \\ \new CueVoice { 
\voiceTwo fis8[ 8] } >> \oneVoice fis[ gis ais b] |
  gis4 dis8[ ais'~] ais4 r4 | 
}

lyrA = \lyricmode {
  and though they did hurt me so bad __
  in the fear and a
}

lyrB = \lyricmode {
  \tweak self-alignment-X #0.75 "but it's" writ -- ten in the star -- light __ _
  and ev' -- ry line on your
}
0
\score {
  \layout { indent = 0 ragged-right = ##f }
  <<
\new Staff \new Voice = "melody" << \global \mel >> 
\addlyrics \lyrA
\addlyrics \lyrB
  >>
}



Hope that helps!
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.



Re: Unable to align lyric to rests (with MWE)

2024-01-02 Thread Kieren MacMillan
Hi John,

> But, ... I don't really see why it should.  There are many songs for which 
> the vocal precedes the melody.

I don’t know of a single one. A rest is literally musical silence — how can it 
have a “vocal” on it? Now, of course, you could have non-sung syllables… but 
that is not equivalent to a REST.

I’d be happy to be proven wrong, though. Please feel free to upload a scan of a 
score where a voice is instructed to sing on a rest.

> Perhaps there is some other way to accomplish this that I'm unaware of.  I'm 
> pretty much a novice at writing.  However, I am transcribing a published 
> score into LP as an exercise but also to do my own arrangement.
> 
> Rests are valid musical expressions (AFAIK) so why shouldn't it be possible 
> to attach a syllable to a rest?

Because a rest is silence — the absence of pitch.
There is sprechstimme, dialogue spoken over rests, front-phrasing of a melody, 
and so forth… but you can’t sing “on” a rest.

Cheers,
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: Unable to align lyric to rests (with MWE)

2024-01-02 Thread Kieren MacMillan
Hi John,

> I need to attach the word to the rest so the rest of the lyrics align 
> properly.

Right. (Certainly it would be *VERY* unusual to actually attach a lyric to a 
rest!)

> I don't think shifting it will do the job (although I'll try it).

Just to clarify: I gave you an adjusted snippet to consider; if it’s not 
shifted enough, increase the #0.5.

Cheers,
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: Unable to align lyric to rests (with MWE)

2024-01-02 Thread Kieren MacMillan
Aloha!

> I'm struggling to align some lyrics and the problem seems to be that I cannot 
> find any way to align syllables to rests.

Do you want to attach the syllable(s) to the rest(s), or simply nudge the 
syllable left a little (e.g., to relax the lyric spacing that follows)?

If the latter, then try:

\version "2.24.3"

global = {
  \time 4/4
  \key b \major
  \tempo 4=80
}

\score {
  <<
\new Staff { 
 \relative c' {
 \global
r4 r8 fis8 fis [fis fis gis ( ] gis4 ) e8  e ( e4 ) r4 |
r4 r8  dis16 dis dis8 e4 fis8 |
 }
  }
\addlyrics {
   \tweak self-alignment-X #0.5 but  it's writ -- ten in the star -- light 
__ _ _ 
   }
  >>
}

[where you can obviously adjust the #0.5 to your liking]

Hope this helps!
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: set global priority order (lyric and dynamic)

2023-12-26 Thread Kieren MacMillan
Hi Cordelia,

> how can i change the global order of apparition ?
> I need to have the lyric before the dynamics; I thought I could make it with 
> priority but I cannot figure out where I’m wrong.

It is generally accepted practice (cf. Elaine Gould, etc.) to place dynamics 
above the staff for voices with lyrics:

\version "2.25.10"

melody = \relative c' {
  \clef treble
  \key c \major
  \time 4/4

  a4 \mf \> b \p c-! \ff d
}

text = \lyricmode {
  Aaa Bee Cee Dee
}

\score{
  <<
\new Voice = "one" {
  \autoBeamOff
  \melody
}
\new Lyrics \lyricsto "one" \text
  >>
  \layout {
\Staff {
  \dynamicUp
} 
  }
}

If you *really* want to have both below, then here’s a solution:

\version "2.25.10"

melody = \relative c' {
  \clef treble
  \key c \major
  \time 4/4

  a4 \mf \> b \p c-! \ff d
}

text = \lyricmode {
  Aaa Bee Cee Dee
}

\score {
  <<
\new Voice = "one" \with { \remove Dynamic_engraver } {
  \autoBeamOff
  \melody
}
\new Lyrics \lyricsto "one" \text
\new Dynamics \with { \remove Script_engraver } \melody
  >>
}

You’ll likely want to have a more stripped down [custom] Dynamics context, so 
that other [non-Script] items don’t appear in your dynamics line.

Hope this helps!
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: Staff Centre Vertical Alignment on page?

2023-12-19 Thread Kieren MacMillan
Hi Stefano,

It would really help if you provided a minimal working example (MWE), so those 
of us with an impulse to try to assist you don’t have to try to invent one 
ourselves…

Thanks,
Kieren.

> On Dec 18, 2023, at 10:47 PM, Stefano Antonelli 
>  wrote:
> On Tue, 2023-12-12 at 16:10 -0800, Stefano Antonelli wrote:
>> I'm producing muliple pngs with a single staff each.  When I 'flip'
>> through these pngs, the staff appears to move up and down on the
>> page.
>> I can set
>> top-system-spacing.basic-distance = #7
> It turns out I need exactly 

__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: Voices, shifting and stem direction

2023-12-17 Thread Kieren MacMillan
Hi Jakob,

> Does anyone know how to align VoiceOne (green) further left to match the 
> horizontal position of VoiceFour (red)?

You could switch the \voiceTwo and \voiceFour commands… but that creates an 
even less pleasing result [IMO].

There are also ways to tweak the horizontal position of the noteheads; I just 
don’t have time right now to give examples (sorry!).

> In the final bar, is it possible to align VoiceTwo (blue) and VoiceFour 
> (red), without causing them to share a stem?

Something like this?

leftTwo = \relative c {
  \global << { \voiceFour \override NoteHead.color = #red c4 c' h a | h g a h | 
\tweak Stem.length #5 c a8\rest c h a h g }
 \new Voice { \voiceTwo \override NoteHead.color = #blue c,2 h4 a | 
h g a h | \tweak NoteColumn.force-hshift -0.5 c2 g\rest } >>
}

For what it’s worth, I would suggest a restructuring of your code, to (a) avoid 
potential potential issues if you start adding things [especially things with 
timing!] to the \global variable, and (b) to improve [at least IMO] readability 
and maintainability. Here’s a possibility I quickly whipped up:

%%%  SUGGESTED STRUCTURE (BEGIN)  %%%
\version "2.25.11"
\language "deutsch"

global = {
  \key c \major
  \time 4/4
}

rightOne = \relative c'' {
  c8 d e fis g d e fis | g d g4. f16 e d8 f~| f e16 d e8 r r2 |
}

rightTwo = \relative c'' {
  g4. a8 h4 c | h4. h8 a4. g8 | c2 r2 |
}

leftOne = \relative c' {
  \override NoteHead.color = #green
  e4 r d c | d2 c4 d | g, f'\rest r2 |
}

leftTwo = \relative c' {
  \override NoteHead.color = #blue
  c,2 h4 a | h g a h | \tweak NoteColumn.force-hshift -0.5 c2 g\rest
}

leftFour = \relative c {
  \override NoteHead.color = #red
  c4 c' h a | h g a h | \tweak Stem.length #5 c a8\rest c h a h g
}

\score {
  \new PianoStaff  <<
\new Staff = "right" <<
  \global
  <<
{ \voiceOne \rightOne }
\\ \new Voice { \voiceTwo \rightTwo }
  >>
>>
\new Staff = "left" <<
  \global \clef bass
  <<
{ \voiceOne \leftOne }
\\ \new Voice { \voiceTwo \leftTwo }
\\ \new Voice { \voiceFour \leftFour }
  >>
>>
  >>
}
%%%  SUGGESTED STRUCTURE (END)  %%%

Here, almost all presentation decisions are left as late as possible (i.e., in 
the \score area), with the exception of the colour setting(s) and the 
voice-specific \tweaks (which I would personally also take out of the content 
code and add to the presentation layer, likely by way of the edition-engraver, 
if this were a “real piece“ of mine). This structure also puts all of the 
voice-splitting in the same place in the code, rather than having some in the 
variable definition area and some in the score area.

Hope all of this helps!
Kieren.

__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: error I can’t figure out

2023-12-16 Thread Kieren MacMillan
Hi Jean,

> See https://lists.gnu.org/archive/html/lilypond-user/2023-11/msg00152.html

Indeed, updating the center-on-word code fixed it.

Thanks!
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




error I can’t figure out

2023-12-16 Thread Kieren MacMillan
Hi all,

I recently upgraded to 2.25.10 (MacPorts).

I’m trying to compile what should be a fairly simple document, and am getting 
the following error(s):

 In 
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_textproc_lilypond/lilypond-devel/work/lilypond-2.25.10/out/share/lilypond/current/scm/lily/lily.scm:
   921:16 13 (lilypond-main _)
950:4 12 (lilypond-all _)
In srfi/srfi-1.scm:
640:9 11 (for-each # …)
In 
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_textproc_lilypond/lilypond-devel/work/lilypond-2.25.10/out/share/lilypond/current/scm/lily/lily.scm:
960:9 10 (_ _)
In ice-9/boot-9.scm:
829:9  9 (catch _ _ # …)
In unknown file:
   8 (ly:parse-file "/Volumes/HDD/Kieren/1_music_archive/1_s…")
   7 (ly:book-process # #< Output_def> #< Output_def> #)
   6 (ly:spacing-spanner::set-springs #)
   5 (ly:separation-item::calc-skylines #)
In ice-9/eval.scm:
159:9  4 (_ #(#(#(#(#(#(#(#(#(#(#(…) …) …) …) …) …) …) …) …) …) …))
159:9  3 (_ #(#(#(#(#(#(#(#(#(#(#(…) …) …) …) …) …) …) …) …) …) …))
155:9  2 (_ _)
In oop/goops.scm:
   1492:4  1 (cache-miss # …)
In unknown file:
   0 (scm-error goops-error #f "No applicable method for ~S…" …)

ERROR: In procedure scm-error:
No applicable method for #< + (2)> in call (+ # 1)

_

[Note: I *believe* I convert-ly'ed all the necessary files, but in my 
excitement to start using the newest features, I may have missed one or two…?]

Any advice on what I should be looking to fix would be appreciated.

Thanks,
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: property-defaults.fonts not working

2023-12-16 Thread Kieren MacMillan
Hi Jean,

>> What is the minimum x for it to work as documented?
> It's 6. See 
> https://gitlab.com/lilypond/lilypond/-/commit/1346d30d183e38cb693c7d61f2ac76785130e449

Thanks — sorry for the noise.
Works great with x=10 (which is the current MacPorts version).

Kieren
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: property-defaults.fonts not working

2023-12-16 Thread Kieren MacMillan
Hi Jean,

> What's the exact value of x in 2.25.x?

Well, it’s currently 2, but anticipating that might be [part of?] the problem, 
I launched an upgrade of lilypond (MacPorts) a few minutes ago.

What is the minimum x for it to work as documented?

Thanks,
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




property-defaults.fonts not working

2023-12-16 Thread Kieren MacMillan
Hi all,

I was excited to try the new font-switching mechanism(s) in 2.25.x, but they 
don’t seem to be having any effect at all on my output…? I used examples, 
cut-and-pasted from the online documentation, e.g.

\paper {
  property-defaults.fonts.serif = "Linux Libertine O"
  property-defaults.fonts.sans = "DejaVu Sans"
  property-defaults.fonts.typewriter = "DejaVu Sans Mono"
}

\relative c'{
  c1-\markup {
serif,
\sans sans,
\typewriter typewriter. }
}

or

\paper {
  property-defaults.fonts.music = "gonville"
}

Nothing changes in the output, and no errors are logged.

Any idea what I might be doing wrong?

Thanks,
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: Dynamics [pl|sp]acing weirdness

2023-12-15 Thread Kieren MacMillan
Hi MIchael,

> While that works, wrapping that combo isn't required all the time. E.g. when 
> you have
> dynamicsA = {
>   s2. s4\mf\< | s2 s2\f |
> }

That’s because this version does not use \after, which is a music function that 
expects a single musical expression as its first parameter.

> there still is the bar check warning, implying that the combo \mf\f does use 
> musical time.
> That's something I don't understand. Especially since it doesn't seem to when 
> wrapped in {}.

\mf\< is two musical expressions; { \mf\< } is one musical expression.
"Use musical time” isn’t exactly how I would frame the behaviour.

> If that's intended (and I'm not saying it isn't or can't be) I'd like to 
> understand the reason for this (to me) inconsistency.

It is intended, as far as I know.

Hope that helps!
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: Dynamics [pl|sp]acing weirdness

2023-12-15 Thread Kieren MacMillan
Hi Michael,

> I've come across some placing or spacing weirdness with dynamics.
> In the attached example \dynamicsA is what I tried to code, aka the \< starts 
> directly after the \mf. What I expected is what you see in \dynamicsB. 
> However it seems as if the combo \mf\< does use some musical time which makes 
> the \f appear 1 quaver later than I had expected.
> Is this behaviour expected or a bug?

Did you notice the error(s) when you tried to compile?  ;)

Try this instead:

dynamicsA = {
  s2. \after 8... { <>\mf\< } s4 | s2 s2\f |
}

Note that the combo you’re trying to insert needs to be wrapped in braces so 
that it’s a single musical expression.

Hope that helps!
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: Changing staff-staff-spacing from page to page

2023-12-14 Thread Kieren MacMillan
Hi Knute,

> Le mardi 10 octobre 2023 à 09:41 -0700, Knute Snortum a écrit :
>> Is there a way to change staff-staff-spacing in different pages in the same 
>> piece? 
> Unfortunately not. You have to chose settings that work well for the whole 
> score (or, if you must, resort to hidden markups taking space).

This is something I inject using the edition-engraver — makes it so simple, and 
keeps presentation code separate from content code.

Cheers,
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: Hide chords

2023-12-05 Thread Kieren MacMillan
Hi Jan,

[p.s. Always cc the list when responding!]

> Thanks ! I’ve looked at that section of the documentation but couldn’t find a 
> solution.

Does

   \temporary \omit Score.ChordName

not work?

Cheers,
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: Hide chords

2023-12-05 Thread Kieren MacMillan
Hi Jan,

> What is the recommended method to “hide” chord names for a couple of measures?

Depends on exactly what you mean by “hide”… :)
Read: 
 
for more information.

Hope that helps!
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: spacing puzzle

2023-12-04 Thread Kieren MacMillan
Hi David,

Have you looked at all the spacing parameters?
https://lilypond.org/doc/v2.23/Documentation/notation/flexible-vertical-spacing-paper-variables#list-of-flexible-vertical-spacing-paper-variables

In particular:
top-system-spacing
the distance from the top of the printable area (i.e., the bottom of the top 
margin) to the first system on a page, when there is no (title or top-level) 
markup between the two.

Hope that helps!
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: Relative rhythms across bars for time changes?

2023-11-18 Thread Kieren MacMillan
Hi all,

When I was in high school, there was a boy named Kenny Wong who was a video 
game god. Didn’t matter what the game was — Asteroids, Galaga, Ms. Pac-Man, 
Robotron, you name it — he had the high score on every console in every arcade 
within a 10 km radius of our school. Whenever we were “in trouble”, and he was 
nearby, we’d yell out “KENNY!”, and he’d usually cruise over and get us to the 
next level. Eventually it got to the point where “KENNY!” was simply a 
shorthand for “I need help with this really tough situation!”

Nowadays, when I’m working in Lilypond, I just yell “JEAN ABOU SAMRA!!”  :)

Well done, as always — and thanks for getting us to the next level!
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: Relative rhythms across bars for time changes?

2023-11-18 Thread Kieren MacMillan
Hi all,

> Thanks, Michael - that's a really nice solution.

Agreed! Although I personally still think \rhythm is cleaner:

\version "2.25.10"

tempoChange =
#(define-music-function (alignValue firstNote secondNote) (number? ly:duration? 
ly:duration?)
   #{
 \tweak self-alignment-X #alignValue
 \tweak font-size -1
 \textEndMark \markup {
   \concat { ( \hspace #0.25 \rhythm { #firstNote } " = " \rhythm { 
#secondNote } \hspace #0.375 ) }
  }
   #} )

music = \relative c'' {
  c4 c c c | d d d d \tempoChange #0 4 2 | b a a b | d d d d | \break
  d d d e | f f f f | a f e d | e e e e \tempoChange #-0.15 2 8. | \break
  e e a g | f f f f | e d d d | b b b b
  \fine
}

\new Staff {
  \new Voice {
\music
  }
}

> I wonder if it would be possible to create such a function which 
> automatically puts the = sign over the barline, and the notes to its right 
> and left.

That’s the solution I’m waiting for! :)

Cheers,
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: Relative rhythms across bars for time changes?

2023-11-18 Thread Kieren MacMillan
Hi all (including -dev!),

> There may be a way to do it with a MetronomeMark — I just don’t know it. I 
> was surprised to find that I couldn’t make the following (or similar) work:

And now I find this: 
Apparently I “offered an extra bounty for this one”. 13 years ago. LOL

Bounty is still good.  :)

Best,
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: Relative rhythms across bars for time changes?

2023-11-18 Thread Kieren MacMillan
Hi Alasdair,

> The sort of notation I want is in this snippet:
> https://lilypond.org/doc/v2.24/Documentation/snippets/rhythms#rhythms-creating-metronome-marks-in-markup-mode

> (b) is there an easier way than the markup given in the snippet?

Try the [relatively recent] \rhythm function:

\relative c' {
  \tempo \markup \concat { ( \rhythm { 16. } " = " \rhythm { 8 } ) }
  c1
  c4 c' c,2
}

> I want that equals sign to be aligned with the barline.  I have two 
> questions: (a) how can I do this?

Are you okay with using a RehearsalMark?

\version "2.25.2"

\layout { ragged-right = ##f }

themark =
  \tweak self-alignment-X #0.1
  \mark \markup \concat { ( \rhythm { 16. } " = " \rhythm { 8 } ) }

\relative c' {
  \override Score.RehearsalMark.font-size = #-1
  c1
  \themark
  c4 c' c,2
}

There may be a way to do it with a MetronomeMark — I just don’t know it. I was 
surprised to find that I couldn’t make the following (or similar) work:

\version "2.25.2"

\layout {
  ragged-right = ##f
  \context {
\Score
\override MetronomeMark.break-align-symbols = #'(staff-bar)
\override MetronomeMark.non-break-align-symbols = #'(staff-bar)
\override MetronomeMark.direction = 0
\override MetronomeMark.self-alignment-X = 0
  }
}

\relative c' {
  c1
  \tempo \markup \concat { ( \rhythm { 16. } " = " \rhythm { 8 } ) }
  c4 c' c,2
}

Maybe someone else has the magic incantation…?

Hope this helps!
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: Separation of the musical notation.

2023-11-16 Thread Kieren MacMillan
Hi all,

> No idea how to do it with Lilypond, may-be other people have an idea.

\version "2.25.2"

teststaff = \new Staff \repeat unfold 12 c''4
test = \new ChoirStaff << \teststaff \teststaff \teststaff >>

\markup {
  \fill-line {
\score { \test }
\score { \test }
  }
}

> As for me, I would do this kind of thing using Lilypond to produce two 
> separate pages of smaller size, and use Scribus to arrange the partial PDF 
> files on the final page and produce the final PDF.

I think it’s ultimately easier to do it natively in Lilypond…?

Hope this helps!
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: fill page

2023-11-09 Thread Kieren MacMillan
Hi David,

> I have a page of music but it is a bit short on the page.  I remember a long 
> time ago that there was something involving padding (I think) as well as some 
> opposing function that, when combined, would space out the systems to fill 
> the page to the bottom margin.  I've been looking through the docs trying to 
> find that solution but have failed.
> 
> Simply put, I want the systems to spread down the page vertically to fill to 
> the bottom margin.

Look for ragged-bottom and ragged-last-bottom:


Hope that helps!
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: Alignment of lyrics

2023-11-02 Thread Kieren MacMillan
Hi Johannes,

>> As a workaround, I could use "\once \override LyricText.self-alignment-X = 
>> #LEFT" - but I'd like to understand the logic and whether there is a more 
>> elegant way...
> 
> The logic is that a syllable is centered, except when it starts a melisma, in 
> which case it is left-aligned. This is intentional.

Possibly relevant/useful: 
https://lists.gnu.org/archive/html/lilypond-user/2015-12/msg00022.html

Cheers,
Kieren.

__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: zero horizontal space between note heads

2023-10-29 Thread Kieren MacMillan
Hi Werner,

> If I set `packed_spacing`, it's getting a little bit tighter, but
> there is still horizontal whitespace between the note heads, and I
> still don't know where it comes from.

What happens if you set the Beam X-extent to point-stencil (or whatever)?

– Kieren
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: automatic accidentals in subsequent measure(s) of *a different staff* in a PianoStaff context

2023-09-06 Thread Kieren MacMillan
Hi all,

>> Haven't you been dreaming about your First Patch™ for quite a while?

Why, yes… yes I have!

> You mean, in a dozen years?

My immediate reactions was “wait wut i actually made three commits at some 
point?” LOL

>> I mean, this would just be a matter of adding the style to the
>> accidental-styles alist in scm/music-functions.scm (plus updating the
>> documentation and regtests). Just saying...
> 
> Indeed that sounds like a job for an uncautious "Yes" sayer.

On the one hand, a large part of my problem as a member of society is being too 
uncautious a “Yes” sayer! ;)
On the other hand… “YES! I intend to try to get this into a patch!!”
[Now we'll see if less than a dozen years passes before it happens.]

Best,
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




  1   2   3   4   5   6   7   8   9   10   >