\version "2.16.0" % preliminary LilyJAZZ version for testing purposes \paper { indent = #0 } %*********************************************************************** % MAPPING ALISTS / LOOKUP TABLES %*********************************************************************** % MAPPING ALIST: GLYPH NAME TO UNICODE CHAR NUMBER ===================== #(define jazz-map '( ("noteheads.s0jazz" . #xe191) ("noteheads.s1jazz" . #xe192) ("noteheads.s2jazz" . #xe193) ("noteheads.s0slashjazz" . #xe19c) ("noteheads.s1slashjazz" . #xe19d) ("noteheads.s2slashjazz" . #xe19e) ("noteheads.s2crossjazz" . #xe1a1) ("flags.u3jazz" . #xe21c) ("flags.u4jazz" . #xe21d) ("flags.u5jazz" . #xe21e) ("flags.u6jazz" . #xe21f) ("flags.u7jazz" . #xe220) ("flags.d3jazz" . #xe221) ("flags.d4jazz" . #xe222) ("flags.d5jazz" . #xe223) ("flags.d6jazz" . #xe224) ("flags.d7jazz" . #xe225) ("flags.ugracejazz" . #xe226) ("flags.dgracejazz" . #xe227) ("dots.dot" . #xe131) ("accidentals.doublesharpjaz" . #xe126) ("accidentals.sharpjazz" . #xe10f) ("accidentals.naturaljazz" . #xe117) ("accidentals.flatjazz" . #xe11b) ("accidentals.flatflatjazz" . #xe124) ("accidentals.rightparenjaz" . #xe127) ("accidentals.leftparenjazz" . #xe128) ("rests.mmendjazz" . #xe0f8) ("rests.0jazz" . #xe100) ("rests.1jazz" . #xe101) ("rests.0ojazz" . #xe102) ("rests.1ojazz" . #xe103) ("rests.2jazz" . #xe108) ("rests.3jazz" . #xe10a) ("rests.4jazz" . #xe10b) ("rests.5jazz" . #xe10c) ("rests.6jazz" . #xe10d) ("rests.7jazz" . #xe10e) ("clefs.Fjazz" . #xe170) ("scripts.ufermatajazz" . #xe132) ("scripts.dfermatajazz" . #xe133) ("scripts.asteriskjazz" . #xe138) ("scripts.sforzatojazz" . #xe13b) ("scripts.esprjazz" . #xe13c) ("scripts.staccatojazz" . #xe13d) ("scripts.tenutojazz" . #xe140) ("scripts.uportatojazz" . #xe141) ("scripts.dportatojazz" . #xe142) ("scripts.umarcatojazz" . #xe143) ("scripts.dmarcatojazz" . #xe144) ("scripts.openjazz" . #xe145) ("scripts.stoppedjazz" . #xe148) ("scripts.trilljazz" . #xe14d) ("scripts.segnojazz" . #xe153) ("scripts.varsegnojazz" . #xe154) ("scripts.codajazz" . #xe155) ("scripts.varcodajazz" . #xe156) ("scripts.trill_elementjazz" . #xe15c) ("scripts.trilelementjazz" . #xe15f) ("scripts.pralljazz" . #xe160) ("scripts.prallpralljazz" . #xe162) ("clefs.F_changejazz" . #xe171) ("clefs.Gjazz" . #xe172) ("clefs.G_changejazz" . #xe173) ("timesig.C44jazz" . #xe178) ("timesig.C22jazz" . #xe179) ("zerojazz" . #x0030) ("onejazz" . #x0031) ("twojazz" . #x0032) ("threejazz" . #x0033) ("fourjazz" . #x0034) ("fivejazz" . #x0035) ("sixjazz" . #x0036) ("sevenjazz" . #x0037) ("eightjazz" . #x0038) ("ninejazz" . #x0039) ("Fjazz" . #x0046) ("fjazz" . #x0066) ("mjazz" . #x006d) ("pjazz" . #x0070) ("rjazz" . #x0072) ("sjazz" . #x0073) ("zjazz" . #x007a))) #(define jazz-alteration-glyph-name-alist '((0 . "accidentals.naturaljazz") (-1/2 . "accidentals.flatjazz") (1/2 . "accidentals.sharpjazz") (1 . "accidentals.doublesharpjaz") (-1 . "accidentals.flatflatjazz"))) %*********************************************************************** % JAZZ GLYPH ACCESS %*********************************************************************** #(define-markup-command (jazzchar layout props charnum) (number?) "char for jazz characters" (interpret-markup layout props (markup (#:fontsize 5 #:override '(font-name . "LilyJAZZ") #:char charnum)))) % JAZZGLYPH: REPLACEMENT FOR MUSICGLYPH ================================ #(define-markup-command (jazzglyph layout props glyphname) (string?) "musicglyph replacemet for jazz (i. e. non-Feta) characters" (let* ((charnum (cdr (assoc glyphname jazz-map)))) (interpret-markup layout props (markup (#:fontsize 5 #:override '(font-name . "LilyJAZZ") #:char charnum))))) %*********************************************************************** % JAZZ CLEFS %*********************************************************************** #(define (jazz-clef grob) "jazz clef stencil" (let* ((glyphname (string-append (ly:grob-property grob 'glyph-name) "jazz"))) (if (pair? (assoc glyphname jazz-map)) (grob-interpret-markup grob (markup #:jazzglyph glyphname)) (ly:clef::print grob)))) %*********************************************************************** % KEY SIGNATURES %*********************************************************************** #(define (jazz-keysig grob) "stencil: jazz key signature (including cancellation)" (let* ((altlist (ly:grob-property grob 'alteration-alist)) (c0pos (ly:grob-property grob 'c0-position)) (keysig-stencil '())) (for-each (lambda (alt) (let* ((alteration (if (grob::has-interface grob 'key-cancellation-interface) 0 (cdr alt))) (glyphname (assoc-get alteration jazz-alteration-glyph-name-alist "")) (padding (cond ((< alteration 0) 0.25) ; any kind of flat ((= alteration 0) 0.05) ; natural ((< alteration 1) 0.1) ; sharp (less than double sharp) (else -0.4))) ; double sharp (ypos (key-signature-interface::alteration-position (car alt) (cdr alt) c0pos)) (acc-stencil (grob-interpret-markup grob (markup #:raise (/ ypos 2) #:jazzglyph glyphname)))) (set! keysig-stencil (ly:stencil-combine-at-edge acc-stencil X RIGHT keysig-stencil padding)))) altlist) keysig-stencil)) %*********************************************************************** % TIME SIGNATURE %*********************************************************************** #(define (jazz-timesig grob) (let* ((style (ly:grob-property grob 'style)) (fraction (ly:grob-property grob 'fraction)) (glyphname (if (equal? style 'C) (cond ((equal? fraction '(4 . 4)) "timesig.C44jazz") ((equal? fraction '(2 . 2)) "timesig.C22jazz") (else "")) ""))) (if (equal? glyphname "") (ly:time-signature::print grob) (grob-interpret-markup grob (markup #:fontsize -5 #:jazzglyph glyphname))))) %*********************************************************************** % NOTE HEADS %*********************************************************************** #(define (jazz-notehead grob) "stencil: jazz noteheads" (let* ((log (ly:grob-property grob 'duration-log))) (set! (ly:grob-property grob 'stem-attachment) '(1.0 . 0.35)) (grob-interpret-markup grob (cond ((<= log 0) (markup #:jazzglyph "noteheads.s0jazz")) ((<= log 1) (markup #:jazzglyph "noteheads.s1jazz")) (else (markup #:jazzglyph "noteheads.s2jazz")))))) %*********************************************************************** % FLAGS %*********************************************************************** #(define (jazz-flag grob) "stencil: jazz flags" (let* ((stem-grob (ly:grob-parent grob X)) (log (ly:grob-property stem-grob 'duration-log)) (dir (ly:grob-property stem-grob 'direction)) (stem-width (* (ly:staff-symbol-line-thickness grob) (ly:grob-property stem-grob 'thickness))) (glyphname (string-append "flags." (if (> dir 0) "u" "d") (number->string log) "jazz")) (flag-stencil (grob-interpret-markup grob (markup #:jazzglyph glyphname))) (flag-pos (cons (* stem-width -1) 0)) (stroke-style (ly:grob-property grob 'stroke-style)) (stroke-stencil (if (equal? stroke-style "grace") (if (equal? dir UP) (make-line-stencil 0.15 -0.5 -1.6 0.75 -0.6) (make-line-stencil 0.15 -0.4 1.6 0.85 0.6)) ; (grob-interpret-markup grob (markup #:jazzglyph "flags.ugracejazz")) ; (grob-interpret-markup grob (markup #:jazzglyph "flags.dgracejazz"))) empty-stencil))) (ly:stencil-translate (ly:stencil-add flag-stencil stroke-stencil) flag-pos))) %*********************************************************************** % DOTS (DURATION) %*********************************************************************** #(define (jazz-dots grob) "stencil: jazz duration dots" (let* ((dot-count (ly:grob-property grob 'dot-count))) (grob-interpret-markup grob (markup (if (>= dot-count 1) (markup #:translate '(0.4 . 0) #:jazzglyph "dots.dot") (markup #:null)) (if (>= dot-count 2) (markup #:translate '(0.25 . 0) #:jazzglyph "dots.dot") (markup #:null)) (if (>= dot-count 3) (markup #:translate '(0.25 . 0) #:jazzglyph "dots.dot") (markup #:null)) (if (>= dot-count 4) (markup #:translate '(0.25 . 0) #:jazzglyph "dots.dot") (markup #:null)) (if (>= dot-count 5) (markup #:translate '(0.25 . 0) #:jazzglyph "dots.dot") (markup #:null)))))) %*********************************************************************** % ACCIDENTALS %*********************************************************************** % ACCIDENTALS (MUSICAL CONTEXT) ======================================== #(define (jazz-accidental grob) "stencil: jazz accidentals in front of notes or used as suggestions" (let* ((alt (ly:grob-property grob 'alteration)) (show (if (null? (ly:grob-property grob 'forced)) (if (null? (ly:grob-object grob 'tie)) #t #f ) #t ))) (if (equal? show #t) (grob-interpret-markup grob (markup #:jazzglyph (assoc-get alt jazz-alteration-glyph-name-alist ""))) (ly:accidental-interface::print grob)))) % CAUTIONARY ACCIDENTALS (MUSICAL CONTEXT) ============================= #(define (jazz-accidental-cautionary grob) "stencil: jazz cautionary accidentals in front of notes" (let* ((alt (ly:grob-property grob 'alteration))) (grob-interpret-markup grob (case alt ((1) (markup #:concat ( #:translate '(0 . -0.05) #:jazzglyph "accidentals.leftparenjazz" #:jazzglyph "accidentals.doublesharpjaz" #:translate '(0 . 0.05) #:jazzglyph "accidentals.rightparenjaz" ))) ((1/2) (markup #:concat ( #:translate '(0 . -0.1) #:jazzglyph "accidentals.leftparenjazz" #:jazzglyph "accidentals.sharpjazz" #:translate '(0 . 0.3) #:jazzglyph "accidentals.rightparenjaz" ))) ((0) (markup #:concat ( #:translate '(0.1 . 0) #:rotate 5 #:jazzglyph "accidentals.leftparenjazz" #:jazzglyph "accidentals.naturaljazz" #:translate '(0.05 . 0.3) #:rotate 5 #:jazzglyph "accidentals.rightparenjaz" ))) ((-1/2) (markup #:concat ( #:translate '(-0.15 . 0.3) #:jazzglyph "accidentals.leftparenjazz" #:jazzglyph "accidentals.flatjazz" #:translate '(0 . 0.2) #:jazzglyph "accidentals.rightparenjaz" ))) ; ((-1) (markup #:concat ( #:translate '(-0.15 . 0.5) #:jazzglyph "accidentals.leftparenjazz" #:jazzglyph "accidentals.flatflatjazz" #:translate '(-0.1 . 0.4) #:jazzglyph "accidentals.rightparenjaz" ))))))) %*********************************************************************** % RESTS %*********************************************************************** #(define (jazz-rest grob) (let* ((duration (ly:grob-property grob 'duration-log)) (glyphname (string-append "rests." (number->string duration) "jazz"))) (grob-interpret-markup grob (markup #:jazzglyph glyphname)))) %*********************************************************************** % DYNAMICS %*********************************************************************** sfpp = #(make-dynamic-script "sfpp" ) % re-defined because of spefilal f with horizontal bar for ligatures/grouping: ff = #(make-dynamic-script "FF" ) fff = #(make-dynamic-script "FFF" ) ffff = #(make-dynamic-script "FFFF" ) fffff = #(make-dynamic-script "FFFFF" ) % to do: make reversible for \jazzOff #(define-markup-command (dynamic layout props arg) (markup?) #:category font "Use jazz instead of feta for dynamic markup font." (interpret-markup layout props (markup #:fontsize 5 #:override '(font-name . "LilyJAZZ") arg))) %*********************************************************************** % ACCENTS %*********************************************************************** #(define (jazz-articulation grob) (let* ((dir (ly:grob-property grob 'direction)) (var (ly:grob-property grob 'script-stencil)) (glyphname (if (= dir DOWN) (car (cdr var)) (cdr (cdr var)))) (jazzchar (assoc-get (string-append "scripts." glyphname "jazz") jazz-map 0 ))) (if (> jazzchar 0) (grob-interpret-markup grob (markup #:jazzchar jazzchar)) (ly:script-interface::print grob)))) fermataMarkup = #(make-music 'MultiMeasureTextEvent 'tweaks (list ;; Set the 'text based on the 'direction (cons 'text (lambda (grob) (if (eq? (ly:grob-property grob 'direction) DOWN) (markup #:concat (" " #:jazzglyph "scripts.dfermatajazz")) (markup #:concat (" " #:jazzglyph "scripts.ufermatajazz"))))) (cons 'outside-staff-priority 40) (cons 'outside-staff-padding 0))) makeUnpurePureContainer = #(ly:make-unpure-pure-container ly:grob::stencil-height (lambda (grob start end) (ly:grob::stencil-height grob))) \layout { \override Staff.Clef #'stencil = #jazz-clef \override Score.BarNumber #'stencil = ##f \override Staff.KeySignature #'stencil = #jazz-keysig \override Staff.KeyCancellation #'stencil = #jazz-keysig \override Staff.TimeSignature #'stencil = #jazz-timesig \override Staff.NoteHead #'stencil = #jazz-notehead \override Staff.NoteHead #'Y-extent = \makeUnpurePureContainer \override Staff.Stem #'thickness = #2 \override Staff.Beam #'beam-thickness = #0.55 \override Staff.Flag #'stencil = #jazz-flag \override Staff.Flag #'Y-extent = \makeUnpurePureContainer \override Staff.Dots #'stencil = #jazz-dots \override Staff.Accidental #'stencil = #jazz-accidental \override Staff.Accidental #'Y-extent = \makeUnpurePureContainer \override Staff.AccidentalCautionary #'stencil = #jazz-accidental-cautionary \override Staff.AccidentalCautionary #'Y-extent = \makeUnpurePureContainer \override Staff.AccidentalSuggestion #'stencil = #jazz-accidental \override Staff.AccidentalSuggestion #'Y-extent = \makeUnpurePureContainer \override Staff.Script #'stencil = #jazz-articulation \override Staff.Rest #'stencil = #jazz-rest \override Staff.Slur #'thickness = #2.5 \override Staff.Tie #'thickness = #2.5 \override Staff.BarLine #'hair-thickness = #3 \override Score.BarNumber #'font-name = #"LilyJAZZ Text" \override Staff.TimeSignature #'font-name = #"LilyJAZZ" \override Staff.TimeSignature #'font-size = #5 \override Staff.DynamicText #'font-name = #"LilyJAZZ" \override Staff.DynamicText #'font-size = #6 \override Score.RehearsalMark #'font-name = #"LilyJAZZ Text" \override Score.MetronomeMark #'font-name = #"LilyJAZZ Text" \override Staff.TextScript #'font-name = #"LilyJAZZ Text" \override Staff.TextScript #'font-size = #1 \override Staff.InstrumentName #'font-name = #"LilyJAZZ Text" \override Staff.TupletNumber #'font-name = "LilyJAZZ Text" \override Staff.TupletBracket #'thickness = #1.5 \override Score.VoltaBracket #'font-name = #"LilyJAZZ Text" \override Score.VoltaBracket #'font-size = #0 \override Score.VoltaBracket #'thickness = #2 } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % for version 2.17.28 #(define (pitch-step p) "Musicological notation for an interval. Eg. C to D is 2." (+ 1 (ly:pitch-steps p))) #(define (conditional-string-downcase str condition) (if condition (string-downcase str) str)) #(define (get-step x ps) "Does PS have the X step? Return that step if it does." (if (null? ps) #f (if (= (- x 1) (ly:pitch-steps (car ps))) (car ps) (get-step x (cdr ps))))) #(define (replace-step p ps) "Copy PS, but replace the step of P in PS." (if (null? ps) '() (let* ((t (replace-step p (cdr ps)))) (if (= (ly:pitch-steps p) (ly:pitch-steps (car ps))) (cons p t) (cons (car ps) t))))) #(define (remove-step x ps) "Copy PS, but leave out the Xth step." (if (null? ps) '() (let* ((t (remove-step x (cdr ps)))) (if (= (- x 1) (ly:pitch-steps (car ps))) t (cons (car ps) t))))) #(define (split-at-predicate pred lst) "Split LST into two lists at the first element that returns #f for (PRED previous_element element). Return the two parts as a pair. Example: (split-at-predicate < '(1 2 3 2 1)) ==> ((1 2 3) . (2 1))" (let ((i (and (pair? lst) (list-index (lambda (x y) (not (pred x y))) lst (cdr lst))))) (if i (call-with-values (lambda () (split-at lst (1+ i))) cons) (list lst)))) #(define (natural-chord-alteration p) "Return the natural alteration for step P." (if (= (ly:pitch-steps p) 6) FLAT 0)) #(define (conditional-kern-before markup bool amount) (if bool (make-line-markup (list (make-hspace-markup amount) markup)) markup)) #(define (markup-join markups sep) "Return line-markup of MARKUPS, joining them with markup SEP" (if (pair? markups) (make-line-markup (list-insert-separator markups sep)) empty-markup)) #(define-public (ignatzek-jazz-chord-names in-pitches bass inversion context) (define (remove-uptil-step x ps) "Copy PS, but leave out everything below the Xth step." (if (null? ps) '() (if (< (ly:pitch-steps (car ps)) (- x 1)) (remove-uptil-step x (cdr ps)) ps))) (define name-root (ly:context-property context 'chordRootNamer)) (define name-note (let ((nn (ly:context-property context 'chordNoteNamer))) (if (eq? nn '()) ;; replacing the next line with name-root gives guile-error...? -rz ;; apparently sequence of defines is equivalent to let, not let* ? -hwn (ly:context-property context 'chordRootNamer) ;; name-root nn))) (define (is-natural-alteration? p) (= (natural-chord-alteration p) (ly:pitch-alteration p))) (define (ignatzek-format-chord-name root prefix-modifiers main-name alteration-pitches addition-pitches suffix-modifiers bass-pitch lowercase-root?) "Format for the given (lists of) pitches. This is actually more work than classifying the pitches." (define (filter-main-name p) "The main name: don't print anything for natural 5 or 3." (if (or (not (ly:pitch? p)) (and (is-natural-alteration? p) (or (= (pitch-step p) 5) (= (pitch-step p) 3)))) '() (list (name-step p)))) (define (glue-word-to-step word x) (make-line-markup (list (make-simple-markup word) (name-step x)))) (define (suffix-modifier->markup mod) (if (or (= 4 (pitch-step mod)) (= 2 (pitch-step mod))) (glue-word-to-step "sus" mod) (glue-word-to-step "huh" mod))) (define (prefix-modifier->markup mod) (if (and (= 3 (pitch-step mod)) (= FLAT (ly:pitch-alteration mod))) (if lowercase-root? empty-markup (ly:context-property context 'minorChordModifier)) (make-simple-markup "huh"))) (define (filter-alterations alters) "Filter out uninteresting (natural) pitches from ALTERS." (define (altered? p) (not (is-natural-alteration? p))) (if (null? alters) '() (let* ((lst (filter altered? alters)) (lp (last-pair alters))) ;; we want the highest also if unaltered (if (and (not (altered? (car lp))) (> (pitch-step (car lp)) 5)) (append lst (last-pair alters)) lst)))) (define (name-step pitch) (define (step-alteration pitch) (- (ly:pitch-alteration pitch) (natural-chord-alteration pitch))) (let* ((num-markup (make-simple-markup (number->string (pitch-step pitch)))) (args (list num-markup)) (total (if (= (ly:pitch-alteration pitch) 0) (if (= (pitch-step pitch) 7) (list (ly:context-property context 'majorSevenSymbol)) args) (cons (accidental->jazz-markup (step-alteration pitch)) args)))) (make-line-markup total))) (let* ((sep (ly:context-property context 'chordNameSeparator)) (slashsep (ly:context-property context 'slashChordSeparator)) (root-markup (name-root root lowercase-root?)) (add-pitch-prefix (ly:context-property context 'additionalPitchPrefix)) (add-markups (map (lambda (x) (glue-word-to-step add-pitch-prefix x)) addition-pitches)) (filtered-alterations (filter-alterations alteration-pitches)) (alterations (map name-step filtered-alterations)) (suffixes (map suffix-modifier->markup suffix-modifiers)) (prefixes (map prefix-modifier->markup prefix-modifiers)) (main-markups (filter-main-name main-name)) (to-be-raised-stuff (markup-join (append main-markups alterations suffixes add-markups) sep)) (base-stuff (if (ly:pitch? bass-pitch) (list slashsep (name-note bass-pitch #f)) '()))) (set! base-stuff (append (list root-markup (conditional-kern-before (markup-join prefixes sep) (and (not (null? prefixes)) (= (ly:pitch-alteration root) NATURAL)) (ly:context-property context 'chordPrefixSpacer)) (make-super-markup to-be-raised-stuff)) base-stuff)) (make-line-markup base-stuff))) (define (ignatzek-format-exception root exception-markup bass-pitch lowercase-root?) (make-line-markup `( ,(name-root root lowercase-root?) ,exception-markup . ,(if (ly:pitch? bass-pitch) (list (ly:context-property context 'slashChordSeparator) (name-note bass-pitch #f)) '())))) (let* ((root (car in-pitches)) (pitches (map (lambda (x) (ly:pitch-diff x root)) (cdr in-pitches))) (lowercase-root? (and (ly:context-property context 'chordNameLowercaseMinor) (let ((third (get-step 3 pitches))) (and third (= (ly:pitch-alteration third) FLAT))))) (exceptions (ly:context-property context 'chordNameExceptions)) (exception (assoc-get pitches exceptions)) (prefixes '()) (suffixes '()) (add-steps '()) (main-name #f) (bass-note (if (ly:pitch? inversion) inversion bass)) (alterations '())) (if exception (ignatzek-format-exception root exception bass-note lowercase-root?) (begin ;; no exception. ;; handle sus4 and sus2 suffix: if there is a 3 together with ;; sus2 or sus4, then we explicitly say add3. (for-each (lambda (j) (if (get-step j pitches) (begin (if (get-step 3 pitches) (begin (set! add-steps (cons (get-step 3 pitches) add-steps)) (set! pitches (remove-step 3 pitches)))) (set! suffixes (cons (get-step j pitches) suffixes))))) '(2 4)) ;; do minor-3rd modifier. (if (and (get-step 3 pitches) (= (ly:pitch-alteration (get-step 3 pitches)) FLAT)) (set! prefixes (cons (get-step 3 pitches) prefixes))) ;; lazy bum. Should write loop. (cond ((get-step 7 pitches) (set! main-name (get-step 7 pitches))) ((get-step 6 pitches) (set! main-name (get-step 6 pitches))) ((get-step 5 pitches) (set! main-name (get-step 5 pitches))) ((get-step 4 pitches) (set! main-name (get-step 4 pitches))) ((get-step 3 pitches) (set! main-name (get-step 3 pitches)))) (let* ((3-diff? (lambda (x y) (= (- (pitch-step y) (pitch-step x)) 2))) (split (split-at-predicate 3-diff? (remove-uptil-step 5 pitches)))) (set! alterations (append alterations (car split))) (set! add-steps (append add-steps (cdr split))) (set! alterations (delq main-name alterations)) (set! add-steps (delq main-name add-steps)) ;; chords with natural (5 7 9 11 13) or leading subsequence. ;; etc. are named by the top pitch, without any further ;; alterations. (if (and (ly:pitch? main-name) (= 7 (pitch-step main-name)) (is-natural-alteration? main-name) (pair? (remove-uptil-step 7 alterations)) (every is-natural-alteration? alterations)) (begin (set! main-name (last alterations)) (set! alterations '()))) (ignatzek-format-chord-name root prefixes main-name alterations add-steps suffixes bass-note lowercase-root?)))))) #(define-public (alteration->text-accidental-jazz-markup alteration) (make-smaller-markup (make-raise-markup (if (= alteration FLAT) 0.3 0.6) (make-jazzglyph-markup (assoc-get alteration jazz-alteration-glyph-name-alist ""))))) #(define (accidental->jazz-markup alteration) (if (= alteration 0) (make-line-markup (list empty-markup)) (conditional-kern-before (alteration->text-accidental-jazz-markup alteration) (= alteration FLAT) 0.2))) #(define (jazzChordNames pitch computer-sind-blöd) (define (pitch-alteration-semitones pitch) (inexact->exact (round (* (ly:pitch-alteration pitch) 2)))) (let* ((name (ly:pitch-notename pitch)) (alt-semitones (pitch-alteration-semitones pitch)) (n-a (cons name alt-semitones))) (display "\n\tn-a \t")(write n-a) (make-line-markup (list (make-simple-markup (vector-ref #("C" "D" "E" "F" "G" "A" "B") (car n-a))) (make-fontsize-markup -2.5 (make-normal-size-super-markup (accidental->jazz-markup (/ (cdr n-a) 2)))))))) #(define-public (note-name->jazz-markup pitch lowercase?) "Return pitch markup for @var{pitch}." (make-line-markup (list (make-simple-markup (conditional-string-downcase (vector-ref #("C" "D" "E" "F" "G" "A" "B") (ly:pitch-notename pitch)) lowercase?)) (accidental->jazz-markup (ly:pitch-alteration pitch))))) \layout { \context { \Score chordNameFunction = #ignatzek-jazz-chord-names chordRootNamer = #note-name->jazz-markup \override ChordName #'font-name = #"LilyJAZZText" \override TextScript #'font-name = #"LilyJAZZ Text" } }