X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=ly%2Fpredefined-fretboards-init.ly;h=ccbcf321ce58b5a87da52c8b7a2fbbd35ce3e096;hb=63309b4631701409b02abb29596325312ba84be6;hp=9e91ed2220252025d8db37b764f898acc7aa79a5;hpb=235de94b7408e9badc7b82c8e0dae8f05009adc3;p=lilypond.git diff --git a/ly/predefined-fretboards-init.ly b/ly/predefined-fretboards-init.ly index 9e91ed2220..ccbcf321ce 100644 --- a/ly/predefined-fretboards-init.ly +++ b/ly/predefined-fretboards-init.ly @@ -1,6 +1,6 @@ %%%% This file is part of LilyPond, the GNU music typesetter. %%%% -%%%% Copyright (C) 2008--2010 Carl D. Sorensen +%%%% Copyright (C) 2008--2011 Carl D. Sorensen %%%% %%%% LilyPond is free software: you can redistribute it and/or modify %%%% it under the terms of the GNU General Public License as published by @@ -42,12 +42,28 @@ hash with the key @var{(cons key-symbol tuning)}.") #(define (chord-shape shape-code tuning) (get-chord-shape shape-code tuning chord-shape-table)) +% scheme function for copying/creating fretboard tables + +#(define (make-fretboard-table . rest) + "Create a new fretboard table. @code{rest} is an optional table name. +If present, the new fretboard table starts as a copy of the fretboard +table @code{rest}." + (if (null? rest) + (make-hash-table 101) + (let ((source-table (car rest))) + (hash-fold + (lambda (key value tab) + (hash-set! tab key value) + tab) + (make-hash-table 101) + source-table)))) + % music function for adding a predefined diagram to % fretboard-table storePredefinedDiagram = -#(define-music-function (parser location - fretboard-table chord tuning diagram-definition) +#(define-music-function + (parser location fretboard-table chord tuning diagram-definition) (hash-table? ly:music? pair? string-or-pair?) (_i "Add predefined fret diagram defined by @var{diagram-definition} for the chord pitches @var{chord} and the stringTuning @var{tuning}.")