]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/translation-functions.scm
[line-dashed-period.ly]: Fix regression test.
[lilypond.git] / scm / translation-functions.scm
index c6eefac9f5e0843380819351cbb54ec25440c4be..87cdbd4c2e475edda0f34e14746435f82be3d6a8 100644 (file)
@@ -1,6 +1,6 @@
 ;;;; This file is part of LilyPond, the GNU music typesetter.
 ;;;;
-;;;; (c) 1998--2010 Han-Wen Nienhuys <hanwen@xs4all.nl>
+;;;; (c) 1998--2011 Han-Wen Nienhuys <hanwen@xs4all.nl>
 ;;;;                Jan Nieuwenhuizen <janneke@gnu.org>
 ;;;;
 ;;;; LilyPond is free software: you can redistribute it and/or modify
@@ -341,7 +341,7 @@ chords.  Returns a placement-list."
           tuning)
 
   (define (calc-fret pitch string tuning)
-    (- (ly:pitch-semitones pitch) (list-ref tuning (1- string))))
+    (- (ly:pitch-semitones pitch) (ly:pitch-semitones (list-ref tuning (1- string)))))
 
   (define (note-pitch a)
     (ly:event-property a 'pitch))
@@ -407,6 +407,9 @@ chords.  Returns a placement-list."
     (let ((this-fret (calc-fret (ly:event-property note 'pitch)
                                 string
                                 tuning)))
+       (if (< this-fret 0)
+           (ly:warning (_ "Negative fret for pitch ~a on string ~a")
+                                       (note-pitch note) string))
        (set! string-fret-fingering-tuples
              (cons (list string
                          this-fret