-;;;; double-plus-new-chord-name.scm -- Compile chord names
+;;;; chord-generic-names.scm -- Compile chord names
;;;;
;;;; source file of the GNU LilyPond music typesetter
;;;;
-;;;; (c) 2003 Jan Nieuwenhuizen <janneke@gnu.org>
+;;;; (c) 2003-2004 Jan Nieuwenhuizen <janneke@gnu.org>
;;;; NOTE: this is experimental code
(ly:pitch-transpose pitch
(ly:make-pitch 0 2 (if (or (= (step-nr pitch) 3)
(= (step-nr pitch) 5))
- -1 0))))
+ FLAT 0))))
(define (step-alteration pitch)
(let* ((diff (ly:pitch-diff (ly:make-pitch 0 0 0) (car pitches)))
(normalized-pitch (ly:pitch-transpose pitch diff))
(alteration (ly:pitch-alteration normalized-pitch)))
- (if (= (step-nr pitch) 7) (+ alteration 1) alteration)))
+ (if (= (step-nr pitch) 7) (+ alteration SEMI-TONE) alteration)))
(define (pitch-unalter pitch)
(let ((alteration (step-alteration pitch)))
(make-simple-markup (number->string (step-nr pitch)))
(make-simple-markup
(case (step-alteration pitch)
- ((-2) "--")
- ((-1) "-")
- ((0) "")
- ((1) "+")
- ((2) "++"))))))
+ ((DOUBLE-FLAT) "--")
+ ((FLAT) "-")
+ ((NATURAL) "")
+ ((SHARP) "+")
+ ((DOUBLE-SHARP) "++"))))))
(define (step->markup-accidental pitch)
(make-line-markup
(make-line-markup
(if (and (= (step-nr pitch) 7)
(= (step-alteration pitch) 1))
- (list (ly:get-context-property context 'majorSevenSymbol))
+ (list (ly:context-property context 'majorSevenSymbol))
(list (accidental->markup (step-alteration pitch))
(make-simple-markup (number->string (step-nr pitch)))))))
(if #f (begin
(write-me "pitches: " pitches)))
(let* ((full-exceptions
- (ly:get-context-property context 'chordNameExceptionsFull))
+ (ly:context-property context 'chordNameExceptionsFull))
(full-exception (full-match full-exceptions))
(full-markup (if full-exception (cadr full-exception) '()))
(partial-exceptions
- (ly:get-context-property context 'chordNameExceptionsPartial))
+ (ly:context-property context 'chordNameExceptionsPartial))
(partial-exception (partial-match partial-exceptions))
(partial-pitches (if partial-exception (car partial-exception) '()))
(partial-markup-prefix
;; + steps:altered + (highest all -- if not altered)
;; + subs:missing
- (let* ((root->markup (assoc-get-default
+ (let* ((root->markup (assoc-get
'root->markup options note-name->markup))
- (step->markup (assoc-get-default
+ (step->markup (assoc-get
'step->markup options step->markup-plusminus))
- (sub->markup (assoc-get-default
+ (sub->markup (assoc-get
'sub->markup options
(lambda (x)
(step-based-sub->markup step->markup x))))
- (sep (assoc-get-default
+ (sep (assoc-get
'separator options (make-simple-markup "/"))))
(if
;; + steps:(highest base) + cons-alt
;; + 'add'
;; + steps:rest
- (let* ((root->markup (assoc-get-default
+ (let* ((root->markup (assoc-get
'root->markup options note-name->markup))
(step->markup
- (assoc-get-default
+ (assoc-get
;; FIXME: ignatzek
;;'step->markup options step->markup-accidental))
'step->markup options step->markup-ignatzek))
- (sep (assoc-get-default
+ (sep (assoc-get
'separator options (make-simple-markup " ")))
- (add-prefix (assoc-get-default 'add-prefix options
+ (add-prefix (assoc-get 'add-prefix options
(make-simple-markup " add"))))
(if