On 9/7/11 11:20 AM, "David Kastrup" <d...@gnu.org> wrote:
>
>
> The recent \contextStringTunings fixes were dissatisfactory to me
> because I found the user interface awkward anyway.
>
> Employing <URL:http://codereview.appspot.com/4969062>, one can code a
> new command and the respective regtest as follows:
>
> %% A scheme function for converting a chord to a string tuning
> stringTuning =
> #(define-scheme-function (parser location chord) (ly:music?)
> (let* ((ev-chord (car (extract-named-music chord 'EventChord))))
> (reverse (event-chord-pitches ev-chord))))
>
> \header {
>
> texidoc = "For other tunings, it is sufficient to set
> @code{stringTunings}. The number of staff lines is adjusted
> accordingly."
>
> }
>
> \new TabStaff {
> \set TabStaff.stringTunings = \stringTuning <f' ais' dis'' gis''>
>
> \relative c'' { c4 d e f }
> }
>
>
> This is more obvious and nicer as either using #`(,(ly:make-pitch ...) ...)
> (and, by the way, I have never seen such a strange tuning, so I consider
> it likely that the respective arguments were simply wrong) or
> contextStringTunings.
Yes, this is much better. And it can also replace \makeStringTuning, I
believe.
%% A scheme function for converting a chord to a string tuning
stringTuning =
#(define-scheme-function (parser location chord) (ly:music?)
(let* ((ev-chord (car (extract-named-music chord 'EventChord))))
(reverse (event-chord-pitches ev-chord))))
\header {
texidoc = "For other tunings, it is sufficient to set
@code{stringTunings}. The number of staff lines is adjusted
accordingly."
}
customTuning = \stringTuning <f ais dis' gis'>
myNotes = { c4\4 e\3 g c }
<<
\new FretBoards \with { stringTunings = \customTuning } {
\chordmode {c1}
}
\new Staff {
\relative c' {
\myNotes
}
}
\new TabStaff \with { stringTunings = \customTuning } {
\relative c' {
\myNotes
}
}
>>
And I think it possible that judicious use of this capability could greatly
simplify the creation of predefined fretboards, although I haven't yet
looked into it carefully.
Thanks for making this, David. I really like it.
Carl
_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel