lilypond-user
[Top][All Lists]
Advanced

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

Re: Bold Maj7 Triangle


From: Gregory Hollands
Subject: Re: Bold Maj7 Triangle
Date: Tue, 30 Nov 2021 14:55:24 -0500

Valentin,

Below, see my code.
Without \set, I get errors (below code).
With \set the code compiles just fine.

Regards,
Greg

% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - %

\version "2.22"

embiggenChordNames = #(define-scheme-function (size) (number?)
   #{ \with {
     chordNameFunction = #(lambda (in-pitches bass inversion context)
       (define exemptions (list musicglyph-markup))
       (define (helper mu)
         (if (list? mu)
           (if (memq (car mu) exemptions)
             (markup (#:fontsize (- size) mu))
             (map helper mu))
           mu))
       (let ((orig (ignatzek-chord-names in-pitches bass inversion context)))
         (markup (#:fontsize size (helper orig)))))
   } #} )

\paper {
  ragged-last = ##f
}

\layout {
  indent = #0
  \context { \ChordNames \embiggenChordNames #2.5 }
  \context {
    \ChordNames {
      %\set majorSevenSymbol = \markup { \fontsize #-3.5 \override #'(thickness . 0.3) \triangle ##f }
      %\set minorChordModifier = \markup { \small m }
      majorSevenSymbol = \markup { \fontsize #-3.5 \override #'(thickness . 0.3) \triangle ##f }
      minorChordModifier = \markup { \small m }
    }
  }
  \override ChordName #'font-name = #"Open Sans Soft Cd SemiBd"
  \override Staff.BarLine.hair-thickness = #4
  \override Staff.BarLine.thick-thickness = #8
}

IntroChords = \chordmode {
 
  a2:m7 bes2:6 c2:maj7 des2:9
 
 
  \set minorChordModifier = \markup { − }
  eis2:maj7 f2:dim g2:aug a2:m
}

<<
  \new ChordNames \with {
    \override BarLine.bar-extent = #'(-1 . 3.5)
    \consists "Bar_engraver"
  }
  \IntroChords
>>

% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - %

Starting lilypond-windows.exe 2.22.0 [Chord Triangle.ly]...
Processing `L:/Snippets/Chord Triangle.ly'
Parsing...
L:/Snippets/Chord Triangle.ly:30:7: error: not a note name: majorSevenSymbol
     
      majorSevenSymbol = \markup { \fontsize #-3.5 \override #'(thickness . 0.3) \triangle ##f }

L:/Snippets/Chord Triangle.ly:30:24: error: syntax error, unexpected '='
      majorSevenSymbol
                       = \markup { \fontsize #-3.5 \override #'(thickness . 0.3) \triangle ##f }

L:/Snippets/Chord Triangle.ly:30:26: error: markup outside of text script or \lyricmode
      majorSevenSymbol =
                         \markup { \fontsize #-3.5 \override #'(thickness . 0.3) \triangle ##f }

L:/Snippets/Chord Triangle.ly:31:7: error: not a note name: minorChordModifier
     
      minorChordModifier = \markup { \small m }

L:/Snippets/Chord Triangle.ly:31:26: error: syntax error, unexpected '='
      minorChordModifier
                         = \markup { \small m }

L:/Snippets/Chord Triangle.ly:31:28: error: markup outside of text script or \lyricmode
      minorChordModifier =
                           \markup { \small m }

L:/Snippets/Chord Triangle.ly:27:17: warning: Music unsuitable for context-mod
    \ChordNames
                {

Interpreting music...
Preprocessing graphical objects...
Finding the ideal number of pages...
Fitting music on 1 page...
Drawing systems...
Converting to `Chord Triangle.pdf'...
fatal error: failed files: "L:/Snippets/Chord Triangle.ly"
Exited with return code 1.

% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - %



On Tue, Nov 30, 2021 at 2:48 PM David Kastrup <dak@gnu.org> wrote:
Gregory Hollands <gregory.j.hollands@gmail.com> writes:

>> On Tue, Nov 30, 2021 at 2:15 PM Valentin Petzel <valentin@petzel.at> wrote:
>>
>>> Hello Gregory,
>>>
>>> That is indeed possible. The difference is just that \set is used to set
>>> context properties during
>>> music. Within the layout block you set context properties by simple
>>> assignment,
>>> so you’d do something like
>>>
>>> \layout {
>>>   \context {
>>>     \ChordNames
>>>     majorSevenSymbol = \markup\fontsize #-3 \override #'(thickness . 0.2)
>>> \triangle ##f
>>>   }
>>> }
>>>
>>> (you can also put \Score instead of \ChordNames, but it should not make a
>>> difference, as ChordNames is the only context that uses this property).
>
> FYI it still needs \set in front, otherwise lilypond throws an error.

You probably forgot the \context block here.  Please, please, please:
whenever you make a statement about some code, _include_ the code you
have actually been using and include the error message.

--
David Kastrup

reply via email to

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