vermeiden. Zusätzliche Stimmen werden durch einen neuen Bezeichner
erstellt, wie das nächste Beispiel zeigt.
-@lilypond[quote,verbatim,ragged-right,relative=2]
+@lilypond[quote,verbatim,ragged-right]
voiceFive = #(context-spec-music (make-voice-props-set 4) 'Voice)
\relative c''' <<
@snippets
@lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
-{grid-lines-changing-their-appearance.ly}
+{grid-lines--changing-their-appearance.ly}
@seealso
tiene fácil solución. Presentamos aquí la plantilla completa para
soprano y cello.
-@lilypond[quote,verbatim,ragged-right]
-\version "2.11.38"
+@lilypond[quote,verbatim,ragged-right,addversion]
sopranoMusic = \relative c' {
\clef treble
\key c \major
Al combinar todo esto junto y escribir la música de los tres compases
del ejemplo anterior, obtenemos:
-@lilypond[quote,verbatim,ragged-right]
-\version "2.11.38"
+@lilypond[quote,verbatim,ragged-right,addversion]
global = { \key d \major \time 4/4 }
sopMusic = \relative c'' {
\clef "treble"
puede variar. Todo lo que nos queda es añadir la música, y combinar
todas las partes.
-@lilypond[quote,verbatim,ragged-right]
-\version "2.11.38"
+@lilypond[quote,verbatim,ragged-right,addversion]
\header {
title = "Jesu, meine Freude"
composer = "J S Bach"
adicionales se añaden definiendo una variable, como se muestra a
continuación:
-@lilypond[quote,verbatim,ragged-right,relative=2]
+@lilypond[quote,verbatim,ragged-right]
voiceFive = #(context-spec-music (make-voice-props-set 4) 'Voice)
\relative c''' <<
podemos establecer la propiedad @code{printPartCombineTexts} al valor
false.
-@lilypond[quote,verbatim,ragged-right,fragment,relative=2]
+@lilypond[quote,verbatim,ragged-right,fragment]
\new Staff <<
\set Staff.printPartCombineTexts = ##f
\partcombine
podemos establecer las propiedades @code{soloText}, @code{soloIIText}
y @code{aDueText}.
-@lilypond[quote,verbatim,ragged-right,fragment,relative=2]
+@lilypond[quote,verbatim,ragged-right,fragment]
\new Staff <<
\set Score.soloText = #"ichi"
\set Score.soloIIText = #"ni"
@lilypond[ragged-right,verbatim,fragment,quote]
\time 3/4
-\relative { c2 e4 g2. }
+\relative c' { c2 e4 g2. }
\addlyrics { play the game }
@end lilypond
@lilypond[ragged-right,verbatim,fragment,quote]
\time 3/4
-\relative { c2 e4 g2. }
+\relative c' { c2 e4 g2. }
\addlyrics { play the game }
\addlyrics { speel het spel }
\addlyrics { joue le jeu }
espacios entre las sílabas, o usar el símbolo de tilde curva
(@code{~}) para obtener una ligadura entre sílabas de la letra.
-@lilypond[quote,relative=2,ragged-right,fragment,verbatim]
+@lilypond[quote,ragged-right,fragment,verbatim]
\time 3/4
-\relative { c2 e4 g2 e4 }
+\relative c' { c2 e4 g2 e4 }
\addlyrics { gran- de_a- mi- go }
\addlyrics { pu- "ro y ho-" nes- to }
\addlyrics { pu- ro~y~ho- nes- to }
@c FIXME: quotes.
@lilypond[quote,ragged-right,fragment,verbatim]
-\relative { e4 f e d e f e2 }
+\relative c' { e4 f e d e f e2 }
\addlyrics { He said: “Let my peo ple go”. }
@end lilypond
tanto debe asegurarse de tener instalada una tipografía (como
DejaVuLGC) que incluya este glifo.}.
-@lilypond[quote,relative=2,ragged-right,fragment,verbatim]
+@lilypond[quote,ragged-right,fragment,verbatim]
\time 3/4
-\relative { c2 e4 g2 e4 }
+\relative c' { c2 e4 g2 e4 }
\addlyrics { gran- de_a- mi- go }
\addlyrics { pu- "ro y ho-" nes- to }
\addlyrics { pu- ro~y~ho- nes- to }
Para que este cambio sea válido para la letra de la partitura
completa, establezca la propiedad dentro del @q{layout} o disposición.
-@lilypond[relative,verbatim,quote,ragged-right]
+@lilypond[verbatim,quote,ragged-right]
\score {
\relative c' {
c c c c
Hi, my name is Bert.
} \addlyrics {
\set vocalName = "Ernie "
- Oh, che -- ri, je t'aime
+ Oh, ché -- ri, je t'aime
}
@end lilypond
@lilypond[verbatim,ragged-right,quote]
%{
<<
- \relative \new Voice = "lahlah" {
+ \relative c' \new Voice = "lahlah" {
\set Staff.autoBeaming = ##f
c4
\slurDotted
texto se retrasará una nota más. Por ejemplo,
@lilypond[verbatim,ragged-right,quote]
-\relative { c c g' }
+\relative c' { c c g' }
\addlyrics {
twin -- \skip 4
kle
@lilypond[ragged-right,quote]
<<
- \relative \new Voice = "lahlah" {
+ \relative c' \new Voice = "lahlah" {
\set Staff.autoBeaming = ##f
c4
<<
de notes. Ces voix additionnelles s'ajoutent en définissant un
identificateur, comme le montre l'exemple suivant :
-@lilypond[quote,verbatim,ragged-right,relative=2]
+@lilypond[quote,verbatim,ragged-right]
voiceFive = #(context-spec-music (make-voice-props-set 4) 'Voice)
\relative c''' <<
mettre un peu d'ordre dans l'indentation. Voici le modèle pour
soprano et violoncelle au complet :
-@lilypond[quote,verbatim,ragged-right]
-\version "2.11.38"
+@lilypond[quote,verbatim,ragged-right,addversion]
sopranoMusic = \relative c' {
\clef treble
\key c \major
caractère souligné (@code{_}), ou encore utiliser un tilde (@code{~})
pour obtenir une liaison entre les syllabes.
-@lilypond[quote,relative=2,ragged-right,fragment,verbatim]
+@lilypond[quote,ragged-right,fragment,verbatim]
\time 3/4
-\relative { c2 e4 g2 e4 }
+\relative c' { c2 e4 g2 e4 }
\addlyrics { gran- de_a- mi- go }
\addlyrics { pu- "ro y ho-" nes- to }
\addlyrics { pu- ro~y~ho- nes- to }
Pour utiliser des lettres accentuées ou des caractères spéciaux
--- cœurs ou guillemets inversés par exemple --- il suffit de les insérer
dans le fichier et de veiller à sauvegarder ce dernier avec le codage
-utf-8. Voir à ce sujet @ref{Text encoding} pour plus de détails.
+UTF-8. Voir à ce sujet @ref{Text encoding} pour plus de détails.
@lilypond[quote,ragged-right,fragment,verbatim]
-\relative { e4 f e d e f e2 }
+\relative c' { e4 f e d e f e2 }
\addlyrics { He said: “Let my peo ple go”. }
@end lilypond
n'apparaîtra dans la partition que si le système dispose d'une police
installée qui contient ce symbole(par exemple DejaVuLGC).}.
-@lilypond[quote,relative=2,ragged-right,fragment,verbatim]
+@lilypond[quote,ragged-right,fragment,verbatim]
\time 3/4
-\relative { c2 e4 g2 e4 }
+\relative c' { c2 e4 g2 e4 }
\addlyrics { gran- de_a- mi- go }
\addlyrics { pu- "ro y ho-" nes- to }
\addlyrics { pu- ro~y~ho- nes- to }
Pour que ce réglage s'applique à toute la partition, définissez-le
dans le bloc @code{\layout}.
-@lilypond[relative,verbatim,quote,ragged-right]
+@lilypond[verbatim,quote,ragged-right]
\score {
\relative c' {
c c c c
Hi, my name is Bert.
} \addlyrics {
\set vocalName = "Ernie "
- Oh, che -- ri, je t'aime
+ Oh, ché -- ri, je t'aime
}
@end lilypond
suivant d'une note :
@lilypond[verbatim,ragged-right,quote]
-\relative { c c g' }
+\relative c' { c c g' }
\addlyrics {
twin -- \skip 4
kle
@lilypond[ragged-right,quote]
<<
- \relative \new Voice = "lahlah" {
+ \relative c' \new Voice = "lahlah" {
\set Staff.autoBeaming = ##f
c4
<<
@end ignore
+@item
+Arpeggios may now use ``parenthesis'' style brackets:
+
+@lilypond[relative,ragged-right]
+ \override Arpeggio #'stencil = #ly:arpeggio::brew-chord-slur
+
+ % Note: does not work for cross staff arpeggios.
+ \override Arpeggio #'X-extent = #ly:grob::stencil-width
+ <c g' c>2\arpeggio ~ c
+@end lilypond
+
@item
Enclosing text within boxes with rounded corners is now possible,
using the @code{rounded-box} command.
additional voices to avoid collisions between notes. Additional
voices are added by defining an variable, as shown below:
-@lilypond[quote,verbatim,ragged-right,relative=2]
+@lilypond[quote,verbatim,ragged-right]
voiceFive = #(context-spec-music (make-voice-props-set 4) 'Voice)
\relative c''' <<
If you just want the merging parts, and not the textual markings,
you may set the property @code{printPartCombineTexts} to false.
-@lilypond[quote,verbatim,ragged-right,fragment,relative=2]
+@lilypond[quote,verbatim,ragged-right]
\new Staff <<
\set Staff.printPartCombineTexts = ##f
\partcombine
set the @code{soloText}, @code{soloIIText}, and @code{aDueText}
properties.
-@lilypond[quote,verbatim,ragged-right,fragment,relative=2]
+@lilypond[quote,verbatim,ragged-right]
\new Staff <<
\set Score.soloText = #"ichi"
\set Score.soloIIText = #"ni"
a duration, so @code{1 4} is a longer duration
than @code{1 16}.
-@lilypond[relative,verbatim,line-width=12\cm]
+@lilypond[verbatim,line-width=12\cm]
\score {
\relative c'' {
g4 e e2 | f4 d d2 | c4 d e f | g4 g g2 |
}
@end lilypond
-@lilypond[relative,verbatim,line-width=12\cm]
+@lilypond[verbatim,line-width=12\cm]
\score {
\relative c'' {
g4 e e2 | f4 d d2 | c4 d e f | g4 g g2 |
staff is stopped and started explicitely and white space is inserted
with the @code{\skip} command.
-@lilypond[verbatim,relative=2,quote]
+@lilypond[verbatim,quote]
<<
\new Staff \with
{
@lilypond[quote,ragged-right,verbatim]
\score {
- \context Staff \relative c'' { c8 c c16 c c c }
+ \new Staff \relative c'' { c8 c c16 c c c }
\layout{
\context {
\Staff
because the setting applies only to the specific staff inside
of which it is written.
-@lilypond[quote,ragged-right,verbatim,relative=2]
+@lilypond[quote,ragged-right,verbatim]
\layout {
\context {
\RemoveEmptyStaffContext
}
<<
- \context Staff = "picc" \picc
- \context Staff = "cbsn" \cbsn
+ \new Staff = "picc" \picc
+ \new Staff = "cbsn" \cbsn
>>
@end lilypond
@lilypond[ragged-right,verbatim,fragment,quote]
\time 3/4
-\relative { c2 e4 g2. }
+\relative c' { c2 e4 g2. }
\addlyrics { play the game }
@end lilypond
@lilypond[ragged-right,verbatim,fragment,quote]
\time 3/4
-\relative { c2 e4 g2. }
+\relative c' { c2 e4 g2. }
\addlyrics { play the game }
\addlyrics { speel het spel }
\addlyrics { joue le jeu }
surround them with quotes or use a @code{_} character, to get spaces
between syllables, or use tilde symbol (@code{~}) to get a lyric tie.
-@lilypond[quote,relative=2,ragged-right,fragment,verbatim]
+@lilypond[quote,ragged-right,fragment,verbatim]
\time 3/4
-\relative { c2 e4 g2 e4 }
+\relative c' { c2 e4 g2 e4 }
\addlyrics { gran- de_a- mi- go }
\addlyrics { pu- "ro y ho-" nes- to }
\addlyrics { pu- ro~y~ho- nes- to }
To enter lyrics with characters from non-English languages, or with
accented and special characters (such as the heart symbol or slanted quotes),
simply insert the characters directly into the input file and save
-it with utf-8 encoding. See @ref{Text encoding}, for more info.
-
-FIXME: quotes.
+it with UTF-8 encoding. See @ref{Text encoding}, for more info.
@lilypond[quote,ragged-right,fragment,verbatim]
-\relative { e4 f e d e f e2 }
-\addlyrics { He said: ââ\82¬Å\93Let my peo ple goââ\82¬Â\9d. }
+\relative c' { e4 f e d e f e2 }
+\addlyrics { He said: â\80\9cLet my peo ple goâ\80\9d. }
@end lilypond
To use normal quotes in lyrics, add a backslash before the
sure to have a font (Like DejaVuLGC) installed that includes this
glyph.}.
-@lilypond[quote,relative=2,ragged-right,fragment,verbatim]
+@lilypond[quote,ragged-right,fragment,verbatim]
\time 3/4
-\relative { c2 e4 g2 e4 }
+\relative c' { c2 e4 g2 e4 }
\addlyrics { gran- de_a- mi- go }
\addlyrics { pu- "ro y ho-" nes- to }
\addlyrics { pu- ro~y~ho- nes- to }
For example,
@lilypond[verbatim,ragged-right,quote]
-\relative { c c g' }
+\relative c' { c c g' }
\addlyrics {
twin -- \skip 4
kle
To make this change for all lyrics in the score, set the property in the
layout.
-@lilypond[relative,verbatim,quote,ragged-right]
+@lilypond[verbatim,quote,ragged-right]
\score {
\relative c' {
c c c c
Hi, my name is Bert.
} \addlyrics {
\set stanza = "2. "
- Oh, chÃ\83© -- ri, je t'aime
+ Oh, ché -- ri, je t'aime
}
@end lilypond
+
@noindent
These numbers are put just before the start of the first syllable.
Hi, my name is Bert.
} \addlyrics {
\set vocalName = "Ernie "
- Oh, che -- ri, je t'aime
+ Oh, ché -- ri, je t'aime
}
@end lilypond
@lilypond[verbatim,ragged-right,quote]
%{
<<
- \relative \new Voice = "lahlah" {
+ \relative c' \new Voice = "lahlah" {
\set Staff.autoBeaming = ##f
c4
\slurDotted
@lilypond[ragged-right,quote]
<<
- \relative \new Voice = "lahlah" {
+ \relative c' \new Voice = "lahlah" {
\set Staff.autoBeaming = ##f
c4
<<
PACKAGE_NAME=LilyPond
MAJOR_VERSION=2
MINOR_VERSION=11
-PATCH_LEVEL=45
+PATCH_LEVEL=46
MY_PATCH_LEVEL=
Drul_array ()
{
}
- Drul_array (T t1, T t2)
+ Drul_array (T const &t1, T const &t2)
+ {
+ set (t1, t2);
+ }
+ void set (T const &t1, T const &t2)
{
array_[0] = t1;
array_[1] = t2;
--- /dev/null
+
+\header {
+
+ texidoc = "There is a variant of the arpeggio sign that uses a
+ `vertical slur' instead of the wiggle."
+
+}
+
+\version "2.11.46"
+
+\relative c' {
+ \override Arpeggio #'stencil = #ly:arpeggio::brew-chord-slur
+
+ % Note: does not work for cross staff arpeggios.
+ \override Arpeggio #'X-extent = #ly:grob::stencil-width
+ <c g' c>2\arpeggio ~ c
+}
--- /dev/null
+\header {
+ texidoc = "You can put lyrics under completion heads."
+}
+\version "2.11.45"
+
+mel = \relative c'' {
+ c1. c1.
+}
+
+lyr = \lyricmode {
+ One two
+}
+
+\score {
+ \new Score <<
+ \new Staff <<
+ \new Voice = "completion" \with {
+ \remove "Note_heads_engraver"
+ \remove "Forbid_line_break_engraver"
+ \consists "Completion_heads_engraver"
+ } \mel
+ >>
+ \new Lyrics \lyricsto "completion" \lyr
+ >>
+}
--- /dev/null
+
+\version "2.11.45"
+
+\header {
+
+ texidoc = "In the single tie case, broken ties peek across line
+ boundaries to determine which direction to take."
+
+}
+
+
+\paper {
+ ragged-right = ##t
+}
+
+\relative c'' {
+ bes1~ \break
+ bes2.
+ \stemUp bes4 ~ \break
+ bes1
+}
*/
#include "align-interface.hh"
-#include "spanner.hh"
-#include "item.hh"
#include "axis-group-interface.hh"
-#include "pointer-group-interface.hh"
-#include "hara-kiri-group-spanner.hh"
#include "grob-array.hh"
+#include "hara-kiri-group-spanner.hh"
#include "international.hh"
+#include "item.hh"
+#include "paper-column.hh"
+#include "pointer-group-interface.hh"
+#include "spanner.hh"
+#include "skyline-pair.hh"
#include "system.hh"
#include "warn.hh"
-#include "paper-column.hh"
/*
TODO: for vertical spacing, should also include a rod & spring
#include "arpeggio.hh"
+#include "bezier.hh"
+#include "font-interface.hh"
#include "grob.hh"
+#include "lookup.hh"
#include "output-def.hh"
-#include "stem.hh"
+#include "pointer-group-interface.hh"
#include "staff-symbol-referencer.hh"
#include "staff-symbol.hh"
+#include "stem.hh"
#include "warn.hh"
-#include "font-interface.hh"
-#include "lookup.hh"
-#include "pointer-group-interface.hh"
Grob *
Arpeggio::get_common_y (Grob *me)
return mol.smobbed_copy ();
}
+MAKE_SCHEME_CALLBACK (Arpeggio, brew_chord_slur, 1);
+SCM
+Arpeggio::brew_chord_slur (SCM smob)
+{
+ Grob *me = unsmob_grob (smob);
+ Interval heads = robust_scm2interval (me->get_property ("positions"),
+ Interval())
+ * Staff_symbol_referencer::staff_space (me);
+
+ Real lt = me->layout ()->get_dimension (ly_symbol2scm ("line-thickness"));
+ Real dy = heads.length ();
+
+ Real height_limit = 1.5;
+ Real ratio = .33;
+ Bezier curve = slur_shape (dy, height_limit, ratio);
+ curve.rotate (M_PI / 2);
+
+ Stencil mol (Lookup::slur (curve, lt, lt));
+ mol.translate_axis (heads[LEFT], Y_AXIS);
+ return mol.smobbed_copy ();
+}
+
/*
We have to do a callback, because print () triggers a
vertical alignment if it is cross-staff.
#include "paper-column.hh"
#include "paper-score.hh"
#include "separation-item.hh"
+#include "skyline-pair.hh"
#include "stencil.hh"
#include "system.hh"
#include "warn.hh"
return scm_from_double (ret);
}
-extern bool debug_skylines;
MAKE_SCHEME_CALLBACK (Axis_group_interface, print, 1)
SCM
Axis_group_interface::print (SCM smob)
Stencil ret;
if (Skyline_pair *s = Skyline_pair::unsmob (me->get_property ("vertical-skylines")))
{
- ret.add_stencil (Lookup::points_to_line_stencil (0.1, (*s)[UP].to_points (X_AXIS)).in_color (255, 0, 255));
- ret.add_stencil (Lookup::points_to_line_stencil (0.1, (*s)[DOWN].to_points (X_AXIS)).in_color (0, 255, 255));
+ ret.add_stencil (Lookup::points_to_line_stencil (0.1, (*s)[UP].to_points (X_AXIS))
+ .in_color (255, 0, 255));
+ ret.add_stencil (Lookup::points_to_line_stencil (0.1, (*s)[DOWN].to_points (X_AXIS))
+ .in_color (0, 255, 255));
}
return ret.smobbed_copy ();
}
event->set_property ("pitch", pits);
event->set_property ("duration", note_dur.smobbed_copy ());
+ event->set_property ("length", Moment (note_dur.get_length ()).smobbed_copy ());
event->set_property ("duration-log", scm_from_int (note_dur.duration_log ()));
Item *note = make_note_head (event);
}
left_to_do_ -= note_dur.get_length ();
-
if (left_to_do_)
- get_global_context ()->add_moment_to_process (now.main_part_ + left_to_do_);
+ get_global_context ()->add_moment_to_process (now.main_part_ + note_dur.get_length());
/*
don't do complicated arithmetic with grace notes.
*/
note_events_.clear ();
prev_notes_.clear ();
}
+ context ()->set_property ("completionBusy",
+ ly_bool2scm (note_events_.size ()));
}
Completion_heads_engraver::Completion_heads_engraver ()
"measureLength ",
/* write */
- ""
+ "completionBusy "
);
--- /dev/null
+/*
+ dynamic-align-engraver.cc -- implement Dynamic_align_engraver
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 2008 Han-Wen Nienhuys <hanwen@lilypond.org>
+
+*/
+
+#include <set>
+
+#include "engraver.hh"
+
+#include "axis-group-interface.hh"
+#include "directional-element-interface.hh"
+#include "item.hh"
+#include "side-position-interface.hh"
+#include "spanner.hh"
+#include "stream-event.hh"
+
+#include "translator.icc"
+
+class Dynamic_align_engraver : public Engraver
+{
+ TRANSLATOR_DECLARATIONS (Dynamic_align_engraver);
+ DECLARE_ACKNOWLEDGER (note_column);
+ DECLARE_ACKNOWLEDGER (dynamic);
+ DECLARE_END_ACKNOWLEDGER (dynamic);
+
+protected:
+ virtual void stop_translation_timestep ();
+
+private:
+ void create_line_spanner (Stream_event *cause);
+ Spanner* line_;
+
+ vector<Spanner*> ended_;
+ vector<Spanner*> started_;
+ vector<Grob*> scripts_;
+ vector<Grob*> support_;
+
+ set<Spanner*> running_;
+};
+
+Dynamic_align_engraver::Dynamic_align_engraver ()
+{
+ line_ = 0;
+}
+
+ADD_ACKNOWLEDGER (Dynamic_align_engraver, dynamic);
+ADD_ACKNOWLEDGER (Dynamic_align_engraver, note_column);
+ADD_END_ACKNOWLEDGER (Dynamic_align_engraver, dynamic);
+
+void
+Dynamic_align_engraver::create_line_spanner (Stream_event* event)
+{
+ if (!line_)
+ line_ = make_spanner ("DynamicLineSpanner",
+ event ? event->self_scm() : SCM_EOL);
+}
+
+void
+Dynamic_align_engraver::acknowledge_end_dynamic (Grob_info info)
+{
+ if (Spanner::has_interface(info.grob()))
+ ended_.push_back (info.spanner ());
+}
+
+void
+Dynamic_align_engraver::acknowledge_note_column (Grob_info info)
+{
+ support_.push_back (info.grob ());
+}
+
+void
+Dynamic_align_engraver::acknowledge_dynamic (Grob_info info)
+{
+ Stream_event *cause = info.event_cause ();
+ create_line_spanner (cause);
+ if (Spanner::has_interface(info.grob()))
+ started_.push_back (info.spanner ());
+ else if (info.item())
+ scripts_.push_back (info.item());
+ else
+ info.grob ()->programming_error ("Unknown dynamic grob.");
+
+ Axis_group_interface::add_element (line_, info.grob ());
+
+ if (cause)
+ {
+ if (Direction d = to_dir (cause->get_property ("direction")))
+ set_grob_direction (line_, d);
+ }
+}
+
+void
+Dynamic_align_engraver::stop_translation_timestep ()
+{
+ for (vsize i = 0; i < started_.size(); i++)
+ running_.insert (started_[i]);
+ for (vsize i = 0; i < ended_.size(); i++)
+ {
+ Spanner *sp = ended_[i];
+
+ set<Spanner*>::iterator it = running_.find (sp);
+ if (it != running_.end())
+ running_.erase (it);
+ else
+ started_[i]->programming_error ("Lost track of this dynamic spanner.");
+ }
+
+ bool end = line_ && running_.empty ();
+ Direction d = LEFT;
+ do
+ {
+ if (line_
+ && ((d == LEFT && !line_->get_bound (LEFT))
+ || (end && d == RIGHT && !line_->get_bound (RIGHT))))
+ {
+ vector<Spanner*> const &spanners =
+ (d == LEFT) ? started_ : ended_;
+
+ Grob *bound = 0;
+ if (scripts_.size())
+ bound = scripts_[0];
+ else if (spanners.size())
+ bound = spanners[0]->get_bound (d);
+ else
+ {
+ programming_error ("Started DynamicLineSpanner but have no left bound.");
+ bound = unsmob_grob (get_property ("currentMusicalColumn"));
+ }
+
+ line_->set_bound (d, bound);
+ }
+ }
+ while (flip (&d) != LEFT);
+
+ for (vsize i = 0; line_ && i < support_.size (); i++)
+ Side_position_interface::add_support (line_, support_[i]);
+
+ if (end)
+ line_ = 0;
+
+ ended_.clear ();
+ started_.clear ();
+ scripts_.clear ();
+ support_.clear ();
+}
+
+
+ADD_TRANSLATOR (Dynamic_align_engraver,
+ /* doc */
+ "Align hairpins and dynamic texts on a horizontal line",
+
+ /* create */
+ "DynamicLineSpanner ",
+
+ /* read */
+ "currentMusicalColumn ",
+
+ /* write */
+ ""
+ );
#include "axis-group-interface.hh"
#include "context.hh"
+#include "engraver.hh"
#include "dimensions.hh"
#include "directional-element-interface.hh"
#include "engraver.hh"
cresc_->set_property ("style", s);
context ()->set_property ((start_type
+ "Spanner").c_str (), SCM_EOL);
- s = get_property ((start_type + "Text").c_str ());
+ s = get_property ((start_type + "Text").c_str ());
if (Text_interface::is_markup (s))
{
cresc_->set_property ("text", s);
cresc_->set_bound (LEFT, script_);
add_bound_item (line_spanner_, cresc_->get_bound (LEFT));
}
-
Axis_group_interface::add_element (line_spanner_, cresc_);
}
}
{
cause = m->to_event ()->unprotect ();
}
- if (unsmob_stream_event (cause) || unsmob_grob (cause))
+ if (e->get_property ("cause") == SCM_EOL
+ && (unsmob_stream_event (cause) || unsmob_grob (cause)))
e->set_property ("cause", cause);
Grob_info i (this, e);
{
if (!group.continuation_line_)
{
- Spanner * line = make_spanner ("BassFigureContinuation", SCM_EOL);
+ Spanner * line
+ = make_spanner ("BassFigureContinuation", SCM_EOL);
Item * item = group.figure_item_;
group.continuation_line_ = line;
line->set_bound (LEFT, item);
void
Figured_bass_engraver::create_grobs ()
{
- Grob *muscol = dynamic_cast<Item*> (unsmob_grob (get_property ("currentMusicalColumn")));
+ Grob *muscol
+ = dynamic_cast<Item*> (unsmob_grob (get_property ("currentMusicalColumn")));
if (!alignment_)
{
alignment_ = make_spanner ("BassFigureAlignment", SCM_EOL);
LY_DEFINE (ly_make_global_context, "ly:make-global-context",
1, 0, 0, (SCM output_def),
"Set up a global interpretation context, using the output"
- " block @var{output_def}. The context is returned.\n")
+ " block @var{output_def}. The context is returned.")
{
LY_ASSERT_SMOB (Output_def, output_def, 1);
Output_def *odef = unsmob_output_def (output_def);
Grob *
common_refpoint_of_array (vector<Grob*> const &arr, Grob *common, Axis a)
{
- for (vsize i = arr.size (); i--;)
- if (Grob *s = arr[i])
- {
- if (common)
- common = common->common_refpoint (s, a);
- else
- common = s;
- }
+ for (vsize i = 0; i < arr.size (); i++)
+ if (common)
+ common = common->common_refpoint (arr[i], a);
+ else
+ common = arr[i];
return common;
}
&& ly_is_equal (bounds[RIGHT]->get_column ()->get_property ("when"),
bounds[LEFT]->get_property ("when")))
me->suicide ();
-
}
MAKE_SCHEME_CALLBACK (Hairpin, print, 1);
/*
should do relative to staff-symbol staff-space?
*/
-
Stencil mol;
Real x = 0.0;
DECLARE_SCHEME_CALLBACK (print, (SCM));
DECLARE_SCHEME_CALLBACK (calc_positions, (SCM));
DECLARE_SCHEME_CALLBACK (brew_chord_bracket, (SCM));
+ DECLARE_SCHEME_CALLBACK (brew_chord_slur, (SCM));
DECLARE_SCHEME_CALLBACK (width, (SCM));
DECLARE_SCHEME_CALLBACK (height, (SCM));
DECLARE_SCHEME_CALLBACK (pure_height, (SCM, SCM, SCM));
class Simultaneous_music_iterator;
class Skyline;
class Skyline_entry;
+class Skyline_pair;
class Slur_configuration;
class Slur_score_state;
class Source_file;
formatted content of the grob is put into a
Property_object. Page-breaking handles Property_object objects.
*/
+
class Prob
{
DECLARE_SMOBS (Prob);
Prob (Prob const &);
virtual string name () const;
SCM type () const { return type_; }
- SCM get_property_alist (bool mutble) const;
+ SCM get_property_alist (bool _mutable) const;
SCM internal_get_property (SCM sym) const;
void instrumented_set_property (SCM, SCM, const char*, int, const char*);
void internal_set_property (SCM sym, SCM val);
};
+
DECLARE_UNSMOB(Prob,prob);
+
SCM ly_prob_set_property_x (SCM system, SCM sym, SCM value);
SCM ly_prob_property (SCM system, SCM sym, SCM dfault);
+SCM ly_prob_type_p (SCM obj, SCM sym);
+
#endif /* PROPERTY_OBJECT_HH */
--- /dev/null
+/*
+ skyline-pair.hh -- declare Skyline_pair
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 2008 Han-Wen Nienhuys <hanwen@lilypond.org>
+
+*/
+
+#ifndef SKYLINE_PAIR_HH
+#define SKYLINE_PAIR_HH
+
+#include "skyline.hh"
+
+class Skyline_pair
+{
+private:
+ Drul_array<Skyline> skylines_;
+
+ DECLARE_SIMPLE_SMOBS(Skyline_pair);
+public:
+ Skyline_pair ();
+ Skyline_pair (vector<Box> const &boxes, Real horizon_padding, Axis a);
+ Skyline_pair (Box const &, Real horizon_padding, Axis a);
+ void raise (Real);
+ void shift (Real);
+ void insert (Box const &, Real horizon_padding, Axis);
+ void merge (Skyline_pair const &other);
+ Skyline &operator [] (Direction d);
+ Skyline const &operator [] (Direction d) const;
+ bool is_empty () const;
+ void print () const;
+ void print_points () const;
+};
+
+#endif /* SKYLINE_PAIR_HH */
bool is_empty () const;
};
-class Skyline_pair
-{
-private:
- Drul_array<Skyline> skylines_;
-
- DECLARE_SIMPLE_SMOBS(Skyline_pair);
-public:
- Skyline_pair ();
- Skyline_pair (vector<Box> const &boxes, Real horizon_padding, Axis a);
- Skyline_pair (Box const &, Real horizon_padding, Axis a);
- void raise (Real);
- void shift (Real);
- void insert (Box const &, Real horizon_padding, Axis);
- void merge (Skyline_pair const &other);
- Skyline &operator [] (Direction d);
- Skyline const &operator [] (Direction d) const;
- bool is_empty () const;
-};
+extern bool debug_skylines;
#endif /* SKYLINE_HH */
// todo: move to somewhere else.
Real get_broken_left_end_align () const;
void substitute_one_mutable_property (SCM sym, SCM val);
- bool fast_substitute_grob_array (SCM sym, Grob_array *);
Interval_t<Moment> spanned_time () const;
virtual Interval_t<int> spanned_rank_interval () const;
void set_my_columns ();
virtual Grob *clone () const;
virtual void do_break_processing ();
+ bool fast_substitute_grob_array (SCM sym, Grob_array *);
};
void add_bound_item (Spanner *, Grob *);
int single_tie_region_size_;
int multi_tie_region_size_;
+ Direction neutral_direction_;
Tie_details ();
void from_grob (Grob *);
{
if (music_context_)
{
- music_context_->event_source ()->remove_listener (GET_LISTENER (set_busy), ly_symbol2scm ("music-event"));
+ music_context_->event_source ()->
+ remove_listener (GET_LISTENER (set_busy), ly_symbol2scm ("music-event"));
}
music_context_ = to;
if (to)
{
- to->event_source ()->add_listener (GET_LISTENER (set_busy), ly_symbol2scm ("music-event"));
+ to->event_source ()->add_listener (GET_LISTENER (set_busy),
+ ly_symbol2scm ("music-event"));
}
}
--- /dev/null
+/*
+ new-dynamic-engraver.cc -- implement New_dynamic_engraver
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 2008 Han-Wen Nienhuys <hanwen@lilypond.org>
+
+*/
+
+
+#include "engraver.hh"
+
+#include "item.hh"
+#include "pointer-group-interface.hh"
+#include "text-interface.hh"
+#include "note-column.hh"
+#include "self-alignment-interface.hh"
+#include "spanner.hh"
+#include "stream-event.hh"
+
+#include "translator.icc"
+
+class New_dynamic_engraver : public Engraver
+{
+ TRANSLATOR_DECLARATIONS (New_dynamic_engraver);
+ DECLARE_ACKNOWLEDGER (note_column);
+ DECLARE_TRANSLATOR_LISTENER (absolute_dynamic);
+ DECLARE_TRANSLATOR_LISTENER (span_dynamic);
+
+protected:
+ virtual void process_music ();
+ virtual void stop_translation_timestep ();
+private:
+ Drul_array<Stream_event *> accepted_spanevents_drul_;
+ Spanner *current_spanner_;
+ Spanner *finished_spanner_;
+
+ Item *script_;
+ Stream_event *script_event_;
+ Stream_event *current_span_event_;
+};
+
+New_dynamic_engraver::New_dynamic_engraver ()
+{
+ script_event_ = 0;
+ current_span_event_ = 0;
+ script_ = 0;
+ finished_spanner_ = 0;
+ current_spanner_ = 0;
+ accepted_spanevents_drul_.set (0, 0);
+}
+
+IMPLEMENT_TRANSLATOR_LISTENER (New_dynamic_engraver, absolute_dynamic);
+void
+New_dynamic_engraver::listen_absolute_dynamic (Stream_event *ev)
+{
+ ASSIGN_EVENT_ONCE (script_event_, ev);
+}
+
+IMPLEMENT_TRANSLATOR_LISTENER (New_dynamic_engraver, span_dynamic);
+void
+New_dynamic_engraver::listen_span_dynamic (Stream_event *ev)
+{
+ Direction d = to_dir (ev->get_property ("span-direction"));
+
+ ASSIGN_EVENT_ONCE (accepted_spanevents_drul_[d], ev);
+}
+
+
+void
+New_dynamic_engraver::process_music ()
+{
+ if (current_spanner_
+ && (accepted_spanevents_drul_[STOP] || script_event_ || accepted_spanevents_drul_[START]))
+ {
+ Stream_event* ender = accepted_spanevents_drul_[STOP];
+ if (!ender)
+ ender = script_event_;
+
+ if (!ender)
+ ender = accepted_spanevents_drul_[START];
+
+ finished_spanner_ = current_spanner_;
+ announce_end_grob (finished_spanner_, ender->self_scm ());
+ current_spanner_ = 0;
+ current_span_event_ = 0;
+ }
+
+ if (accepted_spanevents_drul_[START])
+ {
+ current_span_event_ = accepted_spanevents_drul_[START];
+
+ SCM start_sym = current_span_event_->get_property ("class");
+ string start_type;
+
+ if (start_sym == ly_symbol2scm ("decrescendo-event"))
+ start_type = "decrescendo";
+ else if (start_sym == ly_symbol2scm ("crescendo-event"))
+ start_type = "crescendo";
+ else
+ {
+ programming_error ("unknown dynamic spanner type");
+ return;
+ }
+
+ SCM cresc_type = get_property ((start_type + "Spanner").c_str ());
+
+ if (cresc_type == ly_symbol2scm ("text"))
+ {
+ current_spanner_
+ = make_spanner ("DynamicTextSpanner",
+ accepted_spanevents_drul_[START]->self_scm ());
+
+ SCM text = get_property ((start_type + "Text").c_str ());
+ if (Text_interface::is_markup (text))
+ {
+ current_spanner_->set_property ("text", text);
+ }
+ }
+ else
+ {
+ if (cresc_type != ly_symbol2scm ("hairpin"))
+ {
+ // Fixme: should put value in error message.
+ ly_display_scm (cresc_type);
+ current_span_event_
+ ->origin()->warning ("unknown crescendo style; defaulting to hairpin.");
+ }
+ current_spanner_ = make_spanner ("Hairpin",
+ current_span_event_->self_scm ());
+ if (finished_spanner_)
+ {
+ Pointer_group_interface::add_grob (finished_spanner_,
+ ly_symbol2scm ("adjacent-hairpins"),
+ current_spanner_);
+
+ Pointer_group_interface::add_grob (current_spanner_,
+ ly_symbol2scm ("adjacent-hairpins"),
+ finished_spanner_);
+ }
+ }
+ }
+
+ if (script_event_)
+ {
+ script_ = make_item ("DynamicText", script_event_->self_scm ());
+ script_->set_property ("text",
+ script_event_->get_property ("text"));
+
+ if (finished_spanner_)
+ finished_spanner_->set_bound (RIGHT, script_);
+ if (current_spanner_)
+ {
+ current_spanner_->set_bound (LEFT, script_);
+ set_nested_property (current_spanner_,
+ scm_list_3 (ly_symbol2scm ("bound-details"),
+ ly_symbol2scm ("left"),
+ ly_symbol2scm ("attach-dir")
+ ),
+ scm_from_int (RIGHT));
+
+ }
+ }
+}
+
+
+
+void
+New_dynamic_engraver::stop_translation_timestep ()
+{
+ if (finished_spanner_ && !finished_spanner_->get_bound (RIGHT))
+ finished_spanner_->set_bound (RIGHT,
+ unsmob_grob (get_property ("currentMusicalColumn")));
+
+ if (current_spanner_ && !current_spanner_->get_bound (LEFT))
+ current_spanner_->set_bound (LEFT,
+ unsmob_grob (get_property ("currentMusicalColumn")));
+ script_ = 0;
+ script_event_ = 0;
+ accepted_spanevents_drul_.set (0, 0);
+ finished_spanner_ = 0;
+}
+
+void
+New_dynamic_engraver::acknowledge_note_column (Grob_info info)
+{
+ if (script_ && !script_->get_parent (X_AXIS))
+ {
+ extract_grob_set (info.grob (), "note-heads", heads);
+ if (heads.size ())
+ {
+ Grob *head = heads[0];
+ script_->set_parent (head, X_AXIS);
+ Self_alignment_interface::set_center_parent (script_, X_AXIS);
+ }
+ }
+
+ if (current_spanner_ && !current_spanner_->get_bound (LEFT))
+ current_spanner_->set_bound (LEFT, info.grob ());
+ if (finished_spanner_ && !finished_spanner_->get_bound (RIGHT))
+ finished_spanner_->set_bound (RIGHT, info.grob ());
+}
+
+ADD_ACKNOWLEDGER (New_dynamic_engraver, note_column);
+ADD_TRANSLATOR (New_dynamic_engraver,
+ /* doc */
+ "Create hairpins, dynamic texts, and their vertical"
+ " alignments. The symbols are collected onto a"
+ " @code{DynamicLineSpanner} grob which takes care of vertical"
+ " positioning.",
+
+ /* create */
+ "DynamicTextSpanner "
+ "DynamicText "
+ "Hairpin "
+ "TextSpanner ",
+
+ /* read */
+ "currentMusicalColumn ",
+
+ /* write */
+ ""
+ );
#include "paper-column.hh"
-#include "break-align-interface.hh"
-#include "moment.hh"
-#include "paper-score.hh"
-#include "warn.hh"
#include "axis-group-interface.hh"
-#include "spaceable-grob.hh"
-#include "text-interface.hh"
-#include "lookup.hh"
+#include "break-align-interface.hh"
#include "font-interface.hh"
-#include "output-def.hh"
-#include "pointer-group-interface.hh"
#include "grob-array.hh"
-#include "system.hh"
-#include "spring.hh"
#include "lookup.hh"
+#include "lookup.hh"
+#include "moment.hh"
+#include "output-def.hh"
+#include "paper-score.hh"
+#include "pointer-group-interface.hh"
#include "separation-item.hh"
+#include "skyline-pair.hh"
+#include "spaceable-grob.hh"
+#include "spring.hh"
#include "string-convert.hh"
+#include "system.hh"
+#include "text-interface.hh"
+#include "warn.hh"
Grob *
Paper_column::clone () const
--- /dev/null
+/*
+ paper-system-scheme.cc -- implement Paper_system bindings.
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 2008 Han-Wen Nienhuys <hanwen@lilypond.org>
+
+*/
+
+#include "prob.hh"
+
+#include "skyline-pair.hh"
+
+LY_DEFINE (ly_paper_system_p, "ly:paper-system?",
+ 1, 0, 0, (SCM obj),
+ "Type predicate.")
+{
+ return ly_prob_type_p (obj, ly_symbol2scm ("paper-system"));
+}
+
+LY_DEFINE (ly_paper_system_minimum_distance, "ly:paper-system-minimum-distance",
+ 2, 0, 0, (SCM sys1, SCM sys2),
+ "Measure the minimum distance between these two paper-systems,"
+ " using their stored skylines if possible and falling back to"
+ " their extents otherwise.")
+{
+ Real ret = 0;
+ Prob *p1 = unsmob_prob (sys1);
+ Prob *p2 = unsmob_prob (sys2);
+ Skyline_pair *sky1 = Skyline_pair::unsmob (p1->get_property ("vertical-skylines"));
+ Skyline_pair *sky2 = Skyline_pair::unsmob (p2->get_property ("vertical-skylines"));
+
+ if (sky1 && sky2)
+ ret = (*sky1)[DOWN].distance ((*sky2)[UP]);
+ else
+ {
+ Stencil *s1 = unsmob_stencil (p1->get_property ("stencil"));
+ Stencil *s2 = unsmob_stencil (p2->get_property ("stencil"));
+ Interval iv1 = s1->extent (Y_AXIS);
+ Interval iv2 = s2->extent (Y_AXIS);
+ ret = iv2[UP] - iv1[DOWN];
+ }
+ return scm_from_double (ret);
+}
*/
#include "prob.hh"
-#include "skyline.hh"
LY_DEFINE (ly_prob_set_property_x, "ly:prob-set-property!",
2, 1, 0, (SCM obj, SCM sym, SCM value),
return pr->unprotect ();
}
-
-LY_DEFINE (ly_paper_system_p, "ly:paper-system?",
- 1, 0, 0, (SCM obj),
- "Type predicate.")
+
+LY_DEFINE (ly_prob_mutable_properties, "ly:prob-mutable-properties",
+ 1, 0, 0,
+ (SCM prob),
+ "Retrieve an alist of mutable properties.")
{
- return ly_prob_type_p (obj, ly_symbol2scm ("paper-system"));
+ LY_ASSERT_SMOB (Prob, prob, 1);
+ Prob *ps = unsmob_prob (prob);
+ return ps->get_property_alist (true);
}
-LY_DEFINE (ly_paper_system_minimum_distance, "ly:paper-system-minimum-distance",
- 2, 0, 0, (SCM sys1, SCM sys2),
- "Measure the minimum distance between these two paper-systems,"
- " using their stored skylines if possible and falling back to"
- " their extents otherwise.")
+LY_DEFINE (ly_prob_immutable_properties, "ly:prob-immutable-properties",
+ 1, 0, 0,
+ (SCM prob),
+ "Retrieve an alist of mutable properties.")
{
- Real ret = 0;
- Prob *p1 = unsmob_prob (sys1);
- Prob *p2 = unsmob_prob (sys2);
- Skyline_pair *sky1 = Skyline_pair::unsmob (p1->get_property ("vertical-skylines"));
- Skyline_pair *sky2 = Skyline_pair::unsmob (p2->get_property ("vertical-skylines"));
-
- if (sky1 && sky2)
- ret = (*sky1)[DOWN].distance ((*sky2)[UP]);
- else
- {
- Stencil *s1 = unsmob_stencil (p1->get_property ("stencil"));
- Stencil *s2 = unsmob_stencil (p2->get_property ("stencil"));
- Interval iv1 = s1->extent (Y_AXIS);
- Interval iv2 = s2->extent (Y_AXIS);
- ret = iv2[UP] - iv1[DOWN];
- }
- return scm_from_double (ret);
+ LY_ASSERT_SMOB (Prob, prob, 1);
+ Prob *ps = unsmob_prob (prob);
+ return ps->get_property_alist (false);
}
+
#include "separation-item.hh"
+#include "accidental-placement.hh"
#include "axis-group-interface.hh"
#include "lookup.hh"
#include "note-head.hh"
-#include "stencil.hh"
-#include "skyline.hh"
#include "paper-column.hh"
-#include "warn.hh"
#include "pointer-group-interface.hh"
-#include "accidental-placement.hh"
+#include "skyline-pair.hh"
+#include "stencil.hh"
+#include "warn.hh"
void
Separation_item::add_item (Grob *s, Item *i)
return out;
}
-extern bool debug_skylines;
MAKE_SCHEME_CALLBACK (Separation_item, print, 1)
SCM
Separation_item::print (SCM smob)
--- /dev/null
+/*
+ skyline-pair.cc -- implement Skyline_pair
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 2008 Han-Wen Nienhuys <hanwen@lilypond.org>
+
+*/
+
+#include "skyline-pair.hh"
+
+#include "ly-smobs.icc"
+
+Skyline_pair::Skyline_pair ()
+ : skylines_ (Skyline (DOWN), Skyline (UP))
+{
+}
+
+Skyline_pair::Skyline_pair (vector<Box> const &boxes, Real padding, Axis a)
+ : skylines_ (Skyline (boxes, padding, a, DOWN), Skyline (boxes, padding, a, UP))
+{
+}
+
+Skyline_pair::Skyline_pair (Box const &b, Real padding, Axis a)
+ : skylines_ (Skyline (b, padding, a, DOWN), Skyline (b, padding, a, UP))
+{
+}
+
+void
+Skyline_pair::raise (Real r)
+{
+ skylines_[UP].raise (r);
+ skylines_[DOWN].raise (r);
+}
+
+void
+Skyline_pair::shift (Real r)
+{
+ skylines_[UP].shift (r);
+ skylines_[DOWN].shift (r);
+}
+
+void
+Skyline_pair::insert (Box const &b, Real padding, Axis a)
+{
+ skylines_[UP].insert (b, padding, a);
+ skylines_[DOWN].insert (b, padding, a);
+}
+
+void
+Skyline_pair::merge (Skyline_pair const &other)
+{
+ skylines_[UP].merge (other[UP]);
+ skylines_[DOWN].merge (other[DOWN]);
+}
+
+void
+Skyline_pair::print () const
+{
+ skylines_[UP].print ();
+ skylines_[DOWN].print ();
+}
+
+void
+Skyline_pair::print_points () const
+{
+ skylines_[UP].print ();
+ skylines_[DOWN].print ();
+}
+
+
+bool
+Skyline_pair::is_empty () const
+{
+ return skylines_[UP].is_empty ()
+ && skylines_[DOWN].is_empty ();
+}
+
+Skyline&
+Skyline_pair::operator [] (Direction d)
+{
+ return skylines_[d];
+}
+
+Skyline const&
+Skyline_pair::operator [] (Direction d) const
+{
+ return skylines_[d];
+}
+
+IMPLEMENT_SIMPLE_SMOBS (Skyline_pair);
+IMPLEMENT_TYPE_P (Skyline_pair, "ly:skyline-pair?");
+IMPLEMENT_DEFAULT_EQUAL_P (Skyline_pair);
+
+SCM
+Skyline_pair::mark_smob (SCM)
+{
+ return SCM_EOL;
+}
+
+int
+Skyline_pair::print_smob (SCM s, SCM port, scm_print_state *)
+{
+ Skyline_pair *r = (Skyline_pair *) SCM_CELL_WORD_1 (s);
+ (void) r;
+
+ scm_puts ("#<Skyline-pair>", port);
+ return 1;
+}
return b.end_ == infinity_f && b.y_intercept_ == -infinity_f;
}
-Skyline_pair::Skyline_pair ()
- : skylines_ (Skyline (DOWN), Skyline (UP))
-{
-}
-
-Skyline_pair::Skyline_pair (vector<Box> const &boxes, Real padding, Axis a)
- : skylines_ (Skyline (boxes, padding, a, DOWN), Skyline (boxes, padding, a, UP))
-{
-}
-
-Skyline_pair::Skyline_pair (Box const &b, Real padding, Axis a)
- : skylines_ (Skyline (b, padding, a, DOWN), Skyline (b, padding, a, UP))
-{
-}
-
-void
-Skyline_pair::raise (Real r)
-{
- skylines_[UP].raise (r);
- skylines_[DOWN].raise (r);
-}
-
-void
-Skyline_pair::shift (Real r)
-{
- skylines_[UP].shift (r);
- skylines_[DOWN].shift (r);
-}
-
-void
-Skyline_pair::insert (Box const &b, Real padding, Axis a)
-{
- skylines_[UP].insert (b, padding, a);
- skylines_[DOWN].insert (b, padding, a);
-}
-
-void
-Skyline_pair::merge (Skyline_pair const &other)
-{
- skylines_[UP].merge (other[UP]);
- skylines_[DOWN].merge (other[DOWN]);
-}
-
-bool
-Skyline_pair::is_empty () const
-{
- return skylines_[UP].is_empty ()
- && skylines_[DOWN].is_empty ();
-}
-
-Skyline&
-Skyline_pair::operator [] (Direction d)
-{
- return skylines_[d];
-}
-
-Skyline const&
-Skyline_pair::operator [] (Direction d) const
-{
- return skylines_[d];
-}
/****************************************************************/
IMPLEMENT_TYPE_P (Skyline, "ly:skyline?");
IMPLEMENT_DEFAULT_EQUAL_P (Skyline);
-IMPLEMENT_SIMPLE_SMOBS (Skyline_pair);
-IMPLEMENT_TYPE_P (Skyline_pair, "ly:skyline-pair?");
-IMPLEMENT_DEFAULT_EQUAL_P (Skyline_pair);
-
SCM
Skyline::mark_smob (SCM)
{
return 1;
}
-
-SCM
-Skyline_pair::mark_smob (SCM)
-{
- return SCM_EOL;
-}
-
-int
-Skyline_pair::print_smob (SCM s, SCM port, scm_print_state *)
-{
- Skyline_pair *r = (Skyline_pair *) SCM_CELL_WORD_1 (s);
- (void) r;
-
- scm_puts ("#<Skyline-pair>", port);
- return 1;
-}
#include "paper-column.hh"
#include "separation-item.hh"
#include "skyline.hh"
+#include "skyline-pair.hh"
#include "system.hh"
/* return the right-pointing skyline of the left-items and the left-pointing
#include "paper-score.hh"
#include "pointer-group-interface.hh"
#include "separation-item.hh"
+#include "skyline-pair.hh"
#include "spaceable-grob.hh"
#include "spacing-interface.hh"
#include "staff-spacing.hh"
#include "axis-group-interface.hh"
#include "grob-array.hh"
#include "international.hh"
+#include "lookup.hh"
#include "main.hh"
#include "output-def.hh"
#include "paper-column.hh"
#include "paper-score.hh"
#include "paper-system.hh"
#include "pointer-group-interface.hh"
+#include "skyline-pair.hh"
#include "staff-symbol-referencer.hh"
#include "warn.hh"
-#include "lookup.hh"
-
-extern bool debug_skylines;
System::System (System const &src)
: Spanner (src)
Skyline_pair *skylines = Skyline_pair::unsmob (get_property ("vertical-skylines"));
if (skylines)
{
- sys_stencil.add_stencil (Lookup::points_to_line_stencil (0.1, (*skylines)[UP].to_points (X_AXIS)).in_color (255, 0, 0));
- sys_stencil.add_stencil (Lookup::points_to_line_stencil (0.1, (*skylines)[DOWN].to_points (X_AXIS)).in_color (0, 255, 0));
+ Stencil up
+ = Lookup::points_to_line_stencil (0.1, (*skylines)[UP].to_points (X_AXIS));
+ Stencil down
+ = Lookup::points_to_line_stencil (0.1, (*skylines)[DOWN].to_points (X_AXIS));
+ sys_stencil.add_stencil (up.in_color (255, 0, 0));
+ sys_stencil.add_stencil (down.in_color (0, 255, 0));
}
}
{
staff_symbol_referencer_ = me;
staff_space_ = Staff_symbol_referencer::staff_space (me);
-
+
+ neutral_direction_ = to_dir (me->get_property ("neutral-direction"));
+ if (!neutral_direction_)
+ neutral_direction_ = DOWN;
SCM details = me->get_property ("details");
tie_configs->at (0).dir_ = Direction (sign (tie_configs->at (0).position_));
if (!tie_configs->at (0).dir_)
- tie_configs->at (0).dir_ = DOWN;
+ tie_configs->at (0).dir_
+ = (tie_configs->size() > 1) ? DOWN : details_.neutral_direction_;
}
if (!tie_configs->back ().dir_)
#include "note-head.hh"
#include "output-def.hh"
#include "paper-column.hh"
+#include "pointer-group-interface.hh"
#include "rhythmic-head.hh"
#include "spanner.hh"
#include "staff-symbol-referencer.hh"
Direction d = LEFT;
do
{
- Grob *stem = head (me, d) ? Rhythmic_head::get_stem (head (me, d)) : 0;
+ Grob *one_head = head (me, d);
+ if (!one_head && dynamic_cast<Spanner*> (me))
+ one_head = Tie::head (dynamic_cast<Spanner*> (me)->broken_neighbor (d), d);
+
+ Grob *stem = one_head ? Rhythmic_head::get_stem (one_head) : 0;
if (stem)
stem = Stem::is_invisible (stem) ? 0 : stem;
else if (int p = get_position (me))
return Direction (sign (p));
- return UP;
+ return to_dir (me->get_property("neutral-direction"));
}
// && unsmob_grob_array (yparent->get_object ("ties"))->size () > 1
)
{
+ extract_grob_set (yparent, "ties", ties);
+ if (ties.size() == 1
+ && !to_dir (me->get_property_data ("direction")))
+ {
+ assert (ties[0] == me);
+ set_grob_direction (me, Tie::get_default_dir (me));
+ }
+
/* trigger positioning. */
(void) yparent->get_property ("positioning-done");
}
"dash-period "
"details "
"direction "
- "separation-item "
"head-direction "
"line-thickness "
+ "neutral-direction "
"quant-score "
+ "separation-item "
"staff-position "
"thickness "
);
\consists "Part_combine_engraver"
\consists "Text_engraver"
- \consists "Dynamic_engraver"
+ \consists "New_dynamic_engraver"
+ \consists "Dynamic_align_engraver"
+% \consists "Dynamic_engraver"
\consists "Fingering_engraver"
\consists "Bend_engraver"
middleCClefPosition = #-6
middleCPosition = #-6
firstClef = ##t
+
+ crescendoSpanner = #'hairpin
+ decrescendoSpanner = #'hairpin
defaultBarType = #"|"
barNumberVisibility = #first-bar-number-invisible
setTextCresc = {
\set crescendoText = \markup { \italic "cresc." }
- \set crescendoSpanner = #'dashed-line
+ \set crescendoSpanner = #'text
+ \override DynamicTextSpanner #'style = #'dashed-line
}
setTextDecresc = {
\set decrescendoText = \markup { \italic "decresc." }
- \set decrescendoSpanner = #'dashed-line
+ \set decrescendoSpanner = #'text
+ \override DynamicTextSpanner #'style = #'dashed-line
}
setTextDecr = {
\set decrescendoText = \markup { \italic "decr." }
- \set decrescendoSpanner = #'dashed-line
+ \set decrescendoSpanner = #'text
+ \override DynamicTextSpanner #'style = #'dashed-line
}
setTextDim = {
\set decrescendoText = \markup { \italic "dim." }
- \set decrescendoSpanner = #'dashed-line
+ \set decrescendoSpanner = #'text
+ \override DynamicTextSpanner #'style = #'dashed-line
}
+
setHairpinCresc = {
\unset crescendoText
\unset crescendoSpanner
}
+
setHairpinDecresc = {
\unset decrescendoText
\unset decrescendoSpanner
}
+
setHairpinDim = {
\unset decrescendoText
\unset decrescendoSpanner
(clefPosition ,number? "Where should the center of the clef
symbol go, measured in half staff spaces from the center of the
staff.")
+ (completionBusy ,boolean? "Whether a completion-note head is playing.")
(connectArpeggios ,boolean? "If set, connect arpeggios across
piano staff.")
(countPercentRepeats ,boolean? "If set, produce counters for
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define-public default-melisma-properties
- '(melismaBusy slurMelismaBusy tieMelismaBusy beamMelismaBusy))
+ '(melismaBusy slurMelismaBusy tieMelismaBusy beamMelismaBusy completionBusy))
(springs-and-rods . ,ly:spanner::set-spacing-rods)
(avoid-slur . inside)
(direction . ,ly:tie::calc-direction)
+ (neutral-direction . ,UP)
(stencil . ,ly:tie::print)
(font-size . -6)
(details . (
'grob-property gprop))
(define direction-polyphonic-grobs
- '(Stem Tie Rest Slur PhrasingSlur Script TextScript Dots DotColumn Fingering))
+ '(DotColumn
+ Dots
+ Fingering
+ LaissezVibrerTie
+ PhrasingSlur
+ RepeatTie
+ Rest
+ Script
+ Slur
+ Stem
+ TextScript
+ Tie))
(define-safe-public (make-voice-props-set n)
(make-sequential-music