From: Han-Wen Nienhuys Date: Sun, 17 Apr 2005 20:59:43 +0000 (+0000) Subject: Mathieu Giraud's patch X-Git-Tag: release/2.5.20~24 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=969911beb66f7a53f5a47aa7e00dbe3158e70c30;p=lilypond.git Mathieu Giraud's patch --- diff --git a/ChangeLog b/ChangeLog index 004418afa8..71c5e3b1dd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2005-04-17 Mathieu Giraud + + * scm/chord-name.scm : support for italian and french + chords names. + + * scm/chord-ignatzek-names.scm (ignatzek-chord-names): add + a space defined by chordPrefixSpacer when the root name is + direclty followed by a prefix. + + * ly/engraver-init.ly : chordPrefixSpacer + * scm/define-context-properties.scm : chordPrefixSpacer + * ly/property-init.ly : italianChords, frenchChords + 2005-04-17 Jan Nieuwenhuizen * SConstruct: Require pkg-config. diff --git a/ly/engraver-init.ly b/ly/engraver-init.ly index 94fed640aa..9fed117387 100644 --- a/ly/engraver-init.ly +++ b/ly/engraver-init.ly @@ -513,6 +513,7 @@ AncientRemoveEmptyStaffContext = \context { chordNameExceptions = #ignatzekExceptions chordNoteNamer = #'() chordRootNamer = #note-name->markup + chordPrefixSpacer = #0 chordNameExceptionsFull = #fullJazzExceptions chordNameExceptionsPartial = #partialJazzExceptions diff --git a/ly/property-init.ly b/ly/property-init.ly index bdc433603d..ee2829ead9 100644 --- a/ly/property-init.ly +++ b/ly/property-init.ly @@ -176,7 +176,15 @@ semiGermanChords = { \set chordNoteNamer = #note-name->german-markup } +frenchChords = { + \set chordRootNamer = #(chord-name->italian-markup #t) + \set chordPrefixSpacer = #0.4 +} +italianChords = { + \set chordRootNamer = #(chord-name->italian-markup #f) + \set chordPrefixSpacer = #0.4 +} improvisationOn = { \set squashedPosition = #0 diff --git a/scm/chord-ignatzek-names.scm b/scm/chord-ignatzek-names.scm index 0d9295e301..5ce64b7c90 100644 --- a/scm/chord-ignatzek-names.scm +++ b/scm/chord-ignatzek-names.scm @@ -177,7 +177,10 @@ work than classifying the pitches." (set! base-stuff (append (list root-markup - (markup-join prefixes sep) + (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))) diff --git a/scm/chord-name.scm b/scm/chord-name.scm index e05469f0db..6570b49055 100644 --- a/scm/chord-name.scm +++ b/scm/chord-name.scm @@ -31,6 +31,17 @@ (alteration->text-accidental-markup alteration) (= alteration FLAT) 0.2))) +(define (accidental->markup-italian alteration) + "Return accidental markup for ALTERATION, for use after an italian chord root name." + (if (= alteration 0) + (make-hspace-markup 0.2) + (make-line-markup + (list + (make-hspace-markup (if (= alteration FLAT) 0.7 0.5)) + (make-raise-markup 0.7 (alteration->text-accidental-markup alteration)) + (make-hspace-markup (if (= alteration SHARP) 0.2 0.1)) + )))) + (define-public (note-name->markup pitch) "Return pitch markup for PITCH." (make-line-markup @@ -70,6 +81,23 @@ (list-ref '( "ses" "s" "" "is" "isis") (+ 2 (/ (cdr n-a) 2))) (list-ref '("eses" "es" "" "is" "isis") (+ 2 (/ (cdr n-a) 2))))))))) +(define-public ((chord-name->italian-markup re-with-eacute) pitch) + "Return pitch markup for PITCH, using italian/french note names. + If re-with-eacute is set to #t, french 'ré' is returned for D instead of 're' +" + (let* ((name (ly:pitch-notename pitch)) + (alt (ly:pitch-alteration pitch))) + (make-line-markup + (list + (make-simple-markup + (vector-ref + (if re-with-eacute + #("Do" "Ré" "Mi" "Fa" "Sol" "La" "Si") + #("Do" "Re" "Mi" "Fa" "Sol" "La" "Si")) + name)) + (accidental->markup-italian alt) + )))) + ;; fixme we should standardize on omit-root (or the other one.) ;; perhaps the default should also be reversed --hwn (define-safe-public (sequential-music-to-chord-exceptions seq . rest) diff --git a/scm/define-context-properties.scm b/scm/define-context-properties.scm index dd2c40da41..2c3654be3c 100644 --- a/scm/define-context-properties.scm +++ b/scm/define-context-properties.scm @@ -132,6 +132,9 @@ Contains (@var{chord} . @var{markup}) entries.") (chordNameSeparator ,markup? "The markup object used to separate parts of a chord name.") + (chordPrefixSpacer ,number? + "The space added between the root symbol and the prefix + of a chord name") (chordChanges ,boolean? "Only show changes in chords scheme?") (clefGlyph ,string? "Name of the symbol within the music font.") (clefOctavation ,integer? "Add