[Top][All Lists]

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

Re: Rewrite chordnames - disentangle data from formatting (issue 2234200

From: Thomas Morley
Subject: Re: Rewrite chordnames - disentangle data from formatting (issue 223420043 by address@hidden)
Date: Thu, 16 Apr 2015 00:30:24 +0200

Hi Carl,

before going into details, let us decide how to proceed.

The current patch was intended to be not more than maintaining the
stuff different.
First step seemed to me putting the needed data into an alist.

2015-04-13 4:22 GMT+02:00  <address@hidden>:

> It seems to me that this patch is mostly maintaining the mix of parsing
> and display; it's just putting the stuff into a list first.

So you are absolutely right.

I think you would prefer to dig in deeper, though.

I tend to prefer letting it as is and push a polished version as a _first_ step.
And then tackle next step.

Doing all in one go might result in a too big patch, not feasable for
thorough revision anymore.

What do you think?

> scm/chord-ignatzek-names.scm:395: ;;;; Step 2: Define formatter for the
> chord-elements using this list
> I'm not sure how this separation between step 1 and step 2 really
> accomplishes the stated goal of the patch.  Can you give an example of
> how this makes it easier to define a new display style for a chord?

This patch doesn't pretend to provide a user-interface for it.
Already possible is the following, though.

#(define-public (my-chord-formatter
                pitches bass inversion
  (let* ((chrd (chord-info pitches bass inversion context))
         (exception-markup (assoc-get 'exception-markup chrd)))

      \markup {
        \override #'(baseline-skip . 1)
        \column {
          #(format-root chrd)
          #(let ((bass (format-bass chrd)))
              (if (not (equal? bass ""))

                      \column {
                          %% TODO adjust line automagically
                          %% I've a markup-command doing this
                          %% (but it's not really relevant for the example)
                        \draw-line #'(3.5 . 0)
                        \vspace #0.1
                        \small #(format-bass chrd)
        #(if exception-markup
               \markup {
                 \raise #2
                 \override #'(baseline-skip . 2)
                 \column {
                      \line {
                     #(format-alteration chrd)
                     #(format-suffixes chrd)
                     #(format-additions chrd)
                     \override #'(baseline-skip . 3)
                     #(format-main-name chrd)

 \layout {
     \context {
                chordNameFunction = #my-chord-formatter
         %additionalPitchPrefix = #"add"
         %majorSevenSymbol = #whiteTriangleMarkup
             %chordNameSeparator = ""
             %minorChordModifier = "m"
             slashChordSeparator = ""
             %chordPrefixSpacer = #5
             %#(make-hspace-markup 0.5)
             chordNameLowercaseMinor = ##t
             %chordNoteNamer = #note-name->german-list
             %chordRootNamer = #(chord-name->german-list #f)

 \new ChordNames
   \chordmode {
     \once \set Score.additionalPitchPrefix = #"add"
     c1:9^7 % Cadd9   root-3-5-9
     <bes, d fis>
     <c d>

Any formatting procedure could be replaced by a custom procedure ofcourse



reply via email to

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