tuning)))
(if (< this-fret 0)
(ly:warning (_ "Negative fret for pitch ~a on string ~a")
- (note-pitch note) string))
+ (car pitch-entry) string))
(delete-free-string string)
(set! specified-frets (cons this-fret specified-frets))
(list-set! string-fret-fingers
(cdr pitch-entry)
(list string this-fret finger))))
+ (define (kill-note! string-fret-fingers note-index)
+ (list-set! string-fret-fingers note-index (list #f #t)))
+
(define string-fret-fingers
(map (lambda (string finger)
(if (null? finger)
(_ "Requested string for pitch requires negative fret: string ~a pitch ~a")
string
pitch)
- (ly:warning (_ "Ignoring string request."))
+ (ly:warning (_ "Ignoring string request and recalculating."))
(list-set! string-fret-fingers
(cdr pitch-entry)
(if (null? finger)
(list '() #f)
- (list '() #f finger)))))))))))
+ (list '() #f finger)))))
+ ((eq? handle-negative 'ignore)
+ (begin
+ (ly:warning
+ (_ "Requested string for pitch requires negative fret: string ~a pitch ~a")
+ string
+ pitch)
+ (ly:warning (_ "Ignoring note in tablature."))
+ (kill-note! string-fret-fingers
+ (cdr pitch-entry))))))))))
pitch-alist string-fret-fingers)
;; handle notes without strings assigned -- sorted by pitch, so
;; we need to use the alist to have the note number available
(if (not (list-ref string-fret-finger 1))
(if fit-string
(set-fret! pitch-entry fit-string finger)
- (ly:warning (_ "No string for pitch ~a (given frets ~a)")
- pitch
- specified-frets)))))
+ (begin
+ (ly:warning (_ "No string for pitch ~a (given frets ~a)")
+ pitch
+ specified-frets)
+ (kill-note! string-fret-fingers
+ (cdr pitch-entry)))))))
(sort pitch-alist (lambda (pitch-entry-a pitch-entry-b)
(ly:pitch<? (car pitch-entry-b)
(car pitch-entry-a)))))
string-frets
(create-fretboard
context grob (string-frets->placement-list
- string-frets string-count))))
+ (filter (lambda (entry)
+ (car entry))
+ string-frets)
+ string-count))))
(if (null? grob)
(placement-list->string-frets predefined-fretboard)
(create-fretboard context grob predefined-fretboard)))))