TOPLEVEL_MAJOR_VERSION = 0
TOPLEVEL_MINOR_VERSION = 0
-TOPLEVEL_PATCH_LEVEL = 70
+TOPLEVEL_PATCH_LEVEL = 71
# use to send patches, always empty for released version:
# include separator: ".postfix", "-pl" makes rpm barf
daughter to Jan 'Janneke' Nieuwenhuizen and Han-Wen 'Wendy'
Nienhuys
-Lily is a healthy, bouncing baby weighing 340 kilobytes
+Lily is a healthy, bouncing baby weighing 345 kilobytes
Visiting hours: 24hrs a day at
ftp://pcnov095.win.tue.nl,
-you can see some diapers and pictures at
+you can see some babyfood, diapers and pictures at
http://www.stack.nl/~hanwen/lilypond/index.html
Those deserving special mention (in no particular order):
Esther, Marijke, Heike, Inge, Judith, Hannah, Auke, Ilse, Evelyn,
-Maartje, Suzanne, Ilse (gee, again?), most members of the Eindhovens
-Jongeren Ensemble and last (but certainly not least) Janneke!
+Maartje, Suzanne, Ilse (gee, again?), my friends in the
+Eindhovens Jongeren Ensemble and last (but certainly not least)
+Janneke!
HW
reg.cc, clef-item.cc testing, general comments.
+\bo Werner Lemberg <xlwy01@uxp1.hrz.uni-dortmund.de>, misc
- bugfixes.
+ bugfixes, some Beam and Stem code.
-19/May/97 LilyPond 0.0.68 1
+30/Jun/97 LilyPond 0.0.71 1
This file documents bugs which were "re-introduced" in various pl's
+pl 70
+ * r^"simile"
+
pl69
* scales.ly
* slurs.ly
pl68:
+ * opening rests wohltemperirt
* lyrics broken,
=item *
-Werner Lemberg <xlwy01@uxp1.hrz.uni-dortmund.de>, misc bugfixes.
+Werner Lemberg <xlwy01@uxp1.hrz.uni-dortmund.de>, misc bugfixes, some
+Beam and Stem code.
=back
No difficult algorithms. Associated datastructures have prefix Input
(eg Input_score, Input_command). The .ly file is read, and converted
-to Requests, Voice_elements, Voices.
+to
-The result looks something like this (? = 0 or 1, * =0 or more, + = 1
-or more)
-
- Score {
- Midi_def?
- Paper_def?
- Staff+ {
- Voice+ {
- start_moment
- Voice_element* {
- duration
- Request*
- }
- }
- Input_register { ..}
- }
- }
-
-Request is a baseclass for almost all kinds of information. As you can
-see, the info is stored horizontally; horizontally is the natural form
-for entering music.
-
-=item Setting up music
-
-Simultaneous Requests are grouped into columns. Vertical is the
-natural form for processing music.
-
-=item Processing:
+=item Creating elements
Requests are processed and used to create elements (like balls, stems,
slurs etc). This is done by a hierarchy of "brokers" (called
=head1 INTERNALS
-This chapter deals with the internals of Mudela. In the end Mudela
-converted to Voice, which contain Voice_elements which (in turn)
-contain Requests. The former 2 types are basically containers (lists).
-Consider the following simple mudela
-
- \music { c4 <e4 g4> }
-
-After the parsing, this is converted to: (from the debug output)
-
- Voice { start: 0
- voice_element { dur :1/4
- Stem_req {duration { 4}}
- Note_req {notename: 0 acc: 0 oct: -1
- duration { 4}}
- Group_change_req {}
- }
- voice_element { dur :0
- Terminate_voice_req {}
- }
- }
-
- Voice { start: 1/4
- voice_element { dur :1/4
- Stem_req {duration { 4}}
- Note_req {notename: 2 acc: 0 oct: -1
- duration { 4}}
- Group_change_req {}
- }
- voice_element { dur :0
- Terminate_voice_req {}
- }
- }
-
- Voice { start: 1/4
- voice_element { dur :1/4
- Stem_req {duration { 4}}
- Note_req {notename: 4 acc: 0 oct: -1
- duration { 4}}
- Group_change_req {}
- }
- voice_element { dur :0
- Terminate_voice_req {}
- }
- }
-
+This chapter deals with the internals of Mudela.
=head2 Requests
note, therefore fore each C<Dynamic> request carries a time, measured
from the start of its note.
-=head2 Voice_element
-
-Voice_element is a list of requests together with a duration. It is
-strictly horizontal
-
-=head2 Voice
-
-Voice is a list of Voice_elements together with a starting time.
-
=head2 Voice groups
Voice group is a (time-dependent) collection of voices which share
some of the conventions and difficulties in printing music]
The University of Colorado Music Engraving page.
-http://obenamots.cc.colorado.edu/cgi-bin/Musicpress/engraving.html
+http://obenamots.cc.colorado.edu/Musicpress/engraving.html
More on GNU Music: http://dept-info.labri.u-bordeaux.fr/~strandh/Gsharp
=head1 DESCRIPTION
A (not-at-all complete) overview of other music-typesetting/notation
-packages. Feel free to add info (and mail it to me). Partly based on
-a reflist by Miguel Filgueiras <mig@ncc.up.pt>.
+packages. Feel free to add info (and mail it to me).
=head2 Free packages (with source)
G Sharp, http://dept-info.labri.u-bordeaux.fr/~strandh/Gsharp
+An alpha version notation editor for X. Source available on request.
+
Rosegarden, http://www.math.bath.ac.uk/~masjpf/rose.html
-Common Music/Common Notation, ftp://ccrma-ftp.stanford.edu/pub/Lisp
+A Notation editor/Sequencer for X (win95 port underway). Outputs musictex.
+
+Common Notation, ftp://ccrma-ftp.stanford.edu/pub/Lisp
+
+A versatile lisp package. Part of the Common Music system. Input is in Lisp.
+
+Vivace, http://
-Vivace
+A amateurish notation program for TclTk and X
MPP, http://www.stack.nl/~hanwen/mpp-english.html
-Jan Nieuwenhuizen, Using TeX and the MusiXTeX macro package to
-write parts and scores of music. Department of Physics, Eindhoven
-University of Technology, 1995.
+A preprocessor to MusixTeX by Jan Nieuwenhuizen and Han-Wen Nienhuys.
+It is outdated by its successor, LilyPond.
-MusicEase, ftp://ftp.secret.com/ad-ftp
+Music, http://
-Described in Computer vol 29(6)
+A TROFF preprocessor by Eric Foxley
+MusicEase, ftp://ftp.secret.com/ad-ftp
+Described in Computer vol 29(6)
MusE
-A-R Editions, Inc.
+A-R Music Engraving, by A-R Editions, Inc. Professional engraving on
+Sun boxen.
Mup, http://www.arkkra.com/
A program which creates PS from a script input. Although it comes with
-C source code, it is Shareware ($29).
+C source code, it is Shareware ($ 29).
-PMX
+PMX, http://www.gmd.de/Misc/Music/
-Don Simons, PMX, A Preprocessor for MusiXTeX (Version 1.04).
-dsimons@logicon.com.
+A Preprocessor for MusiXTeX by Don Simons
-Musi*TeX, http://www.gmd.de/misc/music
+Musi*TeX, http://www.gmd.de/Misc/Music/
-Daniel Taupin, Ross Mitchell and Andreas Egler, MusixTeX: Using TeX
-to Write Polyphonic or Instrumental Music (Version T.64). Laboratoire
-de Physique des Solides, Centre Universitaire, Orsay, 1993.
+MusixTeX is a macro package for TeX to typeset polyphonic or
+instrumental music by Daniel Taupin, Ross Mitchell and Andreas
+Egler. It includes a font set with lots symbols
-ABC2MTeX
+ABC2MTeX, http://www.gmd.de/Misc/Music/
-Chris Walshaw, ABC2MTeX --- An easy way of transcribing folk
-and traditional music. School of Maths, University of Greenwich, 1993.
+A preprocessor to MusixTeX by Chris Walshaw for way of transcribing folk
+and traditional music.
SceX
-Miguel Filgueiras and Jos\'e Paulo Leal, A First Formulation of
-SceX, a Music Typesetting System. Centro de Inform\'atica da
-Universidade do Porto, 1993.
+A preprocessor to MusixTeX by Miguel Filgueiras. Source in prolog
+available on request. (?)
-MUTEX
+MUTEX, http://www.gmd.de/Misc/Music/
-Fran\ccois Jalbert, MuTeX User's Guide (Version 1.1). Computer
-Science Department, University of British Columbia, 1989.
+A TeX macro package for typesetting single-staff music by Angelika
+Schofer & Andrea Steinbach. With some fonts
=head2 Free (zero cents)
Calliope, http://www.cl.cam.ac.uk/users/wfc/
-A NeXT package
-
-Mozart
-
-A windows package
+A NeXT package by William F Clocksin. Requires Adobe fonts
=head2 Proprietary
Score
+Personal Composer
+
+Mozart,
+
+A shareware windows package,
+
+Capella
+
+Encore
+
Musicator
=head2 Unknown
-28/May/97 LilyPond 0.0.68 1
+28/May/97 LilyPond 0.0.71 1
-28/May/97 LilyPond 0.0.68 2
+28/May/97 LilyPond 0.0.71 2
-28/May/97 LilyPond 0.0.68 3
+28/May/97 LilyPond 0.0.71 3
-28/May/97 LilyPond 0.0.68 4
+28/May/97 LilyPond 0.0.71 4
-28/May/97 LilyPond 0.0.68 5
+28/May/97 LilyPond 0.0.71 5
+pl 71pre
+ - init id's, Input_register aliases.
+ - bf: notehead x-swap
+ - bf: auto-keys.
+ - bf: first clef
+ - junked \init_end; construct
+ - Preparatory work for MIDI output:
+ * Acceptor as baseclass for Register_group_register
+ * Global_acceptor as interface of Register to Score
+ - bf: empty voice
+ - Lyrics: partially working
+ - some doco updates (junks, mostly)
+
+
+******
june 30
pl 70pre
- bf: text Script
Most of the items are marked in the code as well, with full explanation.
grep for TODO and ugh/ugr
- *
+ * whole head on ledger line
* piano staff
PROJECTS
+ * accidentals per Voice_group
+
* Convert all ref/bib stuff into BibTeX.
* Output class, handles : (smallish)
%
+% setup for Request->Element conversion. Guru-only
+%
\requestregister {
"Score_register"
\consists "Score_horizontal_align_register";
\contains\requestregister {
- "Staff_registers"
-
+ "Staff_registers"
+ \alias "Staff";
\consists "Bar_register";
\consists "Clef_register";
\consists "Key_register";
}
}
}
+
+ \contains\requestregister {
+ "Staff_registers"
+ \alias "Lyric";
+ \contains\requestregister{
+ "Voice_group_registers"
+ \alias "Voice_group";
+ \contains\requestregister{
+ "Voice_registers"
+ \consists "Lyric_register";
+ \consists "Swallow_register";
+ }
+ }
+ }
}
\include "table_sixteen.ini"
-%% Fix Me. This sux.
-\init_end ;
filename: collisions.ly
title:
description: random counterpoint to test collisions
- composer(s): HWN,JCN
+ composer(s):
entered-by: HWN,JCN
copyright: public domain
Tested Features: example file with comments
EndMudelaHeader
%}
-\version "0.0.59";
+\version "0.0.60";
% the % is a comment.
'c4 % ' before note means one octave lower.
% Similarly: ' after means one higher.
c e c f c e c d 'b c 'a 'f 'g 'c2 |
- \octave 'c ;
+ \octave c ;
e4 'g d 'g c 'g 'b 'g e 'g d 'g c 'g 'b 'g
%%%% var 1
r8 e8() c4 r8 e8() c4 r8 f8() c4 r8 e8() c4
\begeleiding
>
\paper{
- \unitspace 2.5\cm % a whole note takes 2.5 \cm ideally.
+ \unitspace 2.5\cm; % a whole note takes 2.5 \cm ideally.
}
}
%{MudelaHeader
filename: scsii-menuetto.ly
- title:Solo Cello Suites,
- description: Suite II part V, Menuetto I
+ title: Solo Cello Suites, Suite II part V, Menuetto I
+ description: Cello suite transcribed for Viola
composers: Johann Sebastian Bach (1685-1750)
entered-by: JCN
- copyright:
+ copyright: public domain
Tested Features:breaking algorithm, chords, multivoice, accents
}
\score{
-% \staff{ lyricregs tekstI }
-% \staff{ lyricregs tekstII }
+ < \multi 3;
+ { \id "Lyric" "1"; tekstI } % ugh
+ { \id "Lyric" "2"; tekstII }
- \melodic < \multi 3; < \melodie \commands >
- <\begeleiding \commands >
+ \melodic < \melodie \commands >
+ \melodic <\begeleiding \commands >
+
>
\paper{
\width 195.\mm;
Tested Features: lyrics
EndMudelaHeader
%}
-\version "0.0.58";
+\version "0.0.60";
melody = \melodic{
\clef\violin;
c4 c | g g | a a | g g |
f f | e e | d d8.( e16 | )c2 | % :|
- g g | f f | e e | d d |
- g g | f f | e( e8. f16 | e )d |
+ g4 g | f f | e e | d d |
+ g g | f f | e( e8. f16 | e4 )d |
c c | g g | a a | g g |
f f | e e | d d8.( e16 | )c2 % :|
c4 c' | e' c' | f' c' | e' c' |
d' b | c' a | f g | c2 |
- e' g | d g | c' g | b g |
- e' g | d' g | c' c'8.( d'16 | c' )b |
+ e'4 g | d g | c' g | b g |
+ e' g | d' g | c' c'8.( d'16 | c'4 )b |
c c' | e' c' | f' c' | e' c' |
d' b | c' a | f g | c2
}
tekst = \lyric{
- Al- tijd is Kort- jak- je ziek,2
- midden in_de week maar s'_zon- dags niet.2
- s'_Zon- dags gaat ze naar de kerk,2
- met een boek vol zil- ver werk.2
- Al- tijd is Kort- jak- je ziek,2
- midden in_de week maar s'_zon- dags niet.2
+ Al-4 tijd is Kort- jak- je ziek,2
+ midden4 in_de week maar s'_zon- dags niet.2
+ s'_Zon-4 dags gaat ze naar de kerk,2
+ met4 een boek vol zil- ver werk.2
+ Al-4 tijd is Kort- jak- je ziek,2
+ midden4 in_de week maar s'_zon- dags niet.2
}
hegedraagjetekst = \lyric{
- Al- tijd zuigt Bill Gates mijn piek,2
- "\TeX" is slecht- ser dan mu- ziek.2
- s'_Zon- dags gaat het door een raam,2
- Weet dat ik me er- voor schaam.2
- Al- tijd zuigt Bill Gates mijn piek,2
- "\TeX" is slecht- ser dan mu- ziek.2
+ Al-4 tijd zuigt Bill Gates mijn piek,2
+ "\TeX"4 is slecht- ser dan mu- ziek.2
+ s'_Zon-4 dags gaat het door een raam,2
+ Weet4 dat ik me er- voor schaam.2
+ Al-4 tijd zuigt Bill Gates mijn piek,2
+ "\TeX"4 is slecht- ser dan mu- ziek.2
}
texte = \lyric{
\textstyle "italic" ;
- Ah! vous dir- ai_- je ma man2
- Ce qui cau- se mon tour- ment2
- Pa- pa veut que je rai- sonne2
- Comme un- e grand- e per- sonne2
- Moi je dis que les bon- bons2
- Val- ent mieux que la rai- son2
+ Ah!4 vous dir- ai_- je ma man2
+ Ce4 qui cau- se mon tour- ment2
+ Pa-4 pa veut que je rai- sonne2
+ Comme4 un- e grand- e per- sonne2
+ Moi4 je dis que les bon- bons2
+ Val-4 ent mieux que la rai- son2
}
texti = \lyric{
\textstyle "roman";
- Twin- kle, twin- kle, lit- tle star,2
- How I won- der what you are.2
- Up a- bove the world so high,2
- Like a dia- mond in the sky.2
- Twin- kle, twin- kle, lit- tle star,2
- How I won- der what you are!2
+ Twin-4 kle, twin- kle, lit- tle star,2
+ How4 I won- der what you are.2
+ Up4 a- bove the world so high,2
+ Like4 a dia- mond in the sky.2
+ Twin-4 kle, twin- kle, lit- tle star,2
+ How4 I won- der what you are!2
}
textii = \lyric{
- When the bla- zing sun is gone,2
- When he no- thing shines up- on,2
- Then you show your lit- tle light,2
- Twin- kle, twin- kle, all the night.2
- Twin- kle, twin- kle, lit- tle star,2
- How I won- der what you are!2
+ When4 the bla- zing sun is gone,2
+ When4 he no- thing shines up- on,2
+ Then4 you show your lit- tle light,2
+ Twin-4 kle, twin- kle, all the night.2
+ Twin-4 kle, twin- kle, lit- tle star,2
+ How4 I won- der what you are!2
}
textiii = \lyric{
- Then the tra- veler in the dark2
- Thanks you for your ti- ny spark;2
- He_could not see which way to go,2
- If you did not twin- kle so.2
- Twin- kle, twin- kle, lit- tle star,2
- How I won- der what you are!2
+ Then4 the tra- veler in the dark2
+ Thanks4 you for your ti- ny spark;2
+ He_could4 not see which way to go,2
+ If4 you did not twin- kle so.2
+ Twin-4 kle, twin- kle, lit- tle star,2
+ How4 I won- der what you are!2
}
\score{
- \staff{ melodicregs global melody }
- \staff{ lyricregs global tekst hegedraagjetekst }
- \staff{ lyricregs global texte }
- \staff{ lyricregs global texti textii textiii }
- \staff{ melodicregs global accompany }
+ < \multi 3;
+ \melodic <\global \melody >
+
+ % ugh
+ \lyric < \id "Lyric" "1"; \global \tekst \hegedraagjetekst >
+% \lyric < \id "Lyric" "2"; \global \texte >
+% \lyric < \id "Lyric" "3"; \global \texti \textii \textiii >
+ \melodic < \global \accompany >
+ >
\paper{
- \unitspace 2.5\cm
+ \unitspace 2.5\cm;
}
\midi{
- \tempo 4:120
+ \tempo 4:120 ;
}
}
title: Das Wohltemperirte Clavier I, Fuga II (c-minor)
description: following Henle's Urtext
composer(s): JS Bach
- entered-by: HWN
- corrected-by: Werner Lemberg (tested with pl 64; 1997-05-17)
+ entered-by: HWN and Werner Lemberg
copyright: Public Domain
Tested Features: stem direction, multivoice, forced accidentals.
- Remarks: the stem direction algorithm is severely broken (look at the
-bass dux) with pl64. [this is supposedly fixed in pl68, can anybody
-knowledgeable remove this comment if it's not appropriate anymore?]
-
-
-
%}
\version "0.0.60";
[es c' b a] [g f! es d] [c8 es' d' c'] |
[bes a bes c'] [fis g a fis] |
%% 5
- g4 r16 [c d es] [f g as8~] [as16 d es f]|
- [g a bes8~] [bes16 es f g] [as g f es] [d8 c'16 b]|
- c'4 r4 r8 [f' es' d']
+ g4 r16 [c d es] [f g as8~] [as16 d es f] |
+ [g a bes8~] [bes16 es f g] [as g f es] [d8 c'16 b!] |
+ % forced accident!
+ c'4 r4 r8 [f' es' d'] |
r8 [as g f] [g f16 es] [f8 d] |
g4 r8 b [c' c'16 b] [c'8 g] |
%% 10
[bes8 c' bes as] [bes g f es] |
[f des' c' bes] [c' as g f] |
%% 15
- g8 \octave c'; [g16 fis] [g8 c] [es g16 fis] [g8 a] |
-% [d g16 fis] [g8 a] [c16 d] es4 [d16 c] |
- [d g16 fis] [g8 a] [c16 d] es4 [d16 c] |
- % wouldn't it be better if I can write
- % `a' instead of `a!' here to get really
- % an `a natural'? Processing this melody
- % alone (only having `a') would yield a
- % different result! (WL)
-%% I don't understand the complaint. The ! makes no difference in output. HWN
-
+ g8 \octave c'; [g16 fis] [g8 c] [es g16 fis!] [g8 a] |
+ [d g16 fis] [g8 a!] [c16 d] es4 [d16 c] |
+ % forced accident!
'bes8 r8 r16 [d e fis] [g a bes8~] [bes16 e f g] |
[a bes c'8~] [c'16 fis16 g a] [bes8 es!16 d] [es8 'g] |
['as f16 es] [f8 'a8] ['bes g16 f] [g8 'b] |
[f16 d es c]~ [c8 B] c4 r8 e |
%% 30
f4 r8 f [f es16 d] [es8 <f as]> |
-% f4 r8 <f as b> [f es16 d] [es8 <f as]> |
- % bug! if you say
- % f4 r8 <f as b> ...
- % the chord overlaps. WL
-%% confirmed. added to TODO. HWN
- <B d> r <B d> r <G2 c> |
+ <B d> r <B d> r <G2 c> |
}
%% 5
['bes8 es16 d] [es8 'g8] ['as f16 es] [f8 'a]
['bes8 g16 f] [g8 'b] [c8 d16 es] f4~ |
- [f8 es16 d] [c16 'bes 'as 'g] ['f8 as g f]
+ [f8 es16 d] [c16 'bes! 'as 'g] ['f8 as g f]
[es d es f] ['b c d 'b] |
[c g16 fis] [g8 d] es4 r8 e8 |
%% 10
[G16 Es F G] [As Bes c d] [es d c d] [es f g a] |
[bes F G As] [Bes c d e] [f es d es] [ f g a b] |
%% 15
- [c'8 b16 a] [g f es d] [c8 es d c] |
+ [c'8 b16 a] [g f! es d] [c8 es d c] |
[Bes A Bes c] [Fis! G A Fis] |
- % see comment above about forced acc.
+ % forced accident
[G8 d16 c] d8 r8 r8 [e16 d] e8 r8 |
r [fis16 e] fis8 r r [G16 F] G8 r8 |
r8 [A16 G] A8 r r [B16 A] B8 r |
r8 [c16 B] [c8 G] [As c16 B] [c8 d] |
[G c16 B] [c8 d] [F16 G] As4 [G16 F] |
\octave c; [es c' b a] [g f es d] [c d es d] [c Bes! As! G] |
- % I think we shouldn't need to force
- % accidents here because they are in
- % another octave range. WL
-
-%% I don't understand the complaint. Accidentals are valid for one octave range
-%% only. Without ! (and printed flat), this still is valid. HWN
-
+ % -> \classic_accidentals
%% 10
[F bes as g] [f es d c] [Bes c d c] [Bes As G F] |
[Es as g f] [es des c Bes] [As8 c' bes as] |
[f d'16 c'] [d'8 fis] g4 r16 [G A B] |
[c16 d es8~] [es16 A Bes c] [d es f8~] [f16 'b c d] |
%% 20
- es8 r r e [f F Es! D] | % see comment above about octave range
+ es8 r r e [f F Es! D] | % -> \classic_accidentals
r [As G F] [G F16 Es] [F8 G] |
[c16 d es d] [c Bes As G] [F bes as g] [f es d c] |
[Bes c d c] [Bes As G F] [Es as g f] [es d c Bes] |
[As Bes c Bes] [As G F Es] [D g f es] [d c B A] |
%% 25
- g4 r4 r16 [G A B] [c d es f] |
+ G4 r4 r16 [G A B] [c d es f] |
[g f as g] [f es d c] [B8 c16 B] [c8 G] |
[As c16 B] [c8 d] [G c16 B] [c8 d] |
[F16 G] As4 [G16 F] Es4 r8 es |
>
}
-
-
\score {
- \melodic < \multi 1;
- < \multi 2;
- \global
- \dux
- \comes
- >
- < \multi 2;
- \global
- \bassdux
- >
-
- >
+ \melodic < \multi 1;
+ < \multi 2;
+ \global
+ \dux
+ \comes
+ >
+ < \multi 2;
+ \global
+ \bassdux
+ >
+ >
+
\paper{}
\midi {
\tempo 4:84;
}
% EOF
-
-
MAJOR_VERSION = 0
MINOR_VERSION = 0
-PATCH_LEVEL = 70
+PATCH_LEVEL = 71
# use to send patches, always empty for released version:
# include separator: ".postfix", "-pl" makes rpm barf
--- /dev/null
+/*
+ acceptor.cc -- implement Acceptor
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "acceptor.hh"
+Acceptor::Acceptor()
+{
+ iterator_count_ = 0;
+}
+
+IMPLEMENT_STATIC_NAME(Acceptor);
+IMPLEMENT_IS_TYPE_B(Acceptor);
Clef_register::acknowledge_element(Score_elem_info info)
{
if (info.elem_l_->name() == Bar::static_name() ) {
- if (!clef_p_){
- create_clef();
+ create_clef();
+ if ( !clef_req_l_ )
clef_p_->default_b_ = true;
- }
}
}
clef_req_l_ = creq_l->clefchange();
- // do it now! Others have to read c0_pos.
- read_req(creq_l->clefchange());
+ read_req(clef_req_l_);
return true;
}
{
if (!clef_p_) {
clef_p_ = new Clef_item;
- announce_element(Score_elem_info(clef_p_,
- clef_req_l_));
-
- clef_p_->read(*this);
+ announce_element(Score_elem_info(clef_p_,clef_req_l_));
}
-
+ clef_p_->read(*this);
}
+
void
Clef_register::do_process_requests()
{
--- /dev/null
+/*
+ global-acceptor.cc -- implement
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "music.hh"
+#include "global-acceptor.hh"
+#include "score.hh"
+#include "score-column.hh"
+
+Global_acceptor::Global_acceptor()
+{
+ score_l_ = 0;
+ last_mom_ = 0;
+}
+
+Acceptor*
+Global_acceptor::ancestor_l(int)
+{
+ return this;
+}
+
+void
+Global_acceptor::add_moment_to_process(Moment m)
+{
+ if (m > last_mom_)
+ return;
+
+ for (int i=0; i < extra_mom_pq_.size(); i++)
+ if (extra_mom_pq_[i] == m)
+ return;
+ extra_mom_pq_.insert(m);
+}
+
+int
+Global_acceptor::depth_i()const
+{
+ return 0;
+}
+
+void
+Global_acceptor::set_score(Score *s)
+{
+ score_l_ = s;
+ last_mom_ = score_l_->music_p_->time_int().max();
+}
+
+void
+Global_acceptor::modify_next(Moment &w)
+{
+ while (extra_mom_pq_.size() &&
+ extra_mom_pq_.front() <= w)
+
+ w =extra_mom_pq_.get();
+}
+
+int
+Global_acceptor::moments_left_i()const
+{
+ return extra_mom_pq_.size();
+}
+
+void
+Global_acceptor::prepare(Moment)
+{
+}
--- /dev/null
+/*
+ acceptor.hh -- declare Acceptor
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef ACCEPTOR_HH
+#define ACCEPTOR_HH
+
+#include "string.hh"
+#include "lily-proto.hh"
+#include "interpreter.hh"
+#include "virtual-methods.hh"
+
+class Acceptor {
+public:
+ String id_str_;
+
+ int iterator_count_;
+
+ virtual Interpreter * interpreter_l() { return 0; }
+
+ /// Score_register = 0, Staff_registers = 1, etc)
+ virtual int depth_i()const=0;
+ virtual Acceptor *find_get_acceptor_l(String name, String id)=0;
+ virtual Acceptor *ancestor_l(int l=1)=0;
+ virtual ~Acceptor(){}
+ NAME_MEMBERS();
+ Acceptor();
+ virtual Acceptor *get_default_interpreter()=0;
+};
+
+class Interpreter : public virtual Acceptor {
+public:
+ virtual bool interpret_request_b(Request*) { return false;}
+};
+#endif // ACCEPTOR_HH
--- /dev/null
+/*
+ global-acceptor.hh -- declare Global_acceptor
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef GLOBAL_ACCEPTOR_HH
+#define GLOBAL_ACCEPTOR_HH
+
+#include "acceptor.hh"
+#include "pqueue.hh"
+
+class Global_acceptor : public virtual Acceptor {
+ PQueue<Moment> extra_mom_pq_;
+ Moment last_mom_;
+public:
+ Score *score_l_;
+ Global_acceptor();
+ int moments_left_i()const;
+ void modify_next(Moment&);
+ void add_moment_to_process(Moment);
+
+ virtual void set_score(Score*);
+ virtual void prepare(Moment);
+ virtual void process() {}
+ virtual void finish() {}
+
+protected:
+ virtual int depth_i() const;
+ virtual Acceptor *ancestor_l(int);
+};
+
+
+
+#endif // GLOBAL_ACCEPTOR_HH
String name_str_;
void add(Input_register *);
-
+ bool is_name_b(String);
bool accept_req_b();
bool accepts_b(String);
void print() const;
#include "lily-proto.hh"
-class Interpreter {
-public:
- int music_list_i_;
- Interpreter();
- virtual ~Interpreter();
- virtual bool interpret_request_b(Request*) { return false;}
-};
-
#endif // INTERPRETER_HH
Array<int> pitch;
Array<int> acc;
int c_position;
+ bool default_b_;
/* *************** */
void add(int pitch, int acc);
void read(const Key_register&);
void set_c_position(int);
- void preprocess();
+ virtual void do_pre_processing();
Molecule* brew_molecule_p()const;
};
Key_register();
NAME_MEMBERS();
private:
+ void create_key();
void read_req(Key_change_req * r);
};
struct My_lily_lexer;
struct Absolute_dynamic_req;
-struct Accidental;
+struct Acceptor;
struct Atom;
struct Bar;
struct Bar_register;
struct Element_group_item;
struct Feature;
struct General_script_def;
+struct Global_acceptor;
struct Group_change_req;
struct Group_feature_req;
struct Horizontal_align_item;
#ifndef MIDIWALKER_HH
#define MIDIWALKER_HH
-#if 0
+
#include "lily-proto.hh"
+
+#if 0
+
+// sketch. . .
+class Midi_register {
+};
+
+class Midi_group_reg : public Midi_register, public Acceptor {
+
+};
+
+class Midi_staff_reg : public Midi_group_reg {
+};
+
+
+class Midi_note_reg : public Midi_register {
+
+};
+
+class Midi_voice_reg : public Midi_group_reg, public Interpreter {
+
+};
+
+class Midi_score_reg: public Midi_group_reg, public Global_acceptor {
+};
+
+
#include "grouping.hh"
#include "staff-walker.hh"
#include "pcursor.hh"
public:
Music_iterator *daddy_iter_l_;
NAME_MEMBERS();
- Register_group_register *report_to_reg_l_;
+ Acceptor *report_to_l_;
- static Music_iterator* static_get_iterator_p(Music*,Register_group_register*);
+ static Music_iterator* static_get_iterator_p(Music*,Acceptor*);
Music_iterator* get_iterator_p(Music*)const;
- void set_reg(Register_group_register*);
+ void set_acceptor(Acceptor*);
Music_iterator();
virtual void next(Moment until);
virtual Moment next_moment()const;
virtual ~Music_iterator();
virtual void construct_children();
void print()const;
- virtual Register_group_register * get_req_acceptor_l();
+ virtual Acceptor * get_req_acceptor_l();
};
// duh.
#include "plist.hh"
#include "score-elem-info.hh"
#include "register.hh"
+#include "acceptor.hh"
+
/**
Group a number of registers. Usually delegates everything to its contents.
Postfix: group
*/
-class Register_group_register : public Request_register {
+class Register_group_register : public Request_register, public virtual Acceptor {
protected:
+
Pointer_list<Request_register*> reg_list_;
Link_array<Register_group_register> group_l_arr_;
Link_array<Request_register> nongroup_l_arr_;
- String id_str_;
Array<Score_elem_info> announce_info_arr_;
virtual bool removable_b()const;
public:
- int iterator_count_;
+ Input_register * ireg_l_;
void check_removal();
Register_group_register();
~Register_group_register();
- /// Score_register = 0, Staff_registers = 1, etc)
- virtual int depth_i()const;
- /**
- Go up in the tree. default: choose next parent
- */
- Register_group_register * ancestor_l(int l=1);
-
- Input_register * ireg_l_;
+
/**
Junk #reg_l#.
-
Pre:
- #reg_l# is in #reg_list_#
+ #reg_l# is in #reg_list_#
*/
virtual void terminate_register(Request_register * reg_l);
virtual Register_group_register * find_register_l(String name,String id);
virtual void do_announces();
virtual void announce_element(Score_elem_info);
- virtual Register_group_register* find_get_reg_l(String name, String id);
- virtual Register_group_register * get_default_interpreter();
-
+
+
virtual void add(Request_register* reg_p);
virtual bool contains_b(Request_register*)const;
+
+ virtual Acceptor* find_get_acceptor_l(String name, String id);
+ virtual Acceptor * get_default_interpreter();
+ /**
+ Go up in the tree. default: choose next parent
+ */
+ Acceptor * ancestor_l(int l=1);
+ int depth_i() const;
+
};
#endif // REGISTERGROUP_HH
bool try_request(Request*);
void post_move_processing();
- virtual Interpreter * interpreter_l() { return 0; }
Register_group_register * daddy_reg_l_;
class Score_column {
friend class Score;
- friend class Score_walker;
+ friend class Score_register;
bool musical_b_;
Moment when_;
#define SCORE_REG_HH
#include "register-group.hh"
-#include "pqueue.hh"
+#include "global-acceptor.hh"
-class Score_register : public Register_group_register {
+class Score_register : public Register_group_register, public Global_acceptor {
Line_of_score * scoreline_l_;
- Score * score_l_;
+
Array<Item*> nobreak_item_p_arr_;
Link_array<Score_elem> musical_item_p_arr_;
void set_cols(Score_column*,Score_column*);
void typeset_all();
- PQueue<Moment> extra_mom_pq_;
- Moment last_mom_;
public:
NAME_MEMBERS();
- void add_moment_to_process(Moment);
Score_register();
- int depth_i() const;
-protected:
- void set_score(Score * score_l);
-
+protected:
+ /* Global_acceptor interface */
+ virtual void set_score(Score * score_l);
+ virtual void prepare(Moment);
+ virtual void finish();
+ virtual void process();
+ virtual int depth_i() const { return Global_acceptor::depth_i();}
+ virtual Acceptor* ancestor_l(int l) { return Global_acceptor::ancestor_l(l);}
+
+protected:
+ /* Register_group_register interface */
virtual Staff_info get_staff_info()const;
virtual bool do_try_request(Request*);
virtual void do_creation_processing();
virtual void typeset_element(Score_elem*elem_p);
virtual Paper_def * paper() const;
virtual void do_pre_move_processing();
-
};
#endif // SCORE_REG_HH
Score(Score const&);
private:
+ void run_acceptor(Global_acceptor*);
void paper_output();
- void setup_music();
/// do midi stuff
void midi();
#include "input-register.hh"
#include "register-group.hh"
+bool
+Input_register::is_name_b(String n)
+{
+ bool b = (n == name_str_);
+ for (int i=0; !b && i < alias_str_arr_.size(); i++)
+ b = b || (alias_str_arr_[i] == n);
+ return b;
+}
+
void
Input_register::print() const
{
lookup_reg(String nm)
{
for (int i=0; i < iregs_p_arr.size(); i++)
- if (iregs_p_arr[i]->name_str_ == nm)
+ if (iregs_p_arr[i]->is_name_b(nm))
return iregs_p_arr[i];
error("can't find reg `" + nm + "'");
}
+
+
Input_register *
Input_register::recursive_find(String nm)
{
- if ( nm == name_str_)
+ if ( is_name_b( nm) )
return this;
Input_register * r =0;
Input_register::find_ireg_l(String nm)
{
for (iter(contains_ireg_p_list_.top(), i); i.ok(); i++)
- if (i->name_str_ == nm)
+ if (i->is_name_b( nm))
return i;
return 0;
+++ /dev/null
-/*
- interpreter.cc -- implement Interpreter
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-#include <assert.h>
-#include "interpreter.hh"
-
-Interpreter::Interpreter()
-{
- music_list_i_ =0;
-}
-
-Interpreter::~Interpreter()
-{
-// assert(!music_list_i_ );
-}
const int FLAT_TOP_PITCH=2; /* fes,ges,as and bes typeset in lower octave */
const int SHARP_TOP_PITCH=4; /* ais and bis typeset in lower octave */
-
-
Key_item::Key_item(int c)
{
+ default_b_ = false;
set_c_position(c);
}
Molecule m(a);
output->add_right(m);
}
- Molecule m(paper()->lookup_l()->fill(Box(
+ if ( pitch.size() ) {
+ Molecule m(paper()->lookup_l()->fill(Box(
Interval(0, paper()->note_width()),
Interval(0,0))));
- if ( pitch.size() )
+
output->add_right(m);
+ }
return output;
}
IMPLEMENT_STATIC_NAME(Key_item);
IMPLEMENT_IS_TYPE_B1(Key_item,Item);
+
+void
+Key_item::do_pre_processing()
+{
+ if (default_b_ ) {
+ empty_b_ = transparent_b_ = (break_status_i() != 1);
+ }
+}
Key_register::Key_register()
{
+ kit_p_ = 0;
do_post_move_processing();
}
+void
+Key_register::create_key()
+{
+ if (!kit_p_) {
+ int c0_i= *get_staff_info().c0_position_i_l_;
+
+ kit_p_ = new Key_item(c0_i);
+ announce_element(Score_elem_info(kit_p_,keyreq_l_));
+ kit_p_->read(*this);
+ }
+}
+
bool
Key_register::do_try_request(Request * req_l)
{
if (keyreq_l_)
return false; // TODO
keyreq_l_ = creq_l->keychange();
- change_key_b_ = true;
read_req(keyreq_l_);
return true;
}
void
Key_register::acknowledge_element(Score_elem_info info)
{
- int c0_i= *get_staff_info().c0_position_i_l_;
- Command_req * r_l = info.req_l_->command() ;
+ Command_req * r_l = info.req_l_->command() ;
if (r_l && r_l->clefchange()) {
-
- if (!kit_p_) {
- kit_p_ = new Key_item(c0_i);
- announce_element(Score_elem_info(kit_p_,0));
- }
- change_key_b_ = true;
- }
-
- if (info.elem_l_->name() == Bar::static_name()) {
- default_key_b_ = true;
- if (!kit_p_) {
- kit_p_ = new Key_item(c0_i);
- announce_element(Score_elem_info(kit_p_,0));
- }
+ create_key();
+ } else if (info.elem_l_->name() == Bar::static_name()) {
+ if ( !keyreq_l_)
+ default_key_b_ = true;
+ create_key();
}
}
void
Key_register::do_process_requests()
{
- int c0_i= *get_staff_info().c0_position_i_l_;
-
if (key_.multi_octave_b_)
assert(false); // TODO .
else if (keyreq_l_) {
- kit_p_ = new Key_item(c0_i);
- kit_p_->read(*this);
- announce_element(Score_elem_info(kit_p_, keyreq_l_));
+ create_key();
}
}
Key_register::do_pre_move_processing()
{
if (kit_p_) {
+ kit_p_->default_b_ = default_key_b_;
typeset_breakable_item( kit_p_);
kit_p_ = 0;
}
{
keyreq_l_ = 0;
default_key_b_ = false;
- kit_p_ = 0;
- change_key_b_ = false;
}
+
IMPLEMENT_STATIC_NAME(Key_register);
IMPLEMENT_IS_TYPE_B1(Key_register,Request_register);
ADD_THIS_REGISTER(Key_register);
#include "path.hh"
#include "config.hh"
#include "source.hh"
+#include "debug.hh"
#include "my-lily-parser.hh"
Sources* source_l_g = 0;
"USA.\n";
}
-static File_path * path_l =0;
+
+static File_path path;
void
do_one_file(String init_str, String file_str)
{
+ if ( "" == path.find( init_str ) )
+ error ( "Can not find `" + init_str +"'");
+
+ if ( path.find( file_str ) == "" )
+ error ( "Can not find `" + file_str + "'");
+
+
Sources sources;
source_l_g = &sources;
- source_l_g->set_path(path_l);
+ source_l_g->set_path(&path);
{
My_lily_parser parser(source_l_g);
parser.set_version_check(version_ignore_b_);
debug_init(); // should be first
- File_path path;
-
// must override (come before) "/usr/local/share/lilypond"!
char const * env_l=getenv("LILYINCLUDE");
if (env_l) {
path.add( "" );
path.add( String( DIR_DATADIR ) + "/init/" );
- path_l = & path;
- path_l->push(DIR_DATADIR );
+ path.push(DIR_DATADIR );
Getopt_long oparser(argc, argv,theopts);
cout << get_version_str() << endl;
#include "music-list.hh"
#include "music-iterator.hh"
-#include "register.hh"
-#include "register-group.hh"
+#include "acceptor.hh"
+#include "request.hh"
#include "interpreter.hh"
#include "debug.hh"
{
#ifndef NPRINT
mtor << name() << "{";
- mtor << "report to " << report_to_reg_l_ << " (" << report_to_reg_l_->name() << ")\n";
+ mtor << "report to " << report_to_l_ << " (" << report_to_l_->name() << ")\n";
mtor << "next at " << next_moment() << " ";
do_print();
mtor << "}\n";
#endif
}
-Register_group_register *
+Acceptor*
Music_iterator::get_req_acceptor_l()
{
- assert(report_to_reg_l_);
- if (report_to_reg_l_->interpreter_l() )
- return report_to_reg_l_;
+ assert(report_to_l_);
+ if (report_to_l_->interpreter_l() )
+ return report_to_l_;
- set_reg( report_to_reg_l_->get_default_interpreter() );
- return report_to_reg_l_;
+ set_acceptor( report_to_l_->get_default_interpreter() );
+ return report_to_l_;
}
void
-Music_iterator::set_reg(Register_group_register*reg)
+Music_iterator::set_acceptor(Acceptor*reg)
{
- if (report_to_reg_l_==reg)
+ if (report_to_l_==reg)
return;
- if (report_to_reg_l_)
- report_to_reg_l_->iterator_count_ --;
+ if (report_to_l_)
+ report_to_l_->iterator_count_ --;
- report_to_reg_l_ = reg;
+ report_to_l_ = reg;
- if (report_to_reg_l_)
- report_to_reg_l_->iterator_count_ ++;
+ if (report_to_l_)
+ report_to_l_->iterator_count_ ++;
}
void
Music_iterator::~Music_iterator()
{
- set_reg(0);
+ set_acceptor(0);
}
Moment
Music_iterator*
Music_iterator::static_get_iterator_p(Music *m,
- Register_group_register *report_l)
+ Acceptor *report_l)
{
Music_iterator * p =0;
if (m->is_type_b( Change_reg::static_name()))
if ( m->is_type_b( Music_list::static_name())) {
Music_list* ml = (Music_list*) m;
if (ml -> type_str_ != "") {
- p->set_reg(report_l->find_get_reg_l(ml-> type_str_, ml->id_str_));
+ Acceptor * a =report_l->
+ find_get_acceptor_l(ml-> type_str_, ml->id_str_);
+
+
+ p->set_acceptor( a);
}
}
- if (! p->report_to_reg_l_ )
- p ->set_reg(report_l);
+ if (! p->report_to_l_ )
+ p ->set_acceptor(report_l);
return p;
}
Music_iterator*
Music_iterator::get_iterator_p(Music*m)const
{
- Music_iterator*p = static_get_iterator_p(m,report_to_reg_l_);
+ Music_iterator*p = static_get_iterator_p(m,report_to_l_);
p->daddy_iter_l_ = (Music_iterator*)this;
p->construct_children();
return p;
Music_iterator::Music_iterator()
{
daddy_iter_l_ =0;
- report_to_reg_l_ = 0;
+ report_to_l_ = 0;
first_b_ = true;
}
for(iter(chord_C_->music_p_list_.top(), i); i.ok(); j++, i++) {
Music_iterator * mi = get_iterator_p( i.ptr());
- set_reg(mi->report_to_reg_l_->ancestor_l( chord_C_->multi_level_i_ ));
- children_p_list_.bottom().add( mi );
+ set_acceptor(mi->report_to_l_->ancestor_l( chord_C_->multi_level_i_ ));
+ if ( mi->ok() )
+ children_p_list_.bottom().add( mi );
+ else
+ delete mi;
}
}
void
{
if (ok()) {
iter_p_ = Music_iterator::get_iterator_p( ptr() );
- if (iter_p_->report_to_reg_l_->depth_i() > report_to_reg_l_->depth_i())
- set_reg(iter_p_->report_to_reg_l_);
+ if (iter_p_->report_to_l_->depth_i() > report_to_l_->depth_i())
+ set_acceptor(iter_p_->report_to_l_);
}
}
Request_iterator::next(Moment m)
{
if ( first_b_) {
- bool gotcha = daddy_iter_l_->report_to_reg_l_->
+ bool gotcha = daddy_iter_l_->report_to_l_->
interpreter_l()->interpret_request_b(req_l_);
if (!gotcha)
req_l_->warning("Junking request: " + String(req_l_->name()));
void
Change_iterator::next(Moment mom)
{
+#if 0
Register_group_register *group_l =
- report_to_reg_l_->find_get_reg_l(change_l_->type_str_,
+ report_to_l_->find_get_reg_l(change_l_->type_str_,
change_l_->id_str_);
- report_to_reg_l_->daddy_reg_l_->remove_register_p(report_to_reg_l_);
- group_l->add(report_to_reg_l_);
-
+ report_to_l_->daddy_reg_l_->remove_register_p(report_to_l_);
+ group_l->add(report_to_l_);
+#endif
Music_iterator::next(mom);
}
/*
if ( daddy_iter_l_
&& daddy_iter_l_->is_type_b(Voice_iterator::static_name() )) {
- set_reg(daddy_iter_l_-> get_req_acceptor_l());
+ set_acceptor(daddy_iter_l_-> get_req_acceptor_l());
} else if (daddy_iter_l_
&& daddy_iter_l_-> is_type_b( Chord_iterator::static_name() )) {
{
#ifndef NPRINT
String s = "";
+
if (init_parse_b_)
s = "Init";
if (!monitor->silence(s+"Declarations") && check_debug) {
#endif
}
-void
-My_lily_parser::do_init_file()
-{
- init_parse_b_ = true;
- set_debug();
- lexer_p_->new_input(init_str_, source_l_);
-}
-
void
My_lily_parser::parse_file(String init, String s)
{
lexer_p_ = new My_lily_lexer;
init_str_ = init;
+ *mlog << "Parsing ... ";
+ init_parse_b_ = true;
+ lexer_p_->new_input( init, source_l_);
+ do_yyparse();
+ print_declarations();
- *mlog << "Parsing ... ";
- lexer_p_->new_input(s, source_l_);
- if (!lexer_p_->source_file_l()) {
- warning("Can not find toplevel file. Ignoring " + s);
- return;
- }
+ init_parse_b_ = false;
+ lexer_p_->new_input( s , source_l_);
do_yyparse();
print_declarations();
+
if(!define_spot_array_.empty())
warning("Braces don't match.");
}
s = p->lookup_l()->rest(balltype_i_, streepjes_b);
}
out = new Molecule(Atom(s));
+ out->translate_x( x_dir_i_ * s.dim.x.length() );
if (dots_i_) {
Symbol d = p->lookup_l()->dots(dots_i_ );
Molecule dm;
My_lily_parser *pars_l = (My_lily_parser*) v_l;
My_lily_lexer * lex_l = pars_l->lexer_p_;
- if (pars_l->first_b_) {
- pars_l->first_b_ = false;
- pars_l->do_init_file();
- }
-
lex_l->lexval_l = (void*) s;
return lex_l->yylex();
}
%}
+
%pure_parser
/* tokens which are not keywords */
%type <melreqvec> pitch_list
%type <midi> midi_block midi_body
%type <moment> duration_length
-%type <music> init_melodic init_lyrics init_music
+
%type <music> Music transposed_music
%type <musiclist> Voice Voice_body
%type <chord> Chord Chord_body
| mudela error
| mudela check_version { }
| mudela add_notenames { }
- | mudela init_end {}
| mudela input_register_spec { add_global_input_register($2); }
;
-init_end: INIT_END ';' {
- THIS->print_declarations();
- THIS->init_parse_b_ = false;
- THIS->set_debug();
- }
- ;
check_version:
VERSION STRING ';' {
if (*$2 != MUDELA_VERSION) {
$$ = new Script_id(*$1, $3, SCRIPT_IDENTIFIER);
delete $1;
}
- | declarable_identifier '=' init_music {
+ | declarable_identifier '=' Music {
$$ = new Music_id(*$1, $3, MUSIC_IDENTIFIER);
delete $1;
}
| SCORE_IDENTIFIER {
$$ = $1->score(true);
}
- | score_body init_music {
+ | score_body Music {
$$->music_p_ = $2;
}
| score_body paper_block {
-/*
- let the lexer switch mode.
-*/
-init_music:
- init_melodic { $$ = $1; }
- | init_lyrics { $$ = $1; }
- ;
-
-init_lyrics:
- LYRIC
- { THIS->lexer_p_->push_lyric_state(); }
- Music
- { $$ = $3; THIS->lexer_p_->pop_state(); }
- ;
-
-init_melodic:
- MELODIC
- { THIS->lexer_p_->push_note_state(); }
- Music
- { $$=$3; THIS->lexer_p_->pop_state(); }
- ;
/*
MUSIC
| Chord { $$ = $1; }
| transposed_music { $$ = $1; }
| MUSIC_IDENTIFIER { $$ = $1->music(true); }
+ | MELODIC
+ { THIS->lexer_p_->push_note_state(); }
+ Music
+ { $$=$3; THIS->lexer_p_->pop_state(); }
+
+ | LYRIC
+ { THIS->lexer_p_->push_lyric_state(); }
+ Music
+ { $$ = $3; THIS->lexer_p_->pop_state(); }
;
Chord:
Register_group_register::Register_group_register()
{
ireg_l_ =0;
- iterator_count_ =0;
}
void
delete reg_p;
}
-IMPLEMENT_IS_TYPE_B1(Register_group_register,Request_register);
+IMPLEMENT_IS_TYPE_B2(Register_group_register,Request_register, Acceptor);
IMPLEMENT_STATIC_NAME(Register_group_register);
ADD_THIS_REGISTER(Register_group_register);
return r;
}
-Register_group_register*
-Register_group_register::find_get_reg_l(String n,String id)
+Acceptor*
+Register_group_register::find_get_acceptor_l(String n,String id)
{
- Register_group_register * ret=0;
- if (ireg_l_-> find_ireg_l( n )) {
+ Acceptor * ret=0;
+ Input_register * ireg_l= ireg_l_-> recursive_find ( n );
+ if (ireg_l ) {
ret = find_register_l(n,id);
if (!ret) {
- ret = ireg_l_-> find_ireg_l(n) -> get_group_register_p();
- add ( ret );
- ret ->id_str_ = id;
+ Register_group_register * group =
+ ireg_l-> get_group_register_p();
+
+ add(group);
+ ret = group;
+
+ if (group->ireg_l_->is_name_b( n ) )
+ ret ->id_str_ = id;
+ else
+ return ret->find_get_acceptor_l(n,id);
+
}
} else if (daddy_reg_l_)
- ret =daddy_reg_l_->find_get_reg_l(n,id);
+ ret =daddy_reg_l_->find_get_acceptor_l(n,id);
else {
warning("Can't find or create `" + n + "' called `" + id + "'\n");
ret =0;
return daddy_reg_l_->depth_i() + 1;
}
-Register_group_register*
+Acceptor*
Register_group_register::ancestor_l(int l)
{
if (!l || !daddy_reg_l_)
return inf;
}
-Register_group_register*
+Acceptor*
Register_group_register::get_default_interpreter()
{
if ( interpreter_l() )
#include "musical-request.hh"
#include "score-column.hh"
-int
-Score_register::depth_i()const
-{
- return 0;
-}
void
Score_register::set_score(Score *s)
{
- score_l_ = s;
+ Global_acceptor::set_score(s);
scoreline_l_ = s->pscore_p_->super_elem_l_->line_of_score_l_;
- last_mom_ = score_l_->music_p_->time_int().max();
}
Score_register::Score_register()
{
- score_l_ = 0;
scoreline_l_ =0;
command_column_l_ =0;
musical_column_l_ =0;
}
+void
+Score_register::prepare(Moment w)
+{
+ Score_column* c1 = new Score_column(w);
+ Score_column* c2 = new Score_column(w);
+
+ c1->musical_b_ = false;
+ c2->musical_b_ = true;
+
+ score_l_->cols_.bottom().add(c1);
+ score_l_->cols_.bottom().add(c2);
+ set_cols(c1,c2);
+
+
+ post_move_processing();
+}
+void
+Score_register::finish()
+{
+ check_removal();
+ do_removal_processing();
+}
void
Score_register::do_creation_processing()
typeset_all();
}
+void
+Score_register::process()
+{
+ process_requests();
+ do_announces();
+ pre_move_processing();
+ check_removal();
+}
void
Score_register::announce_element(Score_elem_info info)
nobreak_item_p_arr_.push(nobreak_p);
}
}
+
void
Score_register::typeset_all()
{
IMPLEMENT_STATIC_NAME(Score_register);
ADD_THIS_REGISTER(Score_register);
-void
-Score_register::add_moment_to_process(Moment m)
-{
- if (m > last_mom_)
- return;
-
- for (int i=0; i < extra_mom_pq_.size(); i++)
- if (extra_mom_pq_[i] == m)
- return;
- extra_mom_pq_.insert(m);
-}
}
void
-Score::setup_music()
+Score::run_acceptor(Global_acceptor * acc_l)
{
- *mlog << "\nSetting up requests..." << flush;
-
- Score_register * score_reg =
- (Score_register*)lookup_reg("Score_register")->get_group_register_p();
-
- score_reg->set_score (this);
+ acc_l->set_score (this);
Music_iterator * iter = Music_iterator::static_get_iterator_p(music_p_,
- score_reg);
+ acc_l);
iter->construct_children();
- while ( iter->ok() || score_reg->extra_mom_pq_.size() ) {
+ while ( iter->ok() || acc_l->moments_left_i() ) {
Moment w = INFTY;
if (iter->ok() ) {
w = iter->next_moment();
iter->print();
}
- if (score_reg->extra_mom_pq_.size() &&
- score_reg->extra_mom_pq_.front() <= w)
-
- w = score_reg->extra_mom_pq_.get();
-
- mtor << "processing moment " << w << "\n";
-
- Score_column* c1 = new Score_column(w);
- Score_column* c2 = new Score_column(w);
-
- c1->musical_b_ = false;
- c2->musical_b_ = true;
-
- cols_.bottom().add(c1);
- cols_.bottom().add(c2);
- score_reg->set_cols(c1,c2);
-
- score_reg->post_move_processing();
+ acc_l->modify_next( w );
+ acc_l->prepare(w);
iter->next( w );
-
- score_reg->process_requests();
- score_reg->do_announces();
- score_reg->pre_move_processing();
- score_reg->check_removal();
+ acc_l->process();
}
delete iter;
- score_reg->check_removal();
- score_reg->do_removal_processing();
- delete score_reg;
+ acc_l->finish();
}
+
void
Score::process()
{
{
if (!paper_p_)
return;
-
+
+ *mlog << "\nCreating elements ..." << flush;
+ pscore_p_ = new PScore(paper_p_);
+
+ Score_register * score_reg =
+ (Score_register*)lookup_reg("Score_register")->get_group_register_p();
+ run_acceptor( score_reg );
+ delete score_reg;
+
if( errorlevel_i_){
// should we? hampers debugging.
warning("Errors found, /*not processing score*/");
// return;
}
- pscore_p_ = new PScore(paper_p_);
- setup_music();
do_cols();
clean_cols(); // can't move clean_cols() farther up.
void
Score::clean_cols()
{
-#if 1
for (iter_top(cols_,c); c.ok(); ) {
if (!c->pcol_l_->used_b()) {
delete c.remove_p();
c++;
}
}
-#endif
}
PCursor<Score_column*>
Begin3
Title: LilyPond
-Version: 0.0.70pre
-Entered-date: 06/29/97
+Version: 0.0.71pre
+Entered-date: 07/01/97
Description: LilyPond is a program which converts a music-script (mudela) into
TeX output, or MIDI to produce multi-staff scores. Features include multiple
meters, clefs, keys, lyrics, versatile input-language, cadenzas
jan@digicash.com (Jan Nieuwenhuizen)
Maintained-by: hanwen@stack.nl (Han-Wen Nienhuys)
Primary-site: pcnov095.win.tue.nl /pub/lilypond/
- 300k lilypond-0.0.70pre.tar.gz
+ 300k lilypond-0.0.71pre.tar.gz
Alternate-site:
Original-site:
Platform: unix/win32, GNU C++
Name: lilypond
-Version: 0.0.70pre
+Version: 0.0.71pre
Release: 1
Copyright: GPL
Group: Applications/Publishing
-Source0: pcnov095.win.tue.nl:/pub/lilypond/lilypond-0.0.70pre.tar.gz
+Source0: pcnov095.win.tue.nl:/pub/lilypond/lilypond-0.0.71pre.tar.gz
Summary: A preprocessor to make TeX typeset music.
URL: http://www.stack.nl/~hanwen/lilypond
Packager: Han-Wen Nienhuys <hanwen@stack.nl>
\font\hslurdfont=xslhd16
\font\hslurhfont=xslhz20
\font\musicfnt=musix16
- \font\dynfont=cmbxti12
+ \font\dynfont=cmbxti10
\font\musicdraw=musixsps
\font\mathfont=cmsy8
}