Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chord letters from lilyjazz-text and symbols from lilyjazz-chord #3

Open
baloe opened this issue Mar 24, 2019 · 2 comments
Open

Chord letters from lilyjazz-text and symbols from lilyjazz-chord #3

baloe opened this issue Mar 24, 2019 · 2 comments

Comments

@baloe
Copy link

baloe commented Mar 24, 2019

Thank you for resolving the Major7 triangle issue. I took some time off but would like to now finally finalize setting up my lilypond jazz environment. I'm not a fan of the Chord font though, and I would like to reproduce the look in this demo.

My idea ist to set the chordname font to lilyjazz-text (instead of lilyjazz-chord) and then use lilyjazz-chord only for the special symbols (flat, sharp, triangle, etc.).
One can easily switch fonts in markup with \override #'(font-name . "lilyjazz-chord){some text}, but I can't quite figure out how to make this work in the definition of JazzChordNames below.

I tried to replace the line (markup ">") with (markup \override #'(font-name . "lilyjazz-chord){">"} but that throws an error. Do you have any ideo on how to make this work?

My backup strategy is to create an entirely new font file where I would combine the letters from lilyjazz-text with the musical symbols in lilyjazz-chord

#(define (JazzChordNames pitch majmin)	;majmin is a required argument for "chordNamer", but not used here
  (let* ((alt (ly:pitch-alteration pitch)))
    (make-line-markup
      (list
	(make-simple-markup
	  (vector-ref #("C" "D" "E" "F" "G" "A" "B")
	    (ly:pitch-notename pitch)))
	(if (= alt 0)			; alteration ?
	  (markup "")		; do nothing
	  (if (= alt FLAT)	; flat or sharp
	    (markup ">")
	    (markup "<")
	  )
	)
      )
    )
  )
)
...
% modify the default ChordNames context
\layout {
  \context {
    \ChordNames
    chordRootNamer = #JazzChordNames	% update the chord names
    chordNameExceptions = #JazzChords	% update the chord exceptions
    \override ChordName.font-name = #"lilyjazz-text"  % use the custom font for displaying the chords
  }
}
@microtherion
Copy link
Owner

I'll have to experiment a bit myself. The interaction between lilypond and scheme and the names used is a bit of a black art…

I'd also recommend testing your formatting at a number of different font sizes, to make sure it's scale independent.

@baloe
Copy link
Author

baloe commented Mar 25, 2019

I attempted the following after stumbling upon this. It compiles fine, but the #:override '(font-family . "lilyjazz-chord") has no impact either.

#(define (JazzChordNames pitch majmin)	;majmin is a required argument for "chordNamer", but not used here
  (let* ((alt (ly:pitch-alteration pitch)))
    (make-line-markup
      (list
	(make-simple-markup
	  (vector-ref #("C" "D" "E" "F" "G" "A" "B")
	    (ly:pitch-notename pitch)))
	(if (= alt 0)			; alteration ?
	  (markup "")		; do nothing
	  (if (= alt FLAT)	; flat or sharp
	    (markup #:override '(font-family . "lilyjazz-chord") ">")
	    (markup #:override '(font-family . "lilyjazz-chord") "<")
	  )
	)
      )
    )
  )
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants