X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scm%2Ftablature.scm;h=71b453c0fb7de0608038cfdef0d5e29e1d183802;hb=89192bb6e7e71cc438817d42f189142d4e44cc2b;hp=38a528475ade7fbb2cfe57a5ae6355f090b10afb;hpb=af8fb06f2cd900edc3618c3c8fa2d13872ba3e0e;p=lilypond.git diff --git a/scm/tablature.scm b/scm/tablature.scm index 38a528475a..71b453c0fb 100644 --- a/scm/tablature.scm +++ b/scm/tablature.scm @@ -1,8 +1,19 @@ -;;;; tablature.scm +;;;; This file is part of LilyPond, the GNU music typesetter. ;;;; -;;;; source file of the GNU LilyPond music typesetter +;;;; Copyright (C) 2009--2010 Marc Hohl ;;;; -;;;; (c) 2009 Marc Hohl +;;;; LilyPond is free software: you can redistribute it and/or modify +;;;; it under the terms of the GNU General Public License as published by +;;;; the Free Software Foundation, either version 3 of the License, or +;;;; (at your option) any later version. +;;;; +;;;; LilyPond is distributed in the hope that it will be useful, +;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;;; GNU General Public License for more details. +;;;; +;;;; You should have received a copy of the GNU General Public License +;;;; along with LilyPond. If not, see . ;; default tunings for common string instruments ;; guitar tunings @@ -11,7 +22,7 @@ (define-public guitar-drop-d-tuning '(4 -1 -5 -10 -15 -22)) (define-public guitar-open-g-tuning '(2 -1 -5 -10 -17 -22)) (define-public guitar-open-d-tuning '(2 -3 -6 -10 -15 -22)) -(define-public guitar-dadgad-tuning '(2 -3 -7 -10 -15 -22)) +(define-public guitar-dadgad-tuning '(2 -3 -5 -10 -15 -22)) (define-public guitar-lute-tuning '(4 -1 -6 -10 -15 -20)) (define-public guitar-asus4-tuning '(4 -3 -8 -10 -15 -20)) ;; bass tunings @@ -63,11 +74,10 @@ (add-new-clef "moderntab" "markup.moderntab" 0 0 0) ;; define sans serif-style tab-Clefs as a markup: -(define-builtin-markup-command (customTabClef +(define-markup-command (customTabClef layout props num-strings staff-space) (integer? number?) - music - () + #:category music "Draw a tab clef sans-serif style." (define (square x) (* x x)) (let* ((scale-factor (/ staff-space 1.5)) @@ -89,7 +99,9 @@ (if (string=? glyph "markup.moderntab") ;; if it is "moderntab", we'll draw it (let* ((staff-symbol (ly:grob-object grob 'staff-symbol)) - (line-count (ly:grob-property staff-symbol 'line-count)) + (line-count (if (ly:grob? staff-symbol) + (ly:grob-property staff-symbol 'line-count) + 0)) (staff-space (ly:staff-symbol-staff-space grob))) (grob-interpret-markup grob (make-customTabClef-markup line-count @@ -189,10 +201,14 @@ (lambda (grob) (parenthesize-tab-note-head grob)))) ;; tab note head is invisible - (ly:grob-set-property! tied-tab-note-head 'transparent #t))) + (begin + (ly:grob-set-property! tied-tab-note-head 'transparent #t) + (ly:grob-set-property! tied-tab-note-head 'whiteout #f)))) ;; tie is not split -> make fret number invisible - (ly:grob-set-property! tied-tab-note-head 'transparent #t)))) + (begin + (ly:grob-set-property! tied-tab-note-head 'transparent #t) + (ly:grob-set-property! tied-tab-note-head 'whiteout #f))))) ;; repeat ties occur within alternatives in a repeat construct; ;; TabNoteHead #'details handles the appearance in this case @@ -204,13 +220,15 @@ (tab-note-head-parenthesized (assoc-get 'parenthesize repeat-tied-properties #t))) (if tab-note-head-visible - ;; tab note head is visible - (if tab-note-head-parenthesized + ;; tab note head is visible + (if tab-note-head-parenthesized (ly:grob-set-property! tied-tab-note-head 'stencil (lambda (grob) (parenthesize-tab-note-head grob)))) ;; tab note head is invisible - (ly:grob-set-property! tied-tab-note-head 'transparent #t)))) + (begin + (ly:grob-set-property! tied-tab-note-head 'transparent #t) + (ly:grob-set-property! tied-tab-note-head 'whiteout #f))))) ;; the slurs should not be too far apart from the corresponding fret number, so ;; we move the slur towards the TabNoteHeads: