2004-02-04 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ * lily/auto-change-iterator.cc: move contents from
+ new-auto-change-iterator.cc from
+
+ * scm/part-combiner.scm: determine split-list from Scheme.
+
+ * lily/new-auto-change-iterator.cc (process): new file.
+
* lily/parser.yy (part_combined_music): remove old PC cruft.
* ly/engraver-init.ly: remove old
* scm/part-combiner.scm: rewrite.
+2004-02-03 Juergen Reuter <reuter@ipd.uka.de>
+
+ * Documentation/user/refman.itely, input/puer-fragment.ly,
+ input/test/vaticana.ly, ly/engraver-init.ly: ancient examples
+ updated for proper use of lyricsto; replaced "(" and ")" ->
+ "\melisma" and "\melismaEnd"
+
+ * input/test/ancient-font.ly: small updates to reduce compile
+ warnings (TODO: junk this file)
+
+ * input/test/gregorian-scripts.ly: added comment about bug
+
+ * lily/gregorian-ligature-engraver.cc, lily/ligature-engraver.cc:
+ tiny robustness fix
+
+ * mf/parmesan-clefs.mf: exact_center fixes (this broke due to
+ recent changes in the feta code); temporarily mapped mensural g
+ clef to a copy of petrucci g clef until mensural g clef will have
+ been rewritten
+
+ * mf/parmesan-heads.mf: bugfix: solved character name clashing
+ between mensural and neo-mensural heads (this broke quite a while
+ ago)
+
+ * mf/parmesan-rests.mf: still more tiny set_char_box() fixes
+
2004-02-03 Jan Nieuwenhuizen <janneke@gnu.org>
* scripts/filter-lilypond-book.py: Handle @include. Add progress
Voices can switch automatically between the top and the bottom
staff. The syntax for this is
@example
- \autochange Staff \context Voice @{ @dots{}@var{music}@dots{} @}
+ \autochange \context Voice @{ @dots{}@var{music}@dots{} @}
@end example
The two staffs of the piano staff must be named @code{up} and
@code{down}.
@lilypond[verbatim,singleline,quote]
\score { \notes \context PianoStaff <<
\context Staff = "up" {
- \autochange Staff \context Voice = VA << \relative c' {
- g4 a b c d r4 a g } >> }
+ \autochange \new Voice \relative c' {
+ g4 a b c d r4 a g } }
\context Staff = "down" {
\clef bass
s1*2
quality output, staff switches should be specified manually.
+
@node Manual staff switches
@subsection Manual staff switches
The syntax for part combining is
@example
- \newpartcombine @var{musicexpr1} @var{musicexpr2}
+ \partcombine @var{musicexpr1} @var{musicexpr2}
@end example
The music expressions will be interpreted as @internalsref{Voice}
polyphony:
@lilypond[verbatim,singleline,fragment,relative 1]
- \new Staff \newpartcombine
+ \new Staff \partcombine
{
g a( b) r
}
@lilypond[verbatim,singleline,fragment]
\new Staff <<
\property Staff.soloADue = ##f
- \newpartcombine
+ \partcombine
{
g a( b) r
}
In @code{soloADue} mode, when the two voices play the same notes on and
off, the part combiner may typeset @code{a2} more than once in a
-measure:
+measure.
Internals: for modern clefs, see @ref{Clef}.
+@refbugs
+
+The mensural g clef is temporarily mapped to the Petrucci g clef,
+until a new mensural g clef will have been implemented.
+
@node Ancient flags
\include "gregorian-init.ly"
\score {
<<
- \context VaticanaVoice {
+ \context VaticanaVoice = "cantus" {
\property Score.BarNumber \set #'transparent = ##t
\notes {
- \[ c'( c' \flexa a \] \[ a \flexa \deminutum g) \] f \divisioMinima
- \[ f( \pes a c' c' \pes d') \] c' \divisioMinima \break
- \[ c'( c' \flexa a \] \[ a \flexa \deminutum g) \] f \divisioMinima
+ \[ c'\melisma c' \flexa a \] \[ a \flexa \deminutum g\melismaEnd \] f \divisioMinima
+ \[ f\melisma \pes a c' c' \pes d'\melismaEnd \] c' \divisioMinima \break
+ \[ c'\melisma c' \flexa a \] \[ a \flexa \deminutum g\melismaEnd \] f \divisioMinima
}
}
- \lyricsto "" \new LyricsVoice \lyrics {
+ \lyricsto "cantus" \new LyricsVoice \lyrics {
San- ctus, San- ctus, San- ctus
} >>
%%% but this is intentional for editorial purposes (simplifies some
%%% global search/replace operations in emacs).
-cantus = \notes {
- \[ g4
- ( %%% Pu-
+cantus = \context VaticanaVoice = "cantus" \notes {
+ \[ g4\melisma %%% Pu-
\pes
- d')
+ d'\melismaEnd
\]
d' %%% er
- \[ d'
- ( %%% na-
+ \[ d'\melisma %%% na-
\pes e' \flexa
- d')
+ d'\melismaEnd
\]
c' %%% tus
- \[ c'
- ( %%% est
+ \[ c'\melisma %%% est
c'
- c')
+ c'\melismaEnd
\]
- \[ d'
- ( %%% no-
+ \[ d'\melisma %%% no-
\flexa c' e' \flexa
- d')
+ d'\melismaEnd
\]
d' %%% bis,
\divisioMaior
- \[ g
- ( %%% et
+ \[ g\melisma %%% et
\pes \deminutum
- d')
+ d'\melismaEnd
\]
- \[ d'
- ( %%% fi-
+ \[ d'\melisma %%% fi-
\pes e' \flexa
- d')
+ d'\melismaEnd
\]
- \[ c'
- ( %%% li-
+ \[ c'\melisma %%% li-
\flexa
- b)
+ b\melismaEnd
\]
a %%% us
- \[ c'
- ( %%% da-
+ \[ c'\melisma %%% da-
c' \pes
- d')
+ d'\melismaEnd
\]
c' %%% tus-
c' %%% est
- \[ c'
- ( %%% no-
+ \[ c'\melisma %%% no-
\pes d' \flexa c'
- c')
+ c'\melismaEnd
\]
- \[ g
- ( %%% bis:
+ \[ g\melisma %%% bis:
\pes a \flexa
- g)
+ g\melismaEnd
\]
\divisioMaxima
}
-verba = \context Lyrics = verba \lyrics {
+verba = \context Lyrics = "verba" \lyrics {
Pu- er na- tus est no- bis,
et fi- li- us da- tus est no- bis:
}
\score {
- \context VaticanaVoice <<
- \addlyrics
+ <<
\cantus
- \verba
+ \lyricsto "cantus" \verba
>>
\paper {
linethickness = \staffspace / 7.0
indent = 0.0
raggedright = ##t
packed = ##t
-% width = 15.0 \cm %%% no effect?
-
\translator {
\ScoreContext
\remove Bar_number_engraver
-\version "2.1.7"
+\version "2.1.18"
\header {
\score {
\notes \context PianoStaff <<
\context Staff = "up" {
- \autochange Staff \context Voice = VA << \relative c' { g4 c e d c r4 a g } >>
+ \autochange \context Voice = VA << \relative c' { g4 c e d c r4 a g } >>
}
\context Staff = "down" {
\clef bass
-\version "2.1.7"
+\version "2.1.18"
\header {
texidoc = "Partcombiner and grace notes can go together."
}
\score {
\new Staff
- \newpartcombine
+ \partcombine
\notes \relative c'' {
c4 d e f \grace f16 g1
}
+\version "2.1.18"
\header {
texidoc ="The a2 string is only printed on notes, not on rests,
and only after chords, solo or polyphony."
\score {
<< \property Score.skipBars = ##t
- \newpartcombine \vone \vtwo
+ \partcombine \vone \vtwo
>>
}
"
}
-\version "1.9.8"
+\version "2.1.18"
vone =\notes
}
\score {
- \newpartcombine \vone \vtwo
+ \partcombine \vone \vtwo
}
}
+\version "2.1.18"
\score {
\new Staff
- \newpartcombine \notes \relative c'' {
+ \partcombine \notes \relative c'' {
bes2(
a4)
}
vone = \notes \relative a' { g4 r8 g8 g8 r8 g8 r8 g2 ~ g2 ~ g4 }
vtwo = \notes \relative g' { e4. e8 r2 e4 r4 r2 e4 }
+\version "2.1.18"
+
\score {
<< \property Score.skipBars = ##t
- \newpartcombine \vone \vtwo
+ \partcombine \vone \vtwo
>>
}
}
+\version "2.1.18"
+
vone = \notes \relative a' { R1 a2 r4 r a a a a }
vtwo = \notes \relative a' { R1 f4 f4 f4 f f f a a }
\score {
- \newpartcombine \vone \vtwo
+ \partcombine \vone \vtwo
}
"
}
+\version "2.1.18"
+
vone = \notes \relative a' { g2 g g g4 g f' c c( c) c c c ~ c
c2. c4 c
}
}
\score {
- \newpartcombine \vone \vtwo
+ \partcombine \vone \vtwo
}
\property Staff.BarLine \override #'bar-size = #3.0 \bar "|"
% \break % 1 (8*1)
- \property Voice.NoteHead \override #'style = #'vaticana_virga
+ \property Voice.NoteHead \override #'style = #'vaticana_quilisma
b! des'! ges! fes!
\breathe
\clef "vaticana_fa1"
- \property Voice.NoteHead \override #'style = #'vaticana_quilisma
+ \property Voice.NoteHead \override #'style = #'vaticana_plica
es d
- \property Voice.NoteHead \override #'style = #'vaticana_rvirga
+ \property Voice.NoteHead \override #'style = #'vaticana_reverse_plica
c d
\property Staff.BarLine \override #'bar-size = #3.0 \bar "|"
% \break %2 (8*1)
- \property Voice.NoteHead \override #'style = #'vaticana_rvirga
+ \property Voice.NoteHead \override #'style = #'vaticana_punctum_cavum
es f
\property Voice.NoteHead \override #'style = #'vaticana_lpes
g as
bes as
\property Voice.NoteHead \override #'style = #'vaticana_vupes
g f
- \property Voice.NoteHead \override #'style = #'vaticana_plica
+ \property Voice.NoteHead \override #'style = #'vaticana_linea_punctum
\property Staff.BarLine \override #'bar-size = #2.0 \bar "|"
% \break % 3 (8*1)
FIXME: padding/minimum-distance is fragile.
+FIXME: episem stops one notehead too early.
+
"}
\include "gregorian-init.ly"
\include "gregorian-init.ly"
-cantus = \notes {
+cantus = \context VaticanaVoice = "cantus" \notes {
\clef "vaticana_fa2"
- \[ f \quilisma g \auctum \descendens a \]
- \[ \virga a g \pes a \inclinatum f \inclinatum d
+ \[ f\melisma \quilisma g \auctum \descendens a\melismaEnd \]
+ \[ \virga a\melisma g \pes a \inclinatum f \inclinatum d
c \pes d \quilisma e \pes f \virga g
- a \flexa f \pes g \inclinatum f \inclinatum e \]
- \[ d \quilisma e f \flexa e \pes f \]
- \[ e \flexa d \]
+ a \flexa f \pes g \inclinatum f \inclinatum e\melismaEnd \]
+ \[ d\melisma \quilisma e f \flexa e \pes f\melismaEnd \]
+ \[ e\melisma \flexa d\melismaEnd \]
}
-verba = \context Lyrics = verba \lyrics {
- Al-4*3 le-4*15 lu-4*5 ia.4*2
+verba = \context Lyrics = "verba" \lyrics {
+ Al- le- lu- ia.
}
\score {
- \context VaticanaVoice <<
+ <<
\cantus
- \verba
+ \lyricsto "cantus" \verba
>>
\paper {
linethickness = \staffspace / 7.0
indent = 0.0
raggedright = ##t
packed = ##t
- % packed = ##t %%%% FIXME
\translator {
\ScoreContext
\remove Bar_number_engraver
*/
#include "music.hh"
-#include "auto-change-iterator.hh"
#include "translator-group.hh"
#include "event.hh"
+#include "music-wrapper-iterator.hh"
+#include "direction.hh"
+
+class Auto_change_iterator : public Music_wrapper_iterator
+{
+public:
+ VIRTUAL_COPY_CONS (Music_iterator);
+ DECLARE_SCHEME_CALLBACK(constructor, ());
+
+ Auto_change_iterator ();
+
+protected:
+ virtual void construct_children ();
+ virtual void process (Moment);
+ Array<Pitch> pending_pitch (Moment)const;
+private:
+ SCM split_list_;
+ Direction where_dir_;
+ void change_to (Music_iterator* , SCM, String);
+};
We could change the current translator's id, but that would make
errors hard to catch
- last->translator_id_string_ = get_change ()->change_to_id_string_;
*/
- // error (_ ("I'm one myself"));
}
else
- ; // error (_ ("none of these in my family"));
-
-}
-
-/*
- Look ahead to find first pitches to determine staff position.
- WARNING: this means that
-
- \autochange Staff \notes { .... \context Staff = otherstaff { .. } .. }
-
- will confuse the autochanger, since it will not notice that the
- music for OTHERSTAFF is not his.
-
- PRECONDITION: this->ok () holds.
-*/
-Array<Pitch>
-Auto_change_iterator::pending_pitch (Moment m) const
-{
- Music_iterator * iter = child_iter_ ->clone ();
- Array<Pitch> ps;
- while (1)
- {
- SCM muses = iter->get_pending_events (m);
- for (SCM s = muses; gh_pair_p (s); s=ly_cdr (s))
- {
- Music * m = unsmob_music (ly_car (s));
- if (m && m->is_mus_type ("note-event"))
- {
- ps.push (*unsmob_pitch (m->get_mus_property ("pitch")));
- }
- }
-
- if (ps.size ())
- break;
+ ;
- iter->skip (m);
- if (!iter->ok ())
- break;
-
- m = iter->pending_moment ();
- }
-
- scm_gc_unprotect_object (iter->self_scm());
-
- return ps;
}
void
Auto_change_iterator::process (Moment m)
{
- /*
- first we get the pitches, then we do the real work.
- Music_wrapper_iterator::process () might process (and throw away)
- pitches we need. */
- Array<Pitch> ps = pending_pitch (m);
-
Music_wrapper_iterator::process (m);
- if (ps.size ())
- {
- Pitch p = ps[0];
- Direction s = Direction (sign (p.steps ()));
- /*
- Don't change for central C.
- TODO: make this tunable somehow. Sometimes, you'd want to
- switch for C.C. as well.
+
+ Moment now = report_to ()->now_mom ();
+ Moment *splitm = 0;
+
+ for (; gh_pair_p (split_list_); split_list_ = gh_cdr (split_list_))
+ {
+ splitm = unsmob_moment (gh_caar (split_list_));
+ if (*splitm > now)
+ break ;
- */
- if (s && s != where_dir_)
+ SCM tag = gh_cdar (split_list_);
+ Direction d = to_dir (tag);
+
+ if (d && d != where_dir_)
{
- where_dir_ = s;
- String to_id = (s >= 0) ? "up" : "down";
- change_to (child_iter_, get_music ()->get_mus_property ("what"), to_id);
+ where_dir_ = d;
+ String to_id = (d >= 0) ? "up" : "down";
+ change_to (child_iter_,
+ ly_symbol2scm ("Staff"),
+ to_id);
}
}
}
Auto_change_iterator::Auto_change_iterator ()
{
where_dir_ = CENTER;
+ split_list_ = SCM_EOL;
+}
+
+void
+Auto_change_iterator::construct_children ()
+{
+ Music_wrapper_iterator::construct_children ();
+ split_list_ = get_music ()->get_mus_property ("split-list");
}
IMPLEMENT_CTOR_CALLBACK (Auto_change_iterator);
int prefix_set = gh_scm2int (primitive->get_grob_property ("prefix-set"));
if (prefix_set & PES_OR_FLEXA)
- if (pitch > prev_pitch) // pes
+ if (!i) // ligature may not start with 2nd head of pes or flexa
+ {
+ primitive->warning ("may not apply `\\~' on first head of "
+ "ligature; ignoring `\\~'");
+ }
+ else if (pitch > prev_pitch) // pes
{
prev_context_info |= PES_LOWER;
context_info |= PES_UPPER;
+++ /dev/null
-/*
- auto-change-iterator.hh -- declare Auto_change_iterator
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1999--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-
- */
-
-#ifndef AUTO_CHANGE_ITERATOR_HH
-#define AUTO_CHANGE_ITERATOR_HH
-
-#include "music-wrapper-iterator.hh"
-#include "direction.hh"
-
-class Auto_change_iterator : public Music_wrapper_iterator
-{
-public:
- VIRTUAL_COPY_CONS (Music_iterator);
- DECLARE_SCHEME_CALLBACK(constructor, ());
-
- Auto_change_iterator ();
-
-protected:
- virtual void process (Moment);
- Array<Pitch> pending_pitch (Moment)const;
-private:
- Direction where_dir_;
- void change_to (Music_iterator* , SCM, String);
-};
-
-#endif /* AUTO_CHANGE_ITERATOR_HH */
{
if (finished_ligature_)
{
- typeset_ligature (finished_ligature_, finished_primitives_);
- finished_primitives_.clear ();
+ if (!finished_primitives_.size ())
+ {
+ finished_ligature_->programming_error ("Ligature_engraver::stop_translation_timestep (): "
+ "junking empty ligature");
+ }
+ else
+ {
+ typeset_ligature (finished_ligature_, finished_primitives_);
+ finished_primitives_.clear ();
+ }
finished_ligature_ = 0;
}
{
printf ("Failed files: ");
for (int i = 0; i < failed_files.size (); i++)
- printf ("%s", failed_files[i].to_str0 ());
+ printf ("%s ", failed_files[i].to_str0 ());
+ printf ("\n");
}
exit (exit_status_global);
}
#include "input.hh"
#include "lilypond-input-version.hh"
#include "scm-hash.hh"
-#include "auto-change-iterator.hh"
#include "ly-modules.hh"
#include "music-sequence.hh"
#include "input-smob.hh"
%type <scm> embedded_scm scalar
%type <music> Music Sequential_music Simultaneous_music
-%type <music> relative_music re_rhythmed_music part_combined_music
+%type <music> relative_music re_rhythmed_music
%type <music> music_property_def context_change
%type <scm> Music_list
%type <scm> property_operation context_mod translator_mod optional_context_mod
;
Composite_music:
- AUTOCHANGE STRING Music {
- Music*chm = MY_MAKE_MUSIC("AutoChangeMusic");
- chm->set_mus_property ("element", $3->self_scm ());
- chm->set_mus_property ("iterator-ctor", Auto_change_iterator::constructor_proc);
+ AUTOCHANGE Music {
+ static SCM proc ;
+ if (!proc)
+ proc = scm_c_eval_string ("make-autochange-music");
+
+ SCM res = scm_call_1 (proc, $2->self_scm ());
+ scm_gc_unprotect_object ($2->self_scm ());
+ $$ = unsmob_music (res);
+ scm_gc_protect_object (res);
+ $$->set_spot (THIS->here_input())
+ }
+ | PARTCOMBINE Music Music {
+ static SCM proc;
+ if (!proc)
+ proc = scm_c_eval_string ("make-part-combine-music");
+ SCM res = scm_call_1 (proc, gh_list ($2->self_scm (),
+ $3->self_scm (), SCM_UNDEFINED));
scm_gc_unprotect_object ($3->self_scm ());
- chm->set_mus_property ("what", scm_string_to_symbol ($2));
-
- $$ = chm;
- chm->set_spot (*$3->origin ());
+ scm_gc_unprotect_object ($2->self_scm ());
+ $$ = unsmob_music (res);
+ scm_gc_protect_object (res);
+ $$->set_spot (THIS->here_input());
}
| grace_head Music {
#if 1
}
| relative_music { $$ = $1; }
| re_rhythmed_music { $$ = $1; }
- | part_combined_music { $$ = $1; }
| TAG embedded_scm Music {
tag_music ($3, $2, THIS->here_input ());
$$ = $3;
}
;
-part_combined_music:
- PARTCOMBINE Music Music {
- static SCM proc;
- if (!proc)
- proc = scm_c_eval_string ("make-part-combine-music");
-
- SCM res = scm_call_1 (proc, gh_list ($2->self_scm (),
- $3->self_scm (), SCM_UNDEFINED));
- scm_gc_unprotect_object ($3->self_scm ());
- scm_gc_unprotect_object ($2->self_scm ());
- $$ = unsmob_music (res);
- scm_gc_protect_object (res);
- }
- ;
-
context_change:
CHANGE STRING '=' STRING {
Music*t= MY_MAKE_MUSIC("TranslatorChange");
\alias "Voice"
\description "Same as @code{Voice} context, except that it is accommodated for tyepsetting Gregorian Chant in the notational style of Editio Vaticana."
- % We can not remove Slur_engraver, since \addlyrics depends on it.
- % Instead, we make the grob transparent.
- % Unfortunately, this gives us a lot of warnings ("Degenerate bow:
- % infinite steepness reqd"), since in ligatures, all note heads are in
- % the same paper column such that the (transparent) slurs eventually may
- % start and end in the same column.
- Slur \override #'transparent = ##t
-
- % We can not remove Stem_engraver, since slurs depend on stems. If
- % we try anyway, lily will crash in slur.scm:16:6: "Wrong type argument
- % in position 1 (expecting grob): ()".
- % As a workaround, we make the grob transparent.
- Stem \set #'transparent = ##t
-
- % Since we do not remove stems, but only make it transparent, we have
- % to set the length to 0.0. Otherwise, articulation marks (such as
- % ictus, circulus or accentus) may be vertically placed quite away from
- % the note head.
- Stem \set #'length = #'0.0
-
+ \remove "Slur_engraver"
+ \remove "Stem_engraver"
\remove "Ligature_bracket_engraver"
\consists "Vaticana_ligature_engraver"
% transparent instead.
LigatureBracket \set #'transparent = ##t
- % We can not remove Slur_engraver, since \addlyrics depends on it.
- % Instead, we make the grob transparent.
- % Unfortunately, this gives us a lot of warnings ("Degenerate bow:
- % infinite steepness reqd"), since in ligatures, all note heads are in
- % the same paper column such that the (transparent) slurs eventually may
- % start and end in the same column.
- Slur \override #'transparent = ##t
-
- % We can not remove Stem_engraver, since slurs depend on stems. If
- % we try anyway, lily will crash in slur.scm:16:6: "Wrong type argument
- % in position 1 (expecting grob): ()".
- % As a workaround, we make the grob transparent.
- Stem \set #'transparent = ##t
-
- % Since we do not remove stems, but only make it transparent, we have
- % to set the length to 0.0. Otherwise, articulation marks (such as
- % ictus, circulus or accentus) may be vertically placed quite away from
- % the note head.
- Stem \set #'length = #'0.0
-
% Put some space before and after divisiones.
% FIXME: This does not seem to show any effect.
Script \set #'padding = #0.5
%
% source file of LilyPond's pretty-but-neat music font
%
-% (c) 2001--2003 Juergen Reuter <reuter@ipd.uka.de>
+% (c) 2001--2004 Juergen Reuter <reuter@ipd.uka.de>
%
fet_begingroup ("clefs")
save reduced_il;
reduced_il# = staff_space# * reduction;
-
set_char_box(0 - xpart exact_center,
0.5reduced_il# + xpart exact_center,
0.8reduced_il# - ypart exact_center,
save za, zb, zc, zd, ze, zf;
pair za, zb, zc, zd, ze, zf;
- rt za = exact_center + (0.50reduced_il, -.45reduced_il);
- zb = exact_center + (0.25reduced_il, -.50reduced_il);
- lft zc = exact_center + (0.00reduced_il, -.25reduced_il);
- lft zd = exact_center + (0.00reduced_il, +.25reduced_il);
- ze = exact_center + (0.25reduced_il, +.50reduced_il);
- rt zf = exact_center + (0.50reduced_il, +.45reduced_il);
+ save xoffs, yoffs;
+ xoffs# = xpart exact_center;
+ yoffs# = ypart exact_center;
+ define_pixels(xoffs, yoffs);
+
+ rt za = (xoffs + 0.50reduced_il, yoffs - .45reduced_il);
+ zb = (xoffs + 0.25reduced_il, yoffs - .50reduced_il);
+ lft zc = (xoffs + 0.00reduced_il, yoffs - .25reduced_il);
+ lft zd = (xoffs + 0.00reduced_il, yoffs + .25reduced_il);
+ ze = (xoffs + 0.25reduced_il, yoffs + .50reduced_il);
+ rt zf = (xoffs + 0.50reduced_il, yoffs + .45reduced_il);
draw za .. zb .. zc -- % lower punctum
zd .. ze .. zf; % upper punctum
enddef;
save za, zb, zc, zd, ze;
pair za, zb, zc, zd, ze;
+ save xoffs, yoffs;
+ xoffs# = xpart exact_center;
+ yoffs# = ypart exact_center;
+ define_pixels(xoffs, yoffs);
+
%left-handed punctum
pickup pencircle xscaled 0.6linethickness yscaled 0.5reduced_il;
- lft za = exact_center + (+0.00reduced_il, +0.00reduced_il);
- zb = exact_center + (+0.25reduced_il, +0.05reduced_il);
- rt zc = exact_center + (+0.50reduced_il, -0.05reduced_il);
+ lft za = (xoffs + 0.00reduced_il, xoffs + 0.00reduced_il);
+ zb = (xoffs + 0.25reduced_il, xoffs + 0.05reduced_il);
+ rt zc = (xoffs + 0.50reduced_il, xoffs - 0.05reduced_il);
draw za .. zb .. zc;
%stem
pickup pencircle scaled 0.6linethickness;
xpart zc = xpart zd = xpart ze;
- ypart zd = ypart exact_center = bot ypart ze + 1.5reduced_il;
+ ypart zd = yoffs = bot ypart ze + 1.5reduced_il;
draw zd -- ze;
%right-handed puncta as in do clef
flag_height# = 0.5 reduced_il#;
define_pixels(flag_height);
+ save xoffs, yoffs;
+ xoffs# = xpart exact_center;
+ yoffs# = ypart exact_center;
+ define_pixels(xoffs, yoffs);
+
%upper flag
save za, zb;
pair za, zb;
pickup pencircle xscaled reduced_slt yscaled flag_height;
- xpart exact_center
- = lft xpart za
- = rt xpart zb - reduced_il;
- ypart za = ypart exact_center +
- 0.5 (reduced_il - flag_height - staff_space);
+ xoffs = lft xpart za = rt xpart zb - reduced_il;
+ ypart za = yoffs + 0.5 (reduced_il - flag_height - staff_space);
ypart zb = ypart za - reduced_il + flag_height;
draw za -- zb;
save za, zb;
pair za, zb;
pickup pencircle xscaled reduced_slt yscaled flag_height;
- xpart exact_center
- = lft xpart za
- = rt xpart zb - reduced_il;
- ypart za = ypart exact_center +
- 0.5 (reduced_il - flag_height + staff_space);
+ xoffs = lft xpart za = rt xpart zb - reduced_il;
+ ypart za = yoffs + 0.5 (reduced_il - flag_height + staff_space);
ypart zb = ypart za - reduced_il + flag_height;
draw za -- zb;
save za, zb;
pair za, zb;
pickup pencircle scaled reduced_slt;
- lft xpart za = lft xpart zb = xpart exact_center;
- ypart exact_center
- = top ypart zb - 1.5 reduced_il
- = bot ypart za + 1.5 reduced_il;
+ lft xpart za = lft xpart zb = xoffs;
+ yoffs = top ypart zb - 1.5 reduced_il = bot ypart za + 1.5 reduced_il;
draw za -- zb;
set_char_box(0 - xpart exact_center,
save za, zb, zc, zd, ze;
pair za, zb, zc, zd, ze;
+ save xoffs, yoffs;
+ xoffs# = xpart exact_center;
+ yoffs# = ypart exact_center;
+ define_pixels(xoffs, yoffs);
+
%stem
pickup pencircle scaled linethickness;
- xpart za = xpart zb =
- xpart exact_center + 0.4reduced_il;
- ypart za = ypart exact_center = bot ypart zb + 1.5reduced_il;
+ xpart za = xpart zb = xoffs + 0.4reduced_il;
+ ypart za = yoffs = bot ypart zb + 1.5reduced_il;
draw za -- zb;
%left-handed punctum
pickup pencircle xscaled reduced_slt yscaled reduced_il;
- lft zc = exact_center;
- zd = exact_center + (0.4reduced_il, 0);
+ lft zc = (xoffs, yoffs);
+ zd = lft zc + (0.4reduced_il, 0);
draw zc -- zd;
%right-handed puncta as in do clef
%
def draw_brevis(expr exact_center, bwidth, bheight, blinethickness) =
- save xoffs, yoffs, brevis_width, brevis_height, linethickness;
- xoffs# = xpart exact_center;
- yoffs# = ypart exact_center;
+ save brevis_width, brevis_height, linethickness;
brevis_width# = bwidth; brevis_height# = bheight;
linethickness# = blinethickness;
serif_size# = (hole_height# - linethickness#)/2;
serif_protrude# = 1.5 serif_size#;
- define_pixels(xoffs, yoffs, brevis_width, brevis_height, linethickness);
+ save xoffs, yoffs;
+ xoffs# = xpart exact_center;
+ yoffs# = ypart exact_center;
+ define_pixels(xoffs, yoffs);
+
+ define_pixels(brevis_width, brevis_height, linethickness);
define_pixels(beam_width, beam_height, serif_size, serif_protrude);
penpos1(beam_width, 0);
set_char_box(0 - xpart exact_center,
2reduced_il# + xpart exact_center,
- -yoffs# + 2.2 half_reduced_il# + staff_space# - ypart exact_center,
- yoffs# + 2.2 half_reduced_il# + ypart exact_center);
+ 2.2 half_reduced_il# + staff_space# - 2 ypart exact_center,
+ 2.2 half_reduced_il# + 2 ypart exact_center);
enddef;
fet_endchar;
def draw_diamond(expr exact_center, reduction) =
- save stem_width, reduced_il, reduced_nht, holeheight, beamheight;
+ save stem_width, reduced_nht, holeheight, beamheight;
save rh_height, rh_width;
stem_width# = 1.4 reduced_slt#;
- reduced_il# = staff_space# * reduction;
reduced_nht# = noteheight# * reduction;
holeheight# = 3 reduced_slt#;
beamheight# = 0.4(reduced_nht# - holeheight#);
- rh_height# = 1.2reduced_il#;
+ rh_height# = 1.2 staff_space# * reduction;
rh_width# / rh_height# = tand(30);
define_pixels(beamheight);
define_pixels(rh_height);
define_pixels(rh_width);
+ save xoffs, yoffs;
+ xoffs# = xpart exact_center;
+ yoffs# = ypart exact_center;
+ define_pixels(xoffs, yoffs);
+
pickup pencircle
xscaled beamheight
yscaled stem_width
rotated 45;
draw
- exact_center + (-rh_width/2, 0) --
- exact_center + (0, rh_height/2) --
- exact_center + (+rh_width/2, 0) --
- exact_center + (0, -rh_height/2) --
+ (xoffs - rh_width/2, yoffs) --
+ (xoffs, yoffs + rh_height/2) --
+ (xoffs + rh_width/2, yoffs) --
+ (xoffs, yoffs - rh_height/2) --
cycle;
enddef;
% col. 1649 ("Contredanse"), fig. 2.
%
- save reduced_il, reduced_slt;
+ save interline, reduced_il, reduced_slt;
+ interline# = staff_space#;
reduced_il# = staff_space# * reduction;
reduced_slt# = linethickness# * reduction;
- define_pixels(reduced_il);
- define_pixels(reduced_slt);
draw_brevis(exact_center, reduced_il#, reduced_il#, reduced_slt#);
+ draw_diamond(exact_center + (1.6interline#*reduction, interline#/2),
+ reduction);
+ draw_diamond(exact_center + (1.6interline#*reduction, -interline#/2),
+ reduction);
- save stem_width, interline;
+ define_pixels(interline);
+ define_pixels(reduced_il);
+ define_pixels(reduced_slt);
+
+ save stem_width;
stem_width# = 1.4 reduced_slt#;
- interline# = staff_space#;
define_pixels(stem_width);
- define_pixels(interline);
- addto currentpicture also currentpicture
- yscaled -1 shifted (0, 2*(ypart exact_center));
- addto currentpicture also currentpicture
- xscaled -1 shifted (2x4l,0);
+ save xoffs, yoffs;
+ xoffs# = xpart exact_center;
+ yoffs# = ypart exact_center;
+ define_pixels(xoffs, yoffs);
% brevis stem
pickup pencircle xscaled stem_width yscaled blot_diameter;
- rt z8 = exact_center + (reduced_il, 0);
+ rt z8 = (xoffs + reduced_il, yoffs);
z9 = z8 + (0, -4reduced_il);
draw z8 .. z9;
- % upper diamond
- draw_diamond(exact_center + (1.6interline*reduction, interline/2),
- reduction);
+ % upper diamond's stem
pickup pencircle xscaled stem_width yscaled blot_diameter;
- z10 = exact_center +
- (1.6interline*reduction + stem_width/2, interline*reduction);
+ z10 = (xoffs + 1.6interline*reduction + stem_width/2,
+ yoffs + interline*reduction);
top z11 = z10 + (0, 1.5interline*reduction);
- draw z10 .. z11; % diamond stem
+ draw z10 .. z11;
- % lower diamond
- draw_diamond(exact_center + (1.6interline*reduction, -interline/2),
- reduction);
+ % lower diamond's stem
pickup pencircle xscaled stem_width yscaled blot_diameter;
- z12 = exact_center +
- (1.6interline*reduction - stem_width/2, -interline*reduction);
+ z12 = (xoffs + 1.6interline*reduction - stem_width/2,
+ yoffs - interline*reduction);
bot z13 = z12 + (0, -3.5interline*reduction);
- draw z12 .. z13; % diamond stem
+ draw z12 .. z13;
save reduced_il, rh_height, rh_width;
reduced_il# = staff_space# * reduction;
dot_diameter# = 0.1 reduction * staff_space#;
define_pixels(width, stem_width, staff_space, dot_diameter);
+ save xoffs, yoffs;
+ xoffs# = xpart exact_center;
+ yoffs# = ypart exact_center;
+ define_pixels(xoffs, yoffs);
+
pickup pencircle
xscaled 0.2width
yscaled stem_width
% half circle
lft z5 = (0, 0);
draw halfcircle scaled width rotated -90
- shifted (z5-exact_center);
+ shifted (z5-(xoffs, yoffs));
% upper dot
- rt x2 = xpart exact_center + width;
- top y1 = ypart exact_center + 0.5width;
+ rt x2 = xoffs + width;
+ top y1 = yoffs + 0.5width;
z2 - z1 = (dot_diameter, -dot_diameter);
draw z1 -- z2;
fet_endchar;
-def draw_mensural_g_clef(expr exact_center, reduction) =
- %
- % TODO: Rewrite me! This clef looks completely awful! --jr
- %
-
-
- %
- % This code is completely undebuggable.
- %
- % the shift command is forbidden because (pen)labels come out
- % completely wrong
- %
-
- %
- % inspired by Francisco Guerrero, "Lib. 1. Missarum" (1566),
- % in: MGG, volume 3, col. 858 ("Ducis"); also by Stefano
- % Fabri, "Quam speciosa veteranis" (1611), in: MGG, volume 3,
- % col. 1698 ("Fabri"); also by Philippus Dulichius,
- % "Fasciculus novus ..." (1598), in: MGG, volume 3, col. 919
- % ("Dulichius"), fig. 1; also by Noe Faignient, "Ic sal de
- % Heer myn God gebenedye" (1568), in: MGG, volume 3, col. 1735
- % ("Faignient").
- %
- % Metafont code partially inspired by Schwabacher 'G' of yswab
- % font.
-
- save reduced_il, stem_width, height, width, apex_o, hair;
-
- reduced_il#=staff_space#*reduction;
-
- set_char_box(0 - xpart exact_center,
- 1.2reduced_il# + xpart exact_center,
- 0.8reduced_il# - ypart exact_center,
- 1.5reduced_il# + ypart exact_center);
-
- stem_width# = 0.17 reduced_il#;
- height# = 1.5 reduced_il#;
- width# = 1.13 reduced_il#;
- apex_o# = 0.02 reduced_il#;
- hair# = 3 linethickness#;
- define_pixels(reduced_il, stem_width, height, width, apex_o, hair);
-
- penpos1(2 stem_width, -142);
- z1l = (0.715 width, 0.742 height);
- penpos1'(hair, -90);
- z1'l = z1r;
- penpos2(1.179 stem_width, -142);
- z2l = (width, 0.466 height);
- penpos3(hair, 77);
- z3 = (0.764 width, 0.067 height);
- z4 = (0.59 width, -apex_o);
- penpos5(1.179 stem_width, 32);
- z5l=(0, 0.457 height);
- penpos6(hair, -56.5);
- z7 = (x4 - 0.843 stem_width, height + apex_o);
- z7 - z6l = whatever * dir33.5;
- penpos8(1.286 stem_width, -130);
- z8r = (0.715 width, 0.742 height) + (-apex_o, apex_o);
- z6r - z8r = whatever * (z7 - z8l);
- filldraw
- z1'r{dir45} .. z2r{down} .. z3r{dir207} .. z5r{up} ..
- z6r{z7-z6l} & z6r -- z8r -- z8l -- z7 --- z6l ...
- z5l{down} .. z4{right} .. z3l{dir27} .. z2l{up} ..
- z1l{1/3[z6l,z7]-z1l} & z1l -- z1r -- z1'r & cycle
- shifted (-exact_center + (0, -0.75reduced_il));
-
- penpos9(stem_width, 0);
- x9r = x4; y9 = 0.3 height;
-
- pickup pencircle
- scaled stem_width
- rotated 45;
- draw z9 -- (z9 + (0, -0.4reduced_il))
- shifted (-exact_center + (0, -0.75reduced_il));
-
- pickup pencircle
- xscaled stem_width
- yscaled hair
- rotated 30;
-
- draw halfcircle
- scaled 0.5 reduced_il
- rotated -90
- shifted z8
- shifted (0, 0.25reduced_il)
- shifted (-exact_center + (0, -0.75reduced_il));
-
- draw halfcircle
- scaled 0.4 reduced_il
- rotated 90
- shifted (z8 + (0, 0.45 reduced_il))
- shifted (0, 0.25reduced_il)
- shifted (-exact_center + (0, -0.75reduced_il));
-enddef;
-
-
-if 0 = 1:
- %
- % This clef is switched due to path problems at smaller sizes.
- %
-fet_beginchar("mensural g clef", "mensural_g", "mensgclef")
- if test = 1:
- draw_staff(-1,3, 0.0);
- fi;
- draw_mensural_g_clef((0,0), 1.0);
-fet_endchar;
-fet_beginchar("mensural g clef", "mensural_g_change", "cmensgclef")
- draw_mensural_g_clef((0,0), .8);
-fet_endchar;
-
-fi;
-
-
def draw_petrucci_g_clef(expr exact_center, reduction) =
% inspired by Josquin Desprez, "Stabat Mater", Libro tertio,
% 1519, printed by Petrucci, in: MGG, volume 7, Table 11.
save za, zb, zc, zd, ze, zf, zg, zh, zi, zj;
pair za, zb, zc, zd, ze, zf, zg, zh, zi, zj;
+ save xoffs, yoffs;
+ xoffs# = xpart exact_center;
+ yoffs# = ypart exact_center;
+ define_pixels(xoffs, yoffs);
+
pickup pencircle
xscaled 0.50 reduced_slt
yscaled 0.22 reduced_il
rotated -35;
- lft za = exact_center + (0.80 reduced_il, +0.00 reduced_il);
- lft zb = exact_center + (1.00 reduced_il, +1.20 reduced_il);
- lft zc = exact_center + (0.70 reduced_il, +2.00 reduced_il);
- lft zd = exact_center + (0.30 reduced_il, +3.00 reduced_il);
- lft ze = exact_center + (0.80 reduced_il, +3.70 reduced_il);
- lft zf = exact_center + (1.00 reduced_il, +3.00 reduced_il);
- lft zg = exact_center + (0.60 reduced_il, +2.00 reduced_il);
- lft zh = exact_center + (0.30 reduced_il, +1.70 reduced_il);
- lft zi = exact_center + (0.00 reduced_il, +0.75 reduced_il);
- lft zj = exact_center + (0.20 reduced_il, +0.60 reduced_il);
+ lft za = (xoffs + 0.80 reduced_il, yoffs + 0.00 reduced_il);
+ lft zb = (xoffs + 1.00 reduced_il, yoffs + 1.20 reduced_il);
+ lft zc = (xoffs + 0.70 reduced_il, yoffs + 2.00 reduced_il);
+ lft zd = (xoffs + 0.30 reduced_il, yoffs + 3.00 reduced_il);
+ lft ze = (xoffs + 0.80 reduced_il, yoffs + 3.70 reduced_il);
+ lft zf = (xoffs + 1.00 reduced_il, yoffs + 3.00 reduced_il);
+ lft zg = (xoffs + 0.60 reduced_il, yoffs + 2.00 reduced_il);
+ lft zh = (xoffs + 0.30 reduced_il, yoffs + 1.70 reduced_il);
+ lft zi = (xoffs + 0.00 reduced_il, yoffs + 0.75 reduced_il);
+ lft zj = (xoffs + 0.20 reduced_il, yoffs + 0.60 reduced_il);
draw za{-1,2} .. zb .. zc .. zd .. ze .. zf .. zg .. zh .. zi .. zj;
yscaled 0.33 reduced_il
rotated -35;
- lft za = exact_center + (1.05 reduced_il, +0.45 reduced_il);
- lft zb = exact_center + (0.55 reduced_il, +0.45 reduced_il);
- lft zc = exact_center + (0.55 reduced_il, -0.45 reduced_il);
- lft zd = exact_center + (1.05 reduced_il, -0.45 reduced_il);
- lft ze = exact_center + (1.10 reduced_il, +0.00 reduced_il);
- lft zf = exact_center + (0.80 reduced_il, +0.00 reduced_il);
+ lft za = (xoffs + 1.05 reduced_il, yoffs + 0.45 reduced_il);
+ lft zb = (xoffs + 0.55 reduced_il, yoffs + 0.45 reduced_il);
+ lft zc = (xoffs + 0.55 reduced_il, yoffs - 0.45 reduced_il);
+ lft zd = (xoffs + 1.05 reduced_il, yoffs - 0.45 reduced_il);
+ lft ze = (xoffs + 1.10 reduced_il, yoffs + 0.00 reduced_il);
+ lft zf = (xoffs + 0.80 reduced_il, yoffs + 0.00 reduced_il);
draw za .. zb .. zc .. zd .. {up}ze -- zf;
enddef;
fet_endchar;
+def draw_mensural_g_clef(expr exact_center, reduction) =
+ % TODO: Rewrite me. The former mensural g clef looked ugly, and the
+ % code was removed when it broke for small font sizes after some
+ % global changes in the font. Currently, the character is mapped to
+ % a copy of the petrucci g clef (which, after all, *is* a mensural g
+ % clef, but not the one that we have in mind here). -- jr
+ %
+ % Possible sources of inspiration for this clef include: Francisco
+ % Guerrero, "Lib. 1. Missarum" (1566), in: MGG, volume 3, col. 858
+ % ("Ducis"); Stefano Fabri, "Quam speciosa veteranis" (1611), in:
+ % MGG, volume 3, col. 1698 ("Fabri"); Philippus Dulichius,
+ % "Fasciculus novus ..." (1598), in: MGG, volume 3, col. 919
+ % ("Dulichius"), fig. 1; Noe Faignient, "Ic sal de Heer myn God
+ % gebenedye" (1568), in: MGG, volume 3, col. 1735 ("Faignient").
+enddef;
+
+%
+% FIXME: This clef is preliminarily mapped to the petrucci g clef
+% until the code for the mensural g clef will be rewritten.
+%
+fet_beginchar("mensural g clef", "mensural_g", "mensgclef")
+ if test = 1:
+ draw_staff(-1,3, 0.0);
+ fi;
+ draw_petrucci_g_clef((0,0), 1.0);
+fet_endchar;
+fet_beginchar("mensural g clef", "mensural_g_change", "cmensgclef")
+ draw_petrucci_g_clef((0,0), .8);
+fet_endchar;
+
+
%%%%%%%%
%
save za, zb, zc, zd, ze, zf;
pair za, zb, zc, zd, ze, zf;
- za = exact_center + (0.90reduced_il, +.45reduced_il);
- zb = exact_center + (0.80reduced_il, +.45reduced_il);
- zc = exact_center + (0.50reduced_il, +.60reduced_il);
- zd = exact_center + (0.20reduced_il, +.45reduced_il);
- ze = exact_center + (0.20reduced_il, -.45reduced_il);
- zf = exact_center + (0.40reduced_il, -.55reduced_il);
+ save xoffs, yoffs;
+ xoffs# = xpart exact_center;
+ yoffs# = ypart exact_center;
+ define_pixels(xoffs, yoffs);
+
+ za = (xoffs + 0.90reduced_il, yoffs + .45reduced_il);
+ zb = (xoffs + 0.80reduced_il, yoffs + .45reduced_il);
+ zc = (xoffs + 0.50reduced_il, yoffs + .60reduced_il);
+ zd = (xoffs + 0.20reduced_il, yoffs + .45reduced_il);
+ ze = (xoffs + 0.20reduced_il, yoffs - .45reduced_il);
+ zf = (xoffs + 0.40reduced_il, yoffs - .55reduced_il);
draw za .. zb .. zc -- zd -- ze -- zf;
set_char_box(0 - xpart exact_center,
save za, zb, zc, zd, ze, zf;
pair za, zb, zc, zd, ze, zf;
- za = exact_center + (0.90reduced_il, +0.70reduced_il);
- zb = exact_center + (0.80reduced_il, +0.70reduced_il);
- zc = exact_center + (0.50reduced_il, +0.85reduced_il);
- zd = exact_center + (0.20reduced_il, +0.70reduced_il);
- ze = exact_center + (0.20reduced_il, -1.10reduced_il);
+ save xoffs, yoffs;
+ xoffs# = xpart exact_center;
+ yoffs# = ypart exact_center;
+ define_pixels(xoffs, yoffs);
+
+ za = (xoffs + 0.90reduced_il, yoffs + 0.70reduced_il);
+ zb = (xoffs + 0.80reduced_il, yoffs + 0.70reduced_il);
+ zc = (xoffs + 0.50reduced_il, yoffs + 0.85reduced_il);
+ zd = (xoffs + 0.20reduced_il, yoffs + 0.70reduced_il);
+ ze = (xoffs + 0.20reduced_il, yoffs - 1.10reduced_il);
draw za .. zb .. zc -- zd -- ze;
save zg, zh, zi, zj;
pair zg, zh, zi, zj;
- zg = exact_center + (0.90reduced_il, -0.05reduced_il);
- zh = exact_center + (0.80reduced_il, -0.05reduced_il);
- zi = exact_center + (0.50reduced_il, +0.10reduced_il);
- zj = exact_center + (0.20reduced_il, -0.05reduced_il);
+ zg = (xoffs + 0.90reduced_il, yoffs - 0.05reduced_il);
+ zh = (xoffs + 0.80reduced_il, yoffs - 0.05reduced_il);
+ zi = (xoffs + 0.50reduced_il, yoffs + 0.10reduced_il);
+ zj = (xoffs + 0.20reduced_il, yoffs - 0.05reduced_il);
draw zg .. zh .. zi -- zj;
set_char_box(0 - xpart exact_center,
% * height: Should match the top edge of the head. Affects vertical
% collision handling.
%
+% TODO: should depth/height include appendages/stems?
overdone_heads = 0;
noteheight# := staff_space# + (1 + overdone_heads)*stafflinethickness#;
%
% (ze is wel breed)
%
-fet_beginchar("Maxima notehead", "-3neo_mensural", "mensuralmaximahead");
+fet_beginchar("Maxima notehead", "-3neo_mensural", "neomensuralmaximahead");
draw_neo_longa (2.6 staff_space#)
fet_endchar;
-fet_beginchar("Longa notehead", "-2neo_mensural", "mensurallongahead");
+fet_beginchar("Longa notehead", "-2neo_mensural", "neomensurallongahead");
draw_neo_longa (2 staff_space#)
fet_endchar;
-fet_beginchar("Brevis notehead", "-1neo_mensural", "mensuralbrevishead")
+fet_beginchar("Brevis notehead", "-1neo_mensural", "neomensuralbrevishead")
draw_neo_brevis(2 staff_space#);
fet_endchar;
-% -*-Fundamental-*-
+% -%-Fundamental-%- -*-Metafont-*-
% parmesan-rests.mf -- implement ancient rests
%
% source file of LilyPond's pretty-but-neat music font
enddef;
fet_beginchar("Neo-mensural maxima rest", "-3neo_mensural", "neomensmaximarest");
- set_char_box(0, neomens_block_rest_x#,
- neomens_block_rest_y#, 2 neomens_block_rest_y#);
- draw_block ((0,-neomens_block_rest_y),
- (neomens_block_rest_x, 2 neomens_block_rest_y));
+ set_char_box(0, 3 neomens_block_rest_x#,
+ neomens_block_rest_y#, neomens_block_rest_y#);
+ draw_block ((0,-neomens_block_rest_y),
+ (neomens_block_rest_x, neomens_block_rest_y));
+ addto currentpicture also currentpicture shifted (2 neomens_block_rest_x, 0);
fet_endchar;
fet_beginchar("Neo-mensural longa rest", "-2neo_mensural", "neomenslongarest");
- set_char_box(0, neomens_block_rest_x#,
- neomens_block_rest_y#, neomens_block_rest_y#);
- draw_block ((0,-neomens_block_rest_y),
- (neomens_block_rest_x, neomens_block_rest_y));
+ set_char_box(0, neomens_block_rest_x#,
+ neomens_block_rest_y#, neomens_block_rest_y#);
+ draw_block ((0,-neomens_block_rest_y),
+ (neomens_block_rest_x, neomens_block_rest_y));
fet_endchar;
fet_beginchar("Neo-mensural breve rest", "-1neo_mensural", "neomensbreverest");
- set_char_box(0, neomens_block_rest_x#,
- 0, neomens_block_rest_y#);
- draw_block ((0,0), (neomens_block_rest_x, neomens_block_rest_y));
+ set_char_box(0, neomens_block_rest_x#,
+ 0, neomens_block_rest_y#);
+ draw_block ((0,0), (neomens_block_rest_x, neomens_block_rest_y));
fet_endchar;
fet_beginchar("Neo-mensural whole rest", "0neo_mensural", "neomenssemibrevisrest");
pen_width, pen_height);
fet_beginchar("Mensural maxima rest", "-3mensural", "mensmaximarest");
- set_char_box(0.7pen_width#, 0.7pen_width#,
+ set_char_box(0, pen_width#,
mens_block_rest_y#, 2mens_block_rest_y#);
pickup pencircle
xscaled pen_width
yscaled pen_height
rotated slight_pen_rotation;
- draw (0, -mens_block_rest_y) -- (0, 2 mens_block_rest_y);
+ draw (w/2, -mens_block_rest_y) -- (w/2, 2 mens_block_rest_y);
fet_endchar;
fet_beginchar("Mensural longa rest", "-2mensural", "menslongarest");
- set_char_box(0.7pen_width#, 0.7pen_width#,
+ set_char_box(0, pen_width#,
mens_block_rest_y#, mens_block_rest_y#);
pickup pencircle
xscaled pen_width
yscaled pen_height
rotated slight_pen_rotation;
- draw (0, -mens_block_rest_y) -- (0, mens_block_rest_y);
+ draw (w/2, -mens_block_rest_y) -- (w/2, mens_block_rest_y);
fet_endchar;
fet_beginchar("Mensural breve rest", "-1mensural", "mensbreverest");
- set_char_box(0.7pen_width#, 0.7pen_width#,
+ set_char_box(0, pen_width#,
0, mens_block_rest_y#);
pickup pencircle
xscaled pen_width
yscaled pen_height
rotated slight_pen_rotation;
- draw (0, 0) -- (0, mens_block_rest_y);
+ draw (w/2, 0) -- (w/2, mens_block_rest_y);
fet_endchar;
fet_beginchar("Mensural whole rest", "0mensural", "menssemibrevisrest");
- set_char_box(0.7pen_width#, 0.7pen_width#,
+ set_char_box(0, pen_width#,
mens_half_block_rest_y#, 0);
pickup pencircle
xscaled pen_width
yscaled pen_height
rotated slight_pen_rotation;
- draw (0, 0) -- (0, -mens_half_block_rest_y);
+ draw (w/2, 0) -- (w/2, -mens_half_block_rest_y);
fet_endchar;
fet_beginchar("Mensural half rest", "1mensural", "mensminimahalfrest");
- set_char_box(0.7pen_width#, 0.7pen_width#,
+ set_char_box(0, pen_width#,
0, mens_half_block_rest_y#);
pickup pencircle
xscaled pen_width
yscaled pen_height
rotated slight_pen_rotation;
- draw (0, 0) -- (0, mens_half_block_rest_y);
+ draw (w/2, 0) -- (w/2, mens_half_block_rest_y);
fet_endchar;
mensrestsize# = .8staff_space#;
(define-public (notice-the-events-for-pc context lst)
(set! noticed (acons (ly:context-id context) lst noticed)))
-(define-public (make-new-part-combine-music music-list)
+(define-public (make-part-combine-music music-list)
(let*
((m (make-music-by-name 'PartCombineMusic))
(m1 (context-spec-music (car music-list) 'Voice "one"))
(ly:run-translator m2 part-combine-listener)
(ly:run-translator m1 part-combine-listener)
(ly:set-mus-property! m 'split-list
- (determine-split-list (reverse (cdr (assoc "one" noticed)))
- (reverse (cdr (assoc "two" noticed)))))
+ (determine-split-list (reverse! (cdr (assoc "one" noticed)) '())
+ (reverse! (cdr (assoc "two" noticed)) '())))
(set! noticed '())
m))
(analyse-solo12 0)
; (if pc-debug (display result))
- (set! result (map
- (lambda (x) (cons (when x) (configuration x)))
- (vector->list result)))
+ (set! result (map
+ (lambda (x) (cons (when x) (configuration x)))
+ (vector->list result)))
(if pc-debug (display result))
result))
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; autochange - fairly related to part combining.
+
+(define-public (make-autochange-music music)
+
+ (define (generate-split-list event-list)
+ (if (null? event-list)
+ '()
+ (let*
+ ((evs (map car (cdar event-list)))
+ (now (caar event-list))
+ (notes (filter (lambda (x)
+ (equal? (ly:get-mus-property x 'name) 'NoteEvent))
+ evs))
+ (pitch (if (pair? notes)
+ (ly:get-mus-property (car notes) 'pitch)
+ #f))
+ )
+
+
+ ;; tail recursive.
+ (if (and pitch (not (= (ly:pitch-steps pitch) 0)))
+ (cons (cons now (sign (ly:pitch-steps pitch)))
+ (generate-split-list (cdr event-list)))
+ (generate-split-list (cdr event-list)))
+ )))
+
+ (set! noticed '())
+
+ (let*
+ ((m (make-music-by-name 'AutoChangeMusic))
+ (context (ly:run-translator music part-combine-listener))
+ (evs (last-pair noticed))
+ )
+
+ (ly:set-mus-property! m 'element music)
+ (ly:set-mus-property!
+ m 'split-list
+ (generate-split-list (if (pair? evs) (reverse! (cdar evs) '()) '()))
+ )
+
+ (set! noticed '())
+ m
+ ))
+
+
def conv (str):
+
+ if re.search (r'\\partcombine', str):
+ sys.stderr.write ('Warning: \\partcombine has been changed. '
+ +'Check conversion manually!')
+
str = re.sub (r'\\context\s+Voice\s*=\s*one\s*\\partcombine\s+Voice\s*\\context\s+Thread\s*=\s*one(.*)\s*'
+ r'\\context\s+Thread\s*=\s*two',
'\\\\newpartcombine\n\\1\n', str)
+
+
return str
-conversions.append (((2,1,17), conv, """\\partcombine -> \\newpartcombine"""))
+conversions.append (((2,1,17), conv, """\\partcombine syntax change to \\newpartcombine"""))
+
+def conv (str):
+ str = re.sub (r'\\newpartcombine', r'\\partcombine', str)
+ str = re.sub (r'\\autochange\s+Staff', r'\\autochange ', str)
+ return str
+
+conversions.append (((2,1,18), conv, """\\newpartcombine -> \\partcombine,
+\\autochange Staff -> \\autochange
+"""))
################################
# END OF CONVERSIONS