alphabetical order.
* input/regression/trill-spanner-pitched.ly: new file.
* lily/font-interface-scheme.cc (LY_DEFINE): function
ly:grob-default-font (changed from get-default-font).
* lily/axis-group-interface-scheme.cc (LY_DEFINE): new file.
* lily/note-head.cc (internal_print): if style is not a symbol,
set style to 'default.
(internal_print): no style suffix if glyph-name-procedure not
set. Default to quarter head.
* scm/define-grobs.scm (Module): new grob TrillPitchHead.
* scm/define-music-properties.scm (all-music-properties): add trill-pitch.
* ly/music-functions-init.ly: \pitchedTrill
* lily/pitched-trill-engraver.cc (acknowledge_grob): new file.
* ly/Welcome_to_LilyPond.ly: update to 2.6.0
* lily/trill-spanner-engraver.cc (finalize): rename req -> event
* scm/define-markup-commands.scm (pad-markup): pad-markup command.
2005-07-08 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ * scm/define-grobs.scm (all-grob-descriptions): reorganize in
+ alphabetical order.
+
+ * input/regression/trill-spanner-pitched.ly: new file.
+
+ * lily/font-interface-scheme.cc (LY_DEFINE): function
+ ly:grob-default-font (changed from get-default-font).
+
+ * lily/axis-group-interface-scheme.cc (LY_DEFINE): new file.
+
+ * lily/note-head.cc (internal_print): if style is not a symbol,
+ set style to 'default.
+ (internal_print): no style suffix if glyph-name-procedure not
+ set. Default to quarter head.
+
+ * scm/define-grobs.scm (Module): new grob TrillPitchHead.
+
+ * scm/define-music-properties.scm (all-music-properties): add trill-pitch.
+
+ * ly/music-functions-init.ly: \pitchedTrill
+
+ * lily/pitched-trill-engraver.cc (acknowledge_grob): new file.
+
+ * ly/Welcome_to_LilyPond.ly: update to 2.6.0
+
+ * lily/trill-spanner-engraver.cc (finalize): rename req -> event
+
+ * scm/define-markup-commands.scm (pad-markup): pad-markup command.
+
* po/fr.po: update
* po/de.po: update.
Program reference: @internalsref{NoteHead}.
+@node Pitched trills
+@subsection Pitched trills
+
+Trills that should be executed on an explicitly specified pitch can be
+typeset with the command @code{pitchedTrill},
+
+@lilypond[raggedright,verbatim]
+ \pitchedTrill c'4\startTrillSpan fis
+ f'\stopTrillSpan
+@end lilypond
+
+The first argument is the main note. The absolute pitch of the second
+is printed as a stemless note head in parentheses.
+
+@refbugs
+
+Relative octave mode ignores the octave of the second argument of
+@code{\pitchedTrill}.
@node Feathered beams
@subsection Feathered beams
--- /dev/null
+\version "2.6.0"
+
+\header {
+
+ texidoc = "Pitched trills are denoted by a small note head in
+ parentheses following the main note. This note head is properly
+ ledgered, and parentheses include the accidental."
+
+}
+
+\paper {
+ raggedright = ##t
+}
+
+\relative {
+ \pitchedTrill c4\startTrillSpan fis f\stopTrillSpan
+}
{
\override TextScript #'extra-offset = #'(2 . 4)
- c'4-\markup { \whiteout foo } c
+ c'4-\markup { \whiteout \pad-markup #0.5 foo } c
}
virtual bool try_music (Music *);
private:
Item *arpeggio_;
- Music *arpeggio_req_;
+ Music *arpeggio_event_;
};
Arpeggio_engraver::Arpeggio_engraver ()
{
arpeggio_ = 0;
- arpeggio_req_ = 0;
+ arpeggio_event_ = 0;
}
bool
Arpeggio_engraver::try_music (Music *m)
{
- if (!arpeggio_req_)
+ if (!arpeggio_event_)
{
- arpeggio_req_ = m;
+ arpeggio_event_ = m;
}
return true;
}
void
Arpeggio_engraver::process_music ()
{
- if (arpeggio_req_)
+ if (arpeggio_event_)
{
- arpeggio_ = make_item ("Arpeggio", arpeggio_req_->self_scm ());
+ arpeggio_ = make_item ("Arpeggio", arpeggio_event_->self_scm ());
}
}
Arpeggio_engraver::stop_translation_timestep ()
{
arpeggio_ = 0;
- arpeggio_req_ = 0;
+ arpeggio_event_ = 0;
}
ADD_TRANSLATOR (Arpeggio_engraver,
- /* descr */ "Generate an Arpeggio from a Arpeggio_req",
+ /* descr */ "Generate an Arpeggio symbol",
/* creats*/ "Arpeggio",
/* accepts */ "arpeggio-event",
/* acks */ "stem-interface rhythmic-head-interface note-column-interface",
--- /dev/null
+/*
+ axis-group-interface-scheme.cc -- implement Axis_group_interface
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
+
+*/
+
+#include "axis-group-interface.hh"
+#include "lily-guile.hh"
+
+LY_DEFINE(ly_relative_group_extent, "ly:relative-group-extent",
+ 3, 0, 0, (SCM elements, SCM common, SCM axis),
+ "Determine the extent of @var{elements} relative to @var{common} in the "
+ "@var{axis} direction.")
+{
+ SCM_ASSERT_TYPE(scm_is_pair (elements), elements, SCM_ARG1, __FUNCTION__, "list");
+ SCM_ASSERT_TYPE(unsmob_grob (common), common, SCM_ARG2, __FUNCTION__, "grob");
+ SCM_ASSERT_TYPE(is_axis (axis), axis, SCM_ARG3, __FUNCTION__, "axis");
+
+
+ Interval ext = Axis_group_interface::relative_group_extent (elements,
+ unsmob_grob (common),
+ (Axis) scm_to_int (axis));
+ return ly_interval2scm (ext);
+}
+
+
*/
#include "axis-group-interface.hh"
+
#include "hara-kiri-group-spanner.hh"
+#include "warn.hh"
void
Axis_group_interface::add_element (Grob *me, Grob *e)
{
- for (SCM ax = me->get_property ("axes"); ax != SCM_EOL; ax = scm_cdr (ax))
+ SCM axes = me->get_property ("axes");
+ if (!scm_is_pair (axes))
+ programming_error ("axes should be nonempty");
+
+ for (SCM ax = axes; ax != SCM_EOL; ax = scm_cdr (ax))
{
Axis a = (Axis) scm_to_int (scm_car (ax));
}
Interval
-Axis_group_interface::relative_group_extent (Axis a, Grob *common, SCM elts)
+Axis_group_interface::relative_group_extent (SCM elts, Grob *common, Axis a)
{
Interval r;
for (SCM s = elts; scm_is_pair (s); s = scm_cdr (s))
return r;
}
+
+
MAKE_SCHEME_CALLBACK (Axis_group_interface, group_extent_callback, 2);
SCM
Axis_group_interface::group_extent_callback (SCM element_smob, SCM scm_axis)
Grob *common = common_refpoint_of_list (elts, me, a);
Real my_coord = me->relative_coordinate (common, a);
- Interval r (relative_group_extent (a, common, elts));
+ Interval r (relative_group_extent (elts, common, a));
return ly_interval2scm (r - my_coord);
}
--- /dev/null
+/*
+ font-interface-scheme.cc -- implement Font_interface bindings
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 2000--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
+
+
+#include "font-interface.hh"
+
+#include "grob.hh"
+
+
+LY_DEFINE (ly_grob_default_font, "ly:grob-default-font",
+ 1, 0, 0, (SCM grob),
+ "Return the default font for grob @var{gr}.")
+{
+ Grob *gr = unsmob_grob (grob);
+ SCM_ASSERT_TYPE (gr, grob, SCM_ARG1, __FUNCTION__, "grob");
+
+ return Font_interface::get_default_font (gr)->self_scm ();
+}
return fm;
}
-LY_DEFINE (ly_font_interface_get_default_font, "ly:get-default-font",
- 1, 0, 0, (SCM grob),
- "Return the default font for grob @var{gr}.")
-{
- Grob *gr = unsmob_grob (grob);
- SCM_ASSERT_TYPE (gr, grob, SCM_ARG1, __FUNCTION__, "grob");
-
- return Font_interface::get_default_font (gr)->self_scm ();
-}
-
SCM
Font_interface::music_font_alist_chain (Grob *g)
{
struct Axis_group_interface
{
DECLARE_SCHEME_CALLBACK (group_extent_callback, (SCM smob, SCM axis));
- static Interval relative_group_extent (Axis, Grob *common, SCM list);
+ static Interval relative_group_extent (SCM list, Grob *common, Axis);
static void add_element (Grob *me, Grob *);
static void set_axes (Grob *, Axis, Axis);
SCM style = me->get_property ("style");
if (!scm_is_symbol (style))
{
- return Stencil ();
+ style = ly_symbol2scm ("default");
}
SCM log = scm_int2num (Note_head::get_balltype (me));
SCM proc = me->get_property ("glyph-name-procedure");
- SCM scm_font_char = scm_call_2 (proc, log, style);
+ String suffix = to_string (robust_scm2int (me->get_property ("duration-log"), 2));
+ if (scm_procedure_p (proc) == SCM_BOOL_T)
+ suffix = ly_scm2string (scm_call_2 (proc, log, style));
+
Font_metric *fm = Font_interface::get_default_font (me);
Direction stem_dir = CENTER;
String prefix = "noteheads.";
String idx
- = prefix + ((stem_dir == UP) ? "u" : "d") + ly_scm2string (scm_font_char);
+ = prefix + ((stem_dir == UP) ? "u" : "d") + suffix;
out = fm->find_by_name (idx);
if (out.is_empty ())
{
- idx = prefix + "s" + ly_scm2string (scm_font_char);
+ idx = prefix + "s" + suffix;
out = fm->find_by_name (idx);
}
--- /dev/null
+/*
+ pitched-trill-engraver.cc -- implement Pitched_trill_engraver
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
+
+*/
+
+#include "engraver.hh"
+
+#include "group-interface.hh"
+#include "axis-group-interface.hh"
+#include "context.hh"
+#include "note-head.hh"
+#include "item.hh"
+#include "side-position-interface.hh"
+#include "pitch.hh"
+#include "warn.hh"
+
+class Pitched_trill_engraver : public Engraver
+{
+
+public:
+ TRANSLATOR_DECLARATIONS(Pitched_trill_engraver);
+
+protected:
+ virtual void acknowledge_grob (Grob_info);
+ virtual void process_music ();
+ virtual bool try_music (Music*);
+ virtual void stop_translation_timestep ();
+private:
+ Item *trill_head_;
+ Item *trill_group_;
+ Item *trill_accidental_;
+
+ Link_array<Grob> heads_;
+
+ void make_trill (Music *);
+};
+
+
+Pitched_trill_engraver::Pitched_trill_engraver ()
+{
+ trill_head_ = 0;
+ trill_group_ = 0;
+ trill_accidental_ = 0;
+}
+
+void
+Pitched_trill_engraver::acknowledge_grob (Grob_info info)
+{
+ Music *mus = info.music_cause ();
+
+ if (Note_head::has_interface (info.grob ()))
+ {
+ heads_.push (info.grob ());
+ }
+ else if (mus
+ && mus->is_mus_type ("trill-span-event")
+ && to_dir (mus->get_property ("span-direction")) == START
+ && unsmob_pitch (mus->get_property ("trill-pitch")))
+ {
+ make_trill (mus);
+ }
+}
+
+void
+Pitched_trill_engraver::make_trill (Music *mus)
+{
+ SCM scm_pitch = mus->get_property ("trill-pitch");
+ Pitch * p = unsmob_pitch (scm_pitch);
+
+ SCM keysig = get_property ("localKeySignature");
+
+ SCM key = scm_cons (scm_int2num (p->get_octave ()),
+ scm_int2num (p->get_notename ()));
+
+ SCM handle = scm_assoc (key, keysig);
+ bool print_acc =
+ (handle == SCM_BOOL_F)
+ || p->get_alteration () == 0;
+
+ if (trill_head_)
+ {
+ programming_error ("already have a trill head.");
+ trill_head_ = 0;
+ }
+
+ trill_head_ = make_item ("TrillPitchHead", mus->self_scm ());
+ SCM c0scm = get_property ("middleCPosition");
+
+ int c0 = scm_is_number (c0scm) ? scm_to_int (c0scm) : 0;
+
+ trill_head_->set_property ("staff-position",
+ scm_from_int (unsmob_pitch (scm_pitch)->steps ()
+ + c0));
+
+ trill_group_ = make_item ("TrillPitchGroup", mus->self_scm());
+
+ Axis_group_interface::add_element (trill_group_, trill_head_);
+
+ if (print_acc)
+ {
+ trill_accidental_ = make_item ("TrillPitchAccidental", mus->self_scm ());
+
+ // fixme: naming -> alterations
+ trill_accidental_->set_property ("accidentals", scm_list_1 (scm_from_int (p->get_alteration ())));
+ Side_position_interface::add_support (trill_accidental_, trill_head_);
+ trill_head_->set_property ("accidental-grob", trill_accidental_->self_scm ());
+ trill_group_->set_parent (trill_head_, Y_AXIS);
+ Axis_group_interface::add_element (trill_group_, trill_accidental_);
+ trill_accidental_->set_parent (trill_head_, Y_AXIS);
+ }
+}
+
+void
+Pitched_trill_engraver::stop_translation_timestep ()
+{
+ if (trill_group_)
+ for (int i = 0; i < heads_.size (); i++)
+ {
+ Side_position_interface::add_support (trill_group_, heads_[i]);
+ }
+
+ heads_.clear ();
+ trill_head_ = 0;
+ trill_group_ = 0;
+ trill_accidental_ = 0;
+}
+
+void
+Pitched_trill_engraver::process_music ()
+{
+}
+
+bool
+Pitched_trill_engraver::try_music (Music *)
+{
+ return false;
+}
+
+ADD_TRANSLATOR (Pitched_trill_engraver,
+ /* descr */ "Print the bracketed notehead after a notehead with trill.",
+ /* creats*/ "TrillPitchHead TrillPitchAccidental TrillPitchGroup",
+ /* accepts */ "",
+ /* acks */ "script-interface text-spanner-interface note-head-interface",
+ /* reads */ "",
+ /* write */ "");
private:
Spanner *span_;
Spanner *finished_;
- Music *current_req_;
- Drul_array<Music *> req_drul_;
+ Music *current_event_;
+ Drul_array<Music *> event_drul_;
void typeset_all ();
};
Trill_spanner_engraver::Trill_spanner_engraver ()
{
finished_ = 0;
- current_req_ = 0;
+ current_event_ = 0;
span_ = 0;
- req_drul_[START] = 0;
- req_drul_[STOP] = 0;
+ event_drul_[START] = 0;
+ event_drul_[STOP] = 0;
}
bool
if (m->is_mus_type ("trill-span-event"))
{
Direction d = to_dir (m->get_property ("span-direction"));
- req_drul_[d] = m;
+ event_drul_[d] = m;
return true;
}
void
Trill_spanner_engraver::process_music ()
{
- if (req_drul_[STOP])
+ if (event_drul_[STOP])
{
if (!span_)
{
- req_drul_[STOP]->origin ()->warning (_ ("can't find start of trill spanner"));
+ event_drul_[STOP]->origin ()->warning (_ ("can't find start of trill spanner"));
}
else
{
finished_ = span_;
span_ = 0;
- current_req_ = 0;
+ current_event_ = 0;
}
}
- if (req_drul_[START])
+ if (event_drul_[START])
{
- if (current_req_)
+ if (current_event_)
{
- req_drul_[START]->origin ()->warning (_ ("already have a trill spanner"));
+ event_drul_[START]->origin ()->warning (_ ("already have a trill spanner"));
}
else
{
- current_req_ = req_drul_[START];
- span_ = make_spanner ("TrillSpanner", req_drul_[START]->self_scm ());
+ current_event_ = event_drul_[START];
+ span_ = make_spanner ("TrillSpanner", event_drul_[START]->self_scm ());
Side_position_interface::set_axis (span_, Y_AXIS);
- req_drul_[START] = 0;
+ event_drul_[START] = 0;
}
}
}
}
typeset_all ();
- req_drul_[START] = 0;
- req_drul_[STOP] = 0;
+ event_drul_[START] = 0;
+ event_drul_[STOP] = 0;
}
void
typeset_all ();
if (span_)
{
- current_req_->origin ()->warning (_ ("unterminated trill spanner"));
+ current_event_->origin ()->warning (_ ("unterminated trill spanner"));
span_->suicide ();
span_ = 0;
}
}
-\version "2.5.25" % necessary for upgrading to future LilyPond versions.
+\version "2.6.0" % necessary for upgrading to future LilyPond versions.
-\version "2.4.0"
+\version "2.6.0"
% Symbols needed to print accordion music
%
% 2' = T
pitchnames = \pitchnamesCatalan
-\version "2.4.0"
+\version "2.6.0"
#(ly:parser-set-note-names parser pitchnames)
-\version "2.4.0"
+\version "2.6.0"
chordmodifiers = #default-chord-modifier-list
-\version "2.4.0"
+\version "2.6.0"
%% < 1.8 compatibility switch
#(ly:set-option 'old-relative)
pitchnames = \pitchnamesDeutsch
-\version "2.4.0"
+\version "2.6.0"
#(ly:parser-set-note-names parser pitchnames)
-\version "2.4.0"
+\version "2.6.0"
drumPitchNames =
#'((acousticbassdrum . acousticbassdrum)
-\version "2.4.0"
+\version "2.6.0"
%
% declare the standard dynamic identifiers.
pitchnames = \pitchnamesEnglish
-\version "2.4.0"
+\version "2.6.0"
#(ly:parser-set-note-names parser pitchnames)
-\version "2.4.0"
+\version "2.5.18"
\context {
\name Global
localKeySignature = #'()
\consists "Font_size_engraver"
-
+
+ \consists "Pitched_trill_engraver"
\consists "Output_property_engraver"
\consists "Arpeggio_engraver"
\consists "Multi_measure_rest_engraver"
%}
-% contributed by Carlos GarcÃa Suárez <<cgscqmp@terra.es>>
+% contributed by Carlos GarcÃa Suárez <<cgscqmp@terra.es>>
% For using "sostingut" notation, which is also correct
pitchnames = \pitchnamesEspanol
-\version "2.4.0"
+\version "2.6.0"
#(ly:parser-set-note-names parser pitchnames)
-\version "2.4.0"
+\version "2.6.0"
%
% Running LilyPond on this file generates the documentation
-\version "2.4.0"
+\version "2.6.0"
%
% Running LilyPond on this file generates the short interface doc
-\version "2.4.0"
+\version "2.6.0"
startGraceMusic = {
-\version "2.4.0"
+\version "2.6.0"
%%%%%%%%
%%%%%%%% shortcuts common for all styles of gregorian chant notation
#(define-public midi-debug #f)
-\version "2.4.0"
+\version "2.6.0"
\include "declarations-init.ly"
pitchnames = \pitchnamesItaliano
-\version "2.4.0"
+\version "2.6.0"
#(ly:parser-set-note-names parser pitchnames)
-\version "2.4.0"
+\version "2.6.0"
\midi {
\tempo 4=60
\include "performer-init.ly"
-\version "2.4.0"
+% -*-Scheme-*-
+
+\version "2.6.0"
applymusic = #(def-music-function (parser location func music) (procedure? ly:music?)
+pitchedTrill =
+#(def-music-function
+ (parser location main-note secondary-note)
+ (ly:music? ly:music?)
+ (let*
+ ((get-notes (lambda (ev-chord)
+ (filter
+ (lambda (m) (eq? 'NoteEvent (ly:music-property m 'name)))
+ (ly:music-property ev-chord 'elements))))
+ (sec-note-events (get-notes secondary-note))
+ (trill-events (filter (lambda (m) (memq 'trill-span-event (ly:music-property m 'types)))
+ (ly:music-property main-note 'elements)))
+
+ (trill-pitch
+ (if (pair? sec-note-events)
+ (ly:music-property (car sec-note-events) 'pitch)
+ )))
+
+ (if (ly:pitch? trill-pitch)
+ (for-each (lambda (m) (ly:music-set-property! m 'trill-pitch trill-pitch))
+ trill-events)
+ (ly:warning (_ "Second argument of \\pitchedTrill should be single note.")))
+
+ main-note))
killCues =
#(def-music-function
-\version "2.4.0"
+\version "2.6.0"
%{
common dutch names for notes. es means flat, is means sharp
pitchnames =\pitchnamesNorsk
-\version "2.4.0"
+\version "2.6.0"
#(ly:parser-set-note-names parser pitchnames)
-\version "2.4.0"
+\version "2.6.0"
\paper {
-\version "2.4.0"
+\version "2.6.0"
-\version "2.4.0"
+\version "2.6.0"
%
% setup for Request->Element conversion. Guru-only
%}
-% contributed by Pedro Kröger <<kroeger@pedrokroeger.net>>
+% contributed by Pedro Kröger <<kroeger@pedrokroeger.net>>
pitchnamesPortuguese = #`(
pitchnames = \pitchnamesPortuguese
-\version "2.4.0"
+\version "2.6.0"
#(ly:parser-set-note-names parser pitchnames)
% property-init.ly
-\version "2.4.0"
+\version "2.6.0"
stemUp = \override Stem #'direction = #1
stemDown = \override Stem #'direction = #-1
-\version "2.4.0"
+\version "2.6.0"
major = #`(
-\version "2.4.0"
+\version "2.6.0"
% code char abbreviations
-\version "2.4.0"
+\version "2.6.0"
startGroup = #(make-span-event 'NoteGroupingEvent START)
stopGroup = #(make-span-event 'NoteGroupingEvent STOP)
pitchnames = \pitchnamesSuomi
-\version "2.4.0"
+\version "2.6.0"
#(ly:parser-set-note-names parser pitchnames)
)
pitchnames = \pitchnamesSvenska
-\version "2.4.0"
+\version "2.6.0"
#(ly:parser-set-note-names parser pitchnames)
-\version "2.4.0" %hier stond 2.1.36, mocht ik dat wel veranderen?
+\version "2.6.0" %hier stond 2.1.36, mocht ik dat wel veranderen?
%{
;;;; WARNING: don't use anonymous functions for initialization.
;; TODO: junk the meta field in favor of something more compact?
+
+;;; todo:: reorder sensibly.
+
(define-public all-grob-descriptions
`(
(Accidental
(AmbitusNoteHead
. (
(duration-log . 2)
- (style . default)
(print-function . ,Note_head::print)
(glyph-name-procedure . ,find-notehead-symbol)
(Y-offset-callbacks . (,Staff_symbol_referencer::callback))
(meta . ((interfaces . (cluster-interface spanner-interface))))
))
+
(ChordName
. (
(print-function . ,Text_interface::print)
item-interface))))
))
+ (CombineTextScript
+ . (
+ (print-function . ,Text_interface::print)
+ (no-spacing-rods . #t)
+ (Y-offset-callbacks . (,Side_position_interface::aligned_side))
+ (X-offset-callbacks . (,Self_alignment_interface::aligned_on_self))
+ (direction . 1)
+ (padding . 0.5)
+ (staff-padding . 0.5)
+ (script-priority . 200)
+ ;; todo: add X self alignment?
+ (baseline-skip . 2)
+ (font-series . bold)
+ (meta . ((interfaces . (text-script-interface
+ text-interface side-position-interface
+ font-interface item-interface ))))
+ ))
+
(Custos
. (
(break-align-symbol . custos)
(meta . ((interfaces . (dynamic-interface axis-group-interface
side-position-interface spanner-interface))))))
- (LeftEdge
- . (
- (break-align-symbol . left-edge)
- (X-extent . (0 . 0))
- (breakable . #t)
- (break-visibility . ,center-invisible)
- (space-alist . (
- (custos . (extra-space . 0.0))
- (ambitus . (extra-space . 2.0))
- (time-signature . (extra-space . 0.0))
- (staff-bar . (extra-space . 0.0))
- (breathing-sign . (minimum-space . 0.0))
- (clef . (extra-space . 0.8))
- (first-note . (fixed-space . 1.0))
- (right-edge . (extra-space . 0.0))
- (key-signature . (extra-space . 0.0))
- (key-cancellation . (extra-space . 0.0))
-
- ))
- (meta . ((interfaces . (break-aligned-interface item-interface ))))
- ))
-
(Fingering
. (
(print-function . ,Text_interface::print)
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
. (
(style . line)
break-aligned-interface item-interface ))))
))
- (VocalName
- . (
- (breakable . #t)
- (Y-offset-callbacks . (,Side_position_interface::aligned_on_support_refpoints))
- (direction . 0)
- (space-alist . ((left-edge . (extra-space . 1.0))
- ))
- (break-align-symbol . instrument-name)
- (print-function . ,Text_interface::print)
- (break-align-symbol . clef)
- (break-visibility . ,begin-of-line-visible)
- (baseline-skip . 2)
- (meta . ((interfaces . (font-interface
- self-alignment-interface
- side-position-interface text-interface
- break-aligned-interface item-interface ))))
- ))
(KeyCancellation
. (
(print-function . ,Key_signature_interface::print)
(meta . ((interfaces . (spanner-interface ledger-line-interface))))
))
+ (LeftEdge
+ . (
+ (break-align-symbol . left-edge)
+ (X-extent . (0 . 0))
+ (breakable . #t)
+ (break-visibility . ,center-invisible)
+ (space-alist . (
+ (custos . (extra-space . 0.0))
+ (ambitus . (extra-space . 2.0))
+ (time-signature . (extra-space . 0.0))
+ (staff-bar . (extra-space . 0.0))
+ (breathing-sign . (minimum-space . 0.0))
+ (clef . (extra-space . 0.8))
+ (first-note . (fixed-space . 1.0))
+ (right-edge . (extra-space . 0.0))
+ (key-signature . (extra-space . 0.0))
+ (key-cancellation . (extra-space . 0.0))
+
+ ))
+ (meta . ((interfaces . (break-aligned-interface item-interface ))))
+ ))
+
(LigatureBracket
. (
(ligature-primitive-callback . ,Note_head::print)
(meta . ((interfaces . (mensural-ligature-interface font-interface))))
))
- (RehearsalMark
- . (
- (print-function . ,Text_interface::print)
- (X-offset-callbacks . (,Self_alignment_interface::aligned_on_self))
- (Y-offset-callbacks . (,Side_position_interface::aligned_side))
- (after-line-breaking-callback . ,shift-right-at-line-begin)
- (self-alignment-X . 0)
- (direction . 1)
- (breakable . #t)
- (font-size . 2)
- (baseline-skip . 2)
- (break-visibility . ,end-of-line-invisible)
- (padding . 0.8)
- (meta . ((interfaces . (text-interface
- side-position-interface font-interface mark-interface
- self-alignment-interface item-interface ))))
- ))
(MetronomeMark
. (
(print-function . ,Text_interface::print)
(NoteHead
. (
- (style . default)
(print-function . ,Note_head::print)
(ligature-primitive-callback . ,Note_head::print)
(glyph-name-procedure . ,find-notehead-symbol)
(meta . ((interfaces . (spacing-interface note-spacing-interface item-interface ))))
))
- (VoiceFollower
- . (
- (style . line)
- (gap . 0.5)
- (breakable . #t)
- (X-extent-callback . #f)
- (Y-extent-callback . #f)
- (print-function . ,Line_spanner::print)
- (after-line-breaking-callback . ,Line_spanner::after_line_breaking)
- (meta . ((interfaces . (line-spanner-interface line-interface spanner-interface))))
- ))
(NoteName
. (
(meta . ((interfaces . (text-interface self-alignment-interface side-position-interface font-interface item-interface ))))
))
+ (OttavaBracket
+ . (
+ (Y-offset-callbacks . (,Side_position_interface::aligned_side))
+ (print-function . ,Ottava_bracket::print)
+ (font-shape . italic)
+ (shorten-pair . (0.0 . -0.6))
+ (staff-padding . 1.0)
+ (padding . 0.5)
+ (minimum-length . 1.0)
+ (dash-fraction . 0.3)
+ (edge-height . (0 . 1.2))
+ (direction . 1)
+ (meta . ((interfaces . (ottava-bracket-interface
+ line-interface side-position-interface
+ font-interface text-interface spanner-interface))))
+ ))
+
(PaperColumn
. (
(axes . (0))
piano-pedal-interface piano-pedal-bracket-interface spanner-interface))))
))
+ (RehearsalMark
+ . (
+ (print-function . ,Text_interface::print)
+ (X-offset-callbacks . (,Self_alignment_interface::aligned_on_self))
+ (Y-offset-callbacks . (,Side_position_interface::aligned_side))
+ (after-line-breaking-callback . ,shift-right-at-line-begin)
+ (self-alignment-X . 0)
+ (direction . 1)
+ (breakable . #t)
+ (font-size . 2)
+ (baseline-skip . 2)
+ (break-visibility . ,end-of-line-invisible)
+ (padding . 0.8)
+ (meta . ((interfaces . (text-interface
+ side-position-interface font-interface mark-interface
+ self-alignment-interface item-interface ))))
+ ))
+
(RemoveEmptyVerticalGroup
. (
(meta . ((interfaces . (script-column-interface item-interface ))))
))
+
+ (SeparationItem
+ . (
+ (X-extent-callback . #f)
+ (Y-extent-callback . #f)
+ (meta . ((interfaces . (spacing-interface separation-item-interface item-interface ))))
+ ))
+
+ (SeparatingGroupSpanner
+ . (
+ (spacing-procedure . ,Separating_group_spanner::set_spacing_rods)
+ (meta . ((interfaces . (only-prebreak-interface spacing-interface separation-spanner-interface spanner-interface))))
+ ))
+
(Slur
. ((slur-details . ,default-slur-details)
(print-function . ,Slur::print)
stanza-number-interface text-interface font-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))))
+ ))
+
(StaffSpacing
. (
(breakable . #t)
(meta . ((interfaces . (stem-tremolo-interface item-interface ))))
))
- (SeparationItem
- . (
- (X-extent-callback . #f)
- (Y-extent-callback . #f)
- (meta . ((interfaces . (spacing-interface separation-item-interface item-interface ))))
- ))
-
- (SeparatingGroupSpanner
- . (
- (spacing-procedure . ,Separating_group_spanner::set_spacing_rods)
- (meta . ((interfaces . (only-prebreak-interface spacing-interface separation-spanner-interface spanner-interface))))
- ))
-
(SustainPedal
. (
(no-spacing-rods . #t)
(meta . ((interfaces . (system-start-delimiter-interface spanner-interface))))
))
+
+ (TabNoteHead
+ . (
+ (print-function . ,Text_interface::print)
+ (Y-offset-callbacks . (,Staff_symbol_referencer::callback))
+ (stem-attachment-function . ,tablature-stem-attachment-function)
+ (font-series . bold)
+ (meta . ((interfaces
+ . (rhythmic-head-interface
+ font-interface
+ note-head-interface staff-symbol-referencer-interface
+ text-interface item-interface ))))
+ ))
+
+
(TextScript
. (
(print-function . ,Text_interface::print)
text-interface side-position-interface font-interface
item-interface ))))
))
- (CombineTextScript
- . (
- (print-function . ,Text_interface::print)
- (no-spacing-rods . #t)
- (Y-offset-callbacks . (,Side_position_interface::aligned_side))
- (X-offset-callbacks . (,Self_alignment_interface::aligned_on_self))
- (direction . 1)
- (padding . 0.5)
- (staff-padding . 0.5)
- (script-priority . 200)
- ;; todo: add X self alignment?
- (baseline-skip . 2)
- (font-series . bold)
- (meta . ((interfaces . (text-script-interface text-interface side-position-interface font-interface item-interface ))))
- ))
+
(TextSpanner
. (
(print-function . ,Text_spanner::print)
(direction . 1)
(meta . ((interfaces . (text-spanner-interface side-position-interface font-interface spanner-interface))))
))
- (TrillSpanner
- . (
- (print-function . ,Dynamic_text_spanner::print)
- (edge-text . ,(cons (make-musicglyph-markup "scripts.trill")
- ""))
- (style . trill)
- (staff-padding . 1.0)
- (padding . 0.5)
- (direction . 1)
- (Y-offset-callbacks . (,Side_position_interface::aligned_side))
- (meta . ((interfaces . (text-spanner-interface side-position-interface font-interface spanner-interface))))
- ))
-
- (OttavaBracket
- . (
- (Y-offset-callbacks . (,Side_position_interface::aligned_side))
- (print-function . ,Ottava_bracket::print)
- (font-shape . italic)
- (shorten-pair . (0.0 . -0.6))
- (staff-padding . 1.0)
- (padding . 0.5)
- (minimum-length . 1.0)
- (dash-fraction . 0.3)
- (edge-height . (0 . 1.2))
- (direction . 1)
- (meta . ((interfaces . (ottava-bracket-interface
- line-interface side-position-interface
- font-interface text-interface spanner-interface))))
- ))
-
- (TabNoteHead
- . (
- (style . default)
- (print-function . ,Text_interface::print)
- (Y-offset-callbacks . (,Staff_symbol_referencer::callback))
- (stem-attachment-function . ,tablature-stem-attachment-function)
- (font-series . bold)
- (meta . ((interfaces
- . (rhythmic-head-interface
- font-interface
- note-head-interface staff-symbol-referencer-interface
- text-interface item-interface ))))
- ))
-
+
(Tie
. (
(print-function . ,Tie::print)
(meta . ((interfaces . (time-signature-interface break-aligned-interface font-interface item-interface ))))
))
+
+ (TrillSpanner
+ . (
+ (print-function . ,Dynamic_text_spanner::print)
+ (edge-text . ,(cons (make-musicglyph-markup "scripts.trill")
+ ""))
+ (style . trill)
+ (staff-padding . 1.0)
+ (padding . 0.5)
+ (direction . 1)
+ (Y-offset-callbacks . (,Side_position_interface::aligned_side))
+ (meta . ((interfaces . (text-spanner-interface side-position-interface font-interface spanner-interface))))
+ ))
+
+ (TrillPitchAccidental
+ . ((X-offset-callbacks . (,Side_position_interface::aligned_side))
+ (padding . 0.2)
+ (direction . ,LEFT)
+ (font-size . -4)
+ (print-function . ,Accidental_interface::print)
+ (meta . ((interfaces . (item-interface font-interface))))
+ ))
+
+ (TrillPitchGroup
+ . ((X-offset-callbacks . (,Side_position_interface::aligned_side))
+ (axes . (,X))
+ (font-size . -4)
+ (print-function . ,parenthesize-elements)
+ (direction . ,RIGHT)
+ (padding . 0.3)
+ (meta . ((interfaces . (font-interface item-interface axis-group-interface))))
+ ))
+
+ (TrillPitchHead
+ . ((print-function . ,Note_head::print)
+ (duration-log . 2)
+ (Y-offset-callbacks . (,Staff_symbol_referencer::callback))
+ (font-size . -4)
+ (meta . ((interfaces . (item-interface font-interface ledgered-interface staff-symbol-referencer-interface))))
+ ))
+
+
(TupletBracket
. (
(padding . 1.1)
; (font-series . bold)
(font-size . -2)
- (meta . ((interfaces . (text-interface line-interface tuplet-bracket-interface font-interface spanner-interface))))
+ (meta . ((interfaces . (text-interface line-interface
+ tuplet-bracket-interface
+ font-interface spanner-interface))))
))
(UnaCordaPedal
(meta . ((interfaces . (vaticana-ligature-interface font-interface))))
))
- (VoltaBracket
- . (
- (print-function . ,Volta_bracket_interface::print)
- (direction . 1)
- (padding . 1)
- (font-encoding . fetaNumber)
- (Y-offset-callbacks . (,Side_position_interface::aligned_side))
- (thickness . 1.6) ;; linethickness
- (height . 2.0) ;; staffspace;
- (minimum-space . 5)
- (font-size . -4)
- (meta . ((interfaces . (volta-bracket-interface
- line-interface text-interface
- side-position-interface font-interface spanner-interface))))
- ))
(VerticalAlignment
. (
(meta . ((interfaces . (axis-group-interface
vertically-spaceable-interface spanner-interface))))
))
+
+ (VocalName
+ . (
+ (breakable . #t)
+ (Y-offset-callbacks . (,Side_position_interface::aligned_on_support_refpoints))
+ (direction . 0)
+ (space-alist . ((left-edge . (extra-space . 1.0))
+ ))
+ (break-align-symbol . instrument-name)
+ (print-function . ,Text_interface::print)
+ (break-align-symbol . clef)
+ (break-visibility . ,begin-of-line-visible)
+ (baseline-skip . 2)
+ (meta . ((interfaces . (font-interface
+ self-alignment-interface
+ side-position-interface text-interface
+ break-aligned-interface item-interface ))))
+ ))
+
+ (VoltaBracket
+ . (
+ (print-function . ,Volta_bracket_interface::print)
+ (direction . 1)
+ (padding . 1)
+ (font-encoding . fetaNumber)
+ (Y-offset-callbacks . (,Side_position_interface::aligned_side))
+ (thickness . 1.6) ;; linethickness
+ (height . 2.0) ;; staffspace;
+ (minimum-space . 5)
+ (font-size . -4)
+ (meta . ((interfaces . (volta-bracket-interface
+ line-interface text-interface
+ side-position-interface font-interface spanner-interface))))
+ ))
+
+
+ (VoiceFollower
+ . (
+ (style . line)
+ (gap . 0.5)
+ (breakable . #t)
+ (X-extent-callback . #f)
+ (Y-extent-callback . #f)
+ (print-function . ,Line_spanner::print)
+ (after-line-breaking-callback . ,Line_spanner::after_line_breaking)
+ (meta . ((interfaces . (line-spanner-interface line-interface spanner-interface))))
+ ))
))
(define (completize-grob-entry x)
(cons (+ (- half) (car yext))
(+ half (cdr yext))))))
-
(def-markup-command (box layout props arg) (markup?)
"Draw a box round @var{arg}. Looks at @code{thickness},
@code{box-padding} and @code{font-size} properties to determine line
(m (interpret-markup layout props arg)))
(box-stencil m th pad)))
-
-
(def-markup-command (filled-box layout props xext yext blot)
(number-pair? number-pair? number?)
"Draw a box with rounded corners of dimensions @var{xext} and @var{yext}."
(ly:stencil-add white stil)))
+(def-markup-command (pad-markup layout props padding arg) (number? markup?)
+ "Add space around a markup object."
+
+ (let*
+ ((stil (interpret-markup layout props arg))
+ (xext (ly:stencil-extent stil X))
+ (yext (ly:stencil-extent stil Y)))
+
+ (ly:make-stencil
+ (ly:stencil-expr stil)
+ (interval-widen xext padding)
+ (interval-widen yext padding))))
+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; space
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
"Stencil as markup"
stil)
-
(define bbox-regexp
(make-regexp "%%BoundingBox: ([0-9-]+) ([0-9-]+) ([0-9-]+) ([0-9-]+)"))
(digit ,integer? "digit for fingering")
(direction ,ly:dir? "Print this up or down?")
(drum-type ,symbol? "Which percussion instrument to play this note on.")
- (tags ,list? "List of symbols that for denoting extra details,
-e.g. @code{\\tag #'part ...} could tag a piece of music as only being active in a part.")
- (text-type ,symbol? "Particular type of text script (e.g. finger, dynamic).")
- (tempo-unit ,ly:duration? "The unit for the metronome count.")
- (tonic ,ly:pitch? "Base of the scale")
(error-found ,boolean? "If true, a parsing error was found in this expression")
(element ,ly:music? "The single child of a Music_wrapper music object, or the body of a repeat.")
(elements ,ly:music-list? "A list of elements for sequential of simultaneous music, or the alternatives of repeated music. ")
(numerator ,integer? "numerator of a time signature")
(once ,boolean? "Apply this operation only during one time step?")
(octavation ,integer?
- "This pitch was octavated by how many octaves?
+ "This pitch was octavated by how many octaves?
For chord inversions, this is negative.")
(origin ,ly:input-location? "where was this piece of music defined?")
(page-penalty ,number? "Penalty for page break hint.")
initializer in @file{define-music-types.scm}.")
(string-number ,integer? "The number of the string in a StringNumberEvent")
(symbol ,symbol? "Grob name to perform an override/revert on.")
+ (tags ,list? "List of symbols that for denoting extra details,
+e.g. @code{\\tag #'part ...} could tag a piece of music as only being active in a part.")
+ (text-type ,symbol? "Particular type of text script (e.g. finger, dynamic).")
+
(text ,markup? "markup expression to be printed")
+ (tempo-unit ,ly:duration? "The unit for the metronome count.")
+ (tonic ,ly:pitch? "Base of the scale")
(tremolo-type ,integer? "")
+ (trill-pitch ,ly:pitch? "Pitch of other note of the trill.")
(type ,symbol? "The type of this music object. Determines iteration in some cases.")
(types ,list? "The types of this music object; determines by what
engraver this music expression is processed.")
(define-public darkcyan '(0.5 0.5 0.0))
(define-public darkmagenta '(0.5 0.0 0.5))
(define-public darkyellow '(0.0 0.5 0.5))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Pitch Trill Heads
+
+(define (parenthesize-elements grob)
+ (let*
+ ((elts (ly:grob-property grob 'elements))
+ (x-ext (ly:relative-group-extent elts grob X))
+ (font (ly:grob-default-font grob))
+ (lp (ly:font-get-glyph font "accidentals.leftparen"))
+ (rp (ly:font-get-glyph font "accidentals.rightparen"))
+ (padding 0.1))
+
+ (ly:stencil-add
+ (ly:stencil-translate-axis lp (- (car x-ext) padding) X)
+ (ly:stencil-translate-axis rp (+ (cdr x-ext) padding) X))
+ ))
ly:format-output
ly:get-all-function-documentation
ly:get-all-translators
- ly:get-default-font
ly:get-glyph
ly:get-option
ly:grob-alist-chain
+ ly:grob-default-font
ly:grob-extent
ly:grob-original
ly:grob-layout
(define-public (format-mark-box-barnumbers mark context)
(make-bold-markup (make-box-markup
(number->string (ly:context-property context 'currentBarNumber)))))
+
+(define-public (format-pitched-trill-head pitch do-print-accidental context)
+ (make-override-markup
+ '(word-space . 0.0)
+ (make-line-markup
+ (append
+ (list
+ (make-musicglyph-markup "accidentals.leftparen"))
+ (if do-print-accidental
+ (list (make-musicglyph-markup
+ (string-append "accidentals."
+ (number->string (ly:pitch-alteration pitch))))
+ (make-hspace-markup 0.2))
+ '())
+
+ (list
+ (make-musicglyph-markup "noteheads.s2")
+ (make-musicglyph-markup "accidentals.rightparen"))
+ ))))