-;; pitch: (notename . accidental)
+;; note-name: (note . accidental)
;; list: (list-of-pitches . (modifier-string . addition-subtraction-string))
;; if a complete chord is found, use name
;; if a chord's base triad is found (c e g), use name
-(define pitch-names-alist '())
-(set! pitch-names-alist
+(define note-names-alist '())
+(set! note-names-alist
(append
'(
; use these for German naming
;((6 . 0) . ("H" ""))
;((6 . -1) . ("B" ("feta-1" . "\12")))
- ; urg, temp hack for accidental size: can't set from Chord::
- ((0 . 1) . ("C" ("feta-1" . "\10")))
- ((1 . 1) . ("D" ("feta-1" . "\10")))
- ((2 . 1) . ("E" ("feta-1" . "\10")))
- ((3 . 1) . ("F" ("feta-1" . "\10")))
- ((4 . 1) . ("G" ("feta-1" . "\10")))
- ((5 . 1) . ("A" ("feta-1" . "\10")))
- ((6 . 1) . ("B" ("feta-1" . "\10")))
-
- ((0 . -1) . ("C" ("feta-1" . "\12")))
- ((1 . -1) . ("D" ("feta-1" . "\12")))
- ((2 . -1) . ("E" ("feta-1" . "\12")))
- ((3 . -1) . ("F" ("feta-1" . "\12")))
- ((4 . -1) . ("G" ("feta-1" . "\12")))
- ((5 . -1) . ("A" ("feta-1" . "\12")))
- ((6 . -1) . ("B" ("feta-1" . "\12")))
+ ; C-p/C-r current feta chars for sharp/flat
+ ; don't use them: ly2dvi breaks (inputenc package)
+ ;((0 . 1) . ("C" ("feta-1" . "\10")))
+ ;((0 . -1) . ("C" ("feta-1" . "\12")))
)
- pitch-names-alist))
+ note-names-alist))
+(define (pitch->note-name pitch)
+ (cons (car pitch) (cadr pitch)))
+
(define (user-pitch-name pitch)
- (let ((entry (assoc pitch pitch-names-alist)))
+ (let ((entry (assoc (pitch->note-name pitch) note-names-alist)))
(if entry
(cdr entry))))
chord-names-alist))
(define (user-chord-name chord)
- ;(display chord)
- ;(newline)
- (let ((entry (assoc chord chord-names-alist)))
- (if entry
- (cdr entry))))
-
+ (let ((entry (assoc (map (lambda (x) (pitch->note-name x)) chord)
+ chord-names-alist)))
+ (if entry
+ (cdr entry))))