indications): new node.
* input/regression/new-markup-syntax.ly (texidoc): add circle.
* lily/new-fingering-engraver.cc (add_string): new function.
(acknowledge_grob): accept string-number-event as well.
* scm/define-markup-commands.scm (circle): new markup command.
* scm/output-lib.scm (print-circled-text-callback): new function.
* lily/GNUmakefile: move ifeq after include stepmake.make.
+2005-03-28 Han-Wen Nienhuys <hanwen@xs4all.nl>
+
+ * Documentation/user/instrument-notation.itely (String number
+ indications): new node.
+
+ * input/regression/new-markup-syntax.ly (texidoc): add circle.
+
+ * lily/new-fingering-engraver.cc (add_string): new function.
+ (acknowledge_grob): accept string-number-event as well.
+
+ * scm/define-markup-commands.scm (circle): new markup command.
+
+ * scm/output-lib.scm (print-circled-text-callback): new function.
+
+ * lily/GNUmakefile: move ifeq after include stepmake.make.
+
2005-03-28 Jan Nieuwenhuizen <janneke@gnu.org>
* config.make.in (HAVE_LIBKPATHSEA_SO):
@itemize @bullet
+@item
+String numbers are now printed on chords as well,
+
+@lilypond[relative,relative=1,raggedright]
+<c\1 e\2 g\3>
+@end lilypond
+
+See also @inputfileref{input/regression,string-number.ly}.
+
@item
Notes with ledger lines will be kept at a distance, so they never
disappear.
-@node Tablatures
-@section Tablatures
+@node Guitar
+@section Guitar
@cindex tablature
@cindex guitar tablature
-Tablature notation is used for notating music for plucked string
-instruments. Pitches are not denoted with note heads, but by
-indicating on which string and fret a note must be played. LilyPond
-offers limited support for tablature.
-
@menu
* Tablatures basic::
* Non-guitar tablatures::
* Fret diagrams::
@end menu
+@node String number indications
+@subsection String number indications
+
+@cindex String numbers
+
+String numbers can be added to chords, by indicating the string number
+with @code{\}@var{number},
+
+@lilypond[relative,relative=1,raggedright]
+<c\1 e\2 g\3>
+@end lilypond
+
+See also @inputfileref{input/regression,string-number.ly}.
+
+
+@seealso
+
+Program reference: @internalsref{StringNumber},
+@internalsref{StringNumberEvent}
+
+@refbugs
+
+Fingering shares the positioning code with the fingering
+(@ref{Fingering instructions}) and articulation on chords. This means
+that it is not possible to have string numbers on the right and
+fingering instructions on the left of the same chord.
+
+
@node Tablatures basic
@subsection Tablatures basic
@cindex Tablatures basic
+Tablature notation is used for notating music for plucked string
+instruments. Pitches are not denoted with note heads, but by
+numbers indicating on which string and fret a note must be played. LilyPond
+offers limited support for tablature.
+
The string number associated to a note is given as a backslash
followed by a number, e.g., @code{c4\3} for a C quarter on the third
string. By default, string 1 is the highest one, and the tuning
% \char-number #"abc1234abc"
\box \column { \line { "string 1" } \line { "string 2" } }
"$\\emptyset$"
+ \circle #4 #0.2
\italic Norsk
\super "2"
\dynamic sfzp
--- /dev/null
+\header {
+ texidoc = "String numbers can be added to chords. They use the same
+positioning mechanism as finger instructions."
+
+}
+
+\version "2.5.17"
+\paper {
+ raggedright = ##t
+}
+
+\relative {
+ <c\1 e\2 g\3>
+ \set fingeringOrientations = #'(down right up)
+ <c\1 e\2 g\3>
+}
NAME = kpath-guile
MODULE_NAME = kpath-guile
-
+MODULE_LDFLAGS= = -lkpathsea
SCRIPTS =
STEPMAKE_TEMPLATES = library c po
MODULE_INCLUDES= $(depth)/flower/include $(depth)/ttftool/include
MODULE_CXXFLAGS=
-ifeq ($(HAVE_LIBKPATHSEA_SO),no)
-MODULE_LDFLAGS= $(KPATHSEA_LIBS)
-endif
-
HELP2MAN_EXECS = lilypond
STEPMAKE_TEMPLATES= c++ executable po help2man
include $(depth)/make/stepmake.make
+ifeq ($(HAVE_LIBKPATHSEA_SO),no)
+MODULE_LDFLAGS+= $(KPATHSEA_LIBS)
+endif
+
+
# for profiling, link guile statically:
#
# USER_LDFLAGS += -static -lltdl -ldl
}
LY_DEFINE (ly_grob_alist_chain, "ly:grob-alist-chain",
- 1, 1, 0, (SCM g, SCM global),
- "Get an alist chain for grob @var{g}, with @var{global} as the "
+ 1, 1, 0, (SCM grob, SCM global),
+ "Get an alist chain for grob @var{grob}, with @var{global} as the "
"global default. If unspecified, @code{font-defaults} "
"from the layout block is taken. ")
{
- Grob *sc = unsmob_grob (g);
- SCM_ASSERT_TYPE (sc, g, SCM_ARG1, __FUNCTION__, "grob");
+ Grob *sc = unsmob_grob (grob);
+ SCM_ASSERT_TYPE (sc, grob, SCM_ARG1, __FUNCTION__, "grob");
if (global == SCM_UNDEFINED)
global
virtual void acknowledge_grob (Grob_info);
void add_fingering (Grob *, Music *, Music *);
void add_script (Grob *, Music *, Music *);
+ void add_string (Grob *, Music *, Music *);
void position_scripts ();
};
{
add_script (inf.grob_, m, note_ev);
}
+ else if (m->is_mus_type ("string-number-event"))
+ {
+ add_string (inf.grob_, m, note_ev);
+ }
else if (m->is_mus_type ("harmonic-event"))
{
inf.grob_->set_property ("style", ly_symbol2scm ("harmonic"));
void
New_fingering_engraver::add_script (Grob *head,
Music *event,
- Music *)
+ Music *note)
{
+ (void) note;
+
Finger_tuple ft;
Grob *g = make_item ("Script", event->self_scm ());
fingerings_.push (ft);
}
+
+void
+New_fingering_engraver::add_string (Grob *head,
+ Music *event,
+ Music *hevent)
+{
+ Finger_tuple ft;
+
+ ft.script_ = make_item ("StringNumber", event->self_scm ());
+
+ Side_position_interface::add_support (ft.script_, head);
+
+ int d = scm_to_int (event->get_property ("string-number"));
+
+ SCM sstr = scm_number_to_string (scm_int2num (d), scm_int2num (10));
+ ft.script_->set_property ("text", sstr);
+
+ ft.finger_event_ = event;
+ ft.note_event_ = hevent;
+ ft.head_ = head;
+
+ fingerings_.push (ft);
+}
+
void
New_fingering_engraver::position_scripts ()
{
#include "output-def.hh"
#include "modified-font-metric.hh"
-MAKE_SCHEME_CALLBACK (Text_interface, interpret_string, 3)
- SCM
+MAKE_SCHEME_CALLBACK (Text_interface, interpret_string, 3);
+SCM
Text_interface::interpret_string (SCM layout_smob,
SCM props,
SCM markup)
return fm->text_stencil (str).smobbed_copy ();
}
-MAKE_SCHEME_CALLBACK (Text_interface, interpret_markup, 3)
- SCM
+MAKE_SCHEME_CALLBACK (Text_interface, interpret_markup, 3);
+SCM
Text_interface::interpret_markup (SCM layout_smob, SCM props, SCM markup)
{
if (scm_is_string (markup))
Buildrequires: texinfo >= 4.7
Buildrequires: guile-devel >= 1.6.4-8
Buildrequires: freetype-devel >= 2.1
+
Buildrequires: fontforge
#fontforge must be >= 20041211 urg. 0.0.0-fdr.1.20041211
+Buildrequires: pango-devel >= 1.6.0
+Buildrequires: fontconfig-devel
+
Requires: libstdc++ python
Requires: guile >= 1.6.4-8 ghostscript >= 8.15
% Functions for direct and embedded PostScript
+%% TODO: use dicts or prefixes to prevent namespace pollution.
+
/pdfmark where
{pop} {userdict /pdfmark /cleartomark load put} ifelse
0 360 arc closepath fill stroke
} bind def
+/draw_circle % R T
+{
+ setlinewidth
+ dup 0 moveto
+ 0 exch 0 exch
+ 0 360 arc closepath stroke
+} bind def
+
/draw_white_dot % x1 y2 R
{
% 0 360 arc fill stroke
side-position-interface self-alignment-interface
item-interface))))
))
+ (StringNumber
+ . (
+ (print-function . ,print-circled-text-callback)
+ (padding . 0.5)
+ (staff-padding . 0.5)
+ (self-alignment-X . 0)
+ (self-alignment-Y . 0)
+ (script-priority . 100)
+ (font-encoding . fetaNumber)
+ (font-size . -5) ; don't overlap when next to heads.
+ (meta . ((interfaces . (string-number-interface
+ font-interface text-script-interface text-interface
+ side-position-interface self-alignment-interface
+ item-interface))))
+ ))
(Glissando
. (
"Stencil as markup"
stil)
+(def-markup-command (circle layout props radius thickness)
+ (number? number?)
+ "A circle of radius @var{radius} and thickness @var{thickness}"
+
+ (ly:make-stencil
+ (list 'circle radius thickness)
+ (cons (- radius) radius)
+ (cons (- radius) radius)))
(def-markup-command (with-url layout props url arg) (string? markup?)
"Add a link to URL @var{url} around @var{arg}. This only works in
blank
bracket
char
+ circle
dashed-line
dashed-slur
dot
((string? arg) (string-append "\"" arg "\""))
((symbol? arg) (string-append "\"" (symbol->string arg) "\""))))
-(define-public (func name . args)
- (string-append
- "(" name
- (if (null? args)
- ""
- (apply string-append
- (map (lambda (x) (string-append " " (arg->string x))) args)))
- ")\n"))
+(define-public (print-circled-text-callback grob)
+ (let*
+ ((text (ly:grob-property grob 'text))
+ (layout (ly:grob-layout grob))
+ (defs (ly:output-def-lookup layout 'text-font-defaults))
+ (props (ly:grob-alist-chain grob defs))
+ (circle (Text_interface::interpret_markup layout props
+ (make-circle-markup
+ 1.0 0.1)))
+ (text-stencil
+ (Text_interface::interpret_markup layout props text)))
+
+ (ly:stencil-align-to! text-stencil X CENTER)
+ (ly:stencil-align-to! text-stencil Y CENTER)
+ (ly:stencil-add text-stencil circle)
+ ))
+
;;(define (mm-to-pt x)
;; (* (/ 72.27 25.40) x))
(string-append (ly:number->string (car c)) " "
(ly:number->string (cdr c))))
-(define (font i)
- (string-append
- "font"
- (make-string 1 (integer->char (+ (char->integer #\A) i)))))
-
-(define (scm-scm action-name)
- 1)
;; silly, use alist?
(define-public (find-notehead-symbol duration style)
;; JUNK this -- see lily.scm: ly:all-output-backend-commands
#:export (unknown
blank
+ circle
dot
white-dot
beam
(ly:number->string off)
" ] 0 draw_dashed_slur"))
+(define (circle radius thick)
+ (format
+ "~a ~a draw_circle" radius thick))
+
+
(define (dot x y radius)
(string-append
" "
(define (dot x y radius)
(embedded-ps (list 'dot x y radius)))
+(define (circle radius thick)
+ (embedded-ps (list 'circle radius thick)))
+
(define (embedded-ps string)
(embedded-ps (list 'embedded-ps string)))