Hallo,
ist dies ein Bug, der auch auf anderen Rechnern (ich nutze Win7/64) auftritt? Ist er eventuell schon gelistet?
Ich wollte mir bei einer Viola-Stimme (als nicht-Streicher) einen Eindruck von den Fingersätzen verschaffen, indem ich die Noten zusätzlich in einem TabStaff anzeige. Dabei bemerkte ich, daß ein Ton alleine auf der 2. Saite gegriffen wird, ein anderer Ton auf der 3. Saite, in einem Akkord mit diesen beiden Tönen aber der tiefere im TabStaff unterschlagen wird (mit der Warnungsmeldung an der Konsole, man möge doch bitte die StringNumber definieren, wohl weil's angeblich nicht eindeutig ist)
\version "2.15.38"
%auch: \version "2.14.2"
\header {
title = "TabStaff for Viola"
subtitle = "or: Why are the red noteheads not listed in the TabStaff?"
}
\include "string-tunings-init.ly"
Va = {
\key as \major
as'
bes'
<\tweak #'color #red as' bes'>
<as'\2>
<bes'\1>
<as'\2 \tweak #'color #red bes'>
<as'\2 bes'\1>
<bes' \tweak #'color #red as'>
des'4
es'
<\tweak #'color #red des' es'>
<as es'>
<bes es'>
<c' es'>
cis'
<\tweak #'color #red cis' es'>
ges
as
<\tweak #'color #red ges as>
<f as>
fis
<\tweak #'color #red fis as>
<\tweak #'color #red fis gis>
<\tweak #'color #red eisis gis>
\bar "||"
<a' a' f'> <a' bes> <a' d' ges> <d' d' bes>
}
\score {
\new GrandStaff <<
\new Staff {
\clef alto
\Va
}
\new TabStaff {
\set TabStaff.stringTunings = #viola-tuning
\Va
}
%{
\new TabStaff {
\set TabStaff.stringTunings = #viola-tuning
\musicMap #(lambda (x) (neighbourhood-strings viola-tuning x)) \Va
}
%}
>>
\header {
piece = #(string-append "LILYPOND " (lilypond-version))
}
}
Nun ja, ich wollte ja sowieso schon die folgende musicMap-Prozedur erstellen, und als Workaround taugt diese in meinem Anwendungsfall.
#(define (articulation-list-contains-stringnumberevent arti-list)
(let ((erg #f))
(for-each (lambda (x)
(let ((a-name (ly:music-property x 'name)))
(if (eq? a-name 'StringNumberEvent)
(set! erg #t)
))) arti-list)
erg))
#(define (neighbourhood-strings pitch-list music-element)
(let ((eventtype (ly:music-property music-element 'name)))
(if (eq? eventtype 'EventChord)
(let*
((es (ly:music-property music-element 'elements))
(note-event-list '())
(string-count (length pitch-list))
(has-allready-stringdef #f))
(for-each (lambda (x)
(let ((subeventtype (ly:music-property x 'name)))
(if (eq? subeventtype 'NoteEvent)
(let*
((pitch (ly:music-property x 'pitch))
(chromatic-pitch (ly:pitch-semitones pitch))
(articulations (ly:music-property x 'articulations))
(has-stringnumber (articulation-list-contains-stringnumberevent articulations)))
(if has-stringnumber
(set! has-allready-stringdef #t)
(set! note-event-list (append! note-event-list (list (list chromatic-pitch pitch x))))))))) es)
; (display "\npitch-list: ") (display pitch-list) (display " ")
(if has-allready-stringdef
(ly:warning "will not apply neighbourhood-strings as a string number is allready defined for at least one note event")
(let ((note-count (length note-event-list)))
(if (> note-count string-count)
(ly:warning "neighbourhood-strings cannot layout ~a notes on only ~a strings" note-count string-count)
(if (> note-count 1)
(let*
((sorted-note-event-list (sort-list note-event-list (lambda (x y) (> (car x) (car y)))))
(trials (+ 1 (- string-count note-count)))
(match-found #f))
; (display "\nnote-count: ") (display note-count) (display " string-count: ") (display string-count)
; (display " trials: ") (display trials) (display " ") (display "\n")
; (for-each (lambda (x) (begin (display " ") (display (car x)) (display "=") (display (cadr x)) (display " "))) sorted-note-event-list)
(do
((start-string 1 (1+ start-string)))
((or match-found (> start-string trials)))
(let ((out-of-range #f))
(do
((tone 0 (1+ tone)))
((>= tone note-count))
(let*
((c-p-tone (car (list-ref sorted-note-event-list tone)))
(p-string (list-ref pitch-list (+ tone (- start-string 1))))
(c-p-string (ly:pitch-semitones p-string)))
(if (< c-p-tone c-p-string) (set! out-of-range #t))))
(if (not out-of-range)
(begin
(set! match-found #t)
; (display "\n *** apply for uppermost stringnumber = ") (display start-string) (display " *** ")
(do
((tone 0 (1+ tone)))
((>= tone note-count))
(let*
((this-note-event (caddr (list-ref sorted-note-event-list tone)))
(as (ly:music-property this-note-event 'articulations)))
(ly:music-set-property! this-note-event 'articulations
(cons (make-music 'StringNumberEvent 'string-number (+ tone start-string)) as))))))))
(if (not match-found)
(ly:warning "cannot find a suitable neighbourhood-strings layout")))))))))
music-element))
Den Grund, warum ich dieses »neighbourhood-strings« definiert habe, erkennt man am unterschiedlichen Ergebnis bei den letzten 4 Akkorden (wenn man den zweiten Tabstaff entkommentiert) - ich wollte nur nebeneinander liegende Saiten benutzt haben.
Arnold