Re: Spacing of chords on a chord lead sheet

2024-05-11 Thread Raphael Mankin


On 11/05/24 01:59, Kieren MacMillan wrote:

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.


Thank you for your suggestions.

I am neither setting nor touching ragged-right.

I suspect that part of the difference that we see is that you forced 
lilypond to spread a limited amount of music over two lines. In my case 
it is jamming 49 bars into one page. After sleeping on it, what worked 
for me, in the end, is



\score {
<<*
\set Score.proportionalNotationDuration = #(ly:make-moment 1/8)
\override Score.SpacingSpanner.strict-note-spacing = ##t
*
\new ChordNames \with {
    \override ChordName.font-size = #'+3
    \override BarLine.bar-extent = #'(-2 . 2)
\   consists "Bar_engraver"
} {
    \introChords \bar "||" \break
    \chordNames \bar "|."
}
>>

\layout {
}
}

__

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.



Spacing of chords on a chord lead sheet

2024-05-09 Thread Raphael Mankin
I have  generated a chord lead sheet for a bass player with just the 
chords on it (\chordMode, no notes). After some  fiddling I got the bar 
lines and repeats printed.


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.


Is there a way of getting proportional spacing?

--




Re: Lead sheets: Maj. 7 chords

2024-04-09 Thread Ivan Kuznetsov
And that was it!
Thank you so much.

On Tue, Apr 9, 2024 at 3:50 PM Aaron Hill  wrote:
>
> You need to adjust the majorSevenSymbol [1].
>
> [1]:
> https://lilypond.org/doc/v2.25/Documentation/notation/customizing-chord-names#chord-name-major7
>



Re: Lead sheets: Maj. 7 chords

2024-04-09 Thread Aaron Hill

On 2024-04-09 1:43 pm, Ivan Kuznetsov wrote:

have been creating some lead sheets in
the style of the "Real Book", using
the \chords{} syntax.  However,
I do not like the way the default
notates "major 7 chords", that is,
a major triad with a major seventh.

The default is to use a "triangle"
to notate such a chord (shown below
in my example" but I much prefer
the way the Real Book notates
such chords, by writing out
"maj7".

How can I get the \chords {} syntax
to notate "major 7 chords as
I prefer, using the notation
"maj7" ?



You need to adjust the majorSevenSymbol [1].

[1]: 
https://lilypond.org/doc/v2.25/Documentation/notation/customizing-chord-names#chord-name-major7



-- Aaron Hill



Lead sheets: Maj. 7 chords

2024-04-09 Thread Ivan Kuznetsov
 have been creating some lead sheets in
the style of the "Real Book", using
the \chords{} syntax.  However,
I do not like the way the default
notates "major 7 chords", that is,
a major triad with a major seventh.

The default is to use a "triangle"
to notate such a chord (shown below
in my example" but I much prefer
the way the Real Book notates
such chords, by writing out
"maj7".

How can I get the \chords {} syntax
to notate "major 7 chords as
I prefer, using the notation
"maj7" ?

Thank you for your help.


\score {

  <<
  \chords { bf1:maj7 }
  \new Staff = "mel"
  {
\time 4/4
\clef "treble"
c''1

  }
  >>

}



Re: repeating chords with just the duration

2024-03-17 Thread Knute Snortum
On Sun, Mar 17, 2024 at 1:43 PM Carl Sorensen 
wrote:

> Use q to repeat chords.
>

Of course.  Thanks.


--
Knute Snortum


Re: repeating chords with just the duration

2024-03-17 Thread Carl Sorensen
Use q to repeat chords.

Carl

On Sun, Mar 17, 2024, 2:10 PM Knute Snortum  wrote:

> I don't use chordmode much, but this snippet doesn't do what I thought it
> would:
>
> \version "2.25.13"
>
> {
>   \new ChordNames \chordmode { a1:7 4 }
> }
>
> It produces an "A7sus4 3" instead of two A7's.  Is this a bug, or is that
> syntax just not supported?
>
> --
> Knute Snortum
>
>


repeating chords with just the duration

2024-03-17 Thread Knute Snortum
I don't use chordmode much, but this snippet doesn't do what I thought it
would:

\version "2.25.13"

{
  \new ChordNames \chordmode { a1:7 4 }
}

It produces an "A7sus4 3" instead of two A7's.  Is this a bug, or is that
syntax just not supported?

--
Knute Snortum


Re: chords

2024-01-18 Thread Charlie Ma
I'd use Single Staff Polyphony

:
 << { 2} \\ { c4,, s1 } >> |

[image: image.png]



On Thu, Jan 18, 2024 at 7:33 AM  wrote:

> Send lilypond-user mailing list submissions to
> lilypond-user@gnu.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://lists.gnu.org/mailman/listinfo/lilypond-user
> or, via email, send a message with subject or body 'help' to
> lilypond-user-requ...@gnu.org
>
> You can reach the person managing the list at
> lilypond-user-ow...@gnu.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of lilypond-user digest..."
> Today's Topics:
>
>1. chord (Alexander Weidner)
>
>
>
> -- Forwarded message --
> From: Alexander Weidner 
> To: lilypond-user@gnu.org
> Cc:
> Bcc:
> Date: Thu, 18 Jan 2024 15:32:13 +
> Subject: chord
> Hello,
>
> how do I notate a Double stop (German: Doppelgriff), where one note has an
> other duration (see image).
>
> Thanks! Alexander___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>


Re: Slurs within chords, and dotted notes

2024-01-14 Thread Joel C. Salomon

On 1/7/2024 4:11 PM, Xavier Scheuer wrote:

\once \override Dots.avoid-slur = #'ignore
(Dots instead of Slur)


Thank you!  That’s what I was misunderstanding.

—Joel





Re: Slurs within chords, and dotted notes

2024-01-07 Thread Xavier Scheuer
On Sun, 7 Jan 2024 at 21:35, Joel C. Salomon  wrote:
>
> Reposting for clarity as to what I’m asking.
>
> In the second case below, instead of the slur attaching to the specific
note, it moves vertically—I assume, to avoid collision with the duration
dot.  (Though it’s interesting that a tie does not mind overlapping the
dot, as in the fourth case.)
>
> In the second case, how can I either—
>
> Allow the slur to overlap the dot (the code shown below does not work), or
> Move the left anchor of the slur horizontally past the dot, so they don’t
conflict?
>
> Obvious searches like [lilypond chord slur dotted note] do not turn up
mention of this, or of any tweak to avoid this.  Any hints?

Hello,

\once \override Dots.avoid-slur = #'ignore
(Dots instead of Slur)

Kind regards,
Xavier


Re: Slurs within chords, and dotted notes

2024-01-07 Thread Jakob Pedersen

Hello Joel

You can shape the Slur manually, like so:

\version "2.25.11"

\fixed c' {
  % undotted note: slur attaches correctly
  2
   |

  % dotted note: slur is moved vertically
  \shape #'((1 . 0.5) (0.5 . 0.3) (0.5 . 0.3) (0 . 0)) Slur %adjusting 
the numbers control the four control points of the Bézier curves

  2.
  4 |

  % undotted note tie for comparison
  2 q |

  % dotted note tie for comparison: slur overlaps dot
  2. q4 |
}

Best wishes,
Jakob

On 07.01.2024 20.16, Joel C. Salomon wrote:


Reposting for clarity as to what I’m asking.

In the second case below, instead of the slur attaching to the 
specific note, it moves vertically—I assume, to avoid collision with 
the duration dot.  (Though it’s interesting that a tie does not mind 
overlapping the dot, as in the fourth case.)


In the second case, how can I either—

  * Allow the slur to overlap the dot (the code shown below does not
work), or
  * Move the left anchor of the slur horizontally past the dot, so
they don’t conflict?

Obvious searches like [lilypond chord slur dotted note] 
 do 
not turn up mention of this, or of any tweak to avoid this. Any hints?


—Joel C. Salomon

|```
\version "2.25.11"

\fixed c' {
  % undotted note: slur attaches correctly
  2
   |

  % dotted note: slur is moved vertically
  \once \override Slur.avoid-slur = #'ignore    % does nothing
  2.
  4 |

  % undotted note tie for comparison
  2 q |

  % dotted note tie for comparison: slur overlaps dot
  2. q4 |
}
```| 


Re: Slurs within chords, and dotted notes

2024-01-07 Thread Joel C. Salomon

Reposting for clarity as to what I’m asking.

In the second case below, instead of the slur attaching to the specific 
note, it moves vertically—I assume, to avoid collision with the duration 
dot.  (Though it’s interesting that a tie does not mind overlapping the 
dot, as in the fourth case.)


In the second case, how can I either—

 * Allow the slur to overlap the dot (the code shown below does not
   work), or
 * Move the left anchor of the slur horizontally past the dot, so they
   don’t conflict?

Obvious searches like [lilypond chord slur dotted note] 
 do not 
turn up mention of this, or of any tweak to avoid this.  Any hints?


—Joel C. Salomon

|```
\version "2.25.11"

\fixed c' {
  % undotted note: slur attaches correctly
  2
   |

  % dotted note: slur is moved vertically
  \once \override Slur.avoid-slur = #'ignore    % does nothing
  2.
  4 |

  % undotted note tie for comparison
  2 q |

  % dotted note tie for comparison: slur overlaps dot
  2. q4 |
}
```|

Re: Slurs within chords, and dotted notes

2024-01-04 Thread Joel C. Salomon

I should have been clearer.  The score I’m trying to emulate has slurs—

|4.  |

—and it’s the vertical movement of the slurs I’m trying to avoid.

The fact that ties will overlap the note dots was a curiosity I found in 
trying to boil that down to a minimal working example.


—Joel

On 1/4/2024 9:28 PM, Mark Stephen Mrotek wrote:


Joel:

Is this better?

\fixed c' {

2

 |

2.

4 |

2 q |

2. q4 |

}

Mark

*From:* lilypond-user-bounces+carsonmark=ca.rr@gnu.org 
 *On Behalf Of 
*Joel C. Salomon

*Sent:* Thursday, January 4, 2024 6:11 PM
*To:* LilyPond Users 
*Subject:* Slurs within chords, and dotted notes

Somewhat surprising result, tested on 2.24 & 2.25.11:

|```|
|\version "2.24"|

|\fixed c' {|
|  2|
|   ||

|  2.|
|  4 ||

|  2 q ||

|  2. q4 ||
|}|
|```|

In the second instance, the tie attaches to the bottom of the initial 
chord, presumably to avoid colliding with the dot.  (Interestingly, 
as in examples 3 & 4, a tie will happily display overlapping the dot.)


Obvious searches (like [lilypond chord slur dotted note] 
<https://www.google.com/search?q=lilypond+chord+slur+dotted+note>) do 
not turn up mention of this, or of any tweak to avoid this.  Any hints?


—Joel C. Salomon



RE: Slurs within chords, and dotted notes

2024-01-04 Thread Mark Stephen Mrotek
Joel:

 

Is this better?

 

\fixed c' {

  2

   |

 

  2.

  4 |

 

  2 q |

 

  2. q4 |

}

 

Mark

 

From: lilypond-user-bounces+carsonmark=ca.rr@gnu.org 
 On Behalf Of Joel C. 
Salomon
Sent: Thursday, January 4, 2024 6:11 PM
To: LilyPond Users 
Subject: Slurs within chords, and dotted notes

 

Somewhat surprising result, tested on 2.24 & 2.25.11:

```
\version "2.24"

\fixed c' {
  2
   |

  2.
  4 |

  2 q |

  2. q4 |
}
``` 

In the second instance, the tie attaches to the bottom of the initial chord, 
presumably to avoid colliding with the dot.  (Interestingly, as in examples 3 & 
4, a tie will happily display overlapping the dot.)

Obvious searches (like [lilypond chord slur dotted note] 
<https://www.google.com/search?q=lilypond+chord+slur+dotted+note> ) do not turn 
up mention of this, or of any tweak to avoid this.  Any hints?

—Joel C. Salomon



Slurs within chords, and dotted notes

2024-01-04 Thread Joel C. Salomon

Somewhat surprising result, tested on 2.24 & 2.25.11:

|```
\version "2.24"

\fixed c' {
  2
   |

  2.
  4 |

  2 q |

  2. q4 |
}
```|

In the second instance, the tie attaches to the bottom of the initial 
chord, presumably to avoid colliding with the dot. (Interestingly, as in 
examples 3 & 4, a tie will happily display overlapping the dot.)


Obvious searches (like [lilypond chord slur dotted note] 
) do 
not turn up mention of this, or of any tweak to avoid this.  Any hints?


—Joel C. Salomon


RE: Cascade Chords

2024-01-01 Thread drtechdaddy
Got it.  Werner’s answer -- using \set tieWaitForNote = ##t   -- is what I was 
looking for.  Thanks.

It might be helpful to include that snippet in the chords section.

 

Joe

 

From: Michael Gerdau  
Sent: Saturday, December 30, 2023 1:20 PM
To: drtechda...@gmail.com
Cc: lilypond-user mailinglist 
Subject: Re: Cascade Chords

 

Please always include the list, so that others can benefit as well 

 

I don’t think cascade chord and arpeggio are the same thing.  Maybe a “cascade 
chord” is a “slow” arpeggio, but what I’m thinking of, each added note occurs 
on a specific fraction of a measure, say every 1/8 or 1/16, or even ¼ note. The 
 build-up is slow and regular enough that you actually hear successive notes. 
I’m not sure “cascade” is even the right term—that’s what Bing told me. Let’s 
say I play and hold C, then 1/8 note later I add and hold E, then 1/8 note 
later add and hold G, then 1/8 later add and hold high C (or Bb if it’s a C7), 
then hold the whole thing for the rest of the measure.

 

Arpeggios don’t necessarily have a timing attached and thus could be played as 
1/8th or whatever speed you (or whoever plays the music) deems appropriate.

 

However if you want it written explicitly then the example Werner provided 
should get you a long way towards your goal.

 

Kind regards,

Michael 





 

From: Michael Gerdau mailto:m...@qata.de> > 
Sent: Saturday, December 30, 2023 12:57 AM
To: drtechda...@gmail.com <mailto:drtechda...@gmail.com> 
Cc: lilypond-user@gnu.org <mailto:lilypond-user@gnu.org> 
Subject: Re: Cascade Chords

 

When you say „cascade chord“ do you mean an arpeggio?

 

If so then yes, Lilypond has a special \arpeggio command that is simply 
appended to the chord that’s broken.

 

Kind regards,

Michael 

 

Mobil gesendet






Am 30.12.2023 um 03:09 schrieb drtechda...@gmail.com 
<mailto:drtechda...@gmail.com> :



Is there a special notation for cascade chords (chords played by adding 
successive notes )?  I could do it by adding a new voice for each note, but 
that seems unwieldly and cluttered.



Re: Cascade Chords

2023-12-30 Thread Michael Gerdau
Please always include the list, so that others can benefit as well I don’t think cascade chord and arpeggio are the same thing.  Maybe a “cascade chord” is a “slow” arpeggio, but what I’m thinking of, each added note occurs on a specific fraction of a measure, say every 1/8 or 1/16, or even ¼ note. The  build-up is slow and regular enough that you actually hear successive notes. I’m not sure “cascade” is even the right term—that’s what Bing told me. Let’s say I play and hold C, then 1/8 note later I add and hold E, then 1/8 note later add and hold G, then 1/8 later add and hold high C (or Bb if it’s a C7), then hold the whole thing for the rest of the measure.Arpeggios don’t necessarily have a timing attached and thus could be played as 1/8th or whatever speed you (or whoever plays the music) deems appropriate.However if you want it written explicitly then the example Werner provided should get you a long way towards your goal.Kind regards,Michael  From: Michael Gerdau  Sent: Saturday, December 30, 2023 12:57 AMTo: drtechda...@gmail.comCc: lilypond-user@gnu.orgSubject: Re: Cascade Chords When you say „cascade chord“ do you mean an arpeggio? If so then yes, Lilypond has a special \arpeggio command that is simply appended to the chord that’s broken. Kind regards,Michael  Mobil gesendetAm 30.12.2023 um 03:09 schrieb drtechda...@gmail.com:Is there a special notation for cascade chords (chords played by adding successive notes )?  I could do it by adding a new voice for each note, but that seems unwieldly and cluttered.

Re: Cascade Chords

2023-12-29 Thread Michael Gerdau
When you say „cascade chord“ do you mean an arpeggio?

If so then yes, Lilypond has a special \arpeggio command that is simply 
appended to the chord that’s broken.

Kind regards,
Michael 

Mobil gesendet

> Am 30.12.2023 um 03:09 schrieb drtechda...@gmail.com:
> 
> 
> Is there a special notation for cascade chords (chords played by adding 
> successive notes )?  I could do it by adding a new voice for each note, but 
> that seems unwieldly and cluttered.


Re: Cascade Chords

2023-12-29 Thread Werner LEMBERG


> Is there a special notation for cascade chords (chords played by
> adding successive notes )?  I could do it by adding a new voice for
> each note, but that seems unwieldly and cluttered.

https://lsr.di.unimi.it/LSR/Item?id=408


Werner



Cascade Chords

2023-12-29 Thread drtechdaddy
Is there a special notation for cascade chords (chords played by adding
successive notes )?  I could do it by adding a new voice for each note, but
that seems unwieldly and cluttered.



Re: Hide chords

2023-12-06 Thread Jan
Hi Kieren,

Indeed, ‘omit' and ‘undo omit' do the trick for temporarily hiding chords 
you’ve written. It was actually the rest spacer that I was missing in my 
Lilypond vocabulary (I’m learning).

Thanks !
Jan
 

> On 5 Dec 2023, at 23:28, Kieren MacMillan  wrote:
> 
> 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-06 Thread Jan
Elaine,
All very clear and exactly what I was looking for.
Thanks a lot !
Jan

> On 6 Dec 2023, at 02:59, Flaming Hakama by Elaine  
> wrote:
> 
> 
>  
>> -- Forwarded message --
>> From: Jan mailto:jan.vander...@gmail.com>>
>> To: lilypond-user Mailinglist > <mailto:lilypond-user@gnu.org>>
>> Cc: 
>> Bcc: 
>> Date: Tue, 5 Dec 2023 22:51:44 +0100
>> Subject: Hide chords
>> What is the recommended method to “hide” chord names for a couple of 
>> measures? For example, in the snipped below I’d like to hide the chords for 
>> measures 5 to 8.
>> 
>> 
>> 
>> Any help would be greatly appreciated.
>> Jan
> 
> 
> You can just enter either rests or spacers for the measures where you don't 
> want chords to appear.
> 
> 
> Instead of what you have, which would be something like
> 
> mychords = \chordmode { 
> df1 | bf:7 | ef2:7 af:7 | f1:m7 | 
> df1 | bf:7 | ef2:7 af:7 | f1:m7 | 
> }
> 
> You could use the following
> 
> mychords = \chordmode { 
> df1 | bf:7 | ef2:7 af:7 | f1:m7 | 
> s1*4 
> }
> 
> 
> 
> If you have different parts that need all the chords
> then you would define different variables, such as in 
> the following example, allChords and someChords.   
> 
> For material that would appear in both, like this 4 bar chord sequence, 
> you can define that as a variable, too, then reference 
> that in the other variables.  
>  
> chordSequence = \chordmode { 
> df1 | bf:7 | ef2:7 af:7 | f1:m7 | 
> }
> 
> allChords = \chordmode { 
>  \chordSequence
>  \chordSequence
> }
> 
> someChords = \chordmode { 
> \chordSequence
> s1*4
> }
> 
> 
> HTH, 
> 
> Elaine Alt
> 415 . 341 .4954   "Confusion is 
> highly underrated"
> ela...@flaminghakama.com <mailto:ela...@flaminghakama.com>Producer ~ Composer 
> ~ Instrumentalist ~ Educator
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-



Re: Hide chords

2023-12-06 Thread Jan
Hi Matthew,
The spacer rest works perfectly for my purpose and I learned something new ;-). 
Thanks for your help!
Jan
. 

> On 5 Dec 2023, at 23:11, msk...@ansuz.sooke.bc.ca wrote:
> 
> On Tue, 5 Dec 2023, Jan wrote:
> 
>> What is the recommended method to “hide” chord names for a couple of 
>> measures? For example, in the snipped below I’d like to hide the chords for 
>> measures 5 to 8.
> 
> Depending on exactly how you're generating the chord names in the first
> place, it may be easy to use spacer rests, as in:
> 
> \new ChordNames { \chordmode { c1 | a1:m | s1 | g1 | } }
> 
> -- 
> Matthew Skala
> msk...@ansuz.sooke.bc.ca People before tribes.
> https://ansuz.sooke.bc.ca/




Re: Hide chords

2023-12-05 Thread Flaming Hakama by Elaine
> -- Forwarded message --
> From: Jan 
> To: lilypond-user Mailinglist 
> Cc:
> Bcc:
> Date: Tue, 5 Dec 2023 22:51:44 +0100
> Subject: Hide chords
> What is the recommended method to “hide” chord names for a couple of
> measures? For example, in the snipped below I’d like to hide the chords for
> measures 5 to 8.
>
>
>
> Any help would be greatly appreciated.
> Jan



You can just enter either rests or spacers for the measures where you don't
want chords to appear.


Instead of what you have, which would be something like

mychords = \chordmode {
df1 | bf:7 | ef2:7 af:7 | f1:m7 |
df1 | bf:7 | ef2:7 af:7 | f1:m7 |
}

You could use the following

mychords = \chordmode {
df1 | bf:7 | ef2:7 af:7 | f1:m7 |
s1*4
}



If you have different parts that need all the chords
then you would define different variables, such as in
the following example, allChords and someChords.

For material that would appear in both, like this 4 bar chord sequence,
you can define that as a variable, too, then reference
that in the other variables.

chordSequence = \chordmode {
df1 | bf:7 | ef2:7 af:7 | f1:m7 |
}

allChords = \chordmode {
 \chordSequence
 \chordSequence
}

someChords = \chordmode {
\chordSequence
s1*4
}


HTH,

Elaine Alt
415 . 341 .4954   "*Confusion is
highly underrated*"
ela...@flaminghakama.com
Producer ~ Composer ~ Instrumentalist ~ Educator
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


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 mskala
On Tue, 5 Dec 2023, Jan wrote:

> What is the recommended method to “hide” chord names for a couple of 
> measures? For example, in the snipped below I’d like to hide the chords for 
> measures 5 to 8.

Depending on exactly how you're generating the chord names in the first
place, it may be easy to use spacer rests, as in:

\new ChordNames { \chordmode { c1 | a1:m | s1 | g1 | } }

-- 
Matthew Skala
msk...@ansuz.sooke.bc.ca People before tribes.
https://ansuz.sooke.bc.ca/

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.




Hide chords

2023-12-05 Thread Jan
What is the recommended method to “hide” chord names for a couple of measures? 
For example, in the snipped below I’d like to hide the chords for measures 5 to 
8.



Any help would be greatly appreciated.
Jan

Re: Parentheses : optional anacrouse and chords at the end of a score

2023-11-06 Thread Guy Melançon
Thanks Guy for the tip, and for digging out the code. it works perfectly
well (under Lilypond 2.24).

I tried using the function to parenthesize chords as well, and it works
just as fine.

You made my day. Warm thanks.

On Sun, Oct 22, 2023 at 1:00 PM Guy Stalnaker  wrote:

> This should get you what you want:
>
> %%%
> \version "2.24.0"
>
> startParenthesis = {
>   \once \override Parentheses.stencils = #(lambda (grob)
>  (let ((par-list (parentheses-interface::calc-parenthesis-stencils
> grob)))
>  (list (car par-list) point-stencil )))
> }
>
> endParenthesis = {
>   \once \override Parentheses.stencils = #(lambda (grob)
> (let ((par-list (parentheses-interface::calc-parenthesis-stencils
> grob)))
> (list point-stencil (cadr par-list
> }
>
> % Example:
> % {
> %  \override Parentheses.font-size = #5
> %  \startParenthesis 
> %  d' e' f'
> %  \endParenthesis \parenthesize g'
> % }
> %%%
>
> On 10/22/23 10:00, Guy Melançon wrote:
>
> I understand the \parenthesize command applies to a single note.
>
> I would like the parentheses to wrap more tan just one note. Something
> like \parenthesize {c4 d e f} to have a parentheses right before c and
> after f. This would be useful writing a jazz score to include an optional
> anacrouse in the last measure.
>
> I would also be interested in doing the same thing with the chords written
> above the staff.
>
> Any ideas, anyone?
>
> Thanks
>
>
> --
> --
>
> “Happiness is the meaning and the purpose of life, the whole aim and end of 
> human existence.”
>
> ― Aristotle
>
>


Re: Parentheses : optional anacrouse and chords at the end of a score

2023-10-22 Thread Guy Stalnaker

This should get you what you want:

%%%
\version "2.24.0"

startParenthesis = {
  \once \override Parentheses.stencils = #(lambda (grob)
 (let ((par-list 
(parentheses-interface::calc-parenthesis-stencils grob)))

 (list (car par-list) point-stencil )))
}

endParenthesis = {
  \once \override Parentheses.stencils = #(lambda (grob)
    (let ((par-list 
(parentheses-interface::calc-parenthesis-stencils grob)))

    (list point-stencil (cadr par-list
}

% Example:
% {
%  \override Parentheses.font-size = #5
%  \startParenthesis 
%  d' e' f'
%  \endParenthesis \parenthesize g'
% }
%%%

On 10/22/23 10:00, Guy Melançon wrote:

I understand the \parenthesize command applies to a single note.

I would like the parentheses to wrap more tan just one note. Something 
like \parenthesize {c4 d e f} to have a parentheses right before c and 
after f. This would be useful writing a jazz score to include an 
optional anacrouse in the last measure.


I would also be interested in doing the same thing with the chords 
written above the staff.


Any ideas, anyone?

Thanks


--
--

“Happiness is the meaning and the purpose of life, the whole aim and end of 
human existence.”

― Aristotle


Re: Parentheses : optional anacrouse and chords at the end of a score

2023-10-22 Thread Jean Abou Samra
Have a look at https://lsr.di.unimi.it/LSR/Item?id=902 


signature.asc
Description: This is a digitally signed message part


Parentheses : optional anacrouse and chords at the end of a score

2023-10-22 Thread Guy Melançon
I understand the \parenthesize command applies to a single note.

I would like the parentheses to wrap more tan just one note. Something like
\parenthesize {c4 d e f} to have a parentheses right before c and after f.
This would be useful writing a jazz score to include an optional anacrouse
in the last measure.

I would also be interested in doing the same thing with the chords written
above the staff.

Any ideas, anyone?

Thanks


How to get rid of indentation of chords on first row?

2023-08-28 Thread Michael Gerdau

Hi list,

in the attached example the first row of chords is indented although 
indent=0 is set and \RemoveAllEmptyStaves is set as well.

When I remove the \guitarPart from the score, all is as expected.

Is there a special incantation required (which?) or is this a bug?

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

\include "predefined-guitar-fretboards.ly"

\paper {
  indent = 0
}

chordNames = \chordmode {
  c1 | d1 | e1 | f1 | g1 | a1 | b1 | \break
  c1 | d1 | e1 | f1 | g1 | a1 | b1 | \break
}

guitar = \relative c' {
}

chordsPart = <<
  \new ChordNames \chordNames
  \new FretBoards \chordNames
>>

guitarPart = \new StaffGroup <<
  \new Staff \with {
midiInstrument = "electric guitar (clean)"
  } { \clef "treble_8" \guitar }
  \new TabStaff \with {
stringTunings = #guitar-tuning
  } \guitar
>>

\score {
  <<
\chordsPart
\guitarPart
  >>
  \layout {
\context {
  \Score
  \RemoveAllEmptyStaves
}
  }
}


chord-test.pdf
Description: Adobe PDF document


Re: chord.ly to extract notes from chords breaks with new Guile

2023-06-01 Thread Jean Abou Samra
Better make that:

> ```
> \version "2.24.1"
> 
> #(define ((Keep_only_engraver i) context)
> ```
>



```
#(define ((Keep_only_performer i) context)
```



>
> ```
> (let ((j 0))
>  (make-performer
>   (listeners
>((note-event performer event)
> (unless (eqv? i j)
>   (ly:event-set-property! event 'pitch #f))
> (set! j (1+ j
>   ((stop-translation-timestep performer)
>(set! j 0)
> 
> #(define (scores n music)
>(apply values
>   (map (lambda (i)
>  #{
>\score {
>  \midi { \context { \Score \consists #(Keep_only_engraver 
> i) } }
> ```



```
  \midi { \context { \Score \consists #(Keep_only_performer 
i) } }
```



> ```
>  #music
>}
>  #})
>(iota n
> 
> mus = <<
>   \new Staff { c'1 d'2 d'4 e'4 }
>   \new Staff << { g'1 a'2 a'4 b'4 } \\ { g1 g1 } >>
> >>
> 
> { \mus }
> 
> $(scores 3 mus) % 3 is the max number of simutaneous notes
> ```


(yay for muscle memory)


signature.asc
Description: This is a digitally signed message part


Re: chord.ly to extract notes from chords breaks with new Guile

2023-05-30 Thread Jean Abou Samra
Le mardi 30 mai 2023 à 20:39 -0400, msk...@ansuz.sooke.bc.ca a écrit :

> I need, at each point in time, to have at most one note per track, exactly one
> track per note, and silence in any leftover tracks, regardless of the
> voice/chord structure of the music.


That sounds like you want a performer-based approach. Like:

```
\version "2.24.1"

#(define ((Keep_only_engraver i) context)
   (let ((j 0))
 (make-performer
  (listeners
   ((note-event performer event)
(unless (eqv? i j)
  (ly:event-set-property! event 'pitch #f))
(set! j (1+ j
  ((stop-translation-timestep performer)
   (set! j 0)

#(define (scores n music)
   (apply values
  (map (lambda (i)
 #{
   \score {
 \midi { \context { \Score \consists #(Keep_only_engraver 
i) } }
 #music
   }
 #})
   (iota n

mus = <<
  \new Staff { c'1 d'2 d'4 e'4 }
  \new Staff << { g'1 a'2 a'4 b'4 } \\ { g1 g1 } >>
>>

{ \mus }

$(scores 3 mus) % 3 is the max number of simutaneous notes
```


signature.asc
Description: This is a digitally signed message part


Re: chord.ly to extract notes from chords breaks with new Guile

2023-05-30 Thread mskala
On Wed, 31 May 2023, Gilles Thibault wrote:

> Not hardly tested but this should work :

Thanks for looking at it further.  I hate to impose on you because I've
already decided to solve this problem in external postprocessing of the
MIDI files, so I hope you won't put a lot of effort into trying to satisfy
my use case with modifications to your script.  I don't think doing it in
Lilypond is really the right solution for me because to really solve it I
need to automatically handle *all* cases of simultaneous notes.  I need,
at each point in time, to have at most one note per track, exactly one
track per note, and silence in any leftover tracks, regardless of the
voice/chord structure of the music.

The code you provide works for the specific example I gave, where the
desired silence comes from a note written as a single note instead of a
chord, but there are many other cases (illustrating the problem with
minimal examples).  In particular:

* change b2 to 2 and the b2 comes out in two tracks.  Maybe it would
  never occur to me to write a one-note chord, but a similar issue can
  happen between two- and three-note chords, or anywhere the number of
  notes per chord in a voice is not always the same.

* a one-voice passage added outside the << >> construct comes out in two
  tracks

* if each of two voices sometimes contains two simultaneous notes, but
  only at most three notes are simultaneous overall, then I need to either
  use four output tracks, or carefully split and then merge to bring it
  down to three, and handling this kind of thing becomes steadily more
  complicated as the number of voices and simultaneous notes grows.

Resolving these points and any other similar ones that may come up, seems
like a lot of work.  If an in-Lilypond solution means I need to do things
like maintain the same number of Voice contexts throughout the entire
piece of music, or think hard about which note/voice index needs to merge
with which other one to minimize the overall number of tracks without ever
having more than one note simultaneous in a track, then we quickly
approach a point where it would be less work for me to just write out the
intended output by hand and not have Lilypond calculate it at all.

In external MIDI processing it's relatively easy:  at every "Note on"
message in chronological order, I can route the note to an unused track or
else know unambiguously that I need more tracks.  At every "Note off," the
track in question becomes available again.  The external code basically
does the same thing that a polyphonic synthesizer would do, just with
output to new MIDI tracks instead of directly to hardware voices.  No need
for separate handling of Lilypond's "single note," "chord," and "voice"
concepts.

-- 
Matthew Skala
msk...@ansuz.sooke.bc.ca People before tribes.
https://ansuz.sooke.bc.ca/



Re: chord.ly to extract notes from chords breaks with new Guile

2023-05-30 Thread Gilles Thibault




in the hope of separating MIDI notes that don't have identical timing.
That is, if my input is
   << { a1 } \\ { b2 2 } >>

it would be nice to be able to separate it out into three separate 
outputs

for separate MIDI channels, like:
  { a1 }
  { b2 c2 }
  { r2 d2 }



Not hardly tested but this should work :

%%%
\version "2.24.1"

\include "chordsAndVoices.ly"

noteAloneToRest = #(define-music-function (music)(ly:music?)
  (map-some-music
(lambda(evt)
  (case (name-of evt)  ;; see chordsAndVoices.ly
((EventChord) evt) ;; not #f => stop iteration
((NoteEvent)   ;; note to rest
  (make-music 'RestEvent 'duration (ly:music-property evt 
'duration '(

(else #f)));; continue iteration
music))


music = << { a1 } \\ { b2 2 } >>

midiI = \extractVoice #1 \music
midiII = \extractVoice #2 \extractNote #1 \music
midiIII = \extractVoice #2 \extractNote #2 \noteAloneToRest \music

\score { <<
  \new Staff  { \midiI }   % { a1 }
  \new Staff  { \midiII }  % { b2 c2 }
  \new Staff  { \midiIII } % { r2 d2 }



% \midi
}




--
Gilles



Re: chord.ly to extract notes from chords breaks with new Guile

2023-05-29 Thread mskala
On Mon, 29 May 2023, Gilles Thibault wrote:

> chord.ly has been renamed to chordsAndVoices.ly (it deals also now with
> Voices)
> You can donwload it here :

Thanks a lot!

As far as I know, the new version works fine.  The problem in the old
version was just because of the non-breaking spaces in the lines I
modified according to instructions from the mailing list.  That was a
problem I encountered back in 2015 too, and thought I had fixed then.  My
version of the file is unmodified since 2015; evidently some non-breaking
spaces survived the earlier fix, and earlier versions of Lilypond ignored
them.  I don't know why the latest version had a problem with these
characters given that earlier versions didn't, but I also don't know why
earlier versions *didn't* have a problem with these particular
non-breaking spaces when others in the same file caused a lot of trouble.

I will say again, as I said in 2015, that I wish people would stop trying
to use HTML for email.  That's where the non-breaking spaces came from.

Anyway, even the old version of chord.ly contained support for separating
voices, which I hadn't previously touched but I investigated just recently
in the hope of separating MIDI notes that don't have identical timing.

That is, if my input is
   << { a1 } \\ { b2 2 } >>

it would be nice to be able to separate it out into three separate outputs
for separate MIDI channels, like:
  { a1 }
  { b2 c2 }
  { r2 d2 }

Unfortunately, both the old chord.ly and new chordsAndVoices.ly code have
the same problem with respect to voices that I encountered in 2015 with
respect to notes within a chord:  requesting a non-existent voice index
returns the last voice instead of silence.  That seems to be the intended
behaviour of the code in your application, so it's not exactly a bug, but
it isn't what I need.

I think the really right answer for me is to not use Lilypond to do this
note-separation at all, but to do postprocessing with other tools on the
MIDI files generated by Lilypond instead.  I'm more confident of really
getting correct results from that in all the different cases of
simultaneous notes, than I would be by trying to do the separation inside
Lilypond.

-- 
Matthew Skala
msk...@ansuz.sooke.bc.ca People before tribes.
https://ansuz.sooke.bc.ca/



Re: chord.ly to extract notes from chords breaks with new Guile

2023-05-29 Thread Gilles Thibault

Le 2023-05-27 22:31, msk...@ansuz.sooke.bc.ca a écrit :

Back in 2015 people on the list helped me with extracting notes from
chords, in this thread:
   
https://lists.gnu.org/archive/html/lilypond-user/2015-09/msg00394.html




chord.ly has been renamed to chordsAndVoices.ly (it deals also now with 
Voices)

You can donwload it here :

  http://gillesth.free.fr/Lilypond/chordsAndVoices/

Note you have also to download checkPitch.ly to make it work.

There is a small help
  
http://gillesth.free.fr/Lilypond/chordsAndVoices/chordsAndVoices-doc.pdf


I use chordsAndVoices.ly a lot, as it is part of the project arranger.ly
  http://gillesth.free.fr/Lilypond/arranger.ly/

My Lilypond version is 2.24.1
Please, tell me if there is something wrong with a more recent version.


--
Gilles



Re: chord.ly to extract notes from chords breaks with new Guile

2023-05-27 Thread Jean Abou Samra
Le samedi 27 mai 2023 à 17:38 -0400, msk...@ansuz.sooke.bc.ca a écrit :
> On Sat, 27 May 2023, Jean Abou Samra wrote:
> 
> > Are you sure that this is the correct example? That the file chord.ly it
> > uses is the same as the one you sent? That LilyPond is the one you believe
> > and unpatched, etc. ?
> 
> Yes, using the chord.ly file I attached to my message, extracted from the
> message as it came back through the mailing list, with the three-line
> input cut and pasted from my message as it came back through the mailing
> list, and the version of Lilypond I compiled from the sources in the file
> lilypond-2.24.1.tar.gz downloaded from the lilypond.org Web site, I get
> these messages:
> 
> GNU LilyPond 2.24.1 (running Guile 2.2)
> Processing `test.ly'
> Parsing...ERROR: In procedure %resolve-variable:
> Unbound variable: #{ }#
> 
> > I can't reproduce your problem (on Fedora); it compiles fine for me and
> > prints a single MM rest.
> 
> Interesting.  What's the provenance of your Lilypond executable - did you
> also compile from source, or use a Fedora package?
> 
> I wonder if the issue could be with my Guile 2.2 installation, which I
> also compiled from sources.  I'm using Slackware, which does not have a
> Guile 2.2 package, having skipped all the way to version 3.  I had to
> install Guile 2.2 over top of that in order to get a version of Lilypond
> that would report itself as using Guile 2.2, but if the build was still
> partly using Slackware's packaged Guile 3.0 somehow, that could explain
> the difference in our results.



As David pointed out, there are no-break spaces on lines 38 and 39, which you 
need to convert to normal spaces.

Now I understand why I did not get the error; I use Frescobaldi, which 
apparently tried to be helpful (in this case a little too helpful) by 
auto-converting them.




signature.asc
Description: This is a digitally signed message part


Re: chord.ly to extract notes from chords breaks with new Guile

2023-05-27 Thread mskala
On Sat, 27 May 2023, David Kastrup wrote:

> which contains a delirious number of unbreakable spaces, code \xa0
> instead of \x20 as for a normal, breakable space.

Thanks!  Correcting these seems to have fixed the problem, at least for
the moment.

I don't know why the old version needed *some* of the non-breaking spaces
to be changed to regular spaces and did not require this of *all* of them,
nor why the new version would be different.  But that's not important.

-- 
Matthew Skala
msk...@ansuz.sooke.bc.ca People before tribes.
https://ansuz.sooke.bc.ca/



Re: chord.ly to extract notes from chords breaks with new Guile

2023-05-27 Thread mskala
On Sat, 27 May 2023, Jean Abou Samra wrote:

> Are you sure that this is the correct example? That the file chord.ly it
> uses is the same as the one you sent? That LilyPond is the one you believe
> and unpatched, etc. ?

Yes, using the chord.ly file I attached to my message, extracted from the
message as it came back through the mailing list, with the three-line
input cut and pasted from my message as it came back through the mailing
list, and the version of Lilypond I compiled from the sources in the file
lilypond-2.24.1.tar.gz downloaded from the lilypond.org Web site, I get
these messages:

GNU LilyPond 2.24.1 (running Guile 2.2)
Processing `test.ly'
Parsing...ERROR: In procedure %resolve-variable:
Unbound variable: #{ }#

> I can't reproduce your problem (on Fedora); it compiles fine for me and
> prints a single MM rest.

Interesting.  What's the provenance of your Lilypond executable - did you
also compile from source, or use a Fedora package?

I wonder if the issue could be with my Guile 2.2 installation, which I
also compiled from sources.  I'm using Slackware, which does not have a
Guile 2.2 package, having skipped all the way to version 3.  I had to
install Guile 2.2 over top of that in order to get a version of Lilypond
that would report itself as using Guile 2.2, but if the build was still
partly using Slackware's packaged Guile 3.0 somehow, that could explain
the difference in our results.

-- 
Matthew Skala
msk...@ansuz.sooke.bc.ca People before tribes.
https://ansuz.sooke.bc.ca/

Re: chord.ly to extract notes from chords breaks with new Guile

2023-05-27 Thread David Kastrup
msk...@ansuz.sooke.bc.ca writes:

> Here's a small example showing the problem:
>
> \include "chord.ly"
> music = { 1 }
> { \extractNote #3 \music }
>
> In version 2.21.0 that produces a whole-note rest.  In version 2.24.1 with
> Guile 2.2 it gives this error output:
>
> GNU LilyPond 2.24.1 (running Guile 2.2)
> Processing `test.ly'
> Parsing...ERROR: In procedure %resolve-variable:
> Unbound variable: #{ }#
>
> Lilypond 2.24.1 compiled with Guile 3.0.9 also gives this error.
>
> I attach the version of chord.ly I'm using, which I got from the 2015
> discussion.  I found these links helpful at that time and I think one of
> them contained the original for this version of chord.ly:
>   http://gillesth.free.fr/Lilypond/chord/
>   http://www.lilypondforum.de/index.php?topic=2080.msg11479#msg11479

Your way of "getting chord.ly from the 2015 discussion" is broken.  To
wit, it contains a line

 ((null? res) (let ((note (list-ref notes (1- len ; last note
    (make-music 'RestEvent 'duration (ly:music-property note 
'duration

which contains a delirious number of unbreakable spaces, code \xa0
instead of \x20 as for a normal, breakable space.

Both Guile and LilyPond treat the unbreakable space as a normal
character instead of a space character.  Please fix your input file to
stop containing unbreakable space characters and also make sure that the
comment

; last note

is not continued with unbreakable space characters into further code
which turns it into a no-show for Guile.

Once you fix your unbreakable space as well as missing linebreak after
comment problems, things will likely look more normal.

-- 
David Kastrup



Re: chord.ly to extract notes from chords breaks with new Guile

2023-05-27 Thread Jean Abou Samra
Le samedi 27 mai 2023 à 16:31 -0400, msk...@ansuz.sooke.bc.ca a écrit :
> Here's a small example showing the problem:
> 
> \include "chord.ly"
> music = { 1 }
> { \extractNote #3 \music }
> 
> In version 2.21.0 that produces a whole-note rest.  In version 2.24.1 with
> Guile 2.2 it gives this error output:
> 
> GNU LilyPond 2.24.1 (running Guile 2.2)
> Processing `test.ly'
> Parsing...ERROR: In procedure %resolve-variable:
> Unbound variable: #{ }#
> 
> Lilypond 2.24.1 compiled with Guile 3.0.9 also gives this error.



Are you sure that this is the correct example? That the file chord.ly it uses 
is the same as the one you sent? That LilyPond is the one you believe and 
unpatched, etc. ?

I can't reproduce your problem (on Fedora); it compiles fine for me and prints 
a single MM rest.


signature.asc
Description: This is a digitally signed message part


chord.ly to extract notes from chords breaks with new Guile

2023-05-27 Thread mskala
Back in 2015 people on the list helped me with extracting notes from
chords, in this thread:
   https://lists.gnu.org/archive/html/lilypond-user/2015-09/msg00394.html

The solution from 2015 has broken now, in the transition between versions
2.21.0 and 2.24.1.  I think it's because of changes in Guile 2.2.  I
haven't had the opportunity to test with versions strictly between 2.21.0
and 2.24.1.

My situation is that I have music containing chords which I want to play
on a monophonic synthesizer, by generating separate MIDI tracks such that
in each track there is only one note playing at a time.  After recording
the tracks separately I'll mix the audio files.  So I'd like to have a
function I can call that takes in music with multi-note chords and selects
just one note from each chord.  Making it a little more complicated, the
number of notes in the chords varies, including some single notes that
Lilypond may represent internally as different from "chords."  I need to
generate as many tracks as the maximum number of notes that will play
simultaneously, but have silence in the extra tracks at times when there
are fewer notes playing than there are tracks.

So, for instance, if my input looks like
  { c4 4 4 }

then I want to generate tracks that might look like
  { c4 c4 c4 }
  { r4 e4 e4 }
  { r4 r4 g4 }

It's not important which tracks get which notes and which tracks get
silence; all that matters is that the union of the output tracks should be
the same notes that were in the input, with silence assigned to
unused tracks.  It would be nice if it could handle more complicated
structures of overlapping notes like
  << { c2 } { d4 e4 } >>

but the solution I've been using since 2015 doesn't, there are some
foreseeable problems with doing that in the general case, and it's not my
main concern right now.  The main issue is that I want my existing files
that work to continue working in more recent Lilypond.

This is a near-dealbreaker for me using a more recent Lilypond at all - I
could and might fix it by just sticking to 2.21.0 indefinitely - but I'd
really like to also be able to override midiDrumPitches, which seems to be
new in some version more recent than 2.21.

Here's a small example showing the problem:

\include "chord.ly"
music = { 1 }
{ \extractNote #3 \music }

In version 2.21.0 that produces a whole-note rest.  In version 2.24.1 with
Guile 2.2 it gives this error output:

GNU LilyPond 2.24.1 (running Guile 2.2)
Processing `test.ly'
Parsing...ERROR: In procedure %resolve-variable:
Unbound variable: #{ }#

Lilypond 2.24.1 compiled with Guile 3.0.9 also gives this error.

I attach the version of chord.ly I'm using, which I got from the 2015
discussion.  I found these links helpful at that time and I think one of
them contained the original for this version of chord.ly:
  http://gillesth.free.fr/Lilypond/chord/
  http://www.lilypondforum.de/index.php?topic=2080.msg11479#msg11479

but those links are both dead now, making it difficult for me to figure
out exactly which changes I applied to get it to work in 2015.  The
version currently in LSR snippet number 545 does not give the unbound
variable error, but it is dated earlier, and it has the problem for which
I started the 2015 thread:  on an out-of-range index it just returns the
last note (d in my example) instead of returning silence.

The present error output seems to be specific to the case of extracting a
note that doesn't exist, such as the third note of a two-note chord in my
example.  It works without error if I only ask for notes that exist.
However, I can't really avoid giving an out-of-range index; being able to
do that and get silence is a big part of the point of the exercise.

-- 
Matthew Skala
msk...@ansuz.sooke.bc.ca People before tribes.
https://ansuz.sooke.bc.ca/%% version Y/M/D = 2015/03/23
%% LSR = http://lsr.di.unimi.it/LSR/Item?u=1=761
%% LSR = http://lsr.di.unimi.it/LSR/Item?u=1=545
%% for Lilypond 2.16 or higher.
%% last major change in extract-note function : as \tuplet as now
%% a 'duration property, we have to deal with this special case.
%% by chord->note. You can now specified several numbers, to
%% extract several notes at one time

#(define (noteEvent? music)
(eq? (ly:music-property music 'name) 'NoteEvent))

#(define (no-duration? music)
(not (ly:duration? (ly:music-property music 'duration

#(define (expand-q-chords music); for q chords : see chord-repetition-init.ly
(expand-repeat-chords! (list 'rhythmic-event) music))

%%  extractNote  %
#(define tagNotExtractNote (gensym))
#(use-modules (ice-9 receive)) %% for the use of receive

#(define (chord->note chord n . args)
"Return either the note n of chord chord, keeping articulations or if other
numbers are specified in args, a chord with the matching notes."
(receive (notes others)
 (partition noteEvent? (ly:music-property chord 'elements))
 (

Re: How can I print only some parts of a score (staves, but no chords)?

2023-05-01 Thread Kieren MacMillan
Hi Werner,

>> \include “chorded.ily”
> Just to avoid potential problems: This must be
>  \include "chorded.ily"
> i.e., straight doublequotes.

Thanks for that.

I recently switched over to a "new" [2014] Mac Mini (because my 2011 iMac 
finally died), and the auto-smart-quotes feature was still on from the initial 
OS install — I’ve now turned it off, so the only “smart quotes” will be the 
ones I’m smart enough to generate myself.  ;)

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 can I print only some parts of a score (staves, but no chords)?

2023-05-01 Thread Werner LEMBERG

> Sure! Just
> 
> \include “chorded.ily”

Just to avoid potential problems: This must be

  \include "chorded.ily"

i.e., straight doublequotes.


Werner


Re: How can I print only some parts of a score (staves, but no chords)?

2023-05-01 Thread Kieren MacMillan
Hi Alessandro,

> Let me explain, because I'm afraid I fell into the XY problem (if that's
> true I apologize for the time wasted). I have a directory with all the
> songs I transcribed, like:
> .
> ├── song1.ly
> ├── song2.ly
> ├── song3.ly
> └── song4.ly
> 
> I would like to be able to compose each song separately (so that I can
> quickly inspect what I am doing, and in case print out a single sheet
> per time), and then maybe have a file (LaTeX or Lilypond) that includes
> different songs.

This is exactly what I do, for most of my projects. I write operas and musicals 
and other large-scale multi-movement works for the “musical stage”. Take, for 
example, my current front-burner project, “The Quest” (a two-act 
“Broadway-style” musical about four Grade 9 girls who play a D game 
called “Quest”… It has 24 musical songs/cues in it. I have 24 _notes.ily files

  Prologue_notes.ily
  StuckInsideASchool_notes.ily
  etc.

In each, I have a variable which creates a “full score” for that song, and I 
have a file

  editing.ly

with which I can work on any given single song/cue by simply changing which 
notes file I \include. Finally, I have all the different output scores I need:

  TheQuest_pianoconductor.ly
  TheQuest_pianovocal.ly
  TheQuest_vocalchoral.ly
  TheQuest_score.ly
  TheQuest_keyboard.ly
  TheQuest_bass.ly
  etc.

In those, I \include the appropriate style file (musical_parts_20pt.ily or 
musical_pianoconductor.ily or whatever) so that the output is exactly what I 
want/need.

> I would like to control whether to print chords or not
> depending on a option (even better a CLI argument,
> but I don’t think it's possible).

I’m quite sure a CLI argument could be passed, and then the appropriate Scheme 
code in your Lilypond file could include/exclude chords as instructed.

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: How can I print only some parts of a score (staves, but no chords)?

2023-05-01 Thread Alessandro Bertulli
Follow up: indeed, a thing like


\version "2.24.1"

\layout{
  \context{
\ChordNames
\remove Chord_name_engraver
  }
}

\include "Del-Tuo-Spirito-Signore.ly"
\include "Ô-Toi-l-au-delà-de-tout.ly"



seems to WORK! Yay! But is this ok? Are there more idiomatic ways to do this?

-- 
Alessandro Bertulli



Re: How can I print only some parts of a score (staves, but no chords)?

2023-05-01 Thread Alessandro Bertulli


Thanks, this is the idea I would like to do, since I need to combine
multiple files together, and thus I cannot simply use variables: I
should use distinct names for everything, not to mention that I couldn't
just "test out" a new piece while I'm writing it without recomposing the
entire "book".

Let me explain, because I'm afraid I fell into the XY problem (if that's
true I apologize for the time wasted). I have a directory with all the
songs I transcribed, like:

.
├── song1.ly
├── song2.ly
├── song3.ly
└── song4.ly

I would like to be able to compose each song separately (so that I can
quickly inspect what I am doing, and in case print out a single sheet
per time), and then maybe have a file (LaTeX or Lilypond) that includes
different songs. There, I would like to control whether to print chords
or not depending on a option (even better a CLI argument, but I don't
think it's possible).

> Sure! Just
>
> \include “chorded.ily”
>
> or not, depending on whether you want chords — then be sure to \remove the 
> relevant engravers in your main file, and \consist them in chorded.ily and 
> voila!  :)

Yeah I too was thinking about style sheets, but I am still a beginner
and I don't know how to use them. Can I disable an engraver for an
entire file, for instance? Because if so then it's trivial, I can just
place at the beginning of the "main" file whether I want chords or not,
then simply \include the song files(?)

-- 
Alessandro Bertulli



Re: How can I print only some parts of a score (staves, but no chords)?

2023-05-01 Thread Kieren MacMillan
Hi Alessandro!

> For comparison, LaTeX's songs package
> (https://songs.sourceforge.net/) can change the type of document
> produced by changing one single option in the document preamble (say,
> from chorded to lyric). Let's see if I can do the same in Lilypond.

Sure! Just

\include “chorded.ily”

or not, depending on whether you want chords — then be sure to \remove the 
relevant engravers in your main file, and \consist them in chorded.ily and 
voila!  :)

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 can I print only some parts of a score (staves, but no chords)?

2023-05-01 Thread Alessandro Bertulli


>> P.S. I am happy there are other solution other than lilypond-book,
>> because to me it seems a very fragile solution (copying the doc and then
>> composing manually), especially if you are embedding music in a complex
>> LaTeX document. There is lyluatex with LuaLaTeX but I don't know if the
>> output is the same in terms of quality
>
> If you’re talking about the lyluatex that Urs Liska was working on,
> the quality is superb — if I only had time to retool my workflow, I
> would probably move it all to that framework.

Actually I was referring to just the CTAN package lyluatex
(https://ctan.org/pkg/lyluatex). Didn't know Urs Liska's lyluatexmp
existed, tho for now it seem still WIP?

Anyway, now I'll try tweaking a bit with \book{} commands, let's see if
I can achieve what I need. For comparison, LaTeX's songs package
(https://songs.sourceforge.net/) can change the type of document
produced by changing one single option in the document preamble (say,
from chorded to lyric). Let's see if I can do the same in Lilypond.

-- 
Alessandro Bertulli



Re: How can I print only some parts of a score (staves, but no chords)?

2023-04-30 Thread Kieren MacMillan
Hi Alessandro,

>> blocks will already do the trick. You can even have multiple parts (using 
>> \bookpart { ... } or even multiple separate books from the same source file 
>> using \book { ... }).
> 
> Do you mean that different pdfs will be produced?

Yes: each \book block will result in a separate PDF output file.

> P.S. I am happy there are other solution other than lilypond-book,
> because to me it seems a very fragile solution (copying the doc and then
> composing manually), especially if you are embedding music in a complex
> LaTeX document. There is lyluatex with LuaLaTeX but I don't know if the
> output is the same in terms of quality

If you’re talking about the lyluatex that Urs Liska was working on, the quality 
is superb — if I only had time to retool my workflow, I would probably move it 
all to that framework.

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 can I print only some parts of a score (staves, but no chords)?

2023-04-30 Thread Alessandro Bertulli


Many thanks to all!

> Doing multiple
>
> \score { ... }
>
> blocks will already do the trick. You can even have multiple parts (using 
> \bookpart { ... } or even multiple separate books from the same source file 
> using \book { ... }).

Do you mean that different pdfs will be produced?

> Now, there are many ways of having selective content. Using tags certainly is 
> one of them. This is nice if you put the content of your \score into a 
> variable, for then you can simply do
>
> \score { \removeWithTag #'chords \myMusic }

Yes, in the end I found a way to do what I was thinking using tags and a
custom Makefile, but it is really cumbersome and I need to touch
multiple things every song added.

By the way, I see that you added some Scheme in your solution: which
parts of the manual should I read to learn what do they do?

Thanks!

P.S. I am happy there are other solution other than lilypond-book,
because to me it seems a very fragile solution (copying the doc and then
composing manually), especially if you are embedding music in a complex
LaTeX document. There is lyluatex with LuaLaTeX but I don't know if the
output is the same in terms of quality

-- 
Alessandro Bertulli



Re: How can I print only some parts of a score (staves, but no chords)?

2023-04-30 Thread Valentin Petzel
Hello Alessandro,

lilypond-book is for embedding Lilypond snippets into a document typeset by 
LaTeX. If you simply want to combine multiple scores into one scorebook 
lilypond can do that by itself.

Doing multiple

\score { ... }

blocks will already do the trick. You can even have multiple parts (using 
\bookpart { ... } or even multiple separate books from the same source file 
using \book { ... }).

Now, there are many ways of having selective content. Using tags certainly is 
one of them. This is nice if you put the content of your \score into a 
variable, for then you can simply do

\score { \removeWithTag #'chords \myMusic }

like this:

%

\version "2.24.1"

\language "italiano"

\paper {
  % annotate-spacing = ##t
  system-system-spacing.basic-distance = #20
}

\header {
  title = "Ô toi l'au-delà de tout"
  composer = "Taizé"
  opus = "149"
}

removeVoice =
#(define-music-function (music) (ly:music?)
   (music-map
(lambda (m)
  (if (eqv? (ly:music-property m 'context-type) 'Voice)
  (ly:music-set-property!
   m
   'property-operations
   '((remove "Note_heads_engraver"
  m)
music))

muteStaffWithTag =
#(define-music-function (tags music) (symbol-list-or-symbol? ly:music?)
   (music-map
(lambda (m)
  (if (not ((tags-remove-predicate tags) m))
  (make-music
   'ContextSpeccedMusic
   'create-new #t
   'property-operations '((accepts "Voice"))
   'context-type 'Devnull
   'element (removeVoice (ly:music-property m 'element)))
  m))
music))

scoreMusic =
<<
  \tag #'chords \chords {
 \set chordChanges = ##t
 \partial 8 s8 | re2.:m | re2.:m | fa4 sol2:m7 | do2:7 fa4 |
 sol1:m7 fa2 | re2:m la:7 | re:m la:7
  }

  \tag #'music \new Staff \new Voice = "voice" \relative {
\clef "treble"
\key re \minor
\overrideTimeSignatureSettings
3/4% timeSignatureFraction
1/8% baseMomentFraction
2,2,2% beatStructure
#'()   % beamExceptions
\overrideTimeSignatureSettings
4/4% timeSignatureFraction
1/8% baseMomentFraction
2,2,2,2% beatStructure
#'()   % beamExceptions
\numericTimeSignature % to display 4/4 instead of C
\time 3/4

\partial 8 re'8\( \bar ".|:" re4 mi8 sol fa mi | re2\) fa8\( sol | la4 sib 
sib8 la | sol2\) la8\( re |
re4 do sib8 la | sol4 la2\) | \time 4/4 la8\( re, mi fa sol4. la8 | fa4 
sol8 fa mi4.\) re8 \bar ":|." 
  }

  \tag #'lyrics \new Lyrics \lyricsto "voice" {
Ô Toi l'au -- de -- là de tout,
quel es -- prit peut Te sai -- sir?
Tous les ê -- tres Te cé -- lè -- brent,
le dé -- sir de tous a -- spi -- re vers Toi. Ô
  }
>>

\markup "Everything"

\score{
  \layout{}
  \scoreMusic
}

\markup "No chords"

\score{
  \layout{}
  \removeWithTag #'chords \scoreMusic
}

\markup "No lyrics"

\score{
  \layout{}
  \removeWithTag #'lyrics \scoreMusic
}

\markup "No music"

\score{
  \layout {
\context {
  \Lyrics
  \consists Bar_engraver
  \override BarLine.bar-extent = #'(-1.5 . 1.5)
  \override BarLine.self-alignment-Y = #-0.7
  \override BarLine.Y-offset = #self-alignment-interface::y-aligned-on-self
  %\override BarLine.extra-spacing-width = #'( . 1)
}
\context {
  \Score
  \override SpacingSpanner.strict-note-spacing = ##t
}
  }
  \muteStaffWithTag #'music \scoreMusic
}


%%

There are many ways to achieve your goal, an the best way might depend on your 
circumstances and preferences.

Cheers,
Valentin

Am Sonntag, 30. April 2023, 13:19:42 CEST schrieb Alessandro Bertulli:
> Hi all,
> 
> I'm playing around a bit with Lilypond and I have copied some sheets I
> have purchased in order to build a custom songbook. Since I play rhythmic
> guitar, I have decorated the staves with chords at the top:



signature.asc
Description: This is a digitally signed message part.


Re: How can I print only some parts of a score (staves, but no chords)?

2023-04-30 Thread Federico Bruni
Il giorno dom 30 apr 2023 alle 13:19:42 +0200, Alessandro Bertulli 
 ha scritto:

However, the singers do not need the chords,
so I would like to omit them and simply print a version of the 
document
with only the staves. Is it possible to do this using the SAME 
lilypond

source file?

I have read something about using tags, but I don't know how should I
use them in my file, which by the way is this:


Don't use tags.

Just use one variable name (say, music) for the \relative block and 
another variable name (say, chords) for the \chords block.
Then call only music in the score block for the singers; and music + 
chords in the score block for the guitar player.


You can find many examples in the documentation about using variables.






Re: How can I print only some parts of a score (staves, but no chords)?

2023-04-30 Thread Kieren MacMillan
Hi Alessandro,


> I want to place multiple scores in a single document

I do this with bookparts:

\bookpart {
  \header { stuff for this bookpart }
  \score {
score with chords
  }
}

\bookpart {
  \header { stuff for this bookpart }
  \score {
score without chords
  }
}

etc.

> I have read something about using tags, but I don't know how should I use them

One *could* do this with tags… but that wouldn’t be my choice.

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.




How can I print only some parts of a score (staves, but no chords)?

2023-04-30 Thread Alessandro Bertulli

Hi all,

I'm playing around a bit with Lilypond and I have copied some sheets I
have purchased in order to build a custom songbook. Since I play rhythmic
guitar, I have decorated the staves with chords at the top:

Now I want to place multiple scores in a single document, and I thought
about using lilypond-book. However, the singers do not need the chords,
so I would like to omit them and simply print a version of the document
with only the staves. Is it possible to do this using the SAME lilypond
source file?

I have read something about using tags, but I don't know how should I
use them in my file, which by the way is this:

%

\version "2.24.1"

\language "italiano"

\paper {
  % annotate-spacing = ##t
  system-system-spacing.basic-distance = #20
}

\header {
  title = "Ô toi l'au-delà de tout"
  composer = "Taizé"
  opus = "149"
}

\score{
  \midi{}
  \layout{}
<<

  \chords{
 \set chordChanges = ##t
 \partial 8 s8 | re2.:m | re2.:m | fa4 sol2:m7 | do2:7 fa4 |
 sol1:m7 fa2 | re2:m la:7 | re:m la:7
}

  \relative {
\clef "treble"
\key re \minor
\overrideTimeSignatureSettings
3/4% timeSignatureFraction
1/8% baseMomentFraction
2,2,2% beatStructure
#'()   % beamExceptions
\overrideTimeSignatureSettings
4/4% timeSignatureFraction
1/8% baseMomentFraction
2,2,2,2% beatStructure
#'()   % beamExceptions
\numericTimeSignature % to display 4/4 instead of C
\time 3/4

\partial 8 re'8\( \bar ".|:" re4 mi8 sol fa mi | re2\) fa8\( sol | la4 sib 
sib8 la | sol2\) la8\( re |
re4 do sib8 la | sol4 la2\) | \time 4/4 la8\( re, mi fa sol4. la8 | fa4 
sol8 fa mi4.\) re8 \bar ":|."

  }

  \addlyrics{
 Ô Toi l'au -- de -- là de tout,
quel es -- prit peut Te sai -- sir?
Tous les ê -- tres Te cé -- lè -- brent,
le dé -- sir de tous a -- spi -- re vers Toi. Ô
}
>>
}

%%

Thanks! (and sorry for the wall-of-text)

-- 
Alessandro Bertulli


Re: How to control ties direction between chords

2023-04-21 Thread Volodymyr Prokopyuk
Thank you Brian and Willian for your working solution!

[image: image.png]
Thank you,
Vlad

On Fri, Apr 21, 2023 at 5:12 PM William Rehwinkel <
will...@williamrehwinkel.net> wrote:

> Dear Vlad,
>
> Inserting ^~ and _~ to the individual notes in the chord should work
> nicely, Like so.
>
> Thanks,
> -William
>
> \version "2.25.2"
>
> \relative {
>\clef treble
>\key c \major
>\time 4/4
><<
>  \new Voice = voiceOne \relative {
>\voiceOne
>4 8
>  }
>  \new Voice = voiceTwo \relative {
>\voiceTwo
>\autoBeamOff r8 8 8
>  }
>>>
> }
>
>
> On 4/21/23 10:47, Volodymyr Prokopyuk wrote:
> > Hi,
> >
> > How can I force the lower tie to be placed downward in the below code
> > snippet? I've tried \once \tieDown but with no luck.
> >
> > \version "2.25.3"
> >
> > \relative {
> >\clef treble
> >\key c \major
> >\time 4/4
> ><<
> >  \new Voice = voiceOne \relative {
> >\voiceOne
> >4~ 8
> >  }
> >  \new Voice = voiceTwo \relative {
> >\voiceTwo
> >\autoBeamOff r8 8 8
> >  }
> >>>
> > }
> >
> > image.png
> >
> >
> > Thank you in advance for your support,
> > Vlad
>
> --
> + --- +
> |   William Rehwinkel - Oberlin College and   |
> |  Conservatory '24   |
> |will...@williamrehwinkel.net |
> | PGP key:|
> | https://ftp.williamrehwinkel.net/pubkey.txt |
> + --- +
>


Re: How to control ties direction between chords

2023-04-21 Thread William Rehwinkel via LilyPond user discussion

Dear Vlad,

Inserting ^~ and _~ to the individual notes in the chord should work 
nicely, Like so.


Thanks,
-William

\version "2.25.2"

\relative {
  \clef treble
  \key c \major
  \time 4/4
  <<
\new Voice = voiceOne \relative {
  \voiceOne
  4 8
}
\new Voice = voiceTwo \relative {
  \voiceTwo
  \autoBeamOff r8 8 8
}
  >>
}


On 4/21/23 10:47, Volodymyr Prokopyuk wrote:

Hi,

How can I force the lower tie to be placed downward in the below code 
snippet? I've tried \once \tieDown but with no luck.


\version "2.25.3"

\relative {
   \clef treble
   \key c \major
   \time 4/4
   <<
     \new Voice = voiceOne \relative {
       \voiceOne
       4~ 8
     }
     \new Voice = voiceTwo \relative {
       \voiceTwo
       \autoBeamOff r8 8 8
     }
   >>
}

image.png


Thank you in advance for your support,
Vlad


--
+ --- +
|   William Rehwinkel - Oberlin College and   |
|  Conservatory '24   |
|will...@williamrehwinkel.net |
| PGP key:|
| https://ftp.williamrehwinkel.net/pubkey.txt |
+ --- +


OpenPGP_signature
Description: OpenPGP digital signature


How to control ties direction between chords

2023-04-21 Thread Volodymyr Prokopyuk
Hi,

How can I force the lower tie to be placed downward in the below code
snippet? I've tried \once \tieDown but with no luck.

\version "2.25.3"

\relative {
  \clef treble
  \key c \major
  \time 4/4
  <<
\new Voice = voiceOne \relative {
  \voiceOne
  4~ 8
}
\new Voice = voiceTwo \relative {
  \voiceTwo
  \autoBeamOff r8 8 8
}
  >>
}

[image: image.png]


Thank you in advance for your support,
Vlad


Re: Excessive spacing due to chords

2023-02-23 Thread mikel

Fantastic, thank you very much!

El 2023-02-23 15:24, Jean Abou Samra escribió:

Le jeudi 23 février 2023 à 15:13 +0100, mi...@orbelanet.com a écrit
:


Good morning,

I have 2 question related to spacing in lilypond:

* How to avoid the excessive gap that forms between the sixteenth
notes
(marked in green in ttached image) due to chords?


Use

\override ChordName.extra-spacing-width = #'(+inf.0 . -inf.0)

See the documentation page here [1].


* How to avoid the collision between the number 3 of the triplet
and
the slur (marked in green in ttached image)?


You could tweak the padding a bit. Giving:

\version "2.24.0"
global = { \key g \minor \tempo 4 = 90 \time 2/4 }
voiceI = \relative {
   \repeat volta 2 {
 % mes.1
 g'16 bes a bes g bes a bes a c b c a c b c |
 a c b c a c b c bes d cis d bes d cis d | \break
 % mes.5
 b d cis d b d cis d c ees d ees c ees d ees d a'( fis d c) a( bes
c
d) d,( ees e f fis g aes) | \break
}
}
voiceII = \relative {
   \repeat volta 2 {
 % mes.1
 g4 a8( bes c4)~ c16 ees( d ees c4.) d8( bes4)~ bes16 d( g fis |
 % mes.5
 g4~) \tweak TupletBracket.padding 2 \tuplet 3/2 { g8 fis( f }
ees4~) \tweak TupletBracket.padding 2 \tuplet 3/2 { ees8 d( cis }
d16) ees( d cis d) c( bes a d) d( cis c b bes a aes) |
}
}
melody = \relative {
   <<
 { \voiceI }
 \\
 { \voiceII }
   >>
}

harmonies = \chords {
   \set minorChordModifier = \markup { "-" }
   g2:m d:7/a s g:m/bes
   g:7/b c:m d:7 g4:m d:aug7
}

\score {
   \new Staff
   <<
 \harmonies
 \new Voice {
   \global
   \melody
 }
   >>
   \layout {
 \context {
   \Staff
   \accepts ChordNames
 }
 \context {
   \ChordNames
   \remove Axis_group_engraver
   \override ChordName.outside-staff-priority = 500
   \override ChordName.direction = #DOWN
   \override ChordName.outside-staff-padding = 0.5
   \override ChordName.extra-spacing-width = #'(+inf.0 . -inf.0)
 }
   }
}

Note that I chose to rename your variables "voiceOne" and "voiceTwo"
because these are also the names of predefined LilyPond commands.

Best,

Jean

Links:
--
[1]
https://lilypond.org/doc/v2.24/Documentation/notation/adjusting-horizontal-spacing-for-specific-layout-objects





Re: Excessive spacing due to chords

2023-02-23 Thread Jean Abou Samra
Le jeudi 23 février 2023 à 15:13 +0100, mi...@orbelanet.com a écrit :
> Good morning,
> 
> I have 2 question related to spacing in lilypond:
> 
> 1. How to avoid the excessive gap that forms between the sixteenth notes  
> (marked in green in ttached image) due to chords?

Use

```
\override ChordName.extra-spacing-width = #'(+inf.0 . -inf.0)
```

See the documentation page 
[here](https://lilypond.org/doc/v2.24/Documentation/notation/adjusting-horizontal-spacing-for-specific-layout-objects).


> 2. How to avoid the collision between the number 3 of the triplet and  
> the slur (marked in green in ttached image)?

You could tweak the padding a bit. Giving:

```
\version "2.24.0"
global = { \key g \minor \tempo 4 = 90 \time 2/4 }
voiceI = \relative {
   \repeat volta 2 {
 % mes.1
 g'16 bes a bes g bes a bes a c b c a c b c |
 a c b c a c b c bes d cis d bes d cis d | \break
 % mes.5
 b d cis d b d cis d c ees d ees c ees d ees d a'( fis d c) a( bes c 
d) d,( ees e f fis g aes) | \break
}
}
voiceII = \relative {
   \repeat volta 2 {
 % mes.1
 g4 a8( bes c4)~ c16 ees( d ees c4.) d8( bes4)~ bes16 d( g fis |
 % mes.5
 g4~) \tweak TupletBracket.padding 2 \tuplet 3/2 { g8 fis( f } ees4~) 
\tweak TupletBracket.padding 2 \tuplet 3/2 { ees8 d( cis } 
d16) ees( d cis d) c( bes a d) d( cis c b bes a aes) |
}
}
melody = \relative {
   <<
 { \voiceI }
 \\
 { \voiceII }
   >>
}

harmonies = \chords {
   \set minorChordModifier = \markup { "-" }
   g2:m d:7/a s g:m/bes
   g:7/b c:m d:7 g4:m d:aug7
}

\score {
   \new Staff
   <<
 \harmonies
 \new Voice {
   \global
   \melody
 }
   >>
   \layout {
 \context {
   \Staff
   \accepts ChordNames
 }
 \context {
   \ChordNames
   \remove Axis_group_engraver
   \override ChordName.outside-staff-priority = 500
   \override ChordName.direction = #DOWN
   \override ChordName.outside-staff-padding = 0.5
   \override ChordName.extra-spacing-width = #'(+inf.0 . -inf.0)
 }
   }
}
```

Note that I chose to rename your variables "voiceOne" and "voiceTwo" because 
these are also the names of predefined LilyPond commands.

Best,

Jean


signature.asc
Description: This is a digitally signed message part


Re: move chords closer to notes

2023-02-21 Thread Jean Abou Samra
Le mardi 21 février 2023 à 14:01 +0100, mi...@orbelanet.com a écrit :
> Oh, I'm so sorry!
> 
> My problem is not relationed with lilypond directly.
> 
> Is just a neovim mapping problem with .ly files, that convert cc to cis  
> (to easyly write sharps and flats).

Instead of that, you probably want to do something like

```
\version "2.24.0"

#(ly:parser-set-note-names
  `((c . ,#{ c #})
(cc . ,#{ cis #})
(d . ,#{ d #})
;; etc...
;; add all notes in your notation
))

\fixed c' {
  c cc d
}
```

to define your own input language.


signature.asc
Description: This is a digitally signed message part


Re: move chords closer to notes

2023-02-21 Thread mikel

Oh, I'm so sorry!

My problem is not relationed with lilypond directly.

Is just a neovim mapping problem with .ly files, that convert cc to cis 
(to easyly write sharps and flats). Then when a compile next line:

\accepts ChordNames
is modified in:
 \acisepts ChordNames

and compilation break off!

I solve it and now work like I want.

Thanks very mutch for your time!

El 2023-02-21 13:43, Jean Abou Samra escribió:

Le mardi 21 février 2023 à 13:35 +0100, mi...@orbelanet.com a écrit
:


Yes, sorry, I see the typo just now.

My lilypond version is 2.24.0.


Did you really compile the snippet unmodified, or did you insert it in
the context of a larger score?





Re: move chords closer to notes

2023-02-21 Thread Jean Abou Samra
Le mardi 21 février 2023 à 13:35 +0100, mi...@orbelanet.com a écrit :
> Yes, sorry, I see the typo just now.
> 
> My lilypond version is 2.24.0.


Did you really compile the snippet unmodified, or did you insert it in the 
context of a larger score?


signature.asc
Description: This is a digitally signed message part


Re: move chords closer to notes

2023-02-21 Thread mikel

Yes, sorry, I see the typo just now.

My lilypond version is 2.24.0.

El 2023-02-21 13:13, Jean Abou Samra escribió:

Le mardi 21 février 2023 à 13:03 +0100, Jean Abou Samra a écrit :


Le mardi 21 février 2023 à 12:41 +0100, mi...@orbelanet.com a
écrit :


Thanks a lot for your response! It looks good in the image you
sent, but for some reason it doesn't work
for me.The next line does not allow me to compile the file, it
does not
accept it:
\remove Axis_group_engraver


(Resend, I got bounces from the list, not sure why.)


Well, you had a typo in the list address (“llilypond”) so your
message above didn't reach the list either.

What version are you using?





Re: move chords closer to notes

2023-02-21 Thread Jean Abou Samra
Le mardi 21 février 2023 à 13:03 +0100, Jean Abou Samra a écrit :
> Le mardi 21 février 2023 à 12:41 +0100, mi...@orbelanet.com a écrit :
> 
> > Thanks a lot for your response!
> > It looks good in the image you sent, but for some reason it doesn't work  
> > for me.The next line does not allow me to compile the file, it does not  
> > accept it:  
> >    \remove Axis_group_engraver
> 
> 
> (Resend, I got bounces from the list, not sure why.)


Well, you had a typo in the list address (“llilypond”) so your message above 
didn't reach the list either.

What version are you using?



signature.asc
Description: This is a digitally signed message part


Re: move chords closer to notes

2023-02-20 Thread Jean Abou Samra
Le mardi 21 février 2023 à 03:55 +0100, mi...@orbelanet.com a écrit :
> Hi everyone,
> when I write the chords together with one or several melodies, the
> chords form a horizontal line, in such a way that if the range of the
> melody is very wide, some chords end up being very far from the
> notes.
> I attach a sample of the .ly file along with its pdf, where you can
> see
> that the first chords are excessively far from the melody. How can
> this
> behavior be changed?
So you want to break the horizontal alignment of chords?
As far as I know, this would be the easiest way:
\version "2.24.0"
global = {
  \key c \major
  \partial 4
  \time 2/4
}
melody = \relative {
  r16 g' g g \bar "||"
<<
  {
e' c c c d b b b c8 a r16 d d c c8 b r16 c c b a8 g r16 g fis g \break
c g fis g b g fis g a8 f r16 g fis g b g fis g a f e f g8 e r16 g g g 
\break
  }
  \\
  {
g4 gis a16 g f a c4 b, a a16 g c d e4 g fis f r g f e r
  }
>>
}

harmonies = \chords {
  \set minorChordModifier = \markup { "-" }
  s4
  c e:7 f2 g c s4 b d2:m g4 g:7 c2
}

\score {
  \new Staff 
  <<
\harmonies
\new Voice {
  \global
  \melody
}
  >>
  \layout {
\context {
  \Staff
  % move ChordNames inside Staff
  \accepts ChordNames
}
\context {
  \ChordNames
  % remove the baseline that aligns chord names together
  \remove Axis_group_engraver
  % define placement among other outside-staff objects
  \override ChordName.outside-staff-priority = 500
  % print below staff
  \override ChordName.direction = #DOWN
  % change distance to staff objects
  \override ChordName.outside-staff-padding = 0.5
}
  }
}


Best,

Jean



signature.asc
Description: This is a digitally signed message part


move chords closer to notes

2023-02-20 Thread mikel

Hi everyone,

when I write the chords together with one or several melodies, the 
chords form a horizontal line, in such a way that if the range of the 
melody is very wide, some chords end up being very far from the notes.


I attach a sample of the .ly file along with its pdf, where you can see 
that the first chords are excessively far from the melody. How can this 
behavior be changed?


Thanks in advance.\version "2.24.0"
global = {
  \key c \major
  \partial 4
  \time 2/4
}
melody = \relative {
  r16 g' g g \bar "||"
<<
  {
e' c c c d b b b c8 a r16 d d c c8 b r16 c c b a8 g r16 g fis g \break
c g fis g b g fis g a8 f r16 g fis g b g fis g a f e f g8 e r16 g g g 
\break
  }
  \\
  {
g4 gis a16 g f a c4 b, a a16 g c d e4 g fis f r g f e r
  }
    >>
}

harmonies = \chords {
  \set minorChordModifier = \markup { "-" }
  s4
  c e:7 f2 g c s4 b d2:m g4 g:7 c2
}

\score {
  \new Staff 
  <<
\harmonies
\new Voice {
  \global
  \melody
}
  >>
  \layout {
  }
}


adios.pdf
Description: Adobe PDF document


Re: Beat markers in the chords section

2023-01-19 Thread Mike Dean
Knute: No, I haven't run Lilypond from the command line (I have enough
trouble using it with Frescobaldi 3.2)
Machine: Windows 10 Pro 64-bit, 16GB memory
LP version 2.24
Mike Dean


On Thu, Jan 19, 2023 at 12:15 PM Knute Snortum  wrote:

> On Thu, Jan 19, 2023 at 9:01 AM Mike Dean  wrote:
> >
> > Kieren: it worked great, thanks mauch
> > I am having problems when I print to PDF in 2.24/Frescobaldi 3.2: the
> program hangs (I'm not sure if it's on the Lilypond side or the Frescobaldi
> side --- Frescobaldi says that it's not responding):
>
> Have you tried invoking LilyPond from the command line?
>
> https://lilypond.org/doc/v2.24/Documentation/usage/command_002dline-usage
>
> Also, tell us what kind of computer you're on (Windows, Mac, Linux).
>
>
> --
> Knute Snortum
>


Re: Beat markers in the chords section

2023-01-19 Thread Knute Snortum
On Thu, Jan 19, 2023 at 9:01 AM Mike Dean  wrote:
>
> Kieren: it worked great, thanks mauch
> I am having problems when I print to PDF in 2.24/Frescobaldi 3.2: the program 
> hangs (I'm not sure if it's on the Lilypond side or the Frescobaldi side --- 
> Frescobaldi says that it's not responding):

Have you tried invoking LilyPond from the command line?

https://lilypond.org/doc/v2.24/Documentation/usage/command_002dline-usage

Also, tell us what kind of computer you're on (Windows, Mac, Linux).


--
Knute Snortum



Re: Beat markers in the chords section

2023-01-19 Thread Kieren MacMillan
Hi Mike,

> I'm wondering if there is a way to put beat markers in the chords section as 
> in the following:

Well, you could definitely use the Slash_repeat_engraver, if you know what 
you’re doing…
I don’t really, but I took a whack at it — see snippet below.

Hope that helps!
Kieren.

p.s. Really, the built-in repeat engravers should handle this more elegantly. 
I’ll see what I can do to put a patch together.

%%%  SNIPPET BEGINS
\version "2.23.14"

% Function to print a specified number of slashes
comp = #(define-music-function (count) (integer?)
  #{
\override ChordName.stencil = #ly:percent-repeat-interface::beat-slash
\override ChordName.thickness = #0.48
\override ChordName.slope = #1.7
\override ChordName.Y-offset = #1
\repeat unfold $count { r4 }
\revert ChordName.stencil
\revert ChordName.Y-offset
  #}
)

\layout {
  system-count = 4
  ragged-right = ##f
  ragged-last = ##f
  \context {
\ChordNames
chordChanges = ##f
\consists Percent_repeat_engraver
\override VerticalAxisGroup.staff-affinity = #DOWN
\override VerticalAxisGroup.nonstaff-relatedstaff-spacing.padding = #1
  }
}

harmonies = \chordmode {
  d4:m \comp 6
  c4 \comp 8
  d2:m
  c4 | d2.:m | d:m | d:m | d:m
d:m | d:m | c | c | c | c |
d:m | d:m | d:m d:m d:m }

melody = \relative c' {
  \key d \minor
  \time 3/4
  \partial 4
  d4 d a' a a2 a8 a g4 g e  c2. R2.  
  r4 r8 g' g g a4 a a a f g a8 d~ d2 R2. R r4 r f8 f
  d4 d a a8 a4. a4 g c, c8 c c4c2 R2. r4 r c8 c 
  d4 f a g e c d d2~ d2.~ d4 r \bar ":|."
}

\score {
  <<
\new ChordNames \harmonies
\new Voice = "one" { \melody }
  >>
}
%%%  SNIPPET ENDS




Beat markers in the chords section

2023-01-18 Thread Mike Dean
Hi group:
I'm wondering if there is a way to put beat markers in the chords section
as in the following:
[image: image.png]
The snippet follows:


harmonies =  \chordmode { d4:m | d2.:m | d:m | c2. | c | c |
c | d:m | d2:m c4 | d2.:m | d:m | d:m | d:m
d:m | d:m | c | c | c | c |
d:m | d:m | d:m d:m d:m \bar ":|." }

melody = \relative c' {
  \key d \minor
  \time 3/4
  \partial 4
  d4 d a' a a2 a8 a g4 g e  c2. R2.
  r4 r8 g' g g a4 a a a f g a8 d~ d2 R2. R r4 r f8 f
  d4 d a a8 a4. a4 g c, c8 c c4c2 R2. r4 r c8 c
  d4 f a g e c d d2~ d2.~ d4 r \bar ":|."
}
\score {
<<
\new ChordNames {
\set chordChanges = ##t
\harmonies
}
\new Voice = "one" { \melody }
>>
}


Mike Dean


Re: 2.24 weirdness with slurred chords

2022-12-25 Thread Werner LEMBERG
>> Here's an MWE showing this.
> 
> Indeed, this looks like a bug.

This is now

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


 Werner



Re: 2.24 weirdness with slurred chords

2022-12-25 Thread Werner LEMBERG

> Hey all.  Ran into a bit of weirdness when trying to do slurred
> chords.  I'm wanting a slur between each of the matching notes
> within the chord.

Why slurs and not ties?

> Here's an MWE showing this.
> 
> \version "2.24.0"
> \language "english"
> 
> \relative c'' {
>   b4 b b
>   < b\1\=1( f\2\=2( b,\3\=3( >4   < b\1\=1) f\2\=2) b,\3\=3) >
>   < e,\1\=1( b\2\=2( e,\3\=3( >2.  < e\1\=1) b\2\=2) e,\3\=3) >2
> }

Indeed, this looks like a bug.  However, a simple solution is to do
the following – but I guess you know this already :-)

```
\version "2.25.0"

\relative c'' {
  b4 b b
  4 ~ 
  2. ~ 2
}
```


Werner


Re: Mimicking `\chords` mode within `\markup`

2022-12-21 Thread Jean Abou Samra

Le 21/12/2022 à 17:56, Joel C. Salomon a écrit :

\version "2.24.0"

\markup {
   Compare \sans\concat{F\char ##x266F °/C} to \sans\concat{F\sharp °/C}
   to \score{\chords{\chordmode{ fis:dim/c }}}
}

Looks like `\chords` is aligning the sharp symbol differently (and
probably using SMUFL U+E870 rather than U+B0 (°), but that matters
less).  How can I copy what `\chords` is doing?

(If the spacing and sizing of the embedded `\score` can be tweaked to
look like inline text, that's good too.)

I'm guessing that I need to somehow create a `ChordName` item, but I
can't see how to do so.



I would do it with \score. There is not really a simple way otherwise.

Add \layout { indent = 0 } in the \score block, and you're done.
You can also put \tweak font-size #-1 before the chord name to
change its size.

Best,
Jean



OpenPGP_signature
Description: OpenPGP digital signature


Mimicking `\chords` mode within `\markup`

2022-12-21 Thread Joel C. Salomon
\version "2.24.0"

\markup {
  Compare \sans\concat{F\char ##x266F °/C} to \sans\concat{F\sharp °/C}
  to \score{\chords{\chordmode{ fis:dim/c }}}
}

Looks like `\chords` is aligning the sharp symbol differently (and
probably using SMUFL U+E870 rather than U+B0 (°), but that matters
less).  How can I copy what `\chords` is doing?

(If the spacing and sizing of the embedded `\score` can be tweaked to
look like inline text, that's good too.)

I'm guessing that I need to somehow create a `ChordName` item, but I
can't see how to do so.

--Joel



Re: (Semi)German chords (B <-> H) with normal slash chords?

2022-04-26 Thread Henning Hraban Ramm

Am 26.04.22 um 12:09 schrieb Boris Lau:

Dear list,

I'm working on a songbook for german kids. Although I personally don't 
like them, I want to use German chord names (B and H exchanged). I could 
use \germanChords or \semiGermanChords to achieve that, but that also 
changes the behavior of slash chords:


B7 -> H7   <-- this is what I want
E/G# -> E/gis  <-- this is weird

Maybe some developer thought, that E/gis is how it's done in Germany.
I think it's rather uncommon and pretty ugly ;-)

But personal tastes aside, is there a way to get the B<->H thing without 
changing the slash chords?


Many thanks in advance,
Best, Boris



Hello Boris,

only a few weeks ago I asked the same (subject: "German chords with 
uppercase bass".


Thomas Morley answered:



\germanChords uses `chord-name->german-markup' to print the root-name
(chordRootNamer) of a chord and `note-name->german-markup' to print an
additional bass-note (chordNoteNamer).
If you comment the chordNoteNamer there, the chordRootNamer takes over.

germanChords = {
  \set chordRootNamer = #(chord-name->german-markup #t)
  %\set chordNoteNamer = #note-name->german-markup
}

scm = \chordmode {
   c1/c | cis/cis
   b1/b | bis/bis | bes/bes
}

<<
   \new ChordNames {
 \germanChords \scm
   }
   \context Voice { \scm }




NB altered bass notes are now printed like the root, i.e. C♯ not Cis.
Already ok? If not holler.


Imho, german chords in LilyPond are not correct and were never: as an
example, C♯ is never a _german_ naming

Also see my comment:
https://gitlab.com/lilypond/lilypond/-/issues/6305#note_890059707



Hraban




(Semi)German chords (B <-> H) with normal slash chords?

2022-04-26 Thread Boris Lau

Dear list,

I'm working on a songbook for german kids. Although I personally don't 
like them, I want to use German chord names (B and H exchanged). I could 
use \germanChords or \semiGermanChords to achieve that, but that also 
changes the behavior of slash chords:


B7 -> H7   <-- this is what I want
E/G# -> E/gis  <-- this is weird

Maybe some developer thought, that E/gis is how it's done in Germany.
I think it's rather uncommon and pretty ugly ;-)

But personal tastes aside, is there a way to get the B<->H thing without 
changing the slash chords?


Many thanks in advance,
Best, Boris

--
Dr. Boris Lau

+49 174 9436758
http://www.borislau.de
Im Ried 7a, 79249 Merzhausen, Germany



Re: German chords with uppercase bass

2022-04-09 Thread Henning Hraban Ramm

Am 09.04.22 um 12:02 schrieb Thomas Morley:

Am Fr., 8. Apr. 2022 um 20:57 Uhr schrieb Henning Hraban Ramm

I really would
like to get German chords (i.e. H instead of B) with uppercase bass
notes – as I know it from all my (German) songbooks.



\germanChords uses `chord-name->german-markup' to print the root-name
(chordRootNamer) of a chord and `note-name->german-markup' to print an
additional bass-note (chordNoteNamer).
If you comment the chordNoteNamer there, the chordRootNamer takes over.

germanChords = {
   \set chordRootNamer = #(chord-name->german-markup #t)
   %\set chordNoteNamer = #note-name->german-markup
}

scm = \chordmode {
c1/c | cis/cis
b1/b | bis/bis | bes/bes
}

<<
\new ChordNames {
  \germanChords \scm
}
\context Voice { \scm }




NB altered bass notes are now printed like the root, i.e. C♯ not Cis.
Already ok? If not holler.


Thank you! Since I don’t have altered bass notes in my current project, 
this would be enough. I didn’t think of those though, and it would be 
better to get "Cis/Cis" from \chordmode{ cis/cis }.



Imho, german chords in LilyPond are not correct and were never: as an
example, C♯ is never a _german_ naming


I guess, but I don’t have any serious musical education.
I can live with C# / Cb, but LilyPond displays the modificators very 
big, and that’s ugly. Might depend on the font. I’d expect them to be 
small and raised, like a footnote marker.



Also see my comment:
https://gitlab.com/lilypond/lilypond/-/issues/6305#note_890059707


I agree.


Hraban



Re: German chords with uppercase bass

2022-04-09 Thread Thomas Morley
Am Fr., 8. Apr. 2022 um 20:57 Uhr schrieb Henning Hraban Ramm
:
>
> Am 07.04.22 um 17:02 schrieb Henning Hraban Ramm:
> > As is shown e.g. in
> > https://lilypond.org/doc/v2.22/Documentation/snippets-big-page.de.html
> > “Changing the chord names to German or semi-German notation”,
> > \germanChords changes bass notes of chords like a:m/c to lowercase.
> >
> > I really would
> > like to get German chords (i.e. H instead of B) with uppercase bass
> > notes – as I know it from all my (German) songbooks.
> >
> > I’m sure there’s a clever setting or Scheme snippet for that.
> > Can you help me?
>
> Please, anyone?
>
> Hraban
>

\germanChords uses `chord-name->german-markup' to print the root-name
(chordRootNamer) of a chord and `note-name->german-markup' to print an
additional bass-note (chordNoteNamer).
If you comment the chordNoteNamer there, the chordRootNamer takes over.

germanChords = {
  \set chordRootNamer = #(chord-name->german-markup #t)
  %\set chordNoteNamer = #note-name->german-markup
}

scm = \chordmode {
   c1/c | cis/cis
   b1/b | bis/bis | bes/bes
}

<<
   \new ChordNames {
 \germanChords \scm
   }
   \context Voice { \scm }
>>

NB altered bass notes are now printed like the root, i.e. C♯ not Cis.
Already ok? If not holler.


Imho, german chords in LilyPond are not correct and were never: as an
example, C♯ is never a _german_ naming

Also see my comment:
https://gitlab.com/lilypond/lilypond/-/issues/6305#note_890059707

Cheers,
  Harm



Re: German chords with uppercase bass

2022-04-08 Thread Henning Hraban Ramm

Am 07.04.22 um 17:02 schrieb Henning Hraban Ramm:
As is shown e.g. in 
https://lilypond.org/doc/v2.22/Documentation/snippets-big-page.de.html 
“Changing the chord names to German or semi-German notation”, 
\germanChords changes bass notes of chords like a:m/c to lowercase.


I really would 
like to get German chords (i.e. H instead of B) with uppercase bass 
notes – as I know it from all my (German) songbooks.


I’m sure there’s a clever setting or Scheme snippet for that.
Can you help me?


Please, anyone?

Hraban



Re: German chords with uppercase bass

2022-04-07 Thread Henning Hraban Ramm

Am 07.04.22 um 17:05 schrieb David Kastrup:

Henning Hraban Ramm  writes:


As is shown e.g. in
https://lilypond.org/doc/v2.22/Documentation/snippets-big-page.de.html
“Changing the chord names to German or semi-German notation”,
\germanChords changes bass notes of chords like a:m/c to lowercase.

While I don’t believe that this is common in Germany, I really would
like to get German chords (i.e. H instead of B) with uppercase bass
notes – as I know it from all my (German) songbooks.


Any accordion music uses uppercase for bass notes and lowercase for
chords.


Ok, I’m guitar-centered. But it’s not about changing LilyPond’s default. 
I just want "\chormode{ g/b }" to display as "G/H".


Hraban




Re: German chords with uppercase bass

2022-04-07 Thread David Kastrup
Henning Hraban Ramm  writes:

> As is shown e.g. in
> https://lilypond.org/doc/v2.22/Documentation/snippets-big-page.de.html
> “Changing the chord names to German or semi-German notation”,
> \germanChords changes bass notes of chords like a:m/c to lowercase.
>
> While I don’t believe that this is common in Germany, I really would
> like to get German chords (i.e. H instead of B) with uppercase bass
> notes – as I know it from all my (German) songbooks.

Any accordion music uses uppercase for bass notes and lowercase for
chords.

-- 
David Kastrup



German chords with uppercase bass

2022-04-07 Thread Henning Hraban Ramm
As is shown e.g. in 
https://lilypond.org/doc/v2.22/Documentation/snippets-big-page.de.html 
“Changing the chord names to German or semi-German notation”, 
\germanChords changes bass notes of chords like a:m/c to lowercase.


While I don’t believe that this is common in Germany, I really would 
like to get German chords (i.e. H instead of B) with uppercase bass 
notes – as I know it from all my (German) songbooks.


I’m sure there’s a clever setting or Scheme snippet for that.
Can you help me?

Hraban

% MWE from the quoted snippet:

scm = \chordmode {
  c1/c | cis/cis
  b1/b | bis/bis | bes/bes
}

<<
  \new ChordNames {
\germanChords \scm
  }
  \context Voice { \scm }
>>



Re: Chords from Fretboard Diagrams

2022-03-27 Thread Carl Sorensen
On Sun, Mar 27, 2022 at 4:09 PM Kieren MacMillan <
kie...@kierenmacmillan.info> wrote:

> Hi Valentin,
>
> > this is unrelated to ChordNames. Rather it just remaps chords
> > from \chordmode depending on Fretboards.
>
> I don't know how they interact exactly… Carl: Any comment on whether or
> not there's any intersection between Valentin's work and the GSoC work you
> did/mentored?
>

As far as I know, there is no interaction.

I think Valentin's work takes the pitches from the FretBoards and turns the
pitches in the FretBoards into chords on a regular staff.

Charles's GSOC work was to store the name of the chord such that one knew
what chord name was intended, especially in cases where there may be
alternate chordnames for the same pitches.

Carl


Re: Chords from Fretboard Diagrams

2022-03-27 Thread Kieren MacMillan
Hi Valentin,

> this is unrelated to ChordNames. Rather it just remaps chords 
> from \chordmode depending on Fretboards.

I don't know how they interact exactly… Carl: Any comment on whether or not 
there's any intersection between Valentin's work and the GSoC work you 
did/mentored?

Thanks,
Kieren.


Re: Chords from Fretboard Diagrams

2022-03-27 Thread Valentin Petzel
Hi Kieren,

I do not know what GSoC you are refering to (I’m not a Lilypond veteran like 
yourself), but this is unrelated to ChordNames. Rather it just remaps chords 
from \chordmode depending on Fretboards.

Cheers,
Valentin

Am Sonntag, 27. März 2022, 22:14:35 CEST schrieb Kieren MacMillan:
> Hi Valentin,
> 
> > Recently I’ve created a small function to invert chords to match Fretboard
> > Diagrams, which I’d like to share with you all.
> 
> That's really cool!
> 
> Question: Does it take into account (or even need to?) the ChordNames GSoC
> work that was done a few years ago?
> 
> Thanks for this!
> Kieren.
> 
> 
> Kieren MacMillan, composer (he/him/his)
> ‣ website: www.kierenmacmillan.info
> ‣ email: kie...@kierenmacmillan.info



signature.asc
Description: This is a digitally signed message part.


Re: Chords from Fretboard Diagrams

2022-03-27 Thread Kieren MacMillan
Hi Valentin,

> Recently I’ve created a small function to invert chords to match Fretboard 
> Diagrams, which I’d like to share with you all.

That's really cool!

Question: Does it take into account (or even need to?) the ChordNames GSoC work 
that was done a few years ago?

Thanks for this!
Kieren.


Kieren MacMillan, composer (he/him/his)
‣ website: www.kierenmacmillan.info
‣ email: kie...@kierenmacmillan.info




Chords from Fretboard Diagrams

2022-03-27 Thread Valentin Petzel
Hello Ponders!

Recently I’ve created a small function to invert chords to match Fretboard 
Diagrams, which I’d like to share with you all.

Cheers,
Valentin#(define (normalize pitch)
   (if (>= (ly:pitch-alteration pitch) 1)
   (normalize (ly:pitch-transpose pitch (ly:make-pitch 0 1 -1)))
   (if (<= (ly:pitch-alteration pitch) -1)
   (normalize (ly:pitch-transpose pitch (ly:make-pitch 0 -1 1/2)))
   pitch)))

#(define (semitones->pitch st chord)
   (if (null? chord)
   (normalize (ly:make-pitch 0 0 (/ st 2)))
   (if (eqv? 0
 (modulo (-
  st
  (ly:pitch-semitones (car chord)))
 12))
   (let* ((ref-pitch (ly:make-pitch 0
(ly:pitch-notename (car chord))
(ly:pitch-alteration (car chord
  (ref-st (ly:pitch-semitones ref-pitch))
  (st-diff (- st ref-st)))
 (ly:make-pitch (/ st-diff 12)
(ly:pitch-notename (car chord))
(ly:pitch-alteration (car chord
   (semitones->pitch st (cdr chord)

#(define (defn-to-frets defn)
   (if (null? defn)
   defn
   (let ((string (cadar defn))
 (fret (cond ((eqv? (caar defn) 'open) 0)
 ((eqv? (caar defn) 'place-fret) (caddar defn))
 (else #f
 (if fret
   (cons (cons string fret) (defn-to-frets (cdr defn)))
   (defn-to-frets (cdr defn))

translateToChords =
#(define-music-function (fretboard-table tuning music) (hash-table? list? ly:music?)
   (define (iter music)
 (let ((elts (ly:music-property music 'elements))
   (elt (ly:music-property music 'element)))
   (if (music-is-of-type? music 'event-chord)
   (let* ((pitches (event-chord-pitches music))
  (hash-key (cons tuning pitches))
  (defn (hash-ref fretboard-table hash-key #f))
  (dparts (if defn (defn-to-frets defn)))
  (notes (event-chord-notes music))
  (dur (if (not (null? notes)) (ly:music-property (car notes) 'duration
 (if defn
 (let* ((notes (map
(lambda (def)
  (let* ((sno (car def))
 (rpi (list-ref tuning (1- sno)))
 (fret-no (cdr def))
 (root-st (ly:pitch-semitones rpi))
 (pitch (semitones->pitch (+ root-st fret-no)
  pitches)))
(if (< fret-no 0)
#f
(make-music 'NoteEvent
'pitch pitch
'duration dur
'articulations
(list (make-music
'StringNumberEvent
'string-number
sno
'tweaks
'((stencil . #f
dparts)))
   (ly:music-set-property! music 'elements
   (filter (lambda (x) x) notes)
   (begin
(if (not (null? elt))
(iter elt))
(for-each iter elts)
   (iter music)
   music)
 
 
\include "predefined-ukulele-fretboards.ly"

chordmusic = \relative {
  \chordmode {
g4 c a:m f
  }
}
<<
  \new ChordNames {
\chordmusic
  }
  \new FretBoards \with {
stringTunings = #ukulele-tuning
  } {
\chordmusic
  }
  \new Staff {
\translateToChords #default-fret-table #ukulele-tuning \chordmusic
  }
  \new TabStaff \with {
stringTunings = #ukulele-tuning
  } {
\translateToChords #default-fret-table #ukulele-tuning \chordmusic
  }
>>

signature.asc
Description: This is a digitally signed message part.


Re: How to catch post-events inside chords in an event listener?

2022-02-07 Thread Jean Abou Samra

Le 07/02/2022 à 20:17, Lukas-Fabian Moser a écrit :

Wow. Thanks. (And luckily Paris and Salzburg share a time zone.)

So here's what made me stumble: In scm/scheme-engravers.scm, we find

(define-public (event-has-articulation? event-type stream-event)
  "Is @var{event-type} in the @code{articulations} list of 
@var{stream-event}?"

  (if (ly:stream-event? stream-event)
  (any
   (lambda (evt-type) (eq? evt-type event-type))
   (append-map
    (lambda (art) (ly:prob-property art 'types))
    (ly:prob-property
 (ly:prob-property stream-event 'music-cause)
 'articulations)))
  #f))

written by Harm.

I wondered why this is not written as, for example:

(define-public (event-has-articulation? event-type stream-event)
  "Is @var{event-type} in the @code{articulations} list of 
@var{stream-event}?"

  (if (ly:stream-event? stream-event)
  (any
   (lambda (art-ev)
 (memq event-type (ly:event-property art-ev 'class)))
   (ly:event-property stream-event 'articulations))
  #f))

Or to be more precise, I made two changes only the first of which I 
actually understood:


1) "append-map"'ping the types of all articulations and then checking 
if "any" is "eq?" can certainly be simplified to checking if "any" 
fulfills a "memq". (Of course, this causes a 'true' return value to 
not being identical to #t, but that should be ok.)


2) But I wondered why Harm's code goes stream-event -> music-cause -> 
articulations -> 'types property instead of stream-event -> 
articulations -> 'class property.


Am I right now in thinking that Harm's code reads the articulations 
from the music objects that caused a stream event, while "my" variant 
only sees those articulations that survive into the stream event 
itself? And the difference would be that those articulations from 
non-chord notes for which there is a dedicated listener are removed, 
as David explained? (See example code below that seems to confirm this.)



That what David said and your example seems to prove it :-)
I'm not an expert in this area, I can't say much more.



And do I understand you correctly that the difference between Harm 
asking for 'types and me asking for 'class is just that for whatever 
historical reasons, the event classes of articulations-as-music is 
stored in 'types, whereas they are stored in 'class for 
articulations-as-stream-events?



About this I can say more though. What is 'types on
music does not necessarily end up being the same as
'class when the music becomes a stream event. Some
music types don't need to be applied to events even
when the respective music expression actually gets turned
into an event (unlike music expressions that never do, such
as SequentialMusic, etc.). For example, the post-event music
class (in 'types) matters to the parser during the music
processing phase, but is irrelevant to the translation
stage, and indeed it does not get carried over:

\version "2.22.1"

\new Voice \with {
  \consists #(lambda (context)
   (make-engraver
    (listeners
 ((tie-event engraver event)
  (ly:message "types: ~a   class: ~a"
  (ly:music-property (ly:event-property 
event 'music-cause)

 'types)
  (ly:event-property event 'class))
}
{ c'~ }

=> types: (post-event tie-event event)   class: (tie-event music-event 
StreamEvent)



Conversely, general event classes like music-event are
irrelevant in music processing (non-music-events are
internal events used to keep contexts in sync; see
the definition of StreamEvent in define-event-classes.scm).

'types and 'class thus have different origins. 'types
is just written verbatim in the definition of the music
"type", in define-music-types.scm. 'class gets initialized
by converting the name of the music expression to Scheme
style (NoteEvent -> note-event), and looking that up
among the predefined event classes, which are defined
according to a hierarchy in define-event-classes.scm
(the code is Music::to_event). I didn't investigate what
the hierarchical structure is useful for.

The conclusion is that while your refactoring won't
cause a difference for current usage with duration-line-event,
it could matter in other cases, not just because of
articulations deleted when they get broadcast, but
because 'types could have entries not in 'class.



If all of this is more-or-less true, I think I'd like to add some 
comments explaining this (to me, quite subtle) difference in the code. 
And anyhow, reading lily/music-scheme.cc and 
lily/stream-event-scheme.cc, I seem to understand that 
ly:prob-property directly specialises to ly:music-property and 
ly:event-property for music and (stream) events, so probably one 
could/should use the more specialised functions in Harm's code?




It depends on what you call specializing -- technically
speaking, internal_get_property is 

Re: How to catch post-events inside chords in an event listener?

2022-02-07 Thread Valentin Petzel
Hello Lukas,

I suppose the reason why Harm makes the detour over the music-cause is because 
the articulations-property might be deleted. Thus to make sure we get the 
original 
full articulations-property he uses the original music instead.

Using (memq x l) sounds very reasonable. Afterall memq can be rewritten as
(any (lambda y) (eq? x y)) l). The append-map Harms uses basically just changes 
to 
order so that first we extract all classes and then we check once, which does 
not 
really bring any advantage in performance (since we have to walk through all of 
them anyway). If anything this append-map solutions should be less efficient, 
as 
each type needs to be visited up to twice.

Cheers,
Valentin


signature.asc
Description: This is a digitally signed message part.


Re: How to catch post-events inside chords in an event listener?

2022-02-07 Thread Lukas-Fabian Moser

Hi Jean,

(CC'ing Harm because I'm using your code to demonstrate my ignorance.)


I'm just still confused as to the terminology of event "classes" vs. event 
"types" etc. But that's something for next week...
Allow me to take advance on next week by an hour, then (in Paris time, 
that is). The terms "music class" and "event class" are well-defined. 
But there is confusion because the 'types property of music objects 
holds music classes, and this is also what extract-typed-music uses. 
If you want to make an analogy with grobs, you would, on the contrary, 
use "type" for one music "definition" (that is the term the Internals 
Reference uses) and not a class grouping several of them. But in the 
context of grobs, a "class" is something else entirely, it refers to 
the four hardcoded grob classes Item, Spanner, Paper_column and 
System. What would most closely resemble music and event classes in 
the grob world is grob "interfaces". It's a holy mess ... 

Wow. Thanks. (And luckily Paris and Salzburg share a time zone.)

So here's what made me stumble: In scm/scheme-engravers.scm, we find

(define-public (event-has-articulation? event-type stream-event)
  "Is @var{event-type} in the @code{articulations} list of 
@var{stream-event}?"

  (if (ly:stream-event? stream-event)
  (any
   (lambda (evt-type) (eq? evt-type event-type))
   (append-map
    (lambda (art) (ly:prob-property art 'types))
    (ly:prob-property
 (ly:prob-property stream-event 'music-cause)
 'articulations)))
  #f))

written by Harm.

I wondered why this is not written as, for example:

(define-public (event-has-articulation? event-type stream-event)
  "Is @var{event-type} in the @code{articulations} list of 
@var{stream-event}?"

  (if (ly:stream-event? stream-event)
  (any
   (lambda (art-ev)
 (memq event-type (ly:event-property art-ev 'class)))
   (ly:event-property stream-event 'articulations))
  #f))

Or to be more precise, I made two changes only the first of which I 
actually understood:


1) "append-map"'ping the types of all articulations and then checking if 
"any" is "eq?" can certainly be simplified to checking if "any" fulfills 
a "memq". (Of course, this causes a 'true' return value to not being 
identical to #t, but that should be ok.)


2) But I wondered why Harm's code goes stream-event -> music-cause -> 
articulations -> 'types property instead of stream-event -> 
articulations -> 'class property.


Am I right now in thinking that Harm's code reads the articulations from 
the music objects that caused a stream event, while "my" variant only 
sees those articulations that survive into the stream event itself? And 
the difference would be that those articulations from non-chord notes 
for which there is a dedicated listener are removed, as David explained? 
(See example code below that seems to confirm this.)


And do I understand you correctly that the difference between Harm 
asking for 'types and me asking for 'class is just that for whatever 
historical reasons, the event classes of articulations-as-music is 
stored in 'types, whereas they are stored in 'class for 
articulations-as-stream-events?


If all of this is more-or-less true, I think I'd like to add some 
comments explaining this (to me, quite subtle) difference in the code. 
And anyhow, reading lily/music-scheme.cc and 
lily/stream-event-scheme.cc, I seem to understand that ly:prob-property 
directly specialises to ly:music-property and ly:event-property for 
music and (stream) events, so probably one could/should use the more 
specialised functions in Harm's code?


Lukas

\version "2.22"

#
(define (HARMevent-has-articulation? event-type stream-event)
  "Is @var{event-type} in the @code{articulations} list of 
@var{stream-event}?"

  (if (ly:stream-event? stream-event)
  (any
   (lambda (evt-type) (eq? evt-type event-type))
   (append-map
    (lambda (art) (ly:prob-property art 'types))
    (ly:prob-property
 (ly:prob-property stream-event 'music-cause)
 'articulations)))
  #f))

#
(define (LFMevent-has-articulation? event-type stream-event)
  "Is @var{event-type} in the @code{articulations} list of 
@var{stream-event}?"

  (if (ly:stream-event? stream-event)
  (any
   (lambda (art-ev)
 (memq event-type (ly:event-property art-ev 'class)))
   (ly:event-property stream-event 'articulations))
  #f))

#(define (test_engraver ctx)
   (make-engraver
    (listeners
 ((note-event engraver event)
  (format #t "Note ~a encountered at ~a.\n"
  (ly:event-property event 'pitch)
  (ly:context-current-moment ctx))
  (format #t "Do I have tie (Harm): ~a\n"
  (HARMevent-has-articulation? 'tie-event event))
  (format #t "Do I have tie (lfm): ~a\n\n"
  (LFMevent-has-articulation? 'tie-event event))

\new Voice \with {
  \consists #test_engraver
} {
  a~ % Tie not seen in stream event
   

Re: How to catch post-events inside chords in an event listener?

2022-02-06 Thread Valentin Petzel
Hi Lukas,

Yes, memq is totally safe here and theoretically faster. But the performance 
difference is not really noticeable in usual situations. And in my opinion the 
whole eq? eqv? and equal? thing is just too confusing for beginners of scheme, 
so I opt so sacrifice this small theoretical gain for not potentially confusing 
people trying to get into this.

Cheers,
Valentin

Am Sonntag, 6. Februar 2022, 22:52:00 CET schrieb Lukas-Fabian Moser:
> Hi Valentin,
> 
> Am 06.02.22 um 20:57 schrieb Valentin Petzel:
> > one could try something like this.
> 
> Yes, thanks, that's what did after David's explanations as well.
> 
> In my situation (where I'm using a custom event type not covered by any
> standard engravers), I can then dispose of the dedicated listener: This
> is essentially what happens for
> 
> \version "2.22"
> 
> #(define (test_engraver ctx)
>  (make-engraver
>   (listeners
> ;;; NOT NEEDED if Tie_engraver is removed
> ;  ((tie-event engraver event)
> ;   (format #t "Tie encountered at ~a.\n" (ly:context-current-moment
> ctx)))
>((note-event engraver event)
> (for-each
>  (lambda (art)
>(if (memq 'tie-event (ly:event-property art 'class))
>(format #t "Tie encountered at ~a.\n"
> (ly:context-current-moment ctx
>  (ly:event-property event 'articulations))
> 
> \layout {
> \context {
>   \Voice
>   \consists #test_engraver
>   \remove Tie_engraver
> }
> }
> 
> {
> a4~
> 
> a~
> a
> }
> 
> (I think it's safe to use memq instead of member.)
> 
> I'm just still confused as to the terminology of event "classes" vs.
> event "types" etc. But that's something for next week...
> 
> Lukas



signature.asc
Description: This is a digitally signed message part.


Re: How to catch post-events inside chords in an event listener?

2022-02-06 Thread Jean Abou Samra


> Le 6 févr. 2022 à 22:52, Lukas-Fabian Moser 
> I'm just still confused as to the terminology of event "classes" vs. event 
> "types" etc. But that's something for next week...



Allow me to take advance on next week by an hour, then (in Paris time, that 
is). The terms "music class" and "event class" are well-defined. But there is 
confusion because the 'types property of music objects holds music classes, and 
this is also what extract-typed-music uses. If you want to make an analogy with 
grobs, you would, on the contrary, use "type" for one music "definition" (that 
is the term the Internals Reference uses) and not a class grouping several of 
them. But in the context of grobs, a "class" is something else entirely, it 
refers to the four hardcoded grob classes Item, Spanner, Paper_column and 
System. What would most closely resemble music and event classes in the grob 
world is grob "interfaces". It's a holy mess ...

Jean


Re: How to catch post-events inside chords in an event listener?

2022-02-06 Thread Lukas-Fabian Moser

Hi Valentin,

Am 06.02.22 um 20:57 schrieb Valentin Petzel:

one could try something like this.


Yes, thanks, that's what did after David's explanations as well.

In my situation (where I'm using a custom event type not covered by any 
standard engravers), I can then dispose of the dedicated listener: This 
is essentially what happens for


\version "2.22"

#(define (test_engraver ctx)
    (make-engraver
 (listeners
;;; NOT NEEDED if Tie_engraver is removed
;  ((tie-event engraver event)
;   (format #t "Tie encountered at ~a.\n" (ly:context-current-moment 
ctx)))

  ((note-event engraver event)
   (for-each
    (lambda (art)
  (if (memq 'tie-event (ly:event-property art 'class))
  (format #t "Tie encountered at ~a.\n" 
(ly:context-current-moment ctx

    (ly:event-property event 'articulations))

\layout {
   \context {
 \Voice
 \consists #test_engraver
 \remove Tie_engraver
   }
}

{
   a4~
   
   a~
   a
}

(I think it's safe to use memq instead of member.)

I'm just still confused as to the terminology of event "classes" vs. 
event "types" etc. But that's something for next week...


Lukas




Re: How to catch post-events inside chords in an event listener?

2022-02-06 Thread Valentin Petzel
Hello Lukas,

one could try something like this.

Valentin

Am Sonntag, 6. Februar 2022, 16:31:31 CET schrieb Lukas-Fabian Moser:
> Folks,
> 
> probably I'm being stupid:
> 
> \version "2.22"
> 
> #(define (test_engraver ctx)
> (make-engraver
>  (listeners
>   ((tie-event engraver event)
>(format #t "Tie encountered at ~a.\n" (ly:context-current-moment
> ctx))
> 
> \layout {
>\context {
>  \Voice
>  \consists #test_engraver
>}
> }
> 
> {
>a4~
> % this one is not seen by the engraver
>a~
>a
> }
> 
> What do I have to do to make my custom engraver also see post-events
> (here, a tie, but in my context it's a custom event type) used inside
> chords?
> 
> Lukas

\version "2.22"

#(define (test_engraver ctx)
(make-engraver
 (listeners
  ((tie-event engraver event)
   (format #t "Tie encountered at ~a.\n" (ly:context-current-moment ctx)))
  ((note-event engraver event)
   (for-each
(lambda (art)
  (if (member 'tie-event (ly:event-property art 'class))
  (format #t "Tie encountered at ~a.\n" (ly:context-current-moment ctx
(ly:event-property event 'articulations)))
   )))

\layout {
   \context {
 \Voice
 \consists #test_engraver
   }
}

{
   a4~
% this one is not seen by the engraver
   a~
   a
}

signature.asc
Description: This is a digitally signed message part.


  1   2   3   4   5   6   7   8   9   10   >