summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReinhold Kainhofer <reinhold@kainhofer.com>2009-01-30 21:30:24 +0100
committerReinhold Kainhofer <reinhold@kainhofer.com>2009-03-08 01:33:35 +0100
commit243b15925ff3ef8b0384ffd0a6ce6664ad19da99 (patch)
tree1d78fe2968e46c3b89fd550d075f3300a8bad320
parenteafd157927c2f7292bab0313d26c783570f56343 (diff)
Implement \eyeglasses as markup command
-) implement \eyeglasses as markup command, using the postscript stored in the eyeglassesps variable -) Use this markup command in musicxml2ly, too -) Add regtest for \eyeglasses (in a \markup and as a markup attached to a note) -) Remove the eyeglasses example from the postscript command and replace it by two rings (the stereo symbol) written in postscript
-rw-r--r--Documentation/topdocs/NEWS.tely9
-rw-r--r--input/regression/markup-eyeglasses.ly6
-rw-r--r--scm/define-markup-commands.scm61
-rw-r--r--scripts/musicxml2ly.py22
4 files changed, 56 insertions, 42 deletions
diff --git a/Documentation/topdocs/NEWS.tely b/Documentation/topdocs/NEWS.tely
index 99089a1782..cc07cd31a4 100644
--- a/Documentation/topdocs/NEWS.tely
+++ b/Documentation/topdocs/NEWS.tely
@@ -62,6 +62,15 @@ which scares away people.
@end ignore
+@item An eyeglasses markup was added, incidating strongly to look at the
+conductor for instructions:
+@lilypond[quote]
+\relative c'' {
+ \mark \markup {\eyeglasses}
+ c4_\markup{\eyeglasses}
+}
+@end lilypond
+
@item
A snap-pizzicato (also known as Bartok-pizzicato) articulation was added:
@lilypond[quote]
diff --git a/input/regression/markup-eyeglasses.ly b/input/regression/markup-eyeglasses.ly
new file mode 100644
index 0000000000..6b47237061
--- /dev/null
+++ b/input/regression/markup-eyeglasses.ly
@@ -0,0 +1,6 @@
+\header {
+ texidoc = "The eyeglasses markup function prints out eyeglasses."
+}
+\version "2.12.3"
+
+\relative c'' { \mark \markup{ \eyeglasses } c4_\markup{ \eyeglasses } }
diff --git a/scm/define-markup-commands.scm b/scm/define-markup-commands.scm
index 9b5c5c5c82..e953774466 100644
--- a/scm/define-markup-commands.scm
+++ b/scm/define-markup-commands.scm
@@ -470,34 +470,23 @@ This inserts @var{str} directly into the output as a PostScript
command string.
@lilypond[verbatim,quote]
-eyeglassesps = #\"
+ringsps = #\"
0.15 setlinewidth
- -0.9 0 translate
- 1.1 1.1 scale
- 1.2 0.7 moveto
- 0.7 0.7 0.5 0 361 arc
+ 0.9 0.6 moveto
+ 0.4 0.6 0.5 0 361 arc
stroke
- 2.20 0.70 0.50 0 361 arc
+ 1.0 0.6 0.5 0 361 arc
stroke
- 1.45 0.85 0.30 0 180 arc
- stroke
- 0.20 0.70 moveto
- 0.80 2.00 lineto
- 0.92 2.26 1.30 2.40 1.15 1.70 curveto
- stroke
- 2.70 0.70 moveto
- 3.30 2.00 lineto
- 3.42 2.26 3.80 2.40 3.65 1.70 curveto
- stroke\"
+ \"
-eyeglasses = \\markup {
- \\with-dimensions #'(0 . 4.4) #'(0 . 2.5)
- \\postscript #eyeglassesps
+rings = \\markup {
+ \\with-dimensions #'(-0.2 . 1.6) #'(0 . 1.2)
+ \\postscript #ringsps
}
\\relative c'' {
- c2^\\eyeglasses
- a2_\\eyeglasses
+ c2^\\rings
+ a2_\\rings
}
@end lilypond"
;; FIXME
@@ -2579,6 +2568,36 @@ figured bass notation.
@end lilypond"
(slashed-digit-internal layout props num #f font-size thickness))
+;; eyeglasses
+(define eyeglassesps
+ "0.15 setlinewidth
+ -0.9 0 translate
+ 1.1 1.1 scale
+ 1.2 0.7 moveto
+ 0.7 0.7 0.5 0 361 arc
+ stroke
+ 2.20 0.70 0.50 0 361 arc
+ stroke
+ 1.45 0.85 0.30 0 180 arc
+ stroke
+ 0.20 0.70 moveto
+ 0.80 2.00 lineto
+ 0.92 2.26 1.30 2.40 1.15 1.70 curveto
+ stroke
+ 2.70 0.70 moveto
+ 3.30 2.00 lineto
+ 3.42 2.26 3.80 2.40 3.65 1.70 curveto
+ stroke")
+
+(define-builtin-markup-command (eyeglasses layout props) () other ()
+ "Prints out eyeglasses, indicating strongly to look at the conductor.
+@lilypond[verbatim,quote]
+\\markup { \\eyeglasses }
+@end lilypond"
+ (interpret-markup layout props
+ (make-with-dimensions-markup '(-0.55 . 2.9) '(0.4 . 2.4)
+ (make-postscript-markup eyeglassesps))))
+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; the note command.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
diff --git a/scripts/musicxml2ly.py b/scripts/musicxml2ly.py
index b8e11f7233..52e6971487 100644
--- a/scripts/musicxml2ly.py
+++ b/scripts/musicxml2ly.py
@@ -45,26 +45,6 @@ def error_message (str):
needed_additional_definitions = []
additional_definitions = {
- "eyeglasses": """eyeglassesps = #"0.15 setlinewidth
- -0.9 0 translate
- 1.1 1.1 scale
- 1.2 0.7 moveto
- 0.7 0.7 0.5 0 361 arc
- stroke
- 2.20 0.70 0.50 0 361 arc
- stroke
- 1.45 0.85 0.30 0 180 arc
- stroke
- 0.20 0.70 moveto
- 0.80 2.00 lineto
- 0.92 2.26 1.30 2.40 1.15 1.70 curveto
- stroke
- 2.70 0.70 moveto
- 3.30 2.00 lineto
- 3.42 2.26 3.80 2.40 3.65 1.70 curveto
- stroke"
-eyeglasses = \markup { \with-dimensions #'(0 . 4.4) #'(0 . 2.5) \postscript #eyeglassesps }""",
-
"tuplet-note-wrapper": """ % a formatter function, which is simply a wrapper around an existing
% tuplet formatter function. It takes the value returned by the given
% function and appends a note of given length.
@@ -1431,7 +1411,7 @@ def musicxml_harp_pedals_to_ly (mxl_event):
def musicxml_eyeglasses_to_ly (mxl_event):
needed_additional_definitions.append ("eyeglasses")
- return musicexp.MarkEvent ("\\eyeglasses")
+ return musicexp.MarkEvent ("\\markup { \\eyeglasses }")
def next_non_hash_index (lst, pos):
pos += 1