-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am Montag, 18. August 2008 schrieb Han-Wen Nienhuys:
> On Sun, Aug 17, 2008 at 9:10 PM, Reinhold Kainhofer
>
> <[EMAIL PROTECTED]> wrote:
> > Attached is a patch for stencil.scm, which adds a make-line-stencil that
> > does exactly that: You call it as
> >    (make-line-stencil linewidth xstart ystart xend yend)
> > and it will create the stencil and correctly set its extent (adding half
> > the line width to all coordinates, too).
> >
> > Okay to apply to master?
>
> make sure that duplicate code with the draw-line markup is eliminated

Done, patch is attached. Okay to apply?


Am Sonntag, 17. August 2008 schrieb Carl D. Sorensen:
> Given the uniqueness of harp pedal diagrams, I think it would make sense
> to define a property harp-pedal-details that would be a place to stash
> all the harp-pedal-specific properties.

Done.
I've added a harp-pedal-details property list, which will be used by 
\harp-diagram. For this, I also had to define a harp-pedal-interface, 
although that interface is not used in any grob (I don't need a 
HarpPedalDiagram grob...). Is this okay or do I need to add/change anything.

Attached is now a patch for master, which adds the functionality directly to 
lilypond, together with proper documentation for the appendix of the NR and 
the IR. I've not written anything for the NR "2.3.3.1 Harp", though.

Okay to apply to master?

Cheers,
Reinhold



- -- 
- ------------------------------------------------------------------
Reinhold Kainhofer, Vienna University of Technology, Austria
email: [EMAIL PROTECTED], http://reinhold.kainhofer.com/
 * Financial and Actuarial Mathematics, TU Wien, http://www.fam.tuwien.ac.at/
 * K Desktop Environment, http://www.kde.org, KOrganizer maintainer
 * Chorvereinigung "Jung-Wien", http://www.jung-wien.at/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFIqcZaTqjEwhXvPN0RAtNVAJ447zjgFm5+d3KNZfUG9zKc7su+kwCeKIqJ
XiqLbTZS8Dyo1U/KAitEE74=
=71jY
-----END PGP SIGNATURE-----
From 8bb9cc35c49c9fd0fbf685c11ed8a16d0e53ab33 Mon Sep 17 00:00:00 2001
From: Reinhold Kainhofer <[EMAIL PROTECTED]>
Date: Mon, 18 Aug 2008 01:45:17 +0200
Subject: [PATCH 1/1] Add a make-line-stencil function, which correctly sets stencil extents

So far, one had to create line stencils manually using
   (ly:make-stencil (list 'draw-line ...) xext yext)
Unfortunately that meant that one had to specify the x- and y- coordinates
twice. This new make-line-stencil function takes the coordinates once,
creates the stencil and properly sets its extent (adding half the line
width to all coordinates of the x- and y-intervals).

Signed-off-by: Reinhold Kainhofer <[EMAIL PROTECTED]>
---
 scm/define-markup-commands.scm |   21 ++++--------------
 scm/fret-diagrams.scm          |   43 ++++++++-------------------------------
 scm/stencil.scm                |   11 ++++++++++
 3 files changed, 25 insertions(+), 50 deletions(-)

diff --git a/scm/define-markup-commands.scm b/scm/define-markup-commands.scm
index d8ee63b..3c35a88 100644
--- a/scm/define-markup-commands.scm
+++ b/scm/define-markup-commands.scm
@@ -42,13 +42,7 @@ A simple line.
                thickness))
         (x (car dest))
         (y (cdr dest)))
-    (ly:make-stencil
-     `(draw-line
-       ,th
-       0 0
-       ,x ,y)
-     (cons (min x 0) (max x 0))
-     (cons (min y 0) (max y 0)))))
+    (make-line-stencil th 0 0 x y)))
 
 (define-builtin-markup-command (draw-circle layout props radius thickness fill)
   (number? number? boolean?)
@@ -206,10 +200,7 @@ thickness and y offset.
          (x1 (car (ly:stencil-extent markup X)))
          (x2 (cdr (ly:stencil-extent markup X)))
          (y (* thick -2))
-         (line (ly:make-stencil
-                `(draw-line ,thick ,x1 ,y ,x2 ,y)
-                (cons (min x1 0) (max x2 0))
-                (cons thick thick))))
+         (line (make-line-stencil thick x1 y x2 y)))
     (ly:stencil-add markup line)))
 
 (define-builtin-markup-command (box layout props arg)
@@ -2530,11 +2521,9 @@ and continue with double letters.
          (num-y (interval-widen (cons center center) (abs dy)))
          (is-sane (and (interval-sane? num-x) (interval-sane? num-y)))
          (slash-stencil (if is-sane
-                            (ly:make-stencil
-                             `(draw-line ,thickness
-                                         ,(car num-x) ,(- (interval-center num-y) dy)
-                                         ,(cdr num-x) ,(+ (interval-center num-y) dy))
-                             num-x num-y)
+                            (make-line-stencil thickness 
+                                         (car num-x) (- (interval-center num-y) dy)
+                                         (cdr num-x) (+ (interval-center num-y) dy))
                             #f)))
     (if (ly:stencil? slash-stencil)
       (begin
diff --git a/scm/fret-diagrams.scm b/scm/fret-diagrams.scm
index fb986f9..1ffa530 100644
--- a/scm/fret-diagrams.scm
+++ b/scm/fret-diagrams.scm
@@ -70,18 +70,11 @@ Line thickness is given by @var{th}, fret & string spacing by
   (let* ((fret-count (+ (- (cadr fret-range) (car fret-range)) 1))
          (sl (* (+ fret-count 1) size))
          (sth (* size th))
-         (half-thickness (* sth 0.5))
          (gap (- size sth))
          (string-stencil
           (if (eq? orientation 'normal)
-              (ly:make-stencil
-               (list 'draw-line sth 0 0 0 sl)
-               (cons (- half-thickness) half-thickness)
-               (cons (- half-thickness) (+ sl half-thickness)))
-              (ly:make-stencil
-               (list 'draw-line sth 0 0 sl 0)
-               (cons (- half-thickness) (+ sl half-thickness))
-               (cons (- half-thickness) half-thickness)))))
+              (make-line-stencil sth 0 0 0 sl)
+              (make-line-stencil sth 0 0 sl 0))))
     (if (= string-count 1)
         string-stencil
         (if (eq? orientation 'normal)
@@ -125,16 +118,10 @@ fret & string spacing by @var{size}. Orientation is given by @var{orientation}"
          (sth (* size th))
          (half-thickness (* sth 0.5)))
     (if (eq? orientation 'normal)
-        (ly:make-stencil
-         (list 'draw-line sth half-thickness size
+        (make-line-stencil sth half-thickness size
                (- fret-length half-thickness) size)
-         (cons 0 fret-length)
-         (cons (- half-thickness) half-thickness))
-        (ly:make-stencil
-         (list 'draw-line sth 0 half-thickness
-               0 (- fret-length half-thickness))
-         (cons (- half-thickness) half-thickness)
-         (cons 0 fret-length)))))
+        (make-line-stencil sth 0 half-thickness
+               0 (- fret-length half-thickness)))))
 
 (define (draw-thick-zero-fret details string-count th size orientation)
   "Draw a thick zeroth fret for a fret diagram whose base fret is not 1."
@@ -381,25 +368,13 @@ Line thickness is given by @var{th}, fret & string spacing by
              (barre-stencil
               (if (eq? barre-type 'straight)
                   (if (eq? orientation 'normal)
-                      (ly:make-stencil
-                       (list
-                        'draw-line (* size dot-radius) left dot-center-y
-                        right dot-center-y)
-                       (cons left right)
-                       (cons (- dot-center-y scale-dot-radius)
-                             (+ dot-center-y scale-dot-radius)))
-                      (ly:make-stencil
-                       (list 'draw-line (* size dot-radius)
+                      (make-line-stencil scale-dot-radius left dot-center-y
+                                         right dot-center-y)
+                      (make-line-stencil scale-dot-radius
                              (* size barre-fret-coordinate)
                              (* size barre-start-string-coordinate)
                              (* size barre-fret-coordinate)
-                             (* size barre-end-string-coordinate))
-                       (cons (- (* size barre-fret-coordinate)
-                                scale-dot-radius)
-                             (+ (* size barre-fret-coordinate)
-                                scale-dot-radius))
-                       (cons (* size barre-start-string-coordinate)
-                             (* size barre-end-string-coordinate))))
+                             (* size barre-end-string-coordinate)))
                   (if (eq? orientation 'normal)
                       (ly:make-stencil
                        (list 'bezier-sandwich
diff --git a/scm/stencil.scm b/scm/stencil.scm
index 6a4b88d..19303ae 100644
--- a/scm/stencil.scm
+++ b/scm/stencil.scm
@@ -70,6 +70,17 @@
 	  (ly:stencil-combine-at-edge stil (other-axis axis) -1 rb padding))
     stil))
 
+(define-public (make-line-stencil width startx starty endx endy)
+  "Make a line stencil of given linewidth and set its extents accordingly"
+  (let ((xext (cons (min startx endx) (max startx endx)))
+        (yext (cons (min starty endy) (max starty endy))))
+    (ly:make-stencil
+      (list 'draw-line width startx starty endx endy)
+      ; Since the line has rounded edges, we have to / can safely add half the 
+      ; width to all coordinates!
+      (interval-widen xext (/ width 2))
+      (interval-widen yext (/ width 2)))))
+
 (define-public (make-filled-box-stencil xext yext)
   "Make a filled box."
   
-- 
1.5.4.3

From 437fff9f3a6e8b80e1662d74d76fe8b02efb784e Mon Sep 17 00:00:00 2001
From: Reinhold Kainhofer <[EMAIL PROTECTED]>
Date: Mon, 18 Aug 2008 20:07:12 +0200
Subject: [PATCH 2/2] Feature: Add Harp pedal diagrams, i.e. a \harp-pedal markup function

Add a \harp-pedal markup function, which produces harp pedalling diagrams. The
syntax is
    \harp-pedal #"^-v|--ov^"
The contents of the string define the positions of the pedals (^/-/v for
up/neutral/down), | is the divider and o indicates that the next pedal
should be circled. It can be tweaked through the size and thickness props
and the harp-pedal-details property list of the TextScript grob. For this, I
had to add a harp-pedal-interface, too.

The only issue I'm still having is that lilypond does not have a function
to draw an ellipse, so all I can do for circled pedals is to draw a circle
rather than an ellipse... Also, using a rounded box does not work, as that
fills its contents, thus overdrawing the pedal box.

I've also added three regression test cases, namely
-) Basic functionality checks (including circled boxes and an empty definition
   string, as well as invalid characters in the string)
-) Sanity checks: Lilypond will check whether the diagram follows standard
   rules (7 pedals with one divider after the third). If not, it will print
   out a warning, but should still produce the diagram as given.
-) Tweaking: Most details of the diagram can be tweaked using size, thickness
   and harp-pedal-details.
---
 input/regression/harp-pedals-sanity-checks.ly |   16 ++
 input/regression/harp-pedals-tweaking.ly      |   20 +++
 input/regression/harp-pedals.ly               |   16 ++
 scm/define-grob-interfaces.scm                |    5 +
 scm/define-grob-properties.scm                |   20 +++
 scm/harp-pedals.scm                           |  183 +++++++++++++++++++++++++
 scm/lily.scm                                  |    1 +
 7 files changed, 261 insertions(+), 0 deletions(-)
 create mode 100644 input/regression/harp-pedals-sanity-checks.ly
 create mode 100644 input/regression/harp-pedals-tweaking.ly
 create mode 100644 input/regression/harp-pedals.ly
 create mode 100644 scm/harp-pedals.scm

diff --git a/input/regression/harp-pedals-sanity-checks.ly b/input/regression/harp-pedals-sanity-checks.ly
new file mode 100644
index 0000000..c49d418
--- /dev/null
+++ b/input/regression/harp-pedals-sanity-checks.ly
@@ -0,0 +1,16 @@
+\version "2.11.56"
+
+\header {
+  texidoc = "The harp-pedal markup function does some sanity checks. All 
+the diagrams here violate the standard (7 pedals with divider after third), so
+a warning is printed out, but they should still look okay."
+}
+
+\relative c'' {
+  % Sanity checks: #pedals != 7:
+  c1^\markup \harp-pedal #"^-v|--"
+  % Sanity checks: no divider, multiple dividers, divider on wrong position:
+  c1^\markup \harp-pedal #"^-v--v^"
+  c1^\markup \harp-pedal #"^|-v|--|v^"
+  c1^\markup \harp-pedal #"^-v-|-v^"
+}
diff --git a/input/regression/harp-pedals-tweaking.ly b/input/regression/harp-pedals-tweaking.ly
new file mode 100644
index 0000000..df2adec
--- /dev/null
+++ b/input/regression/harp-pedals-tweaking.ly
@@ -0,0 +1,20 @@
+\version "2.11.56"
+
+\header {
+  texidoc = "Harp pedals can be tweaked through the size, thickness and 
+harp-pedal-details properties of TextScript."
+}
+
+\relative c'' {
+  \override Voice.TextScript #'harp-pedal-details #'box-width = #1
+  \once \override Voice.TextScript #'size = #1.5
+  \once \override Voice.TextScript #'thickness = #7
+  c1^\markup \harp-pedal #"o^ovo-|vovo-o^"
+  c1^\markup \override #'(harp-pedal-details . (
+                  (box-width . 0.6)
+                  (box-height . 0.3)
+                  (box-offset . 0.5)
+                  (space-before-divider . 0.1)
+                  (space-after-divider . 1.2))) {
+           \harp-pedal #"o^ovo-|vovo-o^"}
+}
\ No newline at end of file
diff --git a/input/regression/harp-pedals.ly b/input/regression/harp-pedals.ly
new file mode 100644
index 0000000..d78c88b
--- /dev/null
+++ b/input/regression/harp-pedals.ly
@@ -0,0 +1,16 @@
+\version "2.11.56"
+
+\header {
+  texidoc = "Basic harp diagram functionality, including circled pedal boxes. 
+The third diagram uses an empty string, the third contains invalid characters. 
+Both cases will create warnings, but should still not fail with an error."
+}
+
+\relative c'' {
+  c1^\markup \harp-pedal #"^v-|vv-^"
+  % circled boxes:
+  c1^\markup \harp-pedal #"o^ovo-|vovo-o^"
+  % invalid pedal specifications, which still should be handled gracefully:
+  c1^\markup \harp-pedal #""
+  c1^\markup \harp-pedal #"asfdvx" %\break
+}
diff --git a/scm/define-grob-interfaces.scm b/scm/define-grob-interfaces.scm
index 8b0dde2..54848be 100644
--- a/scm/define-grob-interfaces.scm
+++ b/scm/define-grob-interfaces.scm
@@ -62,6 +62,11 @@ note)."
  '(columns common-shortest-duration))
 
 (ly:add-interface
+ 'harp-pedal-interface
+ "A harp pedal diagram"
+ '(harp-pedal-details size thickness))
+
+(ly:add-interface
  'key-cancellation-interface
  "A key cancellation."
  '())
diff --git a/scm/define-grob-properties.scm b/scm/define-grob-properties.scm
index 9015764..3dd516a 100644
--- a/scm/define-grob-properties.scm
+++ b/scm/define-grob-properties.scm
@@ -320,6 +320,26 @@ property.")
 
      (hair-thickness ,number? "Thickness of the thin line in a bar
 line.")
+     (harp-pedal-details ,list? "An alist of detailed grob properties
+for harp pedal diagrams.  Each alist entry consists of a
+(@code{property} . @code{value}) pair.
+The properties which can be included in harp-pedal-details
+include the following:
[EMAIL PROTECTED] @bullet
[EMAIL PROTECTED] -- Vertical shift of the center of flat / sharp pedal 
+boxes above / below the horizontal line. Default value 0.8.
[EMAIL PROTECTED]
[EMAIL PROTECTED] -- Width of each pedal box. Default value 0.4.
[EMAIL PROTECTED]
[EMAIL PROTECTED] -- Height of each pedal box. Default value 1.0.
[EMAIL PROTECTED]
[EMAIL PROTECTED] -- Space between boxes before the first divider 
+(so that the diagram can be made symmetric). Default value 0.8.
[EMAIL PROTECTED]
[EMAIL PROTECTED] -- Space between boxes after the first divider. 
+Default value 0.8.
[EMAIL PROTECTED] itemize")
+
      (head-direction ,ly:dir? "Are the note heads left or right in a
 semitie?")
      (height ,ly:dimension? "Height of an object in
diff --git a/scm/harp-pedals.scm b/scm/harp-pedals.scm
new file mode 100644
index 0000000..8ef7dc3
--- /dev/null
+++ b/scm/harp-pedals.scm
@@ -0,0 +1,183 @@
+;;;; harp-pedals.scm --
+;;;;
+;;;;  source file of the GNU LilyPond music typesetter
+;;;;
+;;;; (c) 2008 Reinhold Kainhofer <[EMAIL PROTECTED]>
+
+
+;;;; More verbose version, which takes a list of directions. It's commented
+;;;; out, because it has some issues (see below) and does not add any new
+;;;; functionality over \harp-pedal
+;; (define-builtin-markup-command (harp-pedal-verbose layout props pedal-list) (list?)
+;;   music ; markup type
+;;   ((size 1.0)
+;;    (fret-diagram-details)
+;;    (thickness 0.5))
+;;   "Make a harp pedal diagram containing the directions indicated in @var{pedal-list}.
+;; 
+;;   For example,
+;; 
+;; @example
+;; \\markup \\pedal-diagram-verbose #'(1 0 -1 #\\| 0 0 1 1)
+;; \\markup \\pedal-diagram-verbose #(list UP CENTER DOWN #\\| CENTER CENTER UP UP)
+;; @end example
+;; "
+;;   (make-harp-pedal layout props pedal-list))
+
+
+(define-builtin-markup-command (harp-pedal layout props definition-string) (string?)
+  music ; markup type for the documentation!
+  ((size 1.0)
+   (fret-diagram-details)
+   (thickness 0.5))
+  "Make a harp pedal diagram.  For example,
+
+
[EMAIL PROTECTED],quote]
+\\markup \\harp-pedal #\"^-v|--ov^\"
+}
[EMAIL PROTECTED] lilypond
[EMAIL PROTECTED]
+produces a harp pedal diagram.
+
+Possible elements in @var{definition-string}:
+
[EMAIL PROTECTED] @code
[EMAIL PROTECTED] ^ 
+pedal is up
[EMAIL PROTECTED] -
+pedal is neutral
[EMAIL PROTECTED] v
+pedal is down
[EMAIL PROTECTED] |
+vertical divider line
[EMAIL PROTECTED] o
+the following pedal should be circled (indicating a change)
[EMAIL PROTECTED] table
+
+The function also checks if the string has the typical form of three
+pedals, then the divider and then the remaining four pedals. If not it
+prints out a warning. However, in any case, it will also print each symbol 
+in the order as given. This means you can place the divider (even multiple 
+dividers) anywhere you want, but you'll have to live with the warnings.
+
+The appearance of the diagram can be tweaked inter alia using the size property 
+of the TextScript grob (@code{\\override Voice.TextScript #'size = #0.3}) for 
+the overall, the thickness property 
+(@code{\\override Voice.TextScript #'thickness = #3}) for the line thickness of 
+the horizontal line and the divider. The remaining configuration (box sizes, 
+offsets and spaces) is done by the harp-pedal-details  list of properties  
+(@code{\\override Voice.TextScript #'harp-pedal-details #'box-width = #1}).
+It contains the following settings: @code{box-offset} (vertical shift of the 
+box center for up/down pedals), @code{box-width}, @code{box-height},
[EMAIL PROTECTED] (the spacing between two boxes before the 
+divider) and @code{space-after-divider} (box spacing after the divider)."
+
+;; There is also a \harp-pedal-verbose version, which 
+;; takes a list of -1/0/1 directions and a possible |. Unfortunately, it has some
+;; caveats:
+;;   1) the | cannot be given as a string "|" but as a character #\| and 
+;;      the "o" has to be given as #\o.
+;;   2) if one wants to use directions like UP, CENTER or DOWN, one cannot use
+;;      '(UP DOWN CENTER #\| ....), because the contents of that list are 
+;;      never evaluated to -1/0/1. Instead one has to explicitly create a 
+;;      list like (list UP DOWN CENTER #\| ....)
+
+  (make-harp-pedal layout props (harp-pedals-parse-string definition-string)))
+
+
+(define (harp-pedals-parse-string definition-string)
+ "Parse a harp pedals diagram string and return a list containing 1, 0, -1, #\\o or #\\|"
+  (map (lambda (c) 
+    (case c
+      ((#\^) 1)
+      ((#\v) -1)
+      ((#\-) 0)
+      ((#\| #\o) c)
+      (else c)))
+    (string->list definition-string)))
+
+(define (harp-pedal-info pedal-list)
+  (let check ((pedals pedal-list)
+              (pedalcount 0) 
+              (dividerpositions '()))
+    (if (null? pedals)
+      (cons pedalcount (reverse dividerpositions))
+      
+      (case (car pedals)
+        ((-1 0 1) (check (cdr pedals) (+ pedalcount 1) dividerpositions))
+        ((#\|)    (check (cdr pedals) pedalcount (cons pedalcount dividerpositions)))
+        (else     (check (cdr pedals) pedalcount dividerpositions))))))
+
+(define (harp-pedal-check pedal-list)
+  "Perform some sanity checks for harp pedals (7 pedals, divider after third)"
+  (let ((info (harp-pedal-info pedal-list)))
+    ; 7 pedals:
+    (if (not (equal? (car info) 7))
+      (ly:warning "Harp pedal diagram contains ~a pedals rather than the usual 7." (car info)))
+    ; One divider after third pedal:
+    (if (null? (cdr info))
+      (ly:warning "Harp pedal diagram does not contain a divider (usually after third pedal).")
+      (if (not (equal? (cdr info) '(3)))
+        (ly:warning "Harp pedal diagram contains dividers at positions ~a. Normally, there is only one divider after the third pedal." (cdr info))))))
+      
+
+(define (make-harp-pedal layout props pedal-list)
+  "Make a harp pedals diagram markup"
+       
+  
+  ; FIXME the size variable should be defined by a prop. lookup
+  (harp-pedal-check pedal-list)
+
+  (let* ((size (chain-assoc-get 'size props 1.2))
+        (details (chain-assoc-get 'harp-pedal-details props '()))
+        (dy (* size (assoc-get 'box-offset details 0.8))) ; offset of the box center from the line 
+        (line-width (* (ly:output-def-lookup layout 'line-thickness)
+                       (chain-assoc-get 'thickness props 0.5)))
+        (box-width (* size (assoc-get 'box-width details 0.4)))
+        (box-hheight (* size (/ (assoc-get 'box-height details 1.0) 2))) ; half the box-height, saves some divisions by 2
+        (spacebeforedivider (* size (assoc-get 'space-before-divider details 0.8))) ; full space between boxes before the first divider
+        (spaceafterdivider (* size (assoc-get 'space-after-divider details 0.8))) ; full space between boxes
+        ;(spacebeforedivider (/ (+ box-width (* 8 spaceafterdivider)) 8))
+        (box-x-dimensions (lambda (prev-x p space) (cons (+ prev-x space) 
+                                                   (+ prev-x space box-width))))
+        (box-y-dimensions (lambda (prev-x p space) (cons (- (* p dy) box-hheight) 
+                                                         (+ (* p dy) box-hheight))))
+        (divider-stencil (lambda (xpos) (make-line-stencil line-width xpos (- 0 dy box-hheight) xpos (+ dy box-hheight))))
+        (result (let process-pedal  ((remaining pedal-list)
+                                     (prev-x 0)
+                                     (stencils '())
+                                     (circled #f)
+                                     (space spacebeforedivider))
+          ; Terminal condition of the recursion, return (final-x . stencil-list)
+          (if (null? remaining)
+            (cons (+ prev-x space) stencils) 
+      
+            (case (car remaining)
+              ((1 0 -1)  ; Pedal up/neutral/down
+                  (let* ((p (car remaining))
+                        (stencil (make-filled-box-stencil
+                                   (box-x-dimensions prev-x p space) 
+                                   (box-y-dimensions prev-x p space)))
+                                   ;(circle-stencil (if circled (rounded-box-stencil stencil 0.05 0.3 0.1 ) stencil))
+                                   (circle-stencil (if circled (circle-stencil stencil 0.05 0.2 ) stencil))
+                        (new-prev-x (+ prev-x space box-width)))
+                      (process-pedal (cdr remaining) new-prev-x (cons circle-stencil stencils) #f space)))
+              ((#\|)  ; Divider line
+                  (let* ((xpos (+ prev-x space))
+                         (stencil (divider-stencil xpos))
+                         (new-prev-x (+ prev-x space)))
+                    (process-pedal (cdr remaining) new-prev-x (cons stencil stencils) circled spaceafterdivider)))
+              ((#\o)  ; Next pedal should be circled
+                  (process-pedal (cdr remaining) prev-x stencils #t space))
+              (else
+                  (ly:warning "Unhandled entry in harp-pedal: ~a" (car remaining))
+                  (process-pedal (cdr remaining) prev-x stencils circled space))))))
+        (final-x (car result))
+        (stencils (reverse (cdr result))))
+    ; Add the horizontal line and combine all stencils:
+    (apply ly:stencil-add
+      (cons
+        (make-line-stencil line-width 0 0 final-x 0)
+        stencils))))
+
diff --git a/scm/lily.scm b/scm/lily.scm
index 51038bc..e518ce2 100644
--- a/scm/lily.scm
+++ b/scm/lily.scm
@@ -338,6 +338,7 @@ The syntax is the same as `define*-public'."
 	    "encoding.scm"
 	    
 	    "fret-diagrams.scm"
+	    "harp-pedals.scm"
 	    "predefined-fretboards.scm"
             "define-markup-commands.scm"
 	    "define-grob-properties.scm"
-- 
1.5.4.3

_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to