]> git.donarmstrong.com Git - lilypond.git/commitdiff
Add snappizzicato articulation
authorReinhold Kainhofer <reinhold@kainhofer.com>
Fri, 30 Jan 2009 21:46:02 +0000 (22:46 +0100)
committerReinhold Kainhofer <reinhold@kainhofer.com>
Fri, 6 Mar 2009 19:38:57 +0000 (20:38 +0100)
-) Add "scripts.snappizzicato" glyph to the feta font
-) Add \snappizzicato articulation function
-) Add regtest for snappizzicato
-) Remove custom definition from musicxml2ly and use the new \snappizzicato
-) Add the new articulation to our chart of articulations

Documentation/topdocs/NEWS.tely
input/manual/script-chart.ly
input/regression/articulation-snappizzicato.ly [new file with mode: 0644]
ly/script-init.ly
mf/feta-schrift.mf
scm/script.scm
scripts/musicxml2ly.py

index 8aa218c3723fe75d20ce0da166bff2a93f1a1e53..ae899645c2eb573b65b4161cd7a31cde2ef99e50 100644 (file)
@@ -62,11 +62,20 @@ which scares away people.
 
 @end ignore
 
+@item
+A snap-pizzicato (also known as Bartok-pizzicato) articulation was added:
+@lilypond[quote]
+\relative c'' {
+  c\snappizzicato
+}
+@end lilypond
+
 @item
 FretBoards now have a chordChanges property to keep repeated FretBoard objects
 from being typeset.
 
 
+
 @end itemize
 
 
index 5dc23d0daefdb9647a527bb0f5372b47232375fd..d8cbd8fa7a7a7f10305a168f99adc9faea1213db 100644 (file)
@@ -24,7 +24,7 @@ This chart shows all articulations, or scripts, that feta font contains.
         c''\upbow              c''\downbow            c''\flageolet
         c''\thumb              c''^\lheel             c''\rheel
         c''^\ltoe              c''\rtoe               c''\open
-        c''\stopped            c''\turn               c''\reverseturn
+        c''\stopped            c''\snappizzicato      c''\turn               c''\reverseturn
         c''\trill              c''\prall              c''\mordent
         c''\prallprall         c''\prallmordent       c''\upprall
         c''\downprall          c''\upmordent          c''\downmordent
@@ -39,7 +39,7 @@ This chart shows all articulations, or scripts, that feta font contains.
         upbow__                 downbow__               flageolet__
         thumb__                 lheel__                 rheel__
         ltoe__                  rtoe__                  open__
-        stopped__               turn__                  reverseturn__
+        stopped__               snappizzicato__                  turn__                  reverseturn__
         trill__                 prall__                 mordent__
         prallprall__            prallmordent__          upprall__
         downprall__             upmordent__             downmordent__
diff --git a/input/regression/articulation-snappizzicato.ly b/input/regression/articulation-snappizzicato.ly
new file mode 100644 (file)
index 0000000..90ed805
--- /dev/null
@@ -0,0 +1,6 @@
+\header {
+  texidoc = "The snappizzicato articulation adds a snappizzicato sign to the note."
+}
+\version "2.12.3"
+
+\relative c'' { c4\snappizzicato }
index d1d28a54afc588b6e46f15ad2a3c68ccc90b8cba..f54994a307c9fdc5df8a1e4adb8ab2bcaf32608d 100644 (file)
@@ -52,4 +52,5 @@ downprall = #(make-articulation "downprall")
 segno = #(make-articulation "segno")
 coda = #(make-articulation "coda")
 varcoda = #(make-articulation "varcoda")
+snappizzicato = #(make-articulation "snappizzicato")
 
index 5bb7c1abddd4bd732cb1ed7cb4cdbb975f728af1..7fd09c134199d7cc69dd90e0279e9e16f12be6ea 100644 (file)
@@ -1557,4 +1557,54 @@ fet_beginchar ("Straight caesura", "caesura.straight");
        labels(1a, 1b, 2a, 2b, 3a, 3b, 4a, 4b);
 fet_endchar;
 
+
+fet_beginchar ("snap pizzicato (Bartok pizzicato)", "snappizzicato");
+       save height, width, thickness, superness;
+
+       height# = 4/15 staffsize#;
+       width# = height#;
+       thickness# = 1.3 linethickness#;
+       define_pixels (height, width);
+       define_whole_blacker_pixels (thickness);
+
+       set_char_box (width# / 2, width# / 2, height# / 2, height# / 2);
+
+       penpos1 (thickness, 90);
+       penpos2 (thickness, 180);
+       penpos3 (thickness, 270);
+       penpos4 (thickness, 0);
+
+       x1 = 0;
+       y1r = h;
+       x3 = x1;
+       y3r = -y1r;
+       x4r = w;
+       y4 = 0;
+       x2r = -x4r;
+       y2 = y4;
+
+       penlabels (1, 2, 3, 4);
+
+       % mf doesn't handle pixel dropouts in outline objects, so we use
+       % `draw' if not called by mpost
+       if known miterlimit:
+               penstroke z1e
+                         .. z2e
+                         .. z3e
+                         .. z4e
+                         .. cycle;
+       else:
+               pickup pencircle scaled thickness;
+               draw z1
+                    .. z2
+                    .. z3
+                    .. z4
+                    .. cycle;
+       fi;
+       z5 = (0, 0);
+       z6 = (x5, 1.5*y1r);
+       pickup pencircle scaled thickness;
+        draw z5 -- z6;
+fet_endchar;
+
 fet_endgroup ("scripts");
index 2a7bbd9755da66185b7d803b5285976640053cba..966024f2d2324915cd676edf2eb87a24952c4518 100644 (file)
      ((script-stencil . (feta . ("varcoda" . "varcoda")))
       (padding . 0.20)    
       (avoid-slur . outside)
-      (direction  . 1)))))
+      (direction  . 1)))
+    ("snappizzicato" .
+     ((script-stencil . (feta . ("snappizzicato" . "snappizzicato")))
+      (padding . 0.20)
+      (avoid-slur . outside)
+      (direction  . 1)))
+      ))
index f6fcaa5cc1096ef5b2c164757addaaba0636494d..831873bf862482a187bded8c57ec940c447f9a21 100644 (file)
@@ -45,17 +45,6 @@ def error_message (str):
 needed_additional_definitions = []
 additional_definitions = {
 
-  "snappizzicato": """#(define-markup-command (snappizzicato layout props) ()
-  (interpret-markup layout props
-    (markup #:stencil
-      (ly:stencil-translate-axis
-        (ly:stencil-add
-          (make-circle-stencil 0.7 0.1 #f)
-          (ly:make-stencil
-            (list 'draw-line 0.1 0 0.1 0 1)
-            '(-0.1 . 0.1) '(0.1 . 1)))
-        0.7 X))))""",
-
   "eyeglasses": """eyeglassesps = #"0.15 setlinewidth
       -0.9 0 translate
       1.1 1.1 scale
@@ -1144,12 +1133,6 @@ def musicxml_fingering_event (mxl_event):
     ev.type = mxl_event.get_text ()
     return ev
 
-def musicxml_snappizzicato_event (mxl_event):
-    needed_additional_definitions.append ("snappizzicato")
-    ev = musicexp.MarkupEvent ()
-    ev.contents = "\\snappizzicato"
-    return ev
-
 def musicxml_string_event (mxl_event):
     ev = musicexp.NoDirectionArticulationEvent ()
     ev.type = mxl_event.get_text ()
@@ -1211,7 +1194,7 @@ articulations_dict = {
     #"schleifer": "?",
     #"scoop": "?",
     #"shake": "?",
-    "snap-pizzicato": musicxml_snappizzicato_event,
+    "snap-pizzicato": "snappizzicato",
     #"spiccato": "?",
     "staccatissimo": (musicexp.ShortArticulationEvent, "|"), # or "staccatissimo"
     "staccato": (musicexp.ShortArticulationEvent, "."), # or "staccato"