lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Lilypond generates a chord from nowhere


From: Thomas Morley
Subject: Re: Lilypond generates a chord from nowhere
Date: Wed, 31 Dec 2014 15:25:29 +0100

2014-12-30 20:33 GMT+01:00 Stan Mulder <address@hidden>:
> I have a fretboard problem.
>
> I have defined a new fretboard for a plectrum banjo. Everything is working
> properly when I specify a chord, except when I specify a SLASH chord, i.e.,
> a chord with a designation for the bass player. So for example, if I specify
> a G half-diminished chord, all is well. But if I specify a G half-diminished
> chord with a D-flat in the bass, I get a fretboard fingering I don't 
> recognize.
>
> Okay: g:m7.5-
> Not okay: g:m7.5-/dflat
>
> Basically, I think the chord in both instances (with or without the slash
> notes) should be exactly the same fingerings.

Why should it?

Let me demonstrate a counter-example.

Look at the output from the following code (I refer to guitar, because
I don't know banjo).
I print not the ChordNames and FretBoards, but the Staff-context, so
that you better see what happens.

First you'll see the standard D7-chord.

Second is the same chord, adding lowered fifth in bass
a) It's close to impossible to play on the guitar while keeping the
fingerings for the standard D7 (same for other fingerings).
b) Also, in c-mojor this chord would be a
"double-dominant-seventh-chord with lowered fifth" (translating from
german, not sure whether it's proper english naming). In this case the
note "a" in the upper voices is simply a wrong note (annotated).
Add midi-output to hear it.

Third is the corrected chord with another voicing (others may be
possible as well) resulting in a different fingering.


annotation =
#(define-event-function (parser location m)(ly:music?)
  (if (music-is-of-type? m 'fingering-event)
      #{
        \tweak text
          \markup {
            \vcenter $(number->string (ly:music-property m 'digit))
            \normal-text
            \with-color #red
            \bold
            \vcenter "<- wrong Note"
          }
        $m
      #}
      m))

\relative c {
    \clef "G_8"
    \set fingeringOrientations = #'(right)
    <d-0 a'-2 c-1 fis-3 >1
    <aes-4 d-0 a'\annotation -2 c-1 fis-3 >
    <aes-2 fis'-3 c'-4 d-1 >
}

> How can I correct this?


Now let us see how this behaves with added ChordNames- and FretBoards-contexts.

Regard the code below. Compile it first without any uncommenting.

1) Because no lookup in the fretboard-table happens, LilyPond defaults
to the 'Automatic fret diagrams', see NR
You'll likely recognize none of the fretboards.

2) Uncommenting only the \include ... will give you acces to the
predefined fretboards and the D7-fretboard will come out as known.
But not the others, because they are _not_ stored in
"predefined-guitar-fretboards.ly"

3) Uncommenting
\storePredefinedDiagram #default-fret-table \chordmode { d:7/aes } ...
will return the now stored fretboard for the d:7/aes (which contains
the wrong note), but not for the corrected chord, because there's
still not a predefined fretboard for it.

4) Only uncommenting
\storePredefinedDiagram #default-fret-table \chordmode { d:7^5/aes } ...
will return correct output in all contexts.



%\include "predefined-guitar-fretboards.ly"
%{
\storePredefinedDiagram #default-fret-table \chordmode { d:7/aes }
#guitar-tuning  #'(
           (place-fret 6 4 2)
                   (mute 5)
                   (place-fret 4 4 3)
                   (place-fret 3 5 4)
                   (place-fret 2 3 1)
                   (mute 1)
                   )
%}
%{
\storePredefinedDiagram #default-fret-table \chordmode { d:7^5/aes }
#guitar-tuning  #'(
           (place-fret 6 4 2)
                   (mute 5)
                   (place-fret 4 4 3)
                   (place-fret 3 5 4)
                   (place-fret 2 3 1)
                   (mute 1)
                   )
%}
m =
\chordmode {
    \textLengthOn
    \override TextScript.self-alignment-X = #-0.12
    \override TextScript.font-size = #-3
    \override TextScript.baseline-skip = #1.5
    d1:7
      _"standard D7"
    d:7/aes
      _\markup \center-column {" D7" "lowered 5 in bass" "with wrong note" }
    d:7^5/aes
      _\markup \center-column { "D7" "lowered 5 in bass" "corrected" }
}

<<
  \new ChordNames \m
  \new FretBoards \m
  \new Staff \m
>>

Conclusio:
- It's correct (and intended) LilyPond-behaviour to handle chords with
added bass differently.
- If you want those chords displayed in a certain way, you have to
define them, so that LilyPond knows what you intend. Yes, it's
tedious. But I don't see a reasonable other method.

HTH,
  Harm



reply via email to

[Prev in Thread] Current Thread [Next in Thread]