Re: Conditional code in the midi block

2024-05-20 Thread Carolyn Beeton
Thank you all for your suggestions.  I finally have the flag working after 
years of just editing my master file when I wanted one track per voice!
Thanks,
Carolyn

> On May 20, 2024, at 6:09 AM, Jean Abou Samra  wrote:
> 
> 
>> nostaffmidi =
>> #(define-scheme-function () ()
>>   (if TrackPerVoice #{ \context { \Staff \remove "Staff_performer" } #}))
> 
> 
> Ah, that proves me wrong. I didn't recall the parser was smart enough for 
> this.
> 
> 
>> Although, I don't understand why the contents of the scheme functions cannot 
>> be placed directly into the midi block like this
>> 
>> \midi {
>>  #(if TrackPerVoice #{ \context { \Staff \remove "Staff_performer" } #})
>>  #(if TrackPerVoice #{ \context { \Voice \consists "Staff_performer" } #})
>> }
> 
> 
> It works with $ instead of # , as explained in my other post.
> 
> 
> 



Conditional code in the midi block

2024-05-19 Thread Carolyn Beeton
I would like to include some Staff and Voice context settings in the \midi 
block only if a flag is set to ##t and I have not been able to figure out how 
to do this.  When I try to wrap the \context blocks in a code block with #{…#} 
I get this error:
trackPerVoiceMWE.ly:31:16: error: syntax error, unexpected '{', expecting 
SCM_IDENTIFIER or SCM_TOKEN or STRING or SYMBOL
  \context {
Is there any way to conditionally change the Staff_performer based on a flag 
setting?

This is my non-working MWE:

\version "2.24.0"
\include "english.ly"

global = {
  \key c \major
  \time 4/4
}
TrackPerVoice = ##t
\score {
  \new ChoirStaff <<
\new Staff <<
  \new Voice = "soprano" <<
\global
\relative c' { c'4 d e f << g1 \\ { g4 f e2 } >> }
  >>
  \new Voice = "alto" <<
\global
\voiceTwo
\relative c' { c'4 b a g | f e d2 }
  >>
>>
  >>  
  \layout {}
  \midi {
#(display (format #f "TrackPerVoice is ~a\n" TrackPerVoice))
#(if TrackPerVoice #{  
  #(display "One track per Voice (may make too many voices with polyphony)")
  #(display "Turn this off to get sop and alto combined in one track.")
  \context {
\Staff
\remove "Staff_performer"
  }
  \context {
\Voice
\consists "Staff_performer"
  }
#} )
  }
}

Thanks,
Carolyn


Re: italic phrase in lyrics

2024-05-15 Thread Carolyn Beeton
I have these functions defined:

\version “2.24.0"

italic = {
  \override Lyrics.LyricText.font-shape = #'italic
}

bold = {
  \override Lyrics.LyricText.font-series = #'bold
}

normal = {
  \revert Lyrics.LyricText.font-series
  \revert Lyrics.LyricText.font-shape
}

and I use them like this:

VerseOne = \lyricmode
{
  \italic "O Lord, open thou our lips;" \normal "And our mouth shall show” 
\bold forth thy \normal praise.
}

Carolyn

> Date: Wed, 15 May 2024 17:05:54 -0400 (EDT)
> From: David Olson 
> To: lilypond-user 
> Subject: italic phrase in lyrics
> Message-ID:
> <1642762455.2851938.1715807154285.javamail.zim...@dslextreme.com>
> Content-Type: text/plain; charset="utf-8"
> 
> Suppose the lyrics contain two contradictory propositions: 
> 
> Ma -- the -- ma -- tics is in -- vent -- ed. 
> Ma -- the -- ma -- tics is dis -- cov -- ered. 
> 
> Is this the only way to put the second proposition in italics? 
> 
> \markup { \italic Ma } -- 
> \markup { \italic the } -- 
> \markup { \italic ma } -- 
> \markup { \italic tics } 
> \markup { \italic is } 
> \markup { \italic dis } -- 
> \markup { \italic cov } -- 
> \markup { \italic ered. } 




Re: note collision - shift voiceOne to left

2023-08-01 Thread Carolyn Beeton
OK thanks everyone.  It is clearly moving things around to get the two notes 
tucked together without interfering.   The prefer-dotted-right override only 
works on the upper note.  I was just surprised to see so many different shifts 
in one line of music, but that’s what it takes to keep everything clear. 

Thanks,
Carolyn


> On Aug 1, 2023, at 12:11 PM, Abraham Lee  wrote:
> 
> 
> 
> On Tue, Aug 1, 2023 at 8:12 AM Carolyn Beeton  <mailto:carolyn.bee...@icloud.com>> wrote:
>> Thanks Abraham
>> 
>> I have read that section again and I am still a bit confused at what I am 
>> seeing in this attempt at a MWE.  In bar 2 the voiceTwo notes are shifted 
>> right, but in bar 5 the voiceOne note, a dotted note, is being shifted to 
>> the right.  I have tried using the Staff.NoteCollision.prefer-dotted-right 
>> override but that doesn’t seem to help.  In bar 7 there is a different 
>> construct with temporary voices and there the shifting looks like what I 
>> want.  I am trying to get the dotted stemUp note in bar 5 to be shifted left.
>> 
>> 
>> 
>> \version "2.24.0"
>> \include "english.ly <http://english.ly/>"
>> 
>> SopranoMusic = \relative c'
>> {
>>   fs4 fs e | d d d | b'2 b4 | a d, e | d2.^\markup "why right?" | s2. | s2.
>> } 
>> 
>> AltoMusic = \relative  c'
>> { 
>>   d4 d cs | b cs c | b2 d4 | d d cs | d4 d e | << { fs4 e d | e2. } \\ { d2 
>> s4 | d b cs } >>
>> } 
>> 
>> \score {
>>   \new Staff
>>   <<
>> \key d \major
>> \time 3/4
>> \new Voice = "sopranos"
>> {
>>   \override Staff.NoteCollision.prefer-dotted-right = ##f
>>   \voiceOne
>>   <<  
>> { \SopranoMusic }
>>   >>
>> }
>> \new Voice = "altos"
>> { 
>>   \voiceTwo
>>   <<  
>> { \AltoMusic }
>>   >>
>> }
>>   >>
>>   \layout { }
>> }
>> 
>> Thanks,
>> Carolyn
>> 
>>> On Jul 31, 2023, at 10:36 PM, Abraham Lee >> <mailto:tisimst.lilyp...@gmail.com>> wrote:
>>> 
>>> Hi, Carolyn!
>>> 
>>> On Mon, Jul 31, 2023 at 8:22 AM Carolyn Beeton >> <mailto:carolyn.bee...@icloud.com>> wrote:
>>>> The default when there are two voices with colliding notes is to shift the 
>>>> voice with upstems (odd-numbered voices) to the right and voices with 
>>>> downstems to the left.  I would like the opposite - i.e. voiceOne, with 
>>>> stems up, shifted left.  Is this possible?  (not as a single override, but 
>>>> throughout the entire piece)
>>> 
>>> I trust you've seen this section in the NR on collision resolution, but if 
>>> not, here it is:
>>> 
>>> https://lilypond.org/doc/v2.24/Documentation/notation/multiple-voices#collision-resolution
>>>  
>>> 
>>> Do any of these techniques not help? And if not, perhaps you could show a 
>>> screenshot or provide a small example of the shifting you don't want so we 
>>> can target the problem.
> 
> I won't pretend to understand the internal mechanism that decides which side 
> the notes should go on, but I would have expected the correction to work as 
> you did with prefer-dotted-right = ##f, which it doesn't.  I also tried the 
> NoteColumn.force-hshift property, which kind of works. The note would move 
> successfully, but the dot wouldn't go with it. This would also need to be a 
> local override and unable to control it globally.
> 
> What is done is conventional notation, but I'm curious what is driving your 
> need to move d2. to the left in m.5? If it's for clarity, I wouldn't 
> recommend it, but maybe you have a different reason.
> 
> Sorry I couldn't be more helpful,
> Abraham



Re: note collision - shift voiceOne to left

2023-08-01 Thread Carolyn Beeton
Thanks Abraham

I have read that section again and I am still a bit confused at what I am 
seeing in this attempt at a MWE.  In bar 2 the voiceTwo notes are shifted 
right, but in bar 5 the voiceOne note, a dotted note, is being shifted to the 
right.  I have tried using the Staff.NoteCollision.prefer-dotted-right override 
but that doesn’t seem to help.  In bar 7 there is a different construct with 
temporary voices and there the shifting looks like what I want.  I am trying to 
get the dotted stemUp note in bar 5 to be shifted left.



\version "2.24.0"
\include "english.ly"

SopranoMusic = \relative c'
{
  fs4 fs e | d d d | b'2 b4 | a d, e | d2.^\markup "why right?" | s2. | s2.
} 

AltoMusic = \relative  c'
{ 
  d4 d cs | b cs c | b2 d4 | d d cs | d4 d e | << { fs4 e d | e2. } \\ { d2 s4 
| d b cs } >>
} 

\score {
  \new Staff
  <<
\key d \major
\time 3/4
\new Voice = "sopranos"
{
  \override Staff.NoteCollision.prefer-dotted-right = ##f
  \voiceOne
  <<  
{ \SopranoMusic }
  >>
}
\new Voice = "altos"
{ 
  \voiceTwo
  <<  
{ \AltoMusic }
  >>
}
  >>
  \layout { }
}

Thanks,
Carolyn

> On Jul 31, 2023, at 10:36 PM, Abraham Lee  wrote:
> 
> Hi, Carolyn!
> 
> On Mon, Jul 31, 2023 at 8:22 AM Carolyn Beeton  <mailto:carolyn.bee...@icloud.com>> wrote:
>> The default when there are two voices with colliding notes is to shift the 
>> voice with upstems (odd-numbered voices) to the right and voices with 
>> downstems to the left.  I would like the opposite - i.e. voiceOne, with 
>> stems up, shifted left.  Is this possible?  (not as a single override, but 
>> throughout the entire piece)
> 
> I trust you've seen this section in the NR on collision resolution, but if 
> not, here it is:
> 
> https://lilypond.org/doc/v2.24/Documentation/notation/multiple-voices#collision-resolution
>  
> 
> Do any of these techniques not help? And if not, perhaps you could show a 
> screenshot or provide a small example of the shifting you don't want so we 
> can target the problem.
> 
> Hope that helps,
> Abraham



note collision - shift voiceOne to left

2023-07-31 Thread Carolyn Beeton
The default when there are two voices with colliding notes is to shift the 
voice with upstems (odd-numbered voices) to the right and voices with downstems 
to the left.  I would like the opposite - i.e. voiceOne, with stems up, shifted 
left.  Is this possible?  (not as a single override, but throughout the entire 
piece)

Thanks,
Carolyn


Re: O Canada with Ukrainian lyrics

2023-06-27 Thread Carolyn Beeton
Not really a Lilypond comment, but we no longer sing “in all thy sons command” 
- the words are now “in all of us command”.

https://www.canada.ca/en/canadian-heritage/services/anthems-canada.html#a11

Thanks,
Carolyn

P.s. I think this might be my first post, and I don’t really understand how to 
reply when using the digest format, so this might not even work.  Apologies if 
I have messed up the threading.

> On Jun 27, 2023, at 9:31 AM, lilypond-user-requ...@gnu.org wrote:
> 
> Date: Tue, 27 Jun 2023 09:29:29 -0400
> From: pab...@fastmail.fm (Peter A. Buhr)
> To: Michael Gerdau 
> Cc: ericmcint...@mac.com, lilypond-user@gnu.org
> Subject: Re: O Canada with Ukrainian lyrics
> Message-ID: <87v8f9f2yu@fastmail.fm>
> Content-Type: text/plain; charset="utf-8"
> 
>
> I attached a PDF of O Canada.
> 
> **