* Roy R. Rankin <Roy.Rankin@alcatel.com.au>, major extension,
fixes to abc2ly, lilypond bug fixes
- * Juergen Reuter <reuterj@ira.uka.de> Custos support.
+ * Juergen Reuter <reuterj@ira.uka.de> Ancient notation
+ support (custos, porrectus, mensural notation, ancient
+ clefs, etc.)
* Jeffrey B. Reed <daboys@austin.rr.com>, Windows-NT support.
+1.5.9.hjj2
+==========
+* Emacs-mode: Keyboard shortcuts, separated identifiers from keywords
+and spacing not necessary in font-locking.
+
1.5.9.jcn3
==========
* Bugfix: stepmake: don't go building executables all over the place,
if NAME is set in environment. Some cleanups.
-
+
+
* add-html-footer.py: remove href to self. Substitute @at-variables@
defined in html comments. Any occurrence of
- <!-- @foo@=bar -->
+ <!-- @foo@=bar -->
in the html page, will subsequently substitute any occurrence of @foo@
in the same html page with `bar'.
* windows doc update.
+1.5.9.hwn3
+==========
+
+* Optimizations:
+ - speed up Rational::operator+=
+ - speed up Rational::compare ()
+ - don't store origins if point-and-click not set.
+
+* \figures input mode: \figures { <4 6+> <3- 5>2. }
+
+* Obscure bugfix: call kpsewhich with --format for mfplain.
+
+* Don't put volta bracket on top of following note (vertically).
+
+* Collision fixes.
+
+* Crude figured bass support (supports rests as well, now)
+
+* Bugfix: various collision issues, updated regtest example.
+
+* Porrectus support (Juergen Reuter)
+
1.5.9
=====
@item @email{Roy.Rankin@@alcatel.com.au, Roy R. Rankin},
major extension, fixes to abc2ly, lilypond bug fixes
@item @email{reuterj@@ira.uka.de, Juergen Reuter}
- Custos support.
+ Ancient notation support (custos, porrectus, mensural notation,
+ ancient clefs, etc.)
@item @email{daboys@@austin.rr.com, Jeffrey B. Reed},
Windows-NT support.
@item Shay Rojanski
For Debian in development ("unstable", the future 2.3 or 3.0):
- apt-get install task-debian-devel task-c++-dev \
- python-base libguile9-dev tetex-bin libkpathsea-dev \
+ apt-get install binutils cpp gcc libc6-dev \
+ g++ libstdc++2.10-dev \
+ python-base libguile-dev tetex-bin libkpathsea-dev \
tetex-extra flex bison texinfo bibtex2html groff gs \
netpbm m4 gettext
PACKAGE_NAME=LilyPond
MAJOR_VERSION=1
MINOR_VERSION=5
-PATCH_LEVEL=9
-MY_PATCH_LEVEL=jcn3
+PATCH_LEVEL=10
+MY_PATCH_LEVEL=
# use the above to send patches: MY_PATCH_LEVEL is always empty for a
# released version.
#
# For now let people define these in their environments
#
- : ${MFPLAIN_MP=`kpsewhich mp mfplain.mp`}
+ : ${MFPLAIN_MP=`kpsewhich --format mp mfplain.mp`}
AC_MSG_RESULT($MFPLAIN_MP)
AC_MSG_CHECKING(for inimetapost flags)
#
# For now let people define these in their environments
#
- : ${MFPLAIN_MP=`kpsewhich mp mfplain.mp`}
+ : ${MFPLAIN_MP=`kpsewhich --format mp mfplain.mp`}
echo "$ac_t""$MFPLAIN_MP" 1>&6
echo $ac_n "checking for inimetapost flags""... $ac_c" 1>&6
public:
void set_infinite (int sign);
- bool infty_b () const;
+ bool infty_b () const
+ {
+ return sign_ == 2 || sign_ == -2;
+ }
void invert ();
int num () const { return sign_ * num_; }
int den () const { return den_; }
Initialize to 0.
*/
Rational ();
- Rational (int, int =1);
+ Rational (int);
+ Rational (int, int);
Rational (double);
Rational (Rational const&r) { copy (r);}
normalise ();
}
+Rational::Rational (int n)
+{
+ sign_ = ::sign (n);
+ num_ = abs (n);
+ den_= 1;
+}
+
static
int gcd (int a, int b)
{
{
den_ = 1;
num_ = 0;
- return ;
}
- if (!den_)
- sign_ = 2;
- if (!num_)
- sign_ = 0;
-
- int g = gcd (num_ , den_);
+ else if (!den_)
+ {
+ sign_ = 2;
+ num_ = 1;
+ }
+ else if (!num_)
+ {
+ sign_ = 0;
+ den_ = 1;
+ }
+ else
+ {
+ int g = gcd (num_ , den_);
- num_ /= g;
- den_ /= g;
+ num_ /= g;
+ den_ /= g;
+ }
}
-
int
Rational::sign () const
{
return ::sign (sign_);
}
-bool
-Rational::infty_b () const
-{
- return abs (sign_) > 1;
-}
-
int
Rational::compare (Rational const &r, Rational const &s)
{
return 1;
else if (r.infty_b ())
return 0;
-
- return (r - s).sign ();
+ else if (r.sign_ == 0)
+ return 0;
+ else
+ {
+ /*
+ TODO: fix this code; (r-s).sign() is too expensive.
+
+ return r.sign_ * ::sign (r.num_ * s.den_ - s.num_ * r.den_);
+ */
+ return (r - s).sign ();
+ }
}
int
-\header {
- footnotes = ""
- tagline = "Lily was here (unknown version) -- automatically converted from ABC"
-}
-voicedefault = \notes {
-\property Score.defaultBarType="empty"
+%
+% This is NOT a lilypond input file. It is an ABC file, see
+% http://www.gre.ac.uk/~c.walshaw/abc/
+%
+% LilyPond includes import tools for Finale, Musedata, ABC, MIDI and PMX
+%
+X:1
+T:Paddy O'Rafferty
+C:Trad.
+M:6/8
+K:D
+dff cee|def gfe|dff cee|dfe dBA|dff cee|def gfe|faf gfe|1 dfe dBA:|2 dfe dcB||
+~A3 B3|gfe fdB|AFA B2c|dfe dcB|~A3 ~B3|efe efg|faf gfe|1 dfe dcB:|2 dfe dBA||
+fAA eAA|def gfe|fAA eAA|dfe dBA|fAA eAA|def gfe|faf gfe|dfe dBA:|
- c''8 c''8 f''8 }
-% This is NOT a lilypond input file. It is an ABC file, see
- % http://www.gre.ac.uk/~c.walshaw/abc/
- %
-
-% LilyPond includes import tools for Finale, Musedata, ABC, MIDI and PMX
- b''8 ^\downbow a''8 f''8 d''''1 b'''1 a'''1
- b''8 a''8 e''''1 b''8 a''8 f''8 e''''1
-d''''1 b'''1 a'''1 b''8 a''8 c''8 e''''1 f''8
-b''8 a''8 b'''2 ^"~" b''8 ^"~"-. a''8 b''8 a''8
- f''8 d''''1 b'''1 a'''1 b''8 a''8 b''8 a''8
- a'''1 a'''1 e''''1 a'''1 a'''1 b''8 a''8
-b'''1 a'''1 b''8 a''8 d''''1 e''''1 f''8 f''8
-b'''1 a'''1 b''8 a''8 } c''8 \grace {
- } } }
-}\score{
- \notes <
- \context Staff="default"
- {
- \voicedefault
- }
-
- >
- \paper {
- }
- \midi {}
-}
--- /dev/null
+
+\score { \notes
+
+ \context Staff \notes <
+ % the f and g on 4th beat are exceptionally ugh.
+ \context Voice=i { \stemUp c4 d e f g2 g4 a | }
+ \context Voice=ii { \stemDown g4 f e g g2 g2 }
+>}
+}
}
\score {
- \context Staff \notes \relative c' {
+ \context Staff \notes \transpose c'' {
\time 3/4
% Here's what I was trying to do:
- < \context Voice = VI {\stemDown <g4 b g'>
- r4 r4 }
- \context Voice=VII {\stemUp d'2.} >
+ < \context Voice = VI {\stemDown
+ <g4 b g'>
+ <g4. b g'>
+ <g4 b d'>
+ d'4
+ d'4.
+ }
+
+ \context Voice=VII {\stemUp
+ d'4
+ d'4.
+ <a4 c'>
+ <g4 b g'>
+ <g4. b g'>
+ } >
- % Or:
-
- <\context Voice = VI {\stemUp <g4 b g'> r r}
- \context Voice= VII {\stemDown d'2.} >
}
}
}
-twovoice = \context Staff \notes <
- \context Voice=i { \stemDown c4 d e f g2~ g4 a [c8 d e f] c2| }
- \context Voice=ii { \stemUp g4 f e g ~ g2 g2 c4 g4 g2 }
+twovoice =
+\notes \relative c' \context Staff \notes <
+ \context Voice=i { \stemDown c4 c d d e e f f }
+ \context Voice=ii { \stemUp g4 f f e e d d c }
>
-twovoicesteminvert = \context Staff \notes <
- % the f and g on 4th beat are exceptionally ugh.
- \context Voice=i { \stemUp c4 d e f g2 g4 a | }
- \context Voice=ii { \stemDown g4 f e g g2 g2 }
+twovoicechords = \context Staff \notes <
+ \context Voice = i \relative c' {
+ \stemUp e4 d c b a g f
+ }
+ \context Voice = ii \relative c' {
+ \stemDown <a4 c> <a4 c> <a4 c> <a4 c> <a c>
+ <a c> <a c>
+ }
>
+
threevoice = \context Staff \notes <
\context Voice=i { \stemUp g4 f e f g a g2 }
- \context Voice=ii { \stemUp \property Voice.NoteColumn \override #'horizontal-shift = #1
- e2 e2 e2 e2 }
+ \context Voice=ii { \stemUp \shiftOn
+ e4 e e e e e e e }
\context Voice=iii { \stemDown c4 d e d c d es }
>
-chordstest = \context Staff \notes <
- \context Voice = i \relative c {
- \stemUp e4 dis c f g f a b b
- }
- \context Voice = ii \relative c {
- \stemDown <a4 c> <a4 c> <a4 e'> <a4 c> <e' a> <e a> <e a> <a c> <a d>
- }
->
-
hairyChord = \context Staff \notes\relative c' <
\context Voice=one {
- \property Voice.NoteColumn \override #'horizontal-shift = #0
+\shiftOff
\stemUp
e4
}
\context Voice=two {
\stemUp
+ \shiftOn
\property Voice.NoteColumn \override #'horizontal-shift = #1
cis
}
- \context Voice=three {
- \property Voice.NoteColumn \override #'horizontal-shift = #2
-
+ \context Voice=three { \shiftOnn
\stemUp
ais
}
\context Voice=four {
\stemDown
- \property Voice.NoteColumn \override #'horizontal-shift = #1
+ \shiftOn
fis
}
\score{
- \notes \transpose c'' { \twovoice
- \twovoicesteminvert
- \threevoice \break
- \chordstest
+ \notes \transpose c'' {
+ \twovoice
+ \twovoicechords
+
+ \threevoice
\hairyChord
}
\property Staff.Accidentals \override #'style = #'vaticana
\property Staff.Custos \override #'style = #'vaticana
\property Voice.NoteHead \override #'style = #'vaticana_punctum
+ \property Voice.Porrectus \override #'style = #'vaticana
+ \property Voice.Porrectus \override #'solid = ##t
+ \property Voice.Porrectus \override #'add-stem = ##t
+ \property Voice.Porrectus \override #'stem-direction = #-1
\key es \major
\clef "vaticana_fa2"
c!1 des! e! f! ges!
\clef "vaticana_do2"
\property Voice.NoteHead \override #'style = #'vaticana_subbipunctum
- a! b! ces'
+ a! b!
\property Staff.BarLine \override #'bar-size = #3.0 \bar "|"
\property Voice.NoteHead \override #'style = #'vaticana_virga
- b! a! ges fes
+ ces' b! ces'! \porrectus ges! \porrectus fes!
\breathe
\clef "vaticana_fa1"
\property Voice.NoteHead \override #'style = #'vaticana_quilisma
% \property Staff.StaffSymbol \override #'line-count = #5
\context Staff \outputproperty #(make-type-checker 'staff-symbol-interface)
#'line-count = #5
-
+
\notes \transpose c' {
\property Voice.noAutoBeaming = ##t
\property Staff.KeySignature \override #'style = #'mensural
\property Staff.Accidentals \override #'style = #'mensural
\property Staff.Custos \override #'style = #'mensural
- \property Voice.NoteHead \override #'style = #'neo_mensural
- \property Voice.Rest \override #'style = #'neo_mensural
+ \property Voice.NoteHead \override #'style = #'neo_mensural
+ \property Voice.Rest \override #'style = #'neo_mensural
+ \property Voice.Porrectus \override #'style = #'mensural
+ \property Voice.Porrectus \override #'solid = ##f
+ \property Voice.Porrectus \override #'add-stem = ##t
+ \property Voice.Porrectus \override #'stem-direction = #1
\key a \major
+
+ % IMPORTANT NOTE:
+ %
+ % The porrectus syntax is subject to change. For proper
+ % use, it may eventually change into something like this:
+ %
+ % \ligature { e \porrectus c }
+ %
+ % The reason is that there needs to be some enclosing instance
+ % for correct handling of line breaking, alignment with
+ % adjacent note heads, and placement of accidentals.
+
\clef "neo_mensural_c2"
- c2 dis es fis ges
- \property Staff.forceClef = ##t
+ cis' e' \porrectus d' gis' \porrectus e'
+ \property Staff.forceClef = ##t
\clef "neo_mensural_c2"
- ais bes cis'
- bis as gis fes
+
+ fis' \porrectus b cis''
+ b \porrectus a a \porrectus fis
\clef "petrucci_c2"
- e d c1 \bar "|"
+ cis \porrectus fis ces1 % \bar "|"
\clef "petrucci_c2"
r\longa
- \property Staff.forceClef = ##t
+ \property Staff.forceClef = ##t
\clef "mensural_c2"
r\breve r1 r2
\clef "mensural_g"
r4 r8 r16 r32 r32 \bar "|"
- \property Voice.NoteHead \override #'style = #'mensural
+ \property Voice.NoteHead \override #'style = #'mensural
\property Voice.Stem \override #'style = #'mensural
\property Voice.Stem \override #'thickness = #1.0
- \property Voice.Rest \override #'style = #'mensural
+ \property Voice.Rest \override #'style = #'mensural
\clef "petrucci_f"
c8 b, c16 b, c32 b, c64 b, c b,
d8 e d16 e d32 e d64 e d e
r\longa
- \property Staff.forceClef = ##t
+ \property Staff.forceClef = ##t
\clef "petrucci_f"
- r\breve r1 \bar "|"
+ r\breve r1 % \bar "|"
\clef "mensural_f"
- % FIXME: need this to avoid segmentation fault on r8/r16/r32
- % (Strange: what has Voice.Stem style to do with mensural rests?)
+ % FIXME: must set Voice.Stem style to #'neo_mensural to avoid
+ % segmentation fault on r8/r16/r32. (Strange: what has
+ % Voice.Stem style to do with mensural rests?)
\property Voice.Stem \override #'style = #'neo_mensural
-
r2 r4 r8 r16 r32 r32
\property Voice.Stem \override #'style = #'mensural
- \property Staff.forceClef = ##t
+ \property Staff.forceClef = ##t
\clef "mensural_f"
e2 f g
\clef "mensural_g"
- as'! bes'! cis''!
- bes'! as'! gis'! fis'!
- \property Staff.forceClef = ##t
+
+ % FIXME: In the second and all subsequent lines of score, the
+ % stems and accidentals of the junked notes keep visible on
+ % porrectus grobs. Is this an initialization bug in the line
+ % breaking algorithm?
+
+ bes'! \porrectus as'! \porrectus cis''!
+ bes'! \porrectus fis'! as'! \porrectus ges'!
+ \property Staff.forceClef = ##t
\clef "mensural_g"
e' d' c'1 \bar "|"
- \property Staff.forceClef = ##t
+ \property Staff.forceClef = ##t
\clef "petrucci_g"
c'2 d' e' f' g'
\clef "petrucci_g"
as'! bes'! cis''!
bes'! as'! gis'! fis'!
- \property Staff.forceClef = ##t
+ \property Staff.forceClef = ##t
\clef "mensural_g"
es'! des'! cis'!1 \bar "||"
}
-\version "1.3.146"
-% Example of figured bass, using text scripts.
-% (An alternative is to use a lyrics line if you want the figures
-% aligned vertically.)
-
-
-
-% Scheme macros for accidentals. Note how they can be combined
-% with other strings, for example in: d^#`(columns ,sharp "4")
-
-#(define sharp '((raise . 0.2) (music (named "accidentals-1"))))
-#(define natural '((raise . 0.2) (music (named "accidentals-0"))))
-#(define flat '((raise . 0.2) (music (named "accidentals--1"))))
-
-
-\score{
- \notes \relative c'{
- \clef bass
-
- c^"5" d^#natural g,^"7 6" [a8 e] |
- fis4^"7 6" [g8 d] e4^"7 6" [f?8 c] |
- [d^#sharp d b g][c^"7" c^"5" a^"6" f] |
- [bes^"7" bes^"5" g^"6" e] a4^#sharp d^"6" ~ |
- d^#`(columns ,sharp "4") c^"6" d e^#sharp |
+\header {
+texidoc = "Test figured bass.
+
+Figured bass is created by the FiguredBass context which eats
+note-requests and rest-requests. You can enter these either using
+standard @code{< >} notation, or using the special @code{\figures { }}
+mode, which allows you to type numbers, like @code{<4 6+>}.
+
+" }
+
+\score { \notes <
+\context FiguredBass \transpose c'' {
+ <e! g >
+ <f8 ais >
+ \figures {
+ r
+ <1 3 5>4 <3- 5+ 6!> <5>
+ }
+ }
+ \context Voice {
+ c
+ g8 g
+ f4
+ d
+ c
}
-}
-
+
+>
+ }
*/
Molecule
Beam::stem_beams (Grob*me,Item *here, Item *next, Item *prev,
- Real dy, Real dydx
+ Real /* dy */ , Real dydx
)
{
// ugh -> use commonx
Grob * nd_l = Note_column::first_head (cd);
+
+ /*
+ this case (distant half collide),
+
+ |
+ x |
+ | x
+ |
+
+ the noteheads may be closer than this case (close half collide)
+
+ |
+ |
+ x
+ x
+ |
+ |
+
+ */
- bool half_collide = false;
+ bool close_half_collide = false;
+ bool distant_half_collide = false;
bool full_collide = false;
/*
bool touch = (ups[0] - dps.top () >= 0);
- bool merge_possible = (ups[0] >= dps[0]) && (ups.top () <= dps.top ());
+ bool merge_possible = (ups[0] >= dps[0]) && (ups.top () >= dps.top ());
merge_possible = merge_possible &&
Rhythmic_head::balltype_i (nu_l) == Rhythmic_head::balltype_i (nd_l);
if (abs (ups[i] - dps[j]) == 1)
{
merge_possible = false;
- half_collide = true;
+ if (ups[i] > dps[j])
+ close_half_collide = true;
+ else
+ distant_half_collide = true;
}
else if (ups[i]==dps[j])
full_collide = true;
Real shift_amount = 1;
- if ( touch)
+ if (touch)
shift_amount *= -1;
- else
+
/*
for full collisions, the right hand head may obscure dots, so
make sure the dotted heads go to the right.
*/
- if ((Rhythmic_head::dot_count (nu_l) < Rhythmic_head::dot_count (nd_l)
- && full_collide))
- shift_amount *= -1;
+ if ((Rhythmic_head::dot_count (nu_l) > Rhythmic_head::dot_count (nd_l)
+ && full_collide))
+ shift_amount = 1;
+ /*
+ TODO: these numbers are magic; should devise a set of grob props
+ to tune this behavior. */
+
if (merge_possible)
shift_amount *= 0.0;
- else if (half_collide || full_collide)
+ else if (close_half_collide && !touch)
+ shift_amount *= 0.52;
+ else if (distant_half_collide && !touch)
+ shift_amount *= 0.4;
+ else if (distant_half_collide || close_half_collide || full_collide)
shift_amount *= 0.5;
+ /*
+ we're meshing.
+ */
+ else if (Rhythmic_head::dot_count (nu_l) || Rhythmic_head::dot_count (nd_l))
+ shift_amount *= 0.1;
else
shift_amount *= 0.25;
check_meshing_chords (me, &offsets, extents, clash_groups);
-#if 0
- /*
- if the up and down version are close, and can not be merged, move
- all of them again. */
- if (extents[UP].size () && extents[DOWN].size ())
- {
- Grob *cu_l =clash_groups[UP][0];
- Grob *cd_l =clash_groups[DOWN][0];
-
-
- /*
- TODO.
- */
- Grob * nu_l= Note_column::first_head (cu_l);
- Grob * nd_l = Note_column::first_head (cd_l);
-
- int downpos = Note_column::head_positions_interval (cd_l)[BIGGER];
- int uppos = Note_column::head_positions_interval (cu_l)[SMALLER];
-
- bool merge =
- downpos == uppos
- && Rhythmic_head::balltype_i (nu_l) == Rhythmic_head::balltype_i (nd_l);
-
-
- if (!to_boolean (me->get_grob_property ("merge-differently-dotted")))
- merge = merge && Rhythmic_head::dot_count (nu_l) == Rhythmic_head::dot_count (nd_l);
-
- /*
- notes are close, but can not be merged. Shift
- */
- if (abs (uppos - downpos) < 2 && !merge)
- do
- {
- for (int i=0; i < clash_groups[d].size (); i++)
- {
- if(Rhythmic_head::dot_count (nu_l) > Rhythmic_head::dot_count (nd_l))
- offsets[d][i] += d * 0.5;
- else
- offsets[d][i] -= d * 0.5;
- }
- }
- while ((flip (&d))!= UP);
- }
-#endif
-
do
{
for (int i=0; i < clash_groups[d].size (); i++)
ADD_MUSIC (Melisma_req);
ADD_MUSIC (Melodic_req);
ADD_MUSIC (Note_req);
+ADD_MUSIC (Porrectus_req);
ADD_MUSIC (Rest_req);
ADD_MUSIC (Rhythmic_req);
ADD_MUSIC (Script_req);
#include "engraver.hh"
#include "engraver-group-engraver.hh"
#include "grob.hh"
+#include "main.hh"
void
void
Engraver::announce_grob (Grob* e, Music *m)
{
- if (m && m->origin ()->location_str ().length_i ())
+ if (m && store_locations_global_b
+ && m->origin ()->location_str ().length_i ())
{
e->set_grob_property ("origin", m->get_mus_property ("origin"));
}
--- /dev/null
+#include "engraver.hh"
+#include "text-item.hh"
+#include "musical-request.hh"
+#include "item.hh"
+
+class Figured_bass_engraver : public Engraver
+{
+public:
+ VIRTUAL_COPY_CONS(Translator);
+ Figured_bass_engraver();
+
+protected:
+ Link_array<Note_req> figures_;
+ Rest_req * rest_req_;
+
+ Grob * figure_;
+
+ virtual bool try_music (Music*);
+ virtual void stop_translation_timestep ();
+ virtual void process_music ();
+};
+
+
+Figured_bass_engraver::Figured_bass_engraver()
+{
+ figure_ = 0;
+ rest_req_ = 0;
+}
+
+void
+Figured_bass_engraver::stop_translation_timestep ()
+{
+ if (figure_)
+ {
+ typeset_grob (figure_);
+ figure_ =00;
+ }
+
+ figures_.clear ();
+}
+
+bool
+Figured_bass_engraver::try_music (Music*m)
+{
+ if (Note_req* n = dynamic_cast<Note_req*> (m))
+ {
+ figures_.push (n);
+ return true;
+ }
+ else if (Rest_req * r = dynamic_cast<Rest_req*> (m))
+ {
+ rest_req_ = r;
+ return true;
+ }
+ return false;
+}
+
+void
+Figured_bass_engraver::process_music ()
+{
+ if (rest_req_)
+ {
+ figure_ = new Item (get_property ("BassFigure"));
+ announce_grob (figure_, rest_req_); // todo
+ figure_->set_grob_property ("text" , gh_str02scm ("-"));
+ }
+ else if (figures_.size ())
+ {
+ figure_ = new Item (get_property ("BassFigure"));
+ announce_grob (figure_, figures_[0]); // todo
+ SCM flist = SCM_EOL;
+ for (int i = 0; i < figures_.size (); i++)
+ {
+ Note_req * n = figures_[i];
+ Pitch *p = unsmob_pitch (n->get_mus_property ("pitch"));
+
+ String fstr = to_str (p->steps ()+ 1);
+
+ SCM one_fig = ly_str02scm(fstr.ch_C ());
+
+ if (p->alteration_i_ || to_boolean (n->get_mus_property ("force-accidental") ))
+ {
+ SCM alter = scm_assoc (gh_int2scm (p->alteration_i_),
+ figure_->get_grob_property ("accidental-alist"));
+ if (gh_pair_p (alter))
+ {
+ one_fig = gh_list (ly_symbol2scm ("columns"),
+ one_fig,
+ gh_cdr(alter),
+ SCM_UNDEFINED);
+ }
+ }
+
+ flist = gh_cons (one_fig, flist);
+ }
+
+ flist = gh_cons (ly_symbol2scm ("lines"), flist);
+
+ figure_-> set_grob_property ("text", flist);
+ }
+}
+
+
+ADD_THIS_TRANSLATOR(Figured_bass_engraver);
Do break substitution in S, using CRITERION. Return new value.
CRITERION is either a SMOB pointer to the desired line, or a number
representing the break direction. Do not modify SRC.
+
+ It is rather tightly coded, since it takes a lot of time.
*/
SCM
Grob::handle_broken_grobs (SCM src, SCM criterion)
VIRTUAL_COPY_CONS (Music);
};
+class Porrectus_req : public Request {
+ VIRTUAL_COPY_CONS (Music);
+};
+
/**
Handle key changes.
*/
class Piano_bar_engraver;
class Pitch_squash_engraver;
+class Porrectus_req;
class Property_iterator;
class Rational;
class Relative_octave_music;
extern String output_name_global;
extern bool safe_global_b;
extern bool verbose_global_b;
+extern bool store_locations_global_b;
/* misc */
extern All_font_metrics *all_fonts_global_p;
SCM lookup_identifier (String s);
void push_note_state ();
+ void push_figuredbass_state ();
void push_chord_state ();
void push_lyric_state ();
void pop_state ();
bool note_state_b () const;
bool chord_state_b () const;
bool lyric_state_b () const;
-
+ bool figure_state_b () const;
private:
int lookup_keyword (String);
int scan_bare_word (String);
--- /dev/null
+/*
+ porrectus.hh
+
+ Copyright (C) 2001 Juergen Reuter
+
+ written for the GNU LilyPond music typesetter
+*/
+
+#ifndef PORRECTUS_HH
+#define PORRECTUS_HH
+
+#include "lily-guile.hh"
+
+/*
+ porrectus ligature
+*/
+class Porrectus
+{
+public:
+ static void set_left_head (Grob *, SCM);
+ static SCM get_left_head (Grob *);
+ static void set_right_head (Grob *, SCM);
+ static SCM get_right_head (Grob *);
+ DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM));
+
+private:
+ static Molecule brew_vaticana_molecule (Item *, bool, bool, Direction, Real);
+ static Molecule brew_mensural_molecule (Item *, bool, bool, Direction, Real);
+ static Molecule brew_horizontal_slope (Real, Real, Real);
+ static Molecule create_ledger_line (Interval, Grob *);
+ static Molecule create_streepjes (Grob *, int, int, Interval);
+};
+
+#endif // PORRECTUS_HH
--- /dev/null
+
+/*
+untransposable-music.hh -- declare
+
+source file of the GNU LilyPond music typesetter
+
+(c) 2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ */
+
+#ifndef UNTRANSPOSABLE_MUSIC_HH
+#define UNTRANSPOSABLE_MUSIC_HH
+#include "music-wrapper.hh"
+
+class Untransposable_music : public Music_wrapper
+{
+public:
+ Untransposable_music ();
+ virtual Pitch to_relative_octave (Pitch);
+ virtual void transpose (Pitch);
+ VIRTUAL_COPY_CONS(Music);
+};
+
+
+#endif /* UNTRANSPOSABLE_MUSIC_HH */
+
%x incl
%x lyrics
%x notes
+%x figures
%x quote
%x longcomment
// windows-suck-suck-suck
}
-<INITIAL,chords,incl,lyrics,notes>{
+<INITIAL,chords,incl,lyrics,notes,figures>{
"%{" {
yy_push_state (longcomment);
}
}
}
-<INITIAL,chords,lyrics,notes>\\version{WHITE}* {
+<INITIAL,chords,lyrics,notes,figures>\\version{WHITE}* {
yy_push_state (version);
}
<version>\"[^"]*\" { /* got the version number */
}
-<INITIAL,chords,lyrics,notes>\\maininput {
+<INITIAL,chords,lyrics,notes,figures>\\maininput {
if (!main_input_b_)
{
start_main_input ();
error (_ ("\\maininput disallowed outside init files"));
}
-<INITIAL,chords,lyrics,notes>\\include {
+<INITIAL,chords,lyrics,figures,notes>\\include {
yy_push_state (incl);
}
<incl>\"[^"]*\";? { /* got the include file name */
cerr << _ ("Missing end quote") << endl;
exit (1);
}
-<chords,notes>{RESTNAME} {
+<chords,notes,figures>{RESTNAME} {
const char *s = YYText ();
yylval.scm = ly_str02scm (s);
return RESTNAME;
}
-<chords,notes>R {
+<chords,notes,figures>R {
return MULTI_MEASURE_REST;
}
-<INITIAL,chords,lyrics,notes>\\\${BLACK}*{WHITE} {
+<INITIAL,chords,lyrics,notes,figures>\\\${BLACK}*{WHITE} {
String s=YYText () + 2;
s=s.left_str (s.length_i () - 1);
return scan_escaped_word (s);
}
-<INITIAL,chords,lyrics,notes>\${BLACK}*{WHITE} {
+<INITIAL,chords,lyrics,notes,figures>\${BLACK}*{WHITE} {
String s=YYText () + 1;
s=s.left_str (s.length_i () - 1);
return scan_bare_word (s);
}
-<INITIAL,chords,lyrics,notes>\\\${BLACK}* { // backup rule
+<INITIAL,chords,lyrics,notes,figures>\\\${BLACK}* { // backup rule
cerr << _ ("white expected") << endl;
exit (1);
}
-<INITIAL,chords,lyrics,notes>\${BLACK}* { // backup rule
+<INITIAL,chords,lyrics,notes,figures>\${BLACK}* { // backup rule
cerr << _ ("white expected") << endl;
exit (1);
}
-<INITIAL,chords,lyrics,notes># { //embedded scm
+<INITIAL,chords,lyrics,notes,figures># { //embedded scm
//char const* s = YYText () + 1;
char const* s = here_ch_C ();
int n = 0;
return SCM_T;
}
-<notes>{
+<figures>{
+ \> {
+ return FIGURE_CLOSE;
+ }
+ \< {
+ return FIGURE_OPEN;
+ }
+}
+<notes,figures>{
{ALPHAWORD} {
return scan_bare_word (YYText ());
}
return c;
}
-<INITIAL,notes>. {
+<INITIAL,notes,figures>. {
return YYText ()[0];
}
-<INITIAL,lyrics,notes>\\. {
+<INITIAL,lyrics,notes,figures>\\. {
char c= YYText ()[1];
switch (c) {
yy_push_state (notes);
}
+void
+My_lily_lexer::push_figuredbass_state()
+{
+ yy_push_state (figures);
+}
void
My_lily_lexer::push_chord_state ()
{
return YY_START == lyrics;
}
+bool
+My_lily_lexer::figure_state_b () const
+{
+ return YY_START == figures;
+}
+
/*
urg, belong to String (_convert)
and should be generalised
Moment
Rhythmic_req::length_mom () const
{
- return unsmob_duration (get_mus_property ("duration"))->length_mom ();
-
+ Duration* d = unsmob_duration (get_mus_property ("duration"));
+ return d ? d->length_mom () : Moment (0);
}
void
Rhythmic_req::compress (Moment m)
{
Duration *d = unsmob_duration (get_mus_property ("duration"));
-
- set_mus_property ("duration", d ->compressed (m.main_part_).smobbed_copy ());
+ if (d)
+ set_mus_property ("duration", d ->compressed (m.main_part_).smobbed_copy ());
}
bool
-
-
-
{"duration", DURATION},
{"dynamicscript", DYNAMICSCRIPT},
{"elementdescriptions", ELEMENTDESCRIPTIONS},
- {"font", FONT},
+ {"figures",FIGURES},
{"grace", GRACE},
- {"ngrace", NGRACE},
{"glissando", GLISSANDO},
{"header", HEADER},
{"in", IN_T},
{"repeat", REPEAT},
{"addlyrics", ADDLYRICS},
{"partcombine", PARTCOMBINE},
+ {"porrectus", PORRECTUS},
{"score", SCORE},
{"script", SCRIPT},
{"stylesheet", STYLESHEET},
-
*/
+/*
+
+the rules for who is protecting what are very shady. TODO: uniformise
+this.
+
+
+*/
+
#include <ctype.h>
#include <iostream.h>
#include "transposed-music.hh"
#include "time-scaled-music.hh"
#include "repeated-music.hh"
-
+#include "untransposable-music.hh"
#include "lilypond-input-version.hh"
#include "grace-music.hh"
#include "part-combine-music.hh"
%token DENIES
%token DURATION
%token EXTENDER
-%token FONT
+%token FIGURES FIGURE_OPEN FIGURE_CLOSE
%token GLISSANDO
-%token GRACE NGRACE
+%token GRACE
%token HEADER
%token HYPHEN
%token IN_T
%token PAPER
%token PARTIAL
%token PENALTY
+%token PORRECTUS
%token PROPERTY
%token OVERRIDE SET REVERT
%token PT_T
%token CHORD_BASS CHORD_COLON CHORD_MINUS CHORD_CARET
%type <i> exclamations questions dots
+%type <i> bass_number bass_mod
+%type <scm> bass_figure figure_list figure_spec
%token <i> DIGIT
%token <scm> NOTENAME_PITCH
%token <scm> TONICNAME_PITCH
{ $$ = $3;
THIS->lexer_p_->pop_state ();
}
+ | FIGURES
+ { THIS->lexer_p_->push_figuredbass_state (); }
+ Music
+ {
+ Music * chm = new Untransposable_music () ;
+ chm->set_mus_property ("element", $3->self_scm ());
+ $$ = chm;
+
+ THIS->lexer_p_->pop_state ();
+ }
| CHORDS
{ THIS->lexer_p_->push_chord_state (); }
Music
| BREATHE {
$$ = new Breathing_sign_req;
}
+ | PORRECTUS {
+ $$ = new Porrectus_req;
+ }
;
;
+bass_number:
+ DIGIT
+ | UNSIGNED
+ ;
+
+bass_mod:
+ '-' { $$ = -1; }
+ | '+' { $$ = 1; }
+ | '!' { $$ = 0; }
+ ;
+
+bass_figure:
+ bass_number {
+ Pitch p ;
+ p .notename_i_ = $1 - 1;
+ p.normalise();
+
+ Note_req * nr = new Note_req;
+ $$ = nr->self_scm ();
+ nr->set_mus_property ("pitch", p.smobbed_copy ());
+ scm_unprotect_object ($$);
+ }
+ | bass_figure bass_mod {
+ if ($2) {
+ SCM sp = unsmob_music ($1)->get_mus_property ("pitch");
+ unsmob_pitch (sp)->alteration_i_ += $2;
+ } else {
+ unsmob_music ($1)->set_mus_property ("force-accidental", SCM_BOOL_T);
+ }
+ }
+ ;
+
+figure_list:
+ /**/ {
+ $$ = SCM_EOL;
+ }
+ | figure_list bass_figure {
+ $$ = gh_cons ($2, $1);
+ }
+ ;
+
+figure_spec:
+ FIGURE_OPEN figure_list FIGURE_CLOSE {
+ Music * m = new Request_chord (SCM_EOL);
+ $2 = scm_reverse_x ($2, SCM_EOL);
+ m->set_mus_property ("elements", $2);
+ $$ = m->self_scm ();
+ }
+ ;
+
simple_element:
pitch exclamations questions optional_notemode_duration {
n->set_spot (i);
$$ = v;
}
- | RESTNAME optional_notemode_duration {
+ | figure_spec optional_notemode_duration {
+ Music * m = unsmob_music ($1);
+ Input i = THIS->pop_spot ();
+ m->set_spot (i);
+ for (SCM s = m->get_mus_property ("elements"); gh_pair_p (s); s = gh_cdr (s))
+ {
+ unsmob_music (gh_car (s))->set_mus_property ("duration", $2);
+ }
+ $$ = m;
+ }
+ | RESTNAME optional_notemode_duration {
Input i = THIS->pop_spot ();
SCM e = SCM_UNDEFINED;
--- /dev/null
+/*
+ porrectus-engraver.cc -- implement Porrectus_engraver
+
+ Copyright (C) 2001 Juergen Reuter
+
+ written for the GNU LilyPond music typesetter
+*/
+
+/*
+ * FIXME: Currently, when creating a porrectus item, it takes the
+ * moment of the second note. Actually, it should take the moment of
+ * the first note.
+ *
+ * TODO: Introduce "\~" as alternative syntax for "\porrectus"?
+ *
+ * TODO: Hufnagel support.
+ *
+ * TODO: Fine-tuning of porrectus shape. In particular, the mensural
+ * non-solid shape could either be slightly bigger in height, or the
+ * extrem points could be slightly vertically shifted apart.
+ *
+ * TODO: For white mensural (i.e. #'style=#'mensural, #'solid=##f)
+ * porrectus grobs, it is possible to automatically determine all
+ * porrectus specific properties (add-stem, stem-direction) solely
+ * from the duration of the contributing notes and time-signature.
+ * Introduce a boolean grob property called auto-config, so that, if
+ * turned on, lily automatically sets the remaining properties
+ * properly.
+ *
+ * TODO: The following issues are not (and should not be) handled by
+ * this engraver: (1) accidentals placement, (2) avoiding line
+ * breaking inbetween porrectus, (3) spacing. For example, currently
+ * only the accidental for the second note (cp. the above FIXME) is
+ * printed. These issues should be resolved by some sort of ligature
+ * context that encloses use of this engraver, using syntax like:
+ * \ligature { e \porrectus c }.
+ *
+ * TODO: Do not allow a series of adjacent porrectus requests, as in:
+ * e \porrectus d \porrectus c.
+ */
+
+#include "staff-symbol-referencer.hh"
+#include "porrectus.hh"
+#include "musical-request.hh"
+#include "command-request.hh"
+#include "rhythmic-head.hh"
+#include "item.hh"
+#include "engraver.hh"
+#include "pqueue.hh"
+
+// TODO: PHead_melodic_tuple is duplicated code from tie-engraver.cc.
+// Maybe put this into public class?
+struct PHead_melodic_tuple {
+ Melodic_req *req_l_;
+ Grob *head_l_;
+ Moment end_;
+ PHead_melodic_tuple ();
+ PHead_melodic_tuple (Grob*, Melodic_req*, Moment);
+ static int pitch_compare (PHead_melodic_tuple const &,
+ PHead_melodic_tuple const &);
+ static int time_compare (PHead_melodic_tuple const &,
+ PHead_melodic_tuple const &);
+};
+
+inline int compare (PHead_melodic_tuple const &a, PHead_melodic_tuple const &b)
+{
+ return PHead_melodic_tuple::time_compare (a,b);
+}
+
+class Porrectus_engraver : public Engraver {
+public:
+ Porrectus_engraver ();
+ VIRTUAL_COPY_CONS (Translator);
+
+protected:
+ virtual bool try_music (Music *req_l);
+ virtual void create_grobs ();
+ virtual void stop_translation_timestep ();
+ virtual void start_translation_timestep ();
+ virtual void acknowledge_grob (Grob_info);
+
+private:
+ PQueue<PHead_melodic_tuple> past_notes_pq_;
+ Porrectus_req *porrectus_req_l_;
+ Array<PHead_melodic_tuple> left_heads_;
+ Array<PHead_melodic_tuple> right_heads_;
+ Link_array<Grob> porrectus_p_arr_;
+};
+
+Porrectus_engraver::Porrectus_engraver ()
+{
+ porrectus_req_l_ = 0;
+}
+
+bool
+Porrectus_engraver::try_music (Music *m)
+{
+ if (Porrectus_req *req_l_ = dynamic_cast <Porrectus_req *> (m))
+ {
+ porrectus_req_l_ = req_l_;
+ return true;
+ }
+ else
+ return false;
+}
+
+void
+Porrectus_engraver::acknowledge_grob (Grob_info info_l_)
+{
+ if (Rhythmic_head::has_interface (info_l_.elem_l_))
+ {
+ Note_req *note_req_l_ = dynamic_cast <Note_req *> (info_l_.req_l_);
+ if (!note_req_l_)
+ return;
+ left_heads_.push (PHead_melodic_tuple (info_l_.elem_l_, note_req_l_,
+ now_mom () +
+ note_req_l_->length_mom ()));
+ }
+}
+
+void
+Porrectus_engraver::create_grobs ()
+{
+ if (porrectus_req_l_)
+ {
+ left_heads_.sort (PHead_melodic_tuple::pitch_compare);
+ right_heads_.sort (PHead_melodic_tuple::pitch_compare);
+
+ SCM head_list = SCM_EOL;
+
+ int i = left_heads_.size () - 1;
+ int j = right_heads_.size () - 1;
+
+ while ((i >= 0) && (j >= 0))
+ {
+ head_list =
+ gh_cons (gh_cons (right_heads_[j].head_l_->self_scm (),
+ left_heads_[i].head_l_->self_scm ()),
+ head_list);
+
+ past_notes_pq_. insert (left_heads_[i]);
+ left_heads_.del (i);
+ right_heads_.del (j);
+ i--;
+ j--;
+ }
+
+ for (SCM s = head_list; gh_pair_p (s); s = gh_cdr (s))
+ {
+ SCM caar = gh_caar (s);
+ SCM cdar = gh_cdar (s);
+
+ Item *left_head = dynamic_cast<Item*> (unsmob_grob (caar));
+ Item *right_head = dynamic_cast<Item*> (unsmob_grob (cdar));
+ left_head->set_grob_property("transparent", gh_bool2scm(true));
+ right_head->set_grob_property("transparent", gh_bool2scm(true));
+
+ Grob *porrectus_p_ = new Item (get_property ("Porrectus"));
+ Porrectus::set_left_head(porrectus_p_, caar);
+ Porrectus::set_right_head(porrectus_p_, cdar);
+ porrectus_p_arr_.push (porrectus_p_);
+ announce_grob (porrectus_p_, 0);
+ }
+ }
+}
+
+void
+Porrectus_engraver::stop_translation_timestep ()
+{
+ for (int i = 0; i < left_heads_.size (); i++)
+ {
+ past_notes_pq_.insert (left_heads_[i]);
+ }
+ left_heads_.clear ();
+
+ for (int i = 0; i < porrectus_p_arr_.size (); i++)
+ {
+ typeset_grob (porrectus_p_arr_[i]);
+ }
+ porrectus_p_arr_.clear ();
+}
+
+void
+Porrectus_engraver::start_translation_timestep ()
+{
+ porrectus_req_l_ = 0;
+ Moment now = now_mom ();
+ while (past_notes_pq_.size () && past_notes_pq_.front ().end_ < now)
+ past_notes_pq_.delmin ();
+
+ right_heads_.clear ();
+ while (past_notes_pq_.size () &&
+ (past_notes_pq_.front ().end_ == now))
+ right_heads_.push (past_notes_pq_.get ());
+}
+
+ADD_THIS_TRANSLATOR (Porrectus_engraver);
+
+// TODO: PHead_melodic_tuple is duplicated code from tie-engraver.cc.
+// Maybe put this into public class?
+
+PHead_melodic_tuple::PHead_melodic_tuple ()
+{
+ head_l_ = 0;
+ req_l_ = 0;
+ end_ = 0;
+}
+
+PHead_melodic_tuple::PHead_melodic_tuple (Grob *h, Melodic_req*m, Moment mom)
+{
+ head_l_ = h;
+ req_l_ = m;
+ end_ = mom;
+}
+
+/*
+ signed compare, should use pitch<?
+ */
+int
+PHead_melodic_tuple::pitch_compare (PHead_melodic_tuple const&h1,
+ PHead_melodic_tuple const &h2)
+{
+ SCM p1 = h1.req_l_->get_mus_property ("pitch");
+ SCM p2 = h2.req_l_->get_mus_property ("pitch");
+
+ int result = Pitch::compare (*unsmob_pitch (p1),
+ *unsmob_pitch (p2));
+ return result;
+}
+
+int
+PHead_melodic_tuple::time_compare (PHead_melodic_tuple const&h1,
+ PHead_melodic_tuple const &h2)
+{
+ int result = Moment::compare(h1.end_, h2.end_);
+ return result;
+}
--- /dev/null
+/*
+ porrectus.cc -- implement Porrectus
+
+ Copyright (C) 2001 Juergen Reuter
+
+ written for the GNU LilyPond music typesetter
+
+ TODO: --> see porrectus-engraver.cc
+*/
+
+#include "staff-symbol-referencer.hh"
+#include "porrectus.hh"
+#include "item.hh"
+#include "molecule.hh"
+#include "pitch.hh"
+#include "lookup.hh"
+#include "debug.hh"
+#include "dimensions.hh"
+#include "direction.hh"
+#include "bezier.hh"
+#include "font-interface.hh"
+#include "math.h" // rint
+
+void
+Porrectus::set_left_head (Grob *me, SCM left_head)
+{
+ if (left_head == SCM_EOL)
+ {
+ warning (_ ("(left_head == SCM_EOL) (ignored)"));
+ }
+ me->set_grob_property ("left-head", left_head);
+}
+
+SCM
+Porrectus::get_left_head (Grob *me)
+{
+ SCM left_head = me->get_grob_property ("left-head");
+ return left_head;
+}
+
+void
+Porrectus::set_right_head (Grob *me, SCM right_head)
+{
+ if (right_head == SCM_EOL)
+ {
+ warning (_ ("(right_head == SCM_EOL) (ignored)"));
+ }
+ me->set_grob_property ("right-head", right_head);
+}
+
+SCM
+Porrectus::get_right_head (Grob *me)
+{
+ SCM right_head = me->get_grob_property ("right-head");
+ return right_head;
+}
+
+// Uugh. The following two functions are almost duplicated code from
+// custos.cc, which itself is similar to code in note-head.cc. Maybe
+// this should be moved to staff-symbol-referencer.cc?
+Molecule
+Porrectus::create_ledger_line (Interval x_extent, Grob *me)
+{
+ Molecule line;
+ Molecule slice = Font_interface::get_default_font (me)->find_by_name ("noteheads-ledgerending");
+ Interval slice_x_extent = slice.extent (X_AXIS);
+ Interval slice_y_extent = slice.extent (Y_AXIS);
+
+ // Create left ending of ledger line.
+ Molecule left_ending = slice;
+ left_ending.translate_axis (x_extent[LEFT] - slice_x_extent[LEFT], X_AXIS);
+ if (x_extent.length () > slice_x_extent.length ())
+ line.add_molecule (left_ending);
+
+ // Create right ending of ledger line.
+ Molecule right_ending = slice;
+ right_ending.translate_axis (x_extent[RIGHT] - slice_x_extent[RIGHT],
+ X_AXIS);
+ line.add_molecule (right_ending);
+
+ // Fill out space between left and right ending of ledger line by
+ // lining up a series of slices in a row between them.
+ Molecule fill_out_slice = left_ending;
+ Real thick = slice_y_extent.length ();
+ Real delta_x = slice_x_extent.length () - thick;
+ Real xpos = x_extent [LEFT] + 2*delta_x + thick/2; // TODO: check: thick*2?
+ while (xpos <= x_extent[RIGHT])
+ {
+ fill_out_slice.translate_axis (delta_x, X_AXIS);
+ line.add_molecule (fill_out_slice);
+ xpos += delta_x;
+ }
+
+ return line;
+}
+
+Molecule
+Porrectus::create_streepjes (Grob *me,
+ int pos,
+ int interspaces,
+ Interval extent)
+{
+ Real inter_f = Staff_symbol_referencer::staff_space (me)/2;
+ int streepjes_i = abs (pos) < interspaces
+ ? 0
+ : (abs (pos) - interspaces) /2;
+ Molecule molecule = Molecule();
+ if (streepjes_i)
+ {
+ Direction dir = (Direction)sign (pos);
+ Molecule ledger_line (create_ledger_line (extent, me));
+ ledger_line.set_empty (true);
+ Real offs = (Staff_symbol_referencer::on_staffline (me, pos))
+ ? 0.0
+ : -dir * inter_f;
+ for (int i = 0; i < streepjes_i; i++)
+ {
+ Molecule streep (ledger_line);
+ streep.translate_axis (-dir * inter_f * i * 2 + offs,
+ Y_AXIS);
+ molecule.add_molecule (streep);
+ }
+ }
+ return molecule;
+}
+
+MAKE_SCHEME_CALLBACK (Porrectus,brew_molecule,1);
+SCM
+Porrectus::brew_molecule (SCM smob)
+{
+ Item *me = (Item *)unsmob_grob (smob);
+
+ SCM scm_style = me->get_grob_property ("style");
+ String style;
+ if ((gh_symbol_p (scm_style)) && (scm_style != SCM_EOL))
+ style = ly_scm2string (scm_symbol_to_string (scm_style));
+ else {
+ warning (_ ("porrectus style undefined; using mensural"));
+ style = "mensural";
+ }
+
+ bool solid = to_boolean (me->get_grob_property ("solid"));
+ bool add_stem = to_boolean (me->get_grob_property ("add-stem"));
+
+ SCM stem_direction_scm = me->get_grob_property ("stem-direction");
+ Direction stem_direction =
+ gh_number_p (stem_direction_scm) ? to_dir (stem_direction_scm) : DOWN;
+ if (!stem_direction)
+ stem_direction = DOWN;
+
+ SCM left_head_scm = get_left_head (me);
+ SCM right_head_scm = get_right_head (me);
+ if ((left_head_scm == SCM_EOL) || (right_head_scm == SCM_EOL))
+ {
+ warning (_ ("junking lonely porrectus"));
+ return SCM_EOL;
+ }
+
+ Item *left_head = dynamic_cast<Item*> (unsmob_grob (left_head_scm));
+ Item *right_head = dynamic_cast<Item*> (unsmob_grob (right_head_scm));
+ if (!left_head || !right_head)
+ {
+ warning (_ ("junking lonely porrectus"));
+ return SCM_EOL;
+ }
+
+ Real left_position_f = Staff_symbol_referencer::position_f (left_head);
+ Real right_position_f = Staff_symbol_referencer::position_f (right_head);
+ Real interval = right_position_f - left_position_f;
+
+ Molecule molecule;
+ if (String::compare_i (style, "vaticana") == 0)
+ molecule = brew_vaticana_molecule (me, solid, add_stem, stem_direction,
+ interval);
+ else if (String::compare_i (style, "mensural") == 0)
+ molecule = brew_mensural_molecule (me, solid, add_stem, stem_direction,
+ interval);
+ else
+ return SCM_EOL;
+
+ Real space = Staff_symbol_referencer::staff_space (me);
+ Real head_extent = molecule.extent (X_AXIS).length ();
+ Interval extent (-0.2 * head_extent, 1.2 * head_extent);
+ int interspaces = Staff_symbol_referencer::line_count (me)-1;
+
+ molecule.translate_axis (left_position_f * space/2, Y_AXIS);
+
+ Molecule left_head_streepjes =
+ create_streepjes (me, (int)rint (left_position_f), interspaces, extent);
+ left_head_streepjes.translate_axis (left_position_f * space/2, Y_AXIS);
+ molecule.add_molecule (left_head_streepjes);
+
+ Molecule right_head_streepjes =
+ create_streepjes (me, (int)rint (right_position_f), interspaces, extent);
+ right_head_streepjes.translate_axis (right_position_f * space/2, Y_AXIS);
+ molecule.add_molecule (right_head_streepjes);
+
+ return molecule.smobbed_copy();
+}
+
+Molecule
+Porrectus::brew_vaticana_molecule (Item *me,
+ bool solid,
+ bool add_stem,
+ Direction stem_direction,
+ Real interval)
+{
+ Real space = Staff_symbol_referencer::staff_space (me);
+ Real line_thickness = space/6;
+ Real width = 2.4 * space;
+ Molecule molecule = Molecule ();
+
+ if (interval >= 0.0)
+ {
+ warning (_ ("ascending vaticana style porrectus (ignored)"));
+ }
+
+ if (add_stem)
+ {
+ bool consider_interval =
+ ((stem_direction == DOWN) && (interval < 0.0)) ||
+ ((stem_direction == UP) && (interval > 0.0));
+
+ Interval stem_box_x (-line_thickness/2, +line_thickness/2);
+ Interval stem_box_y;
+
+ if (consider_interval)
+ {
+ Real y_length = interval / 2.0;
+ if (y_length < 1.2 * space)
+ y_length = 1.2 * space;
+ stem_box_y = Interval (0, y_length);
+ }
+ else
+ stem_box_y = Interval (0, space);
+
+ Real y_correction =
+ (stem_direction == UP) ?
+ 0.3 * space :
+ - 0.3 * space - stem_box_y.length();
+
+ Box stem_box (stem_box_x, stem_box_y);
+ Molecule stem = Lookup::filledbox (stem_box);
+ stem.translate_axis (y_correction, Y_AXIS);
+ molecule.add_molecule(stem);
+ }
+
+ Box vertical_edge (Interval (-line_thickness/2, +line_thickness/2),
+ Interval (-4*line_thickness/2, +4*line_thickness/2));
+ Molecule left_edge = Lookup::filledbox (vertical_edge);
+ Molecule right_edge = Lookup::filledbox (vertical_edge);
+ right_edge.translate_axis (width, X_AXIS);
+ right_edge.translate_axis (interval / 2.0, Y_AXIS);
+ molecule.add_molecule(left_edge);
+ molecule.add_molecule(right_edge);
+
+ Bezier bezier;
+ bezier.control_[0] = Offset (0.00 * width, 0.0);
+ bezier.control_[1] = Offset (0.33 * width, interval / 2.0);
+ bezier.control_[2] = Offset (0.66 * width, interval / 2.0);
+ bezier.control_[3] = Offset (1.00 * width, interval / 2.0);
+
+ Molecule slice;
+ slice = Lookup::slur (bezier, 0.0, line_thickness);
+ slice.translate_axis (-3 * line_thickness/2, Y_AXIS);
+ molecule.add_molecule (slice);
+ if (solid)
+ for (int i = -2; i < +2; i++)
+ {
+ slice = Lookup::slur (bezier, 0.0, line_thickness);
+ slice.translate_axis (i * line_thickness/2, Y_AXIS);
+ molecule.add_molecule (slice);
+ }
+ slice = Lookup::slur (bezier, 0.0, line_thickness);
+ slice.translate_axis (+3 * line_thickness/2, Y_AXIS);
+ molecule.add_molecule (slice);
+
+ return molecule;
+}
+
+Molecule
+Porrectus::brew_mensural_molecule (Item *me,
+ bool solid,
+ bool add_stem,
+ Direction stem_direction,
+ Real interval)
+{
+ Real space = Staff_symbol_referencer::staff_space (me);
+ Real line_thickness = space/6;
+ Real width = 2.4 * space;
+ Molecule molecule = Molecule ();
+
+ if (add_stem)
+ {
+ // Uugh. This is currently the same as in
+ // brew_vaticana_molecule, but may eventually be changed.
+
+ bool consider_interval =
+ ((stem_direction == DOWN) && (interval < 0.0)) ||
+ ((stem_direction == UP) && (interval > 0.0));
+
+ Interval stem_box_x (0, line_thickness);
+ Interval stem_box_y;
+
+ if (consider_interval)
+ {
+ Real y_length = interval / 2.0;
+ if (y_length < 1.2 * space)
+ y_length = 1.2 * space;
+ stem_box_y = Interval (0, y_length);
+ }
+ else
+ stem_box_y = Interval (0, space);
+
+ Real y_correction =
+ (stem_direction == UP) ?
+ 0.3 * space :
+ - 0.3 * space - stem_box_y.length();
+
+ Box stem_box (stem_box_x, stem_box_y);
+ Molecule stem = Lookup::filledbox (stem_box);
+ stem.translate_axis (y_correction, Y_AXIS);
+ molecule.add_molecule(stem);
+ }
+
+ Real slope = (interval / 2.0) / width;
+
+ Molecule left_edge =
+ brew_horizontal_slope (line_thickness, slope, 3.5 * line_thickness);
+ left_edge.translate_axis (0.25 * line_thickness, Y_AXIS);
+ molecule.add_molecule(left_edge);
+
+ Molecule right_edge =
+ brew_horizontal_slope (line_thickness, slope, 3.5 * line_thickness);
+ right_edge.translate_axis (width - line_thickness, X_AXIS);
+ right_edge.translate_axis (interval / 2.0 * (1.0 - (line_thickness/width)) +
+ 0.25 * line_thickness, Y_AXIS);
+ molecule.add_molecule(right_edge);
+
+ Molecule bottom_edge =
+ Porrectus::brew_horizontal_slope (width, slope, line_thickness);
+ bottom_edge.translate_axis (-3 * line_thickness/2, Y_AXIS);
+ molecule.add_molecule (bottom_edge);
+
+ Molecule top_edge =
+ Porrectus::brew_horizontal_slope (width, slope, line_thickness);
+ top_edge.translate_axis (+3 * line_thickness/2, Y_AXIS);
+ molecule.add_molecule (top_edge);
+
+ if (solid)
+ {
+ Molecule core =
+ Porrectus::brew_horizontal_slope (width, slope, 6 * line_thickness/2);
+ core.translate_axis (-line_thickness/2, Y_AXIS);
+ molecule.add_molecule (core);
+ }
+
+ return molecule;
+}
+
+Molecule
+Porrectus::brew_horizontal_slope(Real width, Real slope, Real line_thickness)
+{
+ SCM width_scm = gh_double2scm (width);
+ SCM slope_scm = gh_double2scm (slope);
+ SCM line_thickness_scm = gh_double2scm (line_thickness);
+ SCM horizontal_slope = gh_list (ly_symbol2scm ("beam"),
+ width_scm, slope_scm,
+ line_thickness_scm, SCM_UNDEFINED);
+ Box b (Interval (0, width),
+ Interval (0, width * slope +
+ sqrt (sqr(line_thickness/slope) + sqr (line_thickness))));
+ return Molecule (b, horizontal_slope);
+}
smobify_self ();
}
+/*
+ store point & click locations.
+ Global to save some time. (Sue us!)
+ */
+bool store_locations_global_b;
+
Score::Score (Score const &s)
: Input (s)
{
music_ = SCM_EOL;
header_p_ = 0;
smobify_self ();
-
+
+ /*
+ TODO: this is not very elegant....
+ */
+ store_locations_global_b = (gh_eval_str ("point-and-click") != SCM_BOOL_F);
+
Music * m =unsmob_music (s.music_);
music_ = m?m->clone ()->self_scm () : SCM_EOL;
scm_gc_unprotect_object (music_);
def_p_arr_.push (s.def_p_arr_[i]->clone ());
errorlevel_i_ = s.errorlevel_i_;
if (s.header_p_)
- {
- header_p_ = (s.header_p_) ? new Scheme_hash_table (*s.header_p_): 0;
+ {
+ header_p_ = (s.header_p_) ? new Scheme_hash_table (*s.header_p_): 0;
- scm_gc_unprotect_object (header_p_->self_scm ());
- }
-
+ scm_gc_unprotect_object (header_p_->self_scm ());
+ }
}
Score::~Score ()
Real dy, offset;
calc_position_and_height (me,&offset,&dy);
-
- me->set_grob_property ("delta-y", gh_double2scm (dy));
+
+ if (!gh_number_p (me->get_grob_property ("delta-y")))
+ me->set_grob_property ("delta-y", gh_double2scm (dy));
me->translate_axis (offset, Y_AXIS);
return SCM_UNSPECIFIED;
--- /dev/null
+/*
+untransposable-music.cc -- implement Untransposable_music
+
+source file of the GNU LilyPond music typesetter
+
+(c) 2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ */
+
+#include "untransposable-music.hh"
+
+void
+Untransposable_music::transpose (Pitch )
+{
+}
+
+Pitch
+Untransposable_music::to_relative_octave (Pitch p)
+{
+ return p;
+}
+
+ADD_MUSIC(Untransposable_music);
+
+Untransposable_music::Untransposable_music()
+{
+
+}
{
if (volta_span_p_)
Volta_spanner::add_column (volta_span_p_,item);
- if (end_volta_span_p_)
- Volta_spanner::add_column (end_volta_span_p_,item);
}
if (Bar::has_interface (item))
{
;; Copyright (C) 1992,1993,1994 Tim Peters
;; Author: 2001: Heikki Junes
-;; * Emacs-mode: new keywords, reserved words, notenames and brackets are
-;; font-lock-keywords; implementation encourages spacing/indenting.
+;; * Emacs-mode: new keywords, reserved words, identifiers, notenames,
+;; some dynamics and brackets are font-lock-keywords
;; Author: 1997: Han-Wen Nienhuys
;; Author: 1995-1996 Barry A. Warsaw
;; 1992-1994 Tim Peters
;; Created: Feb 1992
;; Version: 0.0
-;; Last Modified: 1SEP2001
+;; Last Modified: 14SEP2001
;; Keywords: lilypond languages music notation
;; This software is provided as-is, without express or implied
(defconst LilyPond-font-lock-keywords
(let* ((keywords '( ; need special order due to over[lapping] of words
-"accepts" "addlyrics" "alternative" "apply" "arpeggio" "autoBeamOff"
-"autoBeamOn" "autochange" "bar" "BarNumberingStaffContext" "break"
-"breathe" "breve" "cadenzaOn" "cadenzaOff" "char" "chord" "chordmodifiers"
-"ChordNamesContext" "chordstest" "chords" "clef" "cm" "commandspanrequest"
-"consistsend" "consists" "context" "default" "denies" "different"
-"dotsBoth" "dotsDown" "dotsUp" "duration" "dynamicscript" "dynamicUp"
-"dynamicDown" "dynamicBoth" "EasyNotation" "elementdescriptions"
-"emptyText" "extreme" "ex" "fatText" "fermata" "fff" "ff" "f" "font" "foo"
-"glissando" "gliss" "grace" "grstaff" "hairyChord" "HaraKiriStaffContext"
-"header" "hideStaffSwitch" "include" "in" "key" "linebreak" "longa"
-"lyrics" "LyricsContext" "LyricsVoiceContext" "major" "mark" "melismaEnd"
-"melisma" "midi" "minor" "mm" "musicalpitch" "m" "name" "newpage"
-"noBreak" "noisebeat" "noise" "normalkey" "normalsize" "notenames" "notes"
-"n" "onestaff" "oneVoice" "one" "OrchestralScoreContext" "outputproperty"
-"override" "paperTwentysix" "paper" "partcombine" "partial" "penalty"
-"PianoStaffContext" "pp" "property" "pt" "p" "relative" "remove" "repeat"
-"restsII" "rests" "revert" "rhythm" "right" "scales" "scale" "scheme"
-"score" "ScoreContext" "scpaper" "scriptBoth" "scriptDown" "scriptUp"
-"script" "scscore" "sd" "sequential" "settings" "set" "sfz" "shitfOnnn"
-"shitfOnn" "shitfOn" "shitfOff" "showStaffSwitch" "simultaneous" "skip"
-"slurBoth" "slurDown" "slurUp" "slurDotted" "slurSolid" "small"
-"spanrequest" "specialKey" "staccato" "StaffContext" "staffspace"
-"stemBoth" "stemDown" "stemUp" "stpaper" "stscore" "stylesheet" "su"
-"tempo" "tenuto" "textII" "textI" "textscript" "thenotes" "ThreadContext"
-"threevoice" "tieBoth" "tieDown" "tieDotted" "tieSolid" "tieUp" "times"
-"time" "tiny" "touch" "translator" "transpose" "tupletBoth" "tupletDown"
-"tupletUp" "twovoicesteminvert" "twovoice" "two" "turnOff" "type" "t"
-"unset" "version" "voiceB" "VoiceContext" "voiceC" "voiceD" "voiceE"
-"voiceOne" "voiceTwo" "voiceThree" "voiceFour" "zagers" "zager" "zoger"
+;; all letters are lowercase
+"accepts" "accompany" "addlyrics" "aeolian" "alias" "alternative"
+"apply" "arpeggio" "autochange" "bar" "break" "breathe" "breve"
+"beamintervals" "broken" "blend" "bcincipit" "char" "ch" "cg"
+"chord\\(s\\|stest\\|chordmodifiers\\)?"
+"clef \\(bass\\|treble\\|violin\\|tenor\\)?"
+"clipping" "cm" "coda" "complex" "commandspanrequest" "consists\\(end\\)?"
+"context" "contrabasso" "decr" "default" "denies" "different" "dirs"
+"down\\(bow\\|prall\\)?" "dorian" "duration" "dynamicscript"
+"eccentric" "eg" "embeddedps" "endincipit" "elementdescriptions"
+"ex\\(treme\\)?" "fermata" "f+" "font" "flageolet" "fp" "fragment" "fz"
+"gliss\\(ando\\)?" "global" "gg" "gmsus" "grace" "gr\\(and\\)?staff"
+"header" "hsize" "in\\(clude\\|versions\\|visible\\)?" "ionian"
+"key\\(s\\(ignature\\)?\\)?" "lag" "lheel" "line\\(break\\|prall\\)"
+"locrian" "longa" "lower" "ltoe" "lydian" "lyrics"
+"maintainer" "mark" "maxima" "mel\\(isma\\|ody\\)?" "midi" "major"
+"minor" "mixolydian" "mordent" "monstrous" "multipart" "music"
+"musicalpitch" "m\\(p\\|f\\|m\\)?" "name" "newpage" "noise\\(beat\\)?"
+"normal\\(key\\|size\\)" "note\\(name\\)?s" "nt?"
+"one\\(staff\\)?" "open" "outputproperty" "over\\(ride\\)?"
+"paper" "partcombine" "partial" "penalty" "phrygian" "pitch" "p+"
+"property" "pt" "prall\\(mordent\\|prall\\|up\\)?" "quickmeasure"
+"relative" "remove" "repeat" "rever\\(t\\|seturn\\)" "rf" "rheel" "rhythm"
+"right" "rtoe" "scales?" "scheme" "score" "scpaper" "script" "scscore" "sd"
+"segno" "sequential" "set\\(tings\\)?" "sf\\(f\\|z\\)?" "shortlong"
+"simultaneous" "singlepart" "skip" "small" "smarttranspose" "spanrequest"
+"staccato" "staff\\(height\\|space\\)" "start" "stop\\(ped\\)?"
+"st\\(paper\\|score\\)" "stuff" "stylesheet" "su" "tab" "tempo" "tenuto"
+"textscript" "thenotes" "thrd" "threevoice" "thumb" "tilt\\(down\\|up\\)"
+"timb" "times?" "timpani" "tiny" "toeters" "touch" "trans\\(lator\\|pose\\)"
+"trill" "trombe" "turn" "type" "t\\(wo\\(voice\\(steminvert\\)?\\)?\\)?"
+"un\\(der\\|set\\)" "up\\(bow\\|per\\|prall\\)?" "version"
+"viol\\(a\\|in\\(incipit\\)?\\|oncello\\)" "visible" "voicedefault" "vsize"
+"x" "zagers?" "z\\(eu\\|o\\)ger"
))
+ (identifiers '(
+
+;; in principle, have one or more uppercase letters
+"\\(\\(BarNumbering\\|Choir\\|Grand\\|HaraKiri\\|OrchestralPart\\|Piano\\|Rhythmic\\)Staff\\|\\(Cue\\|Lyrics\\)?Voice\\|\\(Orchestral\\)?Score\\|ChordNames\\|Grace\\|Lyrics\\|StaffGroup\\|Thread\\)Context" ; *Context
+"\\(script\\|dots\\|dynamic\\|slur\\|stem\\|sustain\\|tie\\|tuplet\\)\\(Both\\|Down\\|Up\\)" ; *(Both/Down/Up)
+"\\(slur\\|tie\\)\\(Dotted\\|Solid\\)" ; *(Dotted/Solid)
+"\\(autoBeam\\|cadenza\\|impro\\|turn\\)\\(Off\\|On\\)" ; *(On/Off)
+"\\(empty\\|fat\\)Text" ; *Text
+"shift\\(On+\\|Off\\|I\\|II\\|III\\|IV\\|V\\)" ; shift*
+"EasyNotation"
+"\\(hide\\|show\\)StaffSwitch"
+"\\(lower\\|upper\\)Voice"
+"voice\\(One\\|Two\\|Three\\|Four\\|B\\|C\\|D\\|E\\)" ; voice*
+"paper\\(Eleven\\|Sixteen\\|Thirteen\\|TwentySix\\)" ; paper*
+"\\(lower\\|upper\\)\\(Octave\\|One\\)" ; (lower/upper)*
+"hairyChord"
+"\\(Piano\\|Rhythmic\\)\\(Staff\\)?"
+"\\(clarinetti\\|fagotti\\|flauti\\|melodic\\|oboi\\|\\(quite\\|rather\\|somewhat\\)LongLyrics\\|violinoII?\\)?\\(Staff\\)?" ; *Staff
+"\\(archi\\|bassi\\|legni\\|ottoni\\|timpani\\|viole\\|violini\\)\\(Group\\)" ; *Group
+"melisma\\(End\\)?" "staff\\(One\\|Two\\)?" "rests\\(II\\)?" "specialKey"
+"noBreak" "paperTwentysix" "endHorizScript" "FontBody" "text(I)+"
+
+ ))
+
(reservedwords '(
-"bass" "treble" "PianoStaff"
+;; Other words which look nicer when colored
+"Accidentals" "autoBeamSettings" "BarLine" "Beam"
+"ChordName\\([s]?\\|s.[a-zA-Z]*\\)" "Grace\\(.[a-zA-Z]*\\)?"
+"\\(Grand\\|Piano\\)Staff" "Lyrics\\(.[a-zA-Z]*\\)?" "NoteHead"
+"Score\\(.[a-zA-Z]*\\)" "Stem" "Staff\\(Symbol\\)?" "TextScript"
+"TimeSignature" "Voice\\(.[a-zA-Z]*\\)?"
))
(kwregex (mapconcat (lambda (x) (concat "\\\\" x)) keywords "\\|"))
+ (iregex (mapconcat (lambda (x) (concat "\\\\" x)) identifiers "\\|"))
(rwregex (mapconcat (lambda (x) (concat "" x)) reservedwords "\\|"))
)
;; font-lock- comment / string / keyword / builtin / function-name /
;; variable-name / type / constant / warning -face
-;; Using extra spaces was both easier to parse and looks better!
-;; highlight note grouping brackets; space around these { [ < brackets > ] }
-;; make the text look {less[<messyand>]erronous}
- '("\\([<{[]\\)[ \t]" 1 font-lock-warning-face)
- '("\\([\]}>]\\)[ \t]" 1 font-lock-warning-face)
- '("^\\([<{[]\\)[ \t]" 1 font-lock-warning-face)
- '("^\\([\]}>]\\)[ \t]" 1 font-lock-warning-face)
- '("\\([<{[]\\)$" 1 font-lock-warning-face)
- '("\\([\]}>]\\)$" 1 font-lock-warning-face)
-
-;; highlight keywords; space after[ ]these commands /increases/readability
- (concat "\\([_^]?\\(" kwregex "\\)\\)[ \t(]")
- (concat "\\([_^]?\\(" kwregex "\\)\\)$")
'("\\([_^]?\\\\[a-zA-Z][a-zA-Z]*\\)" 1 font-lock-constant-face)
- '("\\([a-zA-Z][_a-zA-Z]*\\)[ \t]*=[ \t]*" 1 font-lock-variable-name-face)
- '("[ \t]*=[ \t]*\\([a-zA-Z][_a-zA-Z]*\\)[ \t(]" 1 font-lock-variable-name-face)
- '("[ \t]*=[ \t]*\\([a-zA-Z][_a-zA-Z]*\\)$" 1 font-lock-variable-name-face)
+ '("\\(\\(#'\\)?[a-zA-Z][_a-zA-Z.\-]*[ \t]*=[ \t]*#\\)" 1 font-lock-variable-name-face)
+ '("\\([a-zA-Z][_a-zA-Z.\-]*\\)[ \t]*=[ \t]*" 1 font-lock-variable-name-face)
+ '("[ \t]*=[ \t]*\\([a-zA-Z][_a-zA-Z]*\\)" 1 font-lock-variable-name-face)
+
;; other reserved words
- (cons (concat "\\(" rwregex "\\) ") 'font-lock-variable-name-face)
- (cons (concat "\\(" rwregex "\\)$") 'font-lock-variable-name-face)
+ (cons (concat "\\(" rwregex "\\)") 'font-lock-variable-name-face)
;; highlight note names; separate notes from (other than ')'-type) brackets
- '("[ )\t]\\(\\(\\(\\(do\\|re\\|mi\\|fa\\|sol\\|la\\|si\\)\\(b\\|bb\\|d\\|dd\\|s\\|ss\\)?\\)\\|\\([a-hsr]\\(f\\|ff\\|s\\|ss\\|flat\\|flatflat\\|sharp\\|sharpsharp\\|is[s]?\\|is[s]?is[s]?\\|es[s]?\\|es[s]?es[s]?\\)?\\)\\|\\(as\\(as\\|es\\)?\\)\\|\\(es\\(ses\\)?\\)\\|\\(bb\\)\\)[,']*\\(64\\|32\\|16\\|8\\|4\\|2\\|1\\)?[.]*\\)" 1 font-lock-type-face)
+ '("[ <\{[~()\t]\\(\\(\\(\\(do\\|re\\|mi\\|fa\\|sol\\|la\\|si\\)\\(bb?\\|dd?\\|ss?\\)?\\)\\|\\([a-hsr]\\(flat\\(flat\\)?\\|sharp\\(sharp\\)?\\|ff?\\|ss?\\|is\\(siss\\|s\\|is\\)?\\|es\\(sess\\|s\\|es\\)?\\)?\\)\\|\\(as\\(as\\|es\\)?\\)\\|\\(es\\(es\\)?\\)\\|\\(bb\\)\\)[,']*\\(64\\|32\\|16\\|8\\|4\\|2\\|1\\)?[.]*\\)" 1 font-lock-type-face)
+
+;; highlight identifiers
+ (cons (concat "\\([_^]?\\(" iregex "\\)\\)+\\($\\|[] \t(~{}>\\\\]\\)") '(0 font-lock-function-name-face t))
+
+;; highlight keywords
+ (cons (concat "\\([_^]?\\(" kwregex "\\)\\)+\\($\\|[] \t(~{}>\\\\]\\)") '(0 font-lock-keyword-face t))
+
+ '("\\([][><}{]\\)" 0 font-lock-warning-face t)
+
+ '("\\([(~)]\\|\\\\<\\|\\\\!\\|\\\\>\\)" 0 font-lock-builtin-face t)
- '("\\([(~)]\\)" 1 font-lock-builtin-face)
+;; highlight comments (again)
+ '("\\(%.*\\)" 0 font-lock-comment-face t)
)
)
;;;
;;; Changed 29th Aug 2001 Heikki Junes <heikki.junes@hut.fi>
;;; * Add PS-compilation, PS-viewing and MIDI-play
+;;; Changed 12th Sep 2001 Heikki Junes
+;;; * Keyboard shortcuts
;;; Inspired on auctex
(LilyPond-command (LilyPond-command-query (LilyPond-master-file))
'LilyPond-master-file))
+(defun LilyPond-command-formatdvi ()
+ "Format the dvi output of the current document."
+ (interactive)
+ (LilyPond-command (LilyPond-command-menu "2Dvi") 'LilyPond-master-file)
+)
+
+(defun LilyPond-command-formatps ()
+ "Format the ps output of the current document."
+ (interactive)
+ (LilyPond-command (LilyPond-command-menu "2PS") 'LilyPond-master-file)
+)
+
+(defun LilyPond-command-smartview ()
+ "View the dvi output of current document."
+ (interactive)
+ (LilyPond-command (LilyPond-command-menu "SmartView") 'LilyPond-master-file)
+)
+
+(defun LilyPond-command-view ()
+ "View the dvi output of current document."
+ (interactive)
+ (LilyPond-command (LilyPond-command-menu "View") 'LilyPond-master-file)
+)
+
+(defun LilyPond-command-viewps ()
+ "View the ps output of current document."
+ (interactive)
+ (LilyPond-command (LilyPond-command-menu "ViewPS") 'LilyPond-master-file)
+)
+
+(defun LilyPond-command-midi ()
+ "View the ps output of current document."
+ (interactive)
+ (LilyPond-command (LilyPond-command-menu "Midi") 'LilyPond-master-file)
+)
+
;; FIXME, this is broken
(defun LilyPond-region-file (begin end)
(let (
(define-key LilyPond-mode-map "\C-c\C-b" 'LilyPond-command-buffer)
(define-key LilyPond-mode-map "\C-c\C-k" 'LilyPond-kill-job)
(define-key LilyPond-mode-map "\C-c\C-c" 'LilyPond-command-master)
+ (define-key LilyPond-mode-map "\C-c\C-d" 'LilyPond-command-formatdvi)
+ (define-key LilyPond-mode-map "\C-c\C-f" 'LilyPond-command-formatps)
+ (define-key LilyPond-mode-map "\C-c\C-s" 'LilyPond-command-smartview)
+ (define-key LilyPond-mode-map "\C-c\C-v" 'LilyPond-command-view)
+ (define-key LilyPond-mode-map "\C-c\C-p" 'LilyPond-command-viewps)
+ (define-key LilyPond-mode-map "\C-c\C-m" 'LilyPond-command-midi)
)
;;; Menu Support
[ "Region" LilyPond-command-select-region
:keys "C-c C-r" :style radio
:selected (eq LilyPond-command-current 'LilyPond-command-region) ]))
- (let ((file 'LilyPond-command-on-current))
- (mapcar 'LilyPond-command-menu-entry LilyPond-command-alist))))
+; (let ((file 'LilyPond-command-on-current))
+; (mapcar 'LilyPond-command-menu-entry LilyPond-command-alist))
+;;; Some kind of mapping which includes :keys might be more elegant
+ '([ "LilyPond" (LilyPond-command (LilyPond-command-menu "ViewPS") 'LilyPond-master-file) ])
+ '([ "TeX" (LilyPond-command (LilyPond-command-menu "TeX") 'LilyPond-master-file) ])
+ '([ "2Dvi" (LilyPond-command (LilyPond-command-menu "2Dvi") 'LilyPond-master-file) :keys "C-c C-d"])
+ '([ "2PS" (LilyPond-command (LilyPond-command-menu "2PS") 'LilyPond-master-file) :keys "C-c C-f"])
+ '([ "Book" (LilyPond-command (LilyPond-command-menu "Book") 'LilyPond-master-file) ])
+ '([ "LaTeX" (LilyPond-command (LilyPond-command-menu "LaTeX") 'LilyPond-master-file) ])
+ '([ "SmartView" (LilyPond-command (LilyPond-command-menu "SmartView") 'LilyPond-master-file) :keys "C-c C-s"])
+ '([ "View" (LilyPond-command (LilyPond-command-menu "View") 'LilyPond-master-file) :keys "C-c C-v"])
+ '([ "ViewPS" (LilyPond-command (LilyPond-command-menu "ViewPS") 'LilyPond-master-file) :keys "C-c C-p"])
+ '([ "Midi" (LilyPond-command (LilyPond-command-menu "Midi") 'LilyPond-master-file) :keys "C-c C-m"])
+ ))
(defconst LilyPond-imenu-generic-re "^\\([a-zA-Z_][a-zA-Z0-9_]*\\) *="
(defun LilyPond-command-select-region ()
(interactive)
(message "Next command will be on the region")
- (setq LilyPond-command-current 'LilPond-command-region))
+ (setq LilyPond-command-current 'LilyPond-command-region))
(defun LilyPond-command-menu (name)
;; Execute LilyPond-command-alist NAME from a menu.
\consists "Phrasing_slur_engraver"
\consists "Slur_engraver"
\consists "Tie_engraver"
+ \consists "Porrectus_engraver"
\consists "Tuplet_engraver"
\consists "A2_engraver"
\accepts "InnerChoirStaff"
\accepts "ChoirStaff"
\accepts "InnerStaffGroup"
+ \accepts "FiguredBass"
}
\accepts "ChoirStaff"
\accepts "PianoStaff"
\accepts "NoteNames"
+ \accepts "FiguredBass"
soloText = #"Solo"
soloIIText = #"Solo II"
GraceContext = \translator {
\type "Engraver_group_engraver"
}
+
+FiguredBassContext = \translator {
+ \type "Engraver_group_engraver"
+ \name FiguredBass
+ \consists "Figured_bass_engraver"
+ \consistsend "Axis_group_engraver"
+}
\translator { \PianoStaffContext}
\translator { \LyricsVoiceContext }
\translator { \StaffContainerContext }
-
+\translator { \FiguredBassContext }
Begin3
Title: LilyPond
-Version: 1.5.9
-Entered-date: 08SEP01
+Version: 1.5.10
+Entered-date: 17SEP01
Description: @BLURB@
Keywords: music notation typesetting midi fonts engraving
Author: hanwen@cs.uu.nl (Han-Wen Nienhuys)
janneke@gnu.org (Jan Nieuwenhuizen)
Maintained-by: hanwen@stack.nl (Han-Wen Nienhuys)
Primary-site: sunsite.unc.edu /pub/Linux/apps/sound/convert
- 1000k lilypond-1.5.9.tar.gz
+ 1000k lilypond-1.5.10.tar.gz
Original-site: ftp.cs.uu.nl /pub/GNU/LilyPond/development/
- 1000k lilypond-1.5.9.tar.gz
+ 1000k lilypond-1.5.10.tar.gz
Copying-policy: GPL
End
%define name lilypond
-%define version 1.5.9
+%define version 1.5.10
%define release 1mdk
Name: %{name}
%define info yes
Name: lilypond
-Version: 1.5.9
+Version: 1.5.10
Release: 1
License: GPL
Group: Applications/Publishing
-Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.5.9.tar.gz
+Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.5.10.tar.gz
Summary: Create and print music notation
URL: http://www.lilypond.org/
BuildRoot: /tmp/lilypond-install
Distribution: SuSE Linux 7.0 (i386)
Name: lilypond
-Version: 1.5.9
+Version: 1.5.10
Release: 2
Copyright: GPL
Group: Applications/Publishing
-Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.5.9.tar.gz
+Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.5.10.tar.gz
# music notation software for.. ?
Summary: A program for printing sheet music.
URL: http://www.lilypond.org/
(volta . ((font-family . number) (font-relative-size . -2)))
(tuplet . ((font-family . roman) (font-shape . italic) (font-relative-size . -1)))
- (timesig . ((font-family . number) (font-relative-size . 0)))
+ (timesig . ((font-family . number) ))
(timesig-symbol . ((font-family . music) (font-relative-size . 0)))
(mmrest . ((font-family . number) (font-relative-size . 1)))
-; BROKEN as of 1.3.55, FIXME
-;
+
+
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; DEPRECATED -- DO NOT UPDATE ! -- DO NOT USE !
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
(list (list 'noteNameStyle symbol? 'style))))
+(define generic-porrectus-properties
+ (cons 'porrectus-interface
+ (list
+ (list 'porrectusStyle symbol? 'style)
+ (list 'porrectusSolid boolean? 'solid)
+ (list 'porrectusAddStem boolean? 'add-stem)
+ (list 'porrectusStemDirection dir? 'stem-direction)
+ )))
+
+
(define generic-rest-properties
(cons 'rest-interface
(list (list 'restStyle string? 'reststyle))))
generic-tie-column-properties
generic-tuplet-spanner-properties
generic-notehead-properties
+ generic-porrectus-properties
generic-rest-properties
generic-slur-properties
generic-beam-properties
; distances are given in stafflinethickness (thicknesses) and
; staffspace (distances)
+(define default-alteration-alist
+ '(
+ (0 . ((raise . 0.5) (music "accidentals-0")))
+ (-1 . ((raise . 0.5) (music "accidentals--1")))
+ (-2 . ((raise . 0.5) (music "accidentals--2")))
+ (1 . ((raise . 0.5) (music "accidentals-1")))
+ (2 . ((raise . 0.5) (music "accidentals-2")))
+ ))
+
+
(define all-grob-descriptions
`(
(Accidentals . (
text-interface font-interface break-aligned-interface))
))
+ (BassFigure . (
+ (molecule-callback . ,Text_item::brew_molecule)
+ (Y-offset-callbacks . (,Side_position_interface::aligned_on_self))
+ (direction . 0)
+ (accidental-alist . ,default-alteration-alist)
+ (font-family . number)
+ (font-relative-size . -1)
+ (meta . ,(grob-description "BassFigure" text-interface font-interface ))
+ ))
(Beam . (
;; todo: clean this up a bit: the list is getting
;; rather long.
(meta . ,(grob-description "LyricText" lyric-syllable-interface text-interface font-interface ))
))
+ (Porrectus . (
+ (style . mensural)
+ (solid . #f)
+ (add-stem . #t)
+ (stem-direction . 1)
+ (molecule-callback . ,Porrectus::brew_molecule)
+ (meta . ,(grob-description "Porrectus"
+ porrectus-interface))
+ ))
+
(RehearsalMark . (
(molecule-callback . ,Text_item::brew_molecule)
(X-offset-callbacks . (,Side_position_interface::aligned_on_self))
(TupletBracket . (
(number-gap . 2.0)
- (delta-y . 0)
(thick . 1.0)
(after-line-breaking-callback . ,Tuplet_bracket::after_line_breaking)
(molecule-callback . ,Tuplet_bracket::brew_molecule)
(grob-property-description 'X-offset-callbacks list? "list of functions, each taking an grob and axis argument. The function determine the position relative to this grob's parent. The last one in the list is called first.")
(grob-property-description 'Y-extent-callback procedure? "see @code{X-extent-callback}.")
(grob-property-description 'Y-offset-callbacks list? "see @code{X-offset-callbacks}.")
+(grob-property-description 'add-stem boolean? "Add stem to porrectus?.")
(grob-property-description 'after-line-breaking-callback procedure? "Procedure taking a grob as argument.
This procedure is called (using dependency resolution) after line breaking. Return value is ignored.")
(grob-property-description 'align number? "the alignment of the text, 0 is horizontal, 1 is vertical.")
(grob-property-description 'side-support list? "the support, a list of grobs.")
(grob-property-description 'slope number? "some kind of slope")
(grob-property-description 'slope-limit number? "set slope to zero if slope is running away steeper than this.")
+(grob-property-description 'solid boolean? "should porrectus be solidly filled?.")
(grob-property-description 'space-alist list? "Alist of break align spacing tuples. See basic-property.scm")
(grob-property-description 'space-function procedure? "function of type multiplicity -> real (in staffspace).")
(grob-property-description 'spacing-procedure procedure? "procedure
(grob-property-description 'staff-symbol boolean? "the staff symbol grob that we're in.")
(grob-property-description 'staffline-clearance number? "don't get closer than this to stafflines.")
(grob-property-description 'stem ly-grob? "pointer to Stem object.")
+(grob-property-description 'stem-direction dir? "up or down?.")
(grob-property-description 'stem-end-position number? "Where does the stem end (the end is opposite to the support-head.")
(grob-property-description 'stem-length number? "length of stem.")
(grob-property-description 'stem-shorten list? "shorten stems in forced directions given flag multiplicity.")
+ (lily-interface
+ 'porrectus-interface
+ "A porrectus ligature, joining two note heads into a single grob."
+ '(
+ ))
+
+
(lily-interface
'spaceable-element-interface
"An grob (generally a Paper_column) that takes part in the
squashedPosition
)))
+ (cons
+ 'Porrectus_engraver
+ (engraver-description
+ "Porrectus_engraver"
+ "Join adjacent notes to a porrectus ligature."
+ '(Porrectus)
+ '(
+ )))
+
+
(cons
'Property_engraver
(engraver-description
#
# For now let people define these in their environments
#
- : ${MFPLAIN_MP=`kpsewhich mp mfplain.mp`}
+ : ${MFPLAIN_MP=`kpsewhich --format mp mfplain.mp`}
AC_MSG_RESULT($MFPLAIN_MP)
AC_MSG_CHECKING(for inimetapost flags)