RE: Ties in chord mode

2020-02-29 Thread Ben Eichler
Wow I’ve never seen that syntax before. Works perfectly for what I need, since 
I’m only printing chord letters in a ChordNames context. Thanks Thomas!

-Ben

From: Thomas Morley
Sent: 01 March 2020 07:38
To: Ben Eichler
Cc: lilypond-user
Subject: Re: Ties in chord mode

Am Sa., 29. Feb. 2020 um 11:07 Uhr schrieb Ben Eichler :
>
> Hi all,
>
>
> I transcribe songs using a style of melody + lyrics + chords. In certain 
> songs, I write the same chord twice. Sometimes I want both chords to be 
> printed, for example the second chord is starting a new section. Other times 
> I may want only the first chord to be printed. \set chordChanges = ##t is too 
> blunt an instrument (ha!) to deal with these situations. The only tool I am 
> aware of to deal with this is overflowing bar duration, but sometimes the 
> duration needs to be either irregular or longer than 6 beats, and having a 
> tie would become helpful.
>
> In a 4/4 time signature, if I want to make a chord last for 6 beats, I can 
> luckily work around it using a dotted duration that overflows the bar:
> Chord notation: |C . . . |(C) . F . |
> Lilypond notation: {\chordMode { c1. f2 }
>
> But suppose I want that C major chord to last only for 5 beats, in a melody I 
> would use a tie, but that doesn't work in chord mode, the second chord is 
> printed which I don't want:
> Chord notation: |C . . . |(C) F . . |
> Lilypond notation: \chordmode { c1( c4) f2. }
>
> Or maybe I want that C major chord to last for 3 bars. Multiple ties can be 
> used in a melody, but there's no equivalent in chord mode, the 2nd and 3rd 
> chords are printed which I don't want:
> Chord notation: |C . . . |(C) . . . |(C) . . . |
> Lilypond notation: \chordmode { c1( c c) }
>
> Unless anyone can recommend a workaround for this, I am submitting a request 
> to support ties in chord mode. The parentheses ( ) syntax used for melody 
> seems the obvious choice.
>
> Would appreciate any comments on this. If there's a more appropriate place to 
> submit requests like this I will gladly move it elsewhere.
>
> Thanks in advance,
>
>
> -Ben

Why not:

chrdI = \chordmode { c1. f2 }
chrdII = \chordmode { c1*5/4 f2. }
chrdIII = \chordmode { c1*3 }

<< \new Staff \chrdI \new ChordNames \chrdI >>
<< \new Staff \chrdII \new ChordNames \chrdII >>
<< \new Staff \chrdIII \new ChordNames \chrdIII >>

Cheers,
  Harm



Re: Ties in chord mode

2020-02-29 Thread Thomas Morley
Am Sa., 29. Feb. 2020 um 11:07 Uhr schrieb Ben Eichler :
>
> Hi all,
>
>
> I transcribe songs using a style of melody + lyrics + chords. In certain 
> songs, I write the same chord twice. Sometimes I want both chords to be 
> printed, for example the second chord is starting a new section. Other times 
> I may want only the first chord to be printed. \set chordChanges = ##t is too 
> blunt an instrument (ha!) to deal with these situations. The only tool I am 
> aware of to deal with this is overflowing bar duration, but sometimes the 
> duration needs to be either irregular or longer than 6 beats, and having a 
> tie would become helpful.
>
> In a 4/4 time signature, if I want to make a chord last for 6 beats, I can 
> luckily work around it using a dotted duration that overflows the bar:
> Chord notation: |C . . . |(C) . F . |
> Lilypond notation: {\chordMode { c1. f2 }
>
> But suppose I want that C major chord to last only for 5 beats, in a melody I 
> would use a tie, but that doesn't work in chord mode, the second chord is 
> printed which I don't want:
> Chord notation: |C . . . |(C) F . . |
> Lilypond notation: \chordmode { c1( c4) f2. }
>
> Or maybe I want that C major chord to last for 3 bars. Multiple ties can be 
> used in a melody, but there's no equivalent in chord mode, the 2nd and 3rd 
> chords are printed which I don't want:
> Chord notation: |C . . . |(C) . . . |(C) . . . |
> Lilypond notation: \chordmode { c1( c c) }
>
> Unless anyone can recommend a workaround for this, I am submitting a request 
> to support ties in chord mode. The parentheses ( ) syntax used for melody 
> seems the obvious choice.
>
> Would appreciate any comments on this. If there's a more appropriate place to 
> submit requests like this I will gladly move it elsewhere.
>
> Thanks in advance,
>
>
> -Ben

Why not:

chrdI = \chordmode { c1. f2 }
chrdII = \chordmode { c1*5/4 f2. }
chrdIII = \chordmode { c1*3 }

<< \new Staff \chrdI \new ChordNames \chrdI >>
<< \new Staff \chrdII \new ChordNames \chrdII >>
<< \new Staff \chrdIII \new ChordNames \chrdIII >>

Cheers,
  Harm



Workarounds for cross-staff

2020-02-29 Thread Paolo Prete
Hello,

I am doing some experiments with the cross-staff and I want to show you how
some limits and collisions can be bypassed through some workarounds that I
would like to automate.
Cross-staff is achieved through two basic commands:

1) \change Staff
2) \crossStaff

And I show you how both the first and second command can cause problems.

An example is the following, in which the TupletBracket produces collisions
with the NoteHead, as well as an incorrectly calculated Beam
( http://lilybin.com/m7bykt/1 )

%

\layout {
  \context {
\PianoStaff
\consists #Span_stem_engraver
  }
}

staffUp = \change Staff = "upper"
staffDown = \change Staff = "lower"

{
  \new PianoStaff <<
\new Staff = "upper" {
  s8 s  s
}
\new Staff = "lower"  {
  \stemDown
  \override TupletBracket.direction = #UP
  \override TupletBracket.bracket-visibility = ##t
  \tuplet 3/2 { \staffUp c''8[ \staffDown c' c'] }
}
  >>
}

%

I solved both problems with this workaround, by adding a fake hidden note
to the lower staff:
( http://lilybin.com/nv2o2o/1 )

%

\layout {
  \context {
\PianoStaff
\consists #Span_stem_engraver
  }
}

{
  \new PianoStaff <<
\new Staff = "upper" {
  \override TupletBracket.direction = #UP
  \override TupletBracket.staff-padding = 5
  \hide Rest
  \tuplet 3/2 { \ottava #1 \crossStaff c'''8 \ottava #0 r  r }
}
\new Staff = "lower"  {
  \stemDown
  \hide TupletBracket
  \hide TupletNumber
  \tuplet 3/2 { \once \hide NoteHead e'8[  c' c'] }
}
  >>
}

%


But there is still a problem: as you can see, the staff-padding property on
the TupletBracket is not set. This can be solved if I remove the \
crossStaff command, and manually adjust the stem length on the top staff

( http://lilybin.com/fl9qzx/1 )

%%

\layout {
  \context {
\PianoStaff
\consists #Span_stem_engraver
  }
}

{
  \new PianoStaff <<
\new Staff = "upper" \with {
  \override VerticalAxisGroup #'staff-staff-spacing =
#'((minimum-distance . 11)
 (padding .
-11))
}
{
  \override TupletBracket.direction = #UP
  \override TupletBracket.staff-padding = 5
  \once \override Stem.length = 30
  \once \hide Flag
  \hide Rest
  \tuplet 3/2 { \ottava #1 c'''8 \ottava #0 r  r }
}
\new Staff = "lower"  {
  \stemDown
  \hide TupletBracket
  \hide TupletNumber
  \tuplet 3/2 { \once \hide NoteHead e'8[ c' c'] }
}
  >>
}

%%

As you can see, by making all this manually, the problems disappear. At
this point I ask you: is it possible to automatically increase the length
of the stem in the upper staff until it meets a Beam or a aligned stem in
the lower staff?
Obviously this is accomplished via the \crossStaff command, but I wonder if
there is an alternative way to achieve the same automatic behavior.

Thanks for your attention and suggestions!
(Should/can I cross-post this to the dev ML as well?)


Piano Pedal placement

2020-02-29 Thread Martin Tarenskeen


I am experimenting a bit with piano sustainpedal notation (see attachments) and
have some questions:

- IMO by default *All* pedal markings are aligned too far to the left by
  default. Is there a reason for this, or is this a bug or something that
  needs improvement? This seems to be a structural problem.

- In my example I use some overrides to show how I think the pedalmarkings
  and brackets should be placed. Especially in "mixed" and
  "bracket"  pedalstyle, when I use \sustainOff\sustainOn the ^ should
  point exactly to the center of the notehead (I think?).  In most
  situations a trained pianist will do \sustainOff exactly *on* the start of
  a note or chord and \sustainOn directly *after* the note or chord.

- Question: Is there a shorthand for the frequently needed
  \sustainOff\sustainOn combination? a single command,
  something like \sustainSwitch, would be nice.

--

Martin Tarenskeen\version "2.19.83"
\pointAndClickOff


rh = \relative c' {
  \clef treble
  %\set Dynamics.pedalSustainStyle = #'text
  1_\markup \tiny "pedalSustainStyle = #'text" |
   |
   ~ | q |
  \bar "|."
  \break

  \set Dynamics.pedalSustainStyle = #'mixed
  1_\markup \tiny "pedalSustainStyle = #'mixed" |
   |
   ~ | q |
  \bar "|."
  \break

  \set Dynamics.pedalSustainStyle = #'bracket
  1_\markup \tiny "pedalSustainStyle = #'bracket" |
   |
   ~ | q |
  \bar "|."
}

lh = \relative c {
  \clef bass
  \repeat unfold 3 {
c1 | c | c ~ | c |
\bar "|."
  }
}

pedalA = {
  \repeat unfold 3 {
s1\sustainOn |
s1\sustainOff\sustainOn |
s1\sustainOff\sustainOn |
s2. s4\sustainOff |
  }
}

pedalB = {
 \override Dynamics.SustainPedal.self-alignment-X = #LEFT
 \override Dynamics.PianoPedalBracket.shorten-pair = #'(1 . -1)
  \repeat unfold 3 {
s1\sustainOn |
s1\sustainOff\sustainOn |
s1\sustainOff\sustainOn |
s2. s4\sustainOff |
  }
}

\header {
  title = "Sustain Pedal Test"
}

\score {
  \header { piece = "Default" }
  \new PianoStaff
  <<
\new Staff \rh
\new Staff \lh
\new Dynamics \pedalA
  >>
  \layout {}
}


\score {
  \header { piece = "Optimized" }
  \new PianoStaff
  <<
\new Staff \rh
\new Staff \lh
\new Dynamics \pedalB
  >>
  \layout {}
}


Sustain-Pedal.pdf
Description: Adobe PDF document


Split percent repeats at line breaks

2020-02-29 Thread Davide Liessi
Hi all.
I'd like to have percent repeats automatically split at line breaks,
i.e., in the following example I'd like the first score to look like
the second.

\version "2.19.84"
\score {
  \repeat percent 30 { c'1 }
}
\score {
  {
\repeat percent 14 { c'1 }
\repeat percent 16 { c'1 }
  }
}

I think that this should typically also reset the percent repeat
counter, effectively behaving as if they were distinct percent
repeats, but being able to choose whether to reset it or not would be
nice.

Is there a way to achieve this?

Best wishes.
Davide



Re: Ties in chord mode

2020-02-29 Thread Klaus Blum
Hi Ben, 


Ben Eichler wrote
> suppose I want that C major chord to last only for 5 beats, in a melody
> I would use a tie, but that doesn't work in chord mode, the second chord
> is
> printed which I don't want:
> Chord notation: |C . . . |(C) F . . |
> Lilypond notation: \chordmode { c1( c4) f2. }

If you don't need MIDI output  from your Ly file, you can put invisible
rests into the chords: 

% ---
\version "2.19.83"

<<
  \new ChordNames \chordmode {
c1
s4 f s s
  }
  \new Staff \relative c' {
\repeat unfold 8 {c4} 
  }
>>
% ---

Am I right that you don't want the chord symbols you've put in parentheses? 
If you want an output like  |  C   | (C) F  | you can write
c1 \parenthesize c4 f2.

Cheers, 
Klaus



--
Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html



Re: default stem directions

2020-02-29 Thread Torsten Hämmerle
Rick Kimpel-2 wrote
> I am trying to learn how to change the default stem directions.
> […]
> ...without having to do all the \stemUp \stemDown stuff.
> I'm ok with the manual beaming.

Hi Rick,

You could set up a custom function.
A simplistic example (see below) will read the 'default direction.
As you have already noticed, the default stem direction will be #UP for note
heads below the middle stave line and #DOWN otherwise.

Obviously, you'd like to have it the other way round. The custom function
will give back #DOWN if the default direction is #UP, and #DOWN otherwise).

%%
\version "2.19.83" 

#(define (custom-stemdir)
   (lambda (grob)
 (let ((defdir (ly:grob-property grob 'default-direction)))
   (if (= defdir UP) DOWN UP

\score { 
  \new Staff 
  \with { \override StaffSymbol.line-count =  #1 } 
  { 
\clef percussion 
\numericTimeSignature 
\autoBeamOff 
\relative c' {
  <>^"default"
  b8 c4 c8 b8[ b] b c |
  <>^"custom"
  \override Stem.direction = #(custom-stemdir)
  b8 c4 c8 b8[ b] b c |
} 
  } 
} 
%%

 

HTH,
Torsten
custom-stemdir.png
  



--
Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html



Ties in chord mode

2020-02-29 Thread Ben Eichler
Hi all,


I transcribe songs using a style of melody + lyrics + chords. In certain
songs, I write the same chord twice. Sometimes I want both chords to be
printed, for example the second chord is starting a new section. Other
times I may want only the first chord to be printed. \set chordChanges =
##t is too blunt an instrument (ha!) to deal with these situations. The
only tool I am aware of to deal with this is overflowing bar duration, but
sometimes the duration needs to be either irregular or longer than 6 beats,
and having a tie would become helpful.

In a 4/4 time signature, if I want to make a chord last for 6 beats, I can
luckily work around it using a dotted duration that overflows the bar:
Chord notation: |C . . . |(C) . F . |
Lilypond notation: {\chordMode { c1. f2 }

But suppose I want that C major chord to last only for 5 beats, in a melody
I would use a tie, but that doesn't work in chord mode, the second chord is
printed which I don't want:
Chord notation: |C . . . |(C) F . . |
Lilypond notation: \chordmode { c1( c4) f2. }

Or maybe I want that C major chord to last for 3 bars. Multiple ties can be
used in a melody, but there's no equivalent in chord mode, the 2nd and 3rd
chords are printed which I don't want:
Chord notation: |C . . . |(C) . . . |(C) . . . |
Lilypond notation: \chordmode { c1( c c) }

Unless anyone can recommend a workaround for this, I am submitting a
request to support ties in chord mode. The parentheses ( ) syntax used for
melody seems the obvious choice.

Would appreciate any comments on this. If there's a more appropriate place
to submit requests like this I will gladly move it elsewhere.

Thanks in advance,


-Ben