# FlexLexer debug
InitLexer 1
Lexer 1
-Matrix 1
# flower lib
File_path 1
+Matrix 0
+Vector 1
+# lily
Atom 0
Bar 0
Beam 0
Group_change_req 0
Head_column 0
Idealspacing 0
-Ineq_constrained_qp 0
+Ineq_constrained_qp 1
Input_translator 0
Item 0
Key_item 0
Line_spacer 0
Melodic_req 0
Midi_def 0
+Midistrings 1
Mixed_qp 0
Music 0
Music_iterator 0
Note_head 0
Note_performer 0
Note_req 0
-PCol 0
-PScore 0
+Paper_col 1
+Paper_score 1
Paper_def 0
Paperdef 0
Performer 0
Text_req 0
Time_description 0
Voice 0
-Voice_element 0
-Voice_element_iterator 0
Voice_iterator 0
Word_wrap 0
delete_identifiers 1
-Document reintroduced deficiencies.
-
-* placement of bar-numbers
-
-****************
-vi1=\melodic{
- \meter 4/4;
- \octave c'';
-
- B8 G G G16 A B8 G G G16 A |
-
-}
-
-vi2=\melodic{
- \meter 4/4;
- \octave c'';
-
- r16
-}
-
-%{
-bc=\melodic{
- \clef "bass";
- \meter 4/4;
- \octave c;
-
- G1 |
-}
-%}
-
-\score{
- < \multi 3;
- \vi1
- \vi2
-
- >
-
- \paper{
- geometric=1.2;
- unitspace=8.\mm;
- linewidth=18.\cm;
- gourlay_maxmeasures=4.;
- gourlay_energybound = 70000.;
- basicspace = 2.8\pt;
- }
-}
-***************************
-
- \score { <
- \melodic { \id "Staff" ""; c'4 g'4 }
- \lyric { \id "Lyric" ""; hello4 bye4 < a chord > }
- \lyric { \id "Lyric" ""; bye4 hello4 }
- \melodic { \id "Staff" ""; c'4 g'4 }
- > }
+Document Really Ugly Bugs (coredumps assert fails, etc)
+
+[Solaris]
+
+Stack frame overwrite on Solaris 2.x (this will produce a seg
+fault, signal 11). Stacktrace
+
+ Engraver_group_engraver::Engraver_group_engraver(int)
+ Score_engraver::Score_engraver( )
+ get_group_engraver_p()
+
+We don't know a fix or workaround, but compiling without optimisation
+might help (Without -O2 optimisation, my execs run fine on Solaris;
+without -O2, but with purify, it dumps core)
+
+
+[Linux Intel]
+
+LilyPond occasionally crashes while parsing the initialisation files.
+This is a very obscure bug, and usually entering the commandline
+differently "fixes" it.
+
+ lilypond input.ly
+
+and
+
+ lilypond -I. ./input.ly
+
+makes a difference
+
+Typical stacktrace:
+
+ SIGSEGV
+ __libc_malloc (bytes=16384)
+ ?? ()
+ yyFlexLexer::yy_create_buffer ()
+ Includable_lexer::new_input (this=0x8209a00, s={strh_ = {
+ :
+
+
+I get bitten by this every once in a while, and I am very interested
+in hints what might be wrong.
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 675 Mass Ave, Cambridge, MA 02139, USA
+ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Also add information on how to contact you by electronic and paper mail.
lily/midi-*, mi2mu/*, parts flower/string*.cc, make/*.make, */Makefile
parts of Documentation/mudela.pod, lib/*source-file*, lib/duration.cc,
-lib/source*, flower/*{list,cursor}*, lily/rest-collision*, conflily,
-cygnus w32 stuff, lily/*perf*, some input files
+lib/source*, flower/*{list,cursor}*, lily/rest-collision*,
+lily/*abbreviation*, conflily, cygnus w32 stuff, lily/*perf*, some
+input files
and corresponding header files.
=item *
Mats Bengtsson <matsb@s3.kth.se>, parts of clef-reg.cc, clef-item.cc
-swedish notenames, testing, general comments.
+swedish notenames, testing, general comments, duration
+logs/longa/brevis etc
=item *
=head1 DESCRIPTION
-We use these standards while doing programming for GNU LilyPond
+We use these standards while doing programming for GNU LilyPond. If
+you do some hacking, we appreciate it if you would follow this rules,
+but if you don't, we still like you.
Functions and methods do not return errorcodes, but use assert for
checking status.
use non-ambiguous postfixes C<identifier_name_type_modifier[_modifier]>
+=item *
+
+There is no need for Hungarian if the scope of the variable is small,
+ie. local variables, arguments in function definitions (not
+declarations).
+
=back
Macros, C<enum>s and C<const>s are all uppercase,
=over 5
+=head2 Adjective
+
+Adjectives such as global and static should be spelled out in full.
+They come before the noun that they refer to, just as in normal english.
+
+foo_global_i: a global variable of type int commonly called "foo".
+
+static class members do not need the static_ prefix in the name (the
+Class::var notation usually makes it clear that it is static)
+
=item C<loop_i>
Variable loop: an integer
Generally default arguments are taboo, except for nil pointers.
+The naming convention can be quite conveniently memorised, by
+expressing the type in english, and abbreviating it
+
+ static Array<int*> foo
+
+C<foo> can be described as "the static int-pointer user-array", so you get
+
+ foo_static_l_arr
+
+
+
+
=head1 MISCELLANEOUS
For some tasks, some scripts are supplied, notably creating patches, a
=head2 Running
+Q: I don't get midi-output, even if I use B<-M>
+
+A: Your \score should include a \midi block, eg.
+
+ \score {
+ \melodic { c c g g }
+ \paper {}
+ \midi {
+ \output "myfile.mid";
+ \tempo 4=70;
+ }
+
+The B<-M> option was added to LilyPond because processing the \paper
+block is so slow.
+
Q: I get
can't load library 'libflower.so'
TeX file and and (mechanical) performances to MIDI files.
This is not a Fanmail/Hype page. These pages were entirely created from
-the LilyPond package-sources
+the LilyPond package-sources.
+
+B<These pages are created from the latest development
+snapshots of LilyPond>. You can look at the bottom if you want to
+know which version this was.
=head2 Examples
=item B<-M,--midi>
-do midi output only.
+This disables TeX output. If you have a \midi definition, it will do
+the midi output only.
=item B<-d,--debug>,
Show a summary of usage.
-=item B<-i,--init=>F<FILE>
+=item B<-i,--init=>F<FILE>,
-set init file to F<FILE> (default: F<symbol.ly>).
+Set init file to F<FILE> (default: F<symbol.ly>).
-=item B<--include, -I>=F<DIRECTORY>
+=item B<--include, -I>=F<DIRECTORY>,
-add F<DIRECTORY> to the search path for input files.
+Add F<DIRECTORY> to the search path for input files.
-=item B<--ignore-version, -V>
+=item B<--ignore-version, -V>,
-make incompatible mudela version non-fatal.
+Make incompatible mudela version non-fatal.
=back
=item *
-Multiple staffs in one score. Each staff can have a different meters.
+Multiple staffs in one score. Each staff can have different meters.
=item *
-beams, slurs, ties, chords, super/subscripts (accents and text),
+Beams, slurs, ties, chords, super/subscripts (accents and text)
triplets, general n-plet (triplet, quadruplets, etc.), lyrics,
-transposition dynamics (both absolute and hairpin style)
+transposition dynamics (both absolute and hairpin style).
=item *
-multiple voices within one staff; beams optionally shared
+Multiple voices within one staff; beams optionally shared
between voices. Up to four voices is handled cleanly.
=item *
-multiple scores within one input file. Each score is output to
+Multiple scores within one input file. Each score is output to
a different file.
=item *
-clef changes, meter changes, cadenza-mode, key changes, repeat bars
+Clef changes, meter changes, cadenza-mode, key changes, repeat bars.
=back
=item *
-if the bug has been fixed in a newer release.
+If the bug has been fixed in a newer release.
=item *
-if the bug has been found earlier, consult F<TODO> and F<BUGS>
+If the bug has been found earlier, consult F<TODO> and F<BUGS>.
=back
=over 4
=item *
-send a copy of the input which causes the error
+Send a copy of the input which causes the error.
=item *
-send a description of the platform you use
+Send a description of the platform you use.
=item *
-send a description of the LilyPond version you use (with
-compile/configure options please)
+Send a description of the LilyPond version you use (with
+compile/configure options please).
=item *
-send a description of the bug itself.
+Send a description of the bug itself.
=item *
-send it to bug-gnu-music@vuse.vanderbilt.edu
+Send it to bug-gnu-music@vuse.vanderbilt.edu.
=back
\usepackage{a4wide}
\title{Mudela and LilyPond crash course}
\author{Han-Wen Nienhuys}
+\def\file#1{{\texttt{#1}}}
\begin{document}
\maketitle
\emph{This document is not complete yet. It's just a brief blurb which
skimps some features of Mudela}
+\section{Who is who}
+
+This document describes two different things
+\begin{description}
+\item[Mudela] A language for defining music.
+
+\item[LilyPond] A package (the only one existing :-) which can
+ read a mudela file and interpret it.
+
+ The name ``LilyPond'' does not have much to do with the purpose of
+ the package, but we have a special emotional attachment with the
+ name. (Of course we are not telling why we chose it; this is an
+ excercise for the reader, most of the vital clues are contained in
+ the documentation and the source code. If you have guess, then let
+ me know)
+\end{description}
\section{Overview}
-Mudela is a language for specifying music. LilyPond is a
-program which converts such a specification into formatted sheet
-music, or MIDI output.
-Please note that some examples not only demonstrate features but also
-some lurking bugs. If can't understand what is happening, it might
-just be my (lack of) programming skills.
+Let's start with a very simple example, we will enter ``twinkle twinkle
+little star.'' We start with the most important part: the notes.
+Imagine being in a music-lesson, and that you made an error playing
+``twinkle twinkle''. Your teacher asks you to read out loud the
+melody of the song, just to verify your eyesight. You would probably
+say something like
+\begin{quote}
+ A quarter note C, Another quarter note C, a quarter G, another one, etc.
+\end{quote}
-\begin[fragment,verbatim]{mudela}
- { c4 e4 g4 }
+Mudela tries to capture this verbal presentation of sheet music, in
+the following way. The first line of twinkle twinkle is written in
+as follows
+\begin{verbatim}
+c4 c4 g4 g4 a4 a4 g2
+f4 f4 e4 e4 d4 d4 c2
+\end{verbatim}
+
+The notes are entered with names (a, b, c) combined with numbers
+(2,4). The names designate the pitches, the numbers the durations: 4
+is a quarter note, 2 a half note, etc.
+
+Now all we have to specify what should be done with the music. We
+want a paper version, so we combine the music with a ``output this on
+paper'' statement. These two are combined in ``score'' block. This
+is the final result with its output. We add a comment (the line
+starting with \verb+%+).
+Put this into a file
+called \file{twinkle.ly}
+
+\begin{verbatim}
+
+% twinkle, v1
+\score {
+ \melodic {
+ c4 c4 g4 g4 a4 a4 g2
+ f4 f4 e4 e4 d4 d4 c2
+ }
+ \paper {}
+}
+\end{verbatim}
+
+there are a few things to note about this example:
+
+The braces are grouping characters. In general, in mudela data entry
+for a data section called ``foobar'' looks like this:
+
+\begin{verbatim}
+\foobar { ...... }
+\end{verbatim}
+
+To see if it actually works, we run it through LilyPond. Invoke the
+command
+\begin{verbatim}
+ lilypond twinkle.ly
+\end{verbatim}
+When LilyPond starts working it will produce various ``operator
+pacification'' messages, which you can safely ignore for now. The run
+should have left a file called \file{lelie.tex} in your working
+directory. You can process that file with TeX, and it will look like
+this:
+
+\begin{mudela}
+\score {
+ \melodic {
+ c4 c4 g4 g4 a4 a4 g2
+ f4 f4 e4 e4 d4 d4 c2
+ }
+ \paper {}
+}
\end{mudela}
+As you can see, this is the song that we wanted, albeit a little
+low-pitched. You would probably want a version of the song which has
+all notes an octave higher. This can be done by adding a
+\verb+\octave+ command to the source. This sets the default octave
+for all notes. Another convenience is the default duration: if you do
+not specify a duration with the notename, the last explicitly entered
+is used. The improved version reads thus
-Basics: the \verb+%+ introduces a comment. All music is inside a
-\verb+\score+ block which represents one movement, ie one contiguous
-block of music. Voices are grouped by \verb+{+ and \verb+}+ and
-chords by \verb+<+ and \verb+>+.
\begin[verbatim]{mudela}
+ % twinkle v2
\score {
+ \melodic {
+ \octave c';
+ c4 c g g a a g2
+ f4 f e e d d c2
+ }
+ \paper {}
+}
+\end{mudela}
+
+
+
+\begin[verbatim]{mudela}
+ \score {
\melodic { % {...} is a voice
c'4 g'4 % c and g are pitches, 4 is the duration
% (crotchet/quarter note)
}
\end{mudela}
+
+\begin[fragment,verbatim]{mudela}
+ { c4 e4 g4 }
+\end{mudela}
+
+Basics: the \verb+%+ introduces a comment. All music is inside a
+\verb+\score+ block which represents one movement, ie one contiguous
+block of music. Voices are grouped by \verb+{+ and \verb+}+ and
+chords by \verb+<+ and \verb+>+.
+
+
The \verb+\octave+ command controls the default pitch (octave). If you
do not specify duration, the last one entered is used. The
\verb+\paper+ block contains parameters for spacing and dimensions.
As a related note, you should take a look at the examples and the init
files, as this document does not cover every aspect of mudela yet, and
-may be out of date.
+may be out of date.\footnote{Ok, I am being pessimistic here. This
+ just is a disclaimer. Docs usually are written after the program itself.}
\section{Basic elements}
\subsection{Files}
The de-facto extension of Mudela is \file{.ly}. Files may be included by
-entering \verb+include+ at the start of a line:
+entering \verb+\include+ at the start of a line:
\begin{verbatim}
\include "a_file.ly"
Identifiers in their normal form consist start with a backslash, a
alpha character, followed by alpha-numerics. Identifiers can contain
any characters (except whitespace,
-\verb+$+ and \verb+%+), if you use this
-construct:
+ and \verb+%+), if you use this construct:
\begin{verbatim}
\$i'm_a_weird!!!identifier
=head2 Free packages (with source)
+=over 4
+
=item Rosegarden, http://www.bath.ac.uk/~masjpf/rose.html
A Notation editor/Sequencer for X (windows95 port underway). Outputs musictex.
=item Musictex, http://www.gmd.de/Misc/Music/
MusicTeX is a macro package for TeX to typeset polyphonic or
-instrumental music. It is originally written by Daniel Taupin, Ross
-Mitchell and Andreas Egler.
+instrumental music. It was written by Daniel Taupin. Now obsoleted
+by MusiXTeX and OpusTeX.
It includes a full-featured set of fonts.
=item MusiXTeX, http://www.gmd.de/Misc/Music/
-Daniel Taupin's branch of MusicTeX.
+Newer version of MusicTeX. It also contains contributions by Ross
+Mitchell and Andreas Egler. Daniel Taupin's branch still carries this
+name.
-=item OpusTeX, http://www.inf.ethz.ch/department/Department.html/achermann/opustex
+=item OpusTeX, http://www.inf.ethz.ch/people/achermann/opustex
-Andreas Egler's branch of MusicTeX.
+Andreas Egler's branch of MusiXTeX.
=item ABC2MTeX, http://www.gre.ac.uk/~c.walshaw/abc
A TeX macro package for typesetting single-staff music by Angelika
Schofer & Andrea Steinbach. With some fonts
+=back
=head2 Free (zero cents)
+=over 4
+
=item Calliope, http://www.cl.cam.ac.uk/users/wfc/
A NeXT package by William F. Clocksin. Requires Adobe fonts.
+
+=back
+
=head2 Proprietary
+=over 4
+
=item Scribe, http://adu1.adu.lattrobe.edu.au/Music/Scribe.html
A formatter for medieval scores.
=item Sibelius, http://www.acorn.co.uk/developers/sibelius/Home
-Notation/engraving on Acorn machines.
+Notation editor on Acorn machines. Their developers call it ``best
+notation program available''.
=item Finale
=item Musicator
+=item WolfGang, http://www.unige.ch/lettres/armus/music/wolfgang.html
+
+=item Amadeus, Jerker.Elsgard@abc.se
+
+Professional and expensive (DM 4000,--) engraving. Designed as a
+batch program (like LilyPond). It is aimed at publishers. Its history
+is more than fifteen years and Amadeus has been running under
+different Unix clones. It uses MIDI-keyboard input
+
+
+
+=back
+
+
=head2 Unknown
=item MusE
cadence:cadence::::
cadence harmonique:harmonic cadence::::
cadence mélodique:melodic cadence::::
+:cue-notes:Stichnoten::stichnoten:
caractère:character::::
chaîne de trilles:chain of trills::::
chevron:chevron::::
comma:comma::::
comma enharmonique::::
comma pythagoricien::::
-comma syntonique::::
+comma syntonique: : : : :
consonance:consonant interval; consonance:::consonant:
contralto:contralto::::
contre-temps:contro-time::::
contre-temps régulier:regular contro-time::::
coulé:slur:::binding, bindingsboog:
courbe rythmique:rythmic curve::::
-cresendo:opening angular bracket::::
+:opening angular bracket::::cresendo
croche:eighth note::::
-decrescendo:closing angular bracket::::
+:closing angular bracket::::decrescendo
degré [de la gamme]:degree [of the scale]::::
demi-pause:half rest::::
-demi-soupir:eighth rest::::
-demi-ton:semitone::::
+demi-soupir:eighth rest:::achtste rust:
+demi-ton:semitone:::halve toon:
demi-ton chromatique:chromatic semitone::::
demi-ton diatonique:diatonic semitone::::
-diapason:pitch pipe; tuning fork::::
+diapason:pitch pipe; tuning fork:::stemfluitje; stemvork:
diminué (intervalle):diminished (interval)::::
dissonance:dissonant interval; dissonance::::
-dièse:sharp::::
+dièse:sharp:::kruis:
do:C::::
do central:middle C:::::
doigté:::::
doigté de pédale:::::
-dominante:dominant::::
+dominante:dominant:::dominant:
double barre:double bar line::::
-double bémol:double flat::::
+double bémol:double flat:::dubbelmol:
double croche:sixteenth note::::
-double dièse:double sharp::::
+double dièse:double sharp:::dubbelkruis:
double triolet:double triplet::::
duolet:duplet::::
durée:duration::::
fa:F::::
figure de note:kind of note::::
figure de silence:kind of rest::::
-fioriture:cadenza::::
+fioriture::::cadens:cadenza
forme du mode mineur ancien:ancient form (diatonic minor scale)::::
forme harmonique:harmonic form (diatonic minor scale)::::
forme mélodique:melodic form (diatonic minor scale)::::
-gamme:scale::::
-gamme chromatique:chromatic scale::::
-gamme diatonique majeure:diatonic major scale::::
+gamme:scale:::toonladder:
+gamme chromatique:chromatic scale:::chromatische toonladder:
+gamme diatonique majeure:diatonic major scale:::diatonische majeur toonladder:
gamme diatonique mineure:diatonic minor scale::::
gammes enharmoniques:enharmonic scales::::
gammes relatives:relative scales::::
genre diatonique:diatonic type::::
genre enharmonique:enharmonic type::::
groupe irrégulier:irregular group::::
-grupetto:turn; gruppetto::::
+grupetto:turn; gruppetto:::dubbelslag:
hauteur:pitch::::
huitième de soupir:thirty-second rest::::
incise:motive::::
mode mineur:minor mode::::
modulation:modulation::::
mordant:mordent::::
-mouvement:tempo; movement::::
+:::::
+mouvement:tempo; movement:::deel:
mouvement conjoint:conjunct movement::::
mouvement disjoint:disjunct movement::::
mouvement lent:slow tempo::::
nuance:shading::::
octave:octave::::
ornement:embellishment; accessory::::
-partition:score::::
+:part:::partij:
+partition:score:::partituur:
pause:whole rest::::
phrase:phrase::::
phrasé:phrasing::::
pizzicato:dash over/below::::
-point:dot::::
+point:dot:::punt:
point d'orgue:pause::::
point et liaison combinés:dot and curved line combined::::
pointillés::::
portamento:underline over/below::::
-portée:staff::::
+portée:staff:::(noten)balk; partij:
portées:staves::::
quadruple croche:sixty-fourth note::::
quart de soupir:sixteenth rest::::
renvoi:return sign::::
respiration:artificial rest::::
:double whole note::breve:brevis:breve
-ronde:whole note::::
-rythme:rythm::::
+ronde:whole note:::hele noot:
+rythme:rythm:::ritme:
ré:D::::
-seconde:second::::
+seconde:second::::secunde
seizième de soupir:sixty-fourth rest::::
sensible:leading note::::
-septième:seventh::::
+septième:seventh:::septiem:septime
sextolet:sextuplet::::
si:B::::
signes indicateurs de nuance:shading signs::::
sixain:sextuplet::::
sixte:sixth::::
sol:G::::
-soprano:soprano::::
+soprano:soprano:::sopraan:
soupir:quarter rest::::
sous-dominante:subdominant::::
sous-tonique:subtonic::::
-staccato:dot over/below::::
+:dot over/below::::staccato
sus-dominante:superdominant::::
sus-tonique:supertonic::::
-syncope:syncopation; upbeat::::
+syncope:syncopation; upbeat:::syncope:
syncope irrégulière:irregular syncopation::::
syncope régulière:regular syncopation::::
-temps:beat::::
+temps:beat:::tel:
temps binaire:binary beat::::
temps faible:weak beat::::
temps fort:strong beat::::
+
+pl 13
+ - big Rest/notehead rewrite:
+ * separated Rest, Note_head and Dots
+ * Dot_column: dots are now chord-wise aligned
+ * Rhythmic_head is base for Rest, Note_head
+ * Merged Note_column and Rest_column
+ * Rest_engraver
+ - grand Engraver/Translator/Performer rewrite.
+ * properties: \property voice.dir = -1 (mudela 0.1.3)
+ * Input_translator junked, now Translators are generated
+by the parser (mudela 0.1.4)
+ * Translator changing: \translator Staff=oboesolo
+ * Translator preselect: \type Staff=bla < c4 >. (mudela 0.1.5)
+ * Engraver/Performer now derived of Translator.
+ * Engraver_group_engraver/ Performer_group_performer derived of
+ Translator_group
+ * renamed: Voice -> Thread, Voice_group -> Voice
+ - renamed Audio_score to Performance
+ - junked mididef statics
+ - Audio debug output
+ - bf: excess [] in scsi
+ - bf: swallow \skips
+ - bf: don't crash on infinite dims
+ - renamed wohltemperirt to wtk1-fugue2
+ - bf: address in GPL
+ - bf: errors in stdin
+ - bf: stop if errors in init files
+ - bf: move stem too when doing collisions
+ - Molecule::add_XXXX -> Molecule::add_at_edge ()
+ - doco updeet: why no midi FAQ, index, CodingStyle hungarian
+
+pl 12.jcn3
+ - try at better dynamic font, copied from cmbxti10: mf/*
+ - typesetting abbreviation beams; abbreviation-*
+ - some simple abbrev fixes + code cleanup (dank je, lieverd)
+ - typesetting simple abbreviations: c4:16 === [c16 c c c]
+
+pl 11mb
+ - Support also for \longa in duration-convert.cc, init/ and tex/
+ files. (MB)
+
+********
+sep 3
+
+
pl 12
- bf: don't redefine tex primitives like \textfont and \mathfont
- nicer broken slurs (?)
- robustness in Lookup::*slur
- bf: mi2mu: warn if 0-length string in midi-file
- output id-footer
+
********
sep 1
2. REQUIREMENTS
For the compilation and running of LilyPond you need some additional
-packages. The most unusual one of this are the mf sources to
-MusixTeX. Please refer to the installation instructions on how to
-obtain and install them.
+packages. The most unusual one of this are the metafont sources to
+MusixTeX-fonts. Please refer to the installation instructions on how
+to obtain and install them.
3. INSTALLATINON
4. DOCUMENTATION
-Please refer to the directory Documentation/ for the real doco.
+The real documentation is the directory Documentation/
To generate the pretty-printed docs, you have to run configure first,
and then do this:
5. COMMENTS
-LilyPond is a long way from finished and polished. I do appreciate
-criticism, comments, bugreports, patches, etc. Please send e-mail to
-the mailing lists. See Documentation/links.pod for more info
+LilyPond is a long way from finished and polished. I do appreciate
+criticism, comments, bugreports, patches, etc. Please send e-mail to
+the mailing lists. See Documentation/links.pod for more info
6. DOZE
http://www.stack.nl/~hanwen/lilypond/index.html
-
7. CAVEATS
-Solaris
-
-Stack frame overwrite on Solaris 2.x (this will produce a seg
-fault, signal 11). Stacktrace
-
- Engraver_group_engraver::Engraver_group_engraver(int)
- Score_engraver::Score_engraver( )
- get_group_engraver_p()
-
-We don't know a fix or workaround, but compiling without optimisation
-might help (Without -O2 optimisation, my execs run fine on Solaris;
-without -O2, but with purify, it dumps core)
-
-
-Linux (intel)
-
-LilyPond occasionally crashes while parsing the initialisation files.
-This is a very obscure bug, and usually entering the commandline
-differently "fixes" it.
-
- lilypond input.ly
-
-and
-
- lilypond -I. ./input.ly
-
-makes a difference
-
-Typical stacktrace:
-
- SIGSEGV
- __libc_malloc (bytes=16384)
- ?? ()
- yyFlexLexer::yy_create_buffer ()
- Includable_lexer::new_input (this=0x8209a00, s={strh_ = {
- :
-
-
-I get bitten by this every once in a while, and I am very interested
-in hints what might be wrong.
+Please read the file BUGS for some ugly bugs. This especially
+applies to Solaris 2.x and Linux-Intel unix users.
Most of the items are marked in the code as well, with full explanation.
grep for TODO and ugh/ugr
-
- * move to OpusTeX fonts
-
+ * use properties for:
+ - Text_style
+ - default_octave
+ - plet?
+ - default_duration?
+ - default abbreviation
+ - Staff_sym size
+ - default tempo.
+ - font size
+ - bartypes (get rid of derived Span_bar_engravers)
+ - cadenza mode?
+ - MIDI instrument
+ - staff title
+
* check out egcs
* give Items/Spanners access to unbroken originals
* Spring_spacer:
- write a faster Spring_spacer ( without matrices if possible )
- relate energybound to linelen unitspace fontsize etc.
- -used fixed fp
+ - used fixed point fp
* \header
- revise lexer mode
- ABC?
- SMDL?
+ * robustification
+ - check write errors
+ - check read errors
+
+
+ * placement of bar-numbers
+
+******************
+
+ \score { <
+ \melodic { \id "Staff" ""; c'4 g'4 }
+ \lyric { \id "Lyric" ""; hello4 bye4 < a chord > }
+ \lyric { \id "Lyric" ""; bye4 hello4 }
+ \melodic { \id "Staff" ""; c'4 g'4 }
+ > }
+
+******************
+
* add to MIDI output:
- tempo change
- repeat
- dynamics etc.
* grace notes
- - adapt for multiple font sizes.
- make separate class for Grace_*_engravers
(which is at Voice_gravs level)
- make encapsulated spacing problems.
+ * On-demand loading of simple-engravers
+
* accidentals per Voice_group
* Convert all ref/bib stuff into BibTeX.
- Doc (C) stuff of sheet music
- a tutorial
- * separate Score_elem settings in user-settable (properties
- .. ) and non-user-settable part. Maybe use something like X-resources:
- "Staff=oboe*dir: 0", "Staff=*.Voice_group=solo*dir: 1"
-
* TeX spanners , use texbeam.cc as an example (smallish)
- Glissando
- trill
* Rewrite Stem, Beam and Rhythmic_grouping (hairy)
- [c8. c32 c32]
- - interbeam height
- - doc on Rhythmic_grouping
+ - doc on Rhythmic_grouping
- general shaving on Beam and Stem
- use plet grouping
- - abbreviations [c2 c2]1/2
- separate visual from rhythmic info even more
- beams over bars
-
- * Redo font
- - rename mf fonts to avoid conflicts with musixtex
- - use own fonts/update musixtex fonts/find older (c)-less fonts
+ * Redo fonts
+ - adapt for multiple font sizes.
- hack up mf sources for decent spacing info (and then
read AFM/TFM directly, for text too)
- - use MF to generate rules.
- - rewrite : make a metafont iso font
* Font support:
- mixed fontsizes
- beam stem showthrough, inter beam sizes (french vs german style)
* Collisions
- - bring Collision::do_pre_processing to haircutter
- left/right note balls should be handled by Collision:
< \multi 2; { \stem 1; <b c> } { <f as b> } >
* markers
- * abbreviations c4=16
INPUTLANGUAGE
* bracket (bracketplets)
- * \duration 8; e*2/3
-
* configure pitch_byte
* rest name configurable
* Raw request syntax
-
SMALLISH PROJECTS
* progress when creating MIDI elts.
* write Dynamic_line (to group dynamics horizontally)
- * write Rest_collision
-
- * use Real for y positions.
+ * use Real for all y positions.
* half-sharps, half-flats
< a-4 c-2 g-1 > < c-\ltoe e-\lheel >
- script-spacing
- slur parts as a script
- - stackparameterised scripts for fingering and footing:
+ - stack parameterised scripts for fingering and footing:
% toe to bheel four to five
% ^_u 4_5
* volta
-DOC
- * all errors
-
- * hacking-HOWTO
-
IDEAS
* scoping in Lexer: do general id- assignments in mudela.
*
- rewire acknowledge_element() logic with a process_acknowledged()
- - construct Stem upon receiving Notehead. Junk Stem_req
* pushgroup/popgroup
* whole head on ledger line
+ * multi threading?
+ - 1 thread per element/ 1 thread per line
+ - 1 thread per Translator
TOPLEVEL_MAJOR_VERSION = 0
TOPLEVEL_MINOR_VERSION = 1
-TOPLEVEL_PATCH_LEVEL = 12
+TOPLEVEL_PATCH_LEVEL = 13
# use to send patches, always empty for released version:
TOPLEVEL_MY_PATCH_LEVEL =
-$convert_mudela_version = "0.1.1";
+$convert_mudela_version = "0.1.2";
use Getopt::Long;
{
s/\\tempo (.*):(.*);/\\tempo $1 = $2;/g
}
+
+sub convert_0_1_2_to_0_1_3
+{
+ s/\\stem *(\\up|1) *;/\\stemup/g;
+ s/\\stem *(\\down|-1) *;/\\stemdown/g;
+ s/\\stem *0 *;/\\stemboth/g;
+ s/\\hshift ([^;]+) *;/\\property Voice.hshift = $1/g;
+}
+
+sub convert_0_1_4_to_0_1_5
+{
+ s/([<{]) *\\id "Piano" (.+);/\\type Grandstaff = $3 $1/;
+ s/([<{]) *\\id (.+) (.+);/\\type $2 = $3 $1/;
+}
+
###############################################################
sub last_conversion
. " -h, --help print this help\n"
. " -o, --output=FILE name output file\n"
. " -s, --show-rules print all known conversion rules\n"
- . " -t, --to=VERSION convert to version VERSION\n"
+ . " -t, --to=VERSION convert to version VERSION\n"
}
"0.0.59" => \&convert_0_0_58_to_0_0_59,
"0.0.60" => \&convert_0_0_59_to_0_0_60,
"0.0.61" => \&convert_0_0_60_to_0_0_61,
- "0.1.1" => \&convert_0_1_0_to_0_1_1
+ "0.1.1" => \&convert_0_1_0_to_0_1_1,
+ "0.1.2" => \&no_conv,
+ "0.1.3" => \&convert_0_1_2_to_0_1_3,
+ "0.1.4" => \&no_conv,
+ "0.1.5" => \&convert_0_1_4_to_0_1_5
);
use FileHandle;
use Getopt::Long;
+
my $lily_version;
my $footstr;
my $mw_id = "<!make_website!>";
my $id_str = "make-website 0.4";
-
my $TAR="tar";
my $MAKE="make";
local $base="lilypond/";
-local @examples=("twinkle-pop", "twinkle", "multi", "wohltemperirt",
+local @examples=("twinkle-pop", "twinkle", "multi", "wtk1-fugue2",
#"standchen-16",
#"standchen-20",
- "toccata-fuga-E", "scsii-menuetto",
+ "wtk1-prelude1",
+ "toccata-fuga-E",
+ "scsii-menuetto",
"cadenza", "scales",
#"rhythm",
"gallina");
-# rhythm, scales,
-
sub gen_html
{
{
print "generating HTML list\n";
open HTMLLIST, ">example_output.html";
+
print HTMLLIST "<html><body><TITLE>Rendered Examples</TITLE>\n
-These example files are taken from the LilyPond distribution.\n
-LilyPond currently only outputs TeX and MIDI. The pictures and\n
- PostScript files were generated using TeX, Ghostscript and some graphics tools. \n
-The GIF files have been scaled to eliminate aliasing.";
- foreach $a (@examples) {
- $name=$a;
- print HTMLLIST "<h1>example file: $name</h1>\n<XMP>\n";
+These example files are taken from the LilyPond distribution.
+LilyPond currently only outputs TeX and MIDI. The pictures and
+PostScript files were generated using TeX, Ghostscript and some
+graphics tools. The papersize used for these examples is A4. The GIF
+files have been scaled to eliminate aliasing.";
+
+
+
+ foreach $a (@examples)
+ {
+ $name=$a; print HTMLLIST "<h1>example file: $name</h1>\n<XMP>\n";
open IF, "$depth/input/$a.ly";
input_record_separator IF "%}";
+pl 29
+ - Dictionary_iter, Dictionary
+
pl 28
- String::bool ()
- GNU indentation.
D(i) = d;
}
L.try_set_band();
- assert ( L.band_i() == P.band_i ());
+ assert (L.band_i() == P.band_i ());
}
for (int i=0; i < dim(); i++)
{
int k=-s;
- for ( ; k < -band_size_i(); k++)
+ for (; k < -band_size_i(); k++)
f.elem (i,k + s) = 0.0;
- for ( ; k <= band_size_i()&& k<=s ; k++)
+ for (; k <= band_size_i()&& k<=s ; k++)
f.elem (i, k + s) = band_.elem (i,k+ band_size_i());
for (; k <= s; k++)
f.elem (i, k + s) =0.0;
Full_storage f (d, 2*band_size_i()+1);
for (int i=0; i < d && i < dim(); i++)
{
- for ( int k=0; k < 2*band_size_i(); k++)
+ for (int k=0; k < 2*band_size_i(); k++)
f.elem (i,k) = elem (i,k);
}
Diagonal_storage::mult_next (int &i, int &j) const
{
j++;
- if ( j < i - band_size_i())
+ if (j < i - band_size_i())
j = i- band_size_i();
- if ( j > i + band_size_i() || j >= dim ())
+ if (j > i + band_size_i() || j >= dim ())
{
i++;
j = 0 >? i - band_size_i();
Diagonal_storage::trans_next (int &i, int& j) const
{
i++;
- if ( i < j - band_size_i())
+ if (i < j - band_size_i())
i = j-band_size_i();
- if ( i >= dim() || i > j + band_size_i ())
+ if (i >= dim() || i > j + band_size_i ())
{
j++;
i = 0 >? j - band_size_i();
Real
Diagonal_storage::elem (int i, int j) const
{
- if (abs ( i-j) > band_size_i())
+ if (abs (i-j) > band_size_i())
return 0;
else
return band_.elem (i, j - i +band_size_i());
*/
assert (!nul_entry);
- if (abs ( i-j) > band_size_i())
+ if (abs (i-j) > band_size_i())
return nul_entry;
else
return band_.elem (i, j - i + band_size_i());
Diagonal_storage::try_right_multiply (Matrix_storage*dest,
const Matrix_storage*right) const
{
- if ( right->name() != Diagonal_storage::static_name ())
+ if (right->name() != Diagonal_storage::static_name ())
return false;
const Diagonal_storage* right_diag = (Diagonal_storage const*)right;
int stopk = i + band_size_i() <? n-1 <? j + band2;
int relk = startk + band_size_i() -i;
Real sum =0.0;
- for ( int k = startk; k <= stopk; k++)
+ for (int k = startk; k <= stopk; k++)
sum += band_.elem (i, relk++) * right_diag->elem (k, j);
dest->elem (i, j) = sum;
set_band_size (band_i);
resize_dim (stor_l->dim());
- for ( int i=0,j=0; mult_ok (i,j); mult_next (i,j))
+ for (int i=0,j=0; mult_ok (i,j); mult_next (i,j))
band_.elem (i, j + band_i -i) = stor_l->elem (i,j);
}
t.concat (edge_in_l_arr_);
#endif
- while ( edge_out_l_arr_.size())
+ while (edge_out_l_arr_.size())
remove_edge_out_idx (0);
while (edge_in_l_arr_.size())
{
int i = pretty_str.index_i ('(');
if (i>=0)
- pretty_str = pretty_str.left_str (i);
+ pretty_str = pretty_str.left_str (i);
int l = pretty_str.index_last_i (' '); // strip until last ' '
if (l>=0)
- pretty_str = pretty_str.nomid_str (0,l+1);
+ pretty_str = pretty_str.nomid_str (0,l+1);
return pretty_str;
}
{
int l=pret.index_last_i (':')-1;
if (l>=0)
- pret = pret.left_str (l);
+ pret = pret.left_str (l);
return pret;
}
Dstream::identify_as (String name)
{
if (!os_l_)
- return *this;
+ return *this;
String mem (strip_pretty (name));
String cl (strip_member (mem));
String idx = cl;
if (silent_assoc_p_->elt_b (mem))
- idx = mem;
+ idx = mem;
else if (silent_assoc_p_->elt_b (cl))
- idx = cl;
+ idx = cl;
else
{
- (*silent_assoc_p_)[idx] = false;
+ (*silent_assoc_p_)[idx] = false;
}
local_silence_b_ = (*silent_assoc_p_)[idx];
if (current_classname_str_ != idx && !local_silence_b_)
{
- current_classname_str_=idx;
- if (!(*silent_assoc_p_)["Dstream"])
- *os_l_ << "[" << current_classname_str_ << ":]"; // messy.
+ current_classname_str_=idx;
+ if (!(*silent_assoc_p_)["Dstream"])
+ *os_l_ << "[" << current_classname_str_ << ":]"; // messy.
}
return *this;
}
Dstream::silence (String s)
{
if (!silent_assoc_p_->elt_b (s))
- return false;
+ return false;
return (*silent_assoc_p_)[s];
}
Dstream::output (String s)
{
if (local_silence_b_|| !os_l_)
- return ;
+ return ;
for (char const *cp = s ; *cp; cp++)
- switch (*cp)
- {
- case '{':
- case '[':
- case '(': indent_level_i_ += INDTAB;
- *os_l_ << *cp;
- break;
+ switch (*cp)
+ {
+ case '{':
+ case '[':
+ case '(': indent_level_i_ += INDTAB;
+ *os_l_ << *cp;
+ break;
- case ')':
- case ']':
- case '}':
- indent_level_i_ -= INDTAB;
- *os_l_ << *cp ;
+ case ')':
+ case ']':
+ case '}':
+ indent_level_i_ -= INDTAB;
+ *os_l_ << *cp ;
- assert (indent_level_i_>=0) ;
- break;
+ assert (indent_level_i_>=0) ;
+ break;
- case '\n':
- *os_l_ << '\n' << String (' ', indent_level_i_) << flush;
- break;
- default:
- *os_l_ << *cp;
- break;
- }
+ case '\n':
+ *os_l_ << '\n' << String (' ', indent_level_i_) << flush;
+ break;
+ default:
+ *os_l_ << *cp;
+ break;
+ }
return ;
}
silent_assoc_p_ = new Assoc<String,bool>;
indent_level_i_ = 0;
if (!os_l_)
- return;
+ return;
char const * fn =cfg_nm ? cfg_nm : ".dstreamrc";
{
- ifstream ifs (fn); // can't open
- if (!ifs)
- return;
- }
+ ifstream ifs (fn); // can't open
+ if (!ifs)
+ return;
+ }
Text_db cfg (fn);
while (! cfg.eof()){
- Text_record r (cfg++);
- if (r.size() != 2)
- {
- r.message ("not enough fields in Dstream init.");
- continue;
- }
- (*silent_assoc_p_)[r[0]] = (bool)(int)(Scalar (r[1]));
- }
+ Text_record r (cfg++);
+ if (r.size() != 2)
+ {
+ r.message ("not enough fields in Dstream init.");
+ continue;
+ }
+ (*silent_assoc_p_)[r[0]] = (bool)(int)(Scalar (r[1]));
+ }
}
{
for (Assoc_iter<String, bool> i (*silent_assoc_p_); i.ok(); i++)
{
- i.val() = 0;
+ i.val() = false;
}
}
#include "dstream.hh"
bool flower_check_debug=false;
-ofstream null_device ( "/dev/null");
+ofstream null_device ("/dev/null");
Dstream default_flower_stream (&null_device ,"/dev/null");
Dstream *flower_dstream = &default_flower_stream;
Full_storage::Full_storage (Matrix_storage*m)
{
set_size (m->rows(), m->cols ());
- if ( !m->is_type_b ( Full_storage::static_name()))
+ if (!m->is_type_b (Full_storage::static_name()))
for (int i=0; i<height_i_; i++)
for (int j=0; j<width_i_; j++)
els_p_p_[i][j]=0.0;
int i= find (key);
arr[i].free = true;
}
- void
- add (K key, V val) {
+ void add (K key, V val) {
int i = find_creat (key);
arr[i].val = val;
}
/// return current T
T& operator *() { return thing(); }
operator T() { return thing(); }
- Cursor<T> operator =( const Cursor<T>& c);
+ Cursor<T> operator =(const Cursor<T>& c);
/// make cursor with #no# items back
- Cursor<T> operator -( int no) const;
+ Cursor<T> operator -(int no) const;
/// make cursor with #no# items further
- Cursor<T> operator +( int no) const;
+ Cursor<T> operator +(int no) const;
int operator -(Cursor<T> op) const;
Cursor<T> operator -=(int);
Cursor<T> operator +=(int);
/// move one up.
void previous();
/// return current and move one down
- Cursor<T> operator ++( int);
+ Cursor<T> operator ++(int);
/// return current and move one up
- Cursor<T> operator --( int);
+ Cursor<T> operator --(int);
/// point to link?
bool ok() const;
Cursor<T>::Cursor (const List<T>& list, Link<T>* pointer) :
list_((List<T>&) list)
{
- if ( list.size())
+ if (list.size())
pointer_ = pointer ? pointer : list.top_;
else
pointer_ = pointer;
template<class T>
inline
Cursor<T>::Cursor (const Cursor<T>& cursor) :
- list_( cursor.list_)
+ list_(cursor.list_)
{
pointer_ = cursor.pointer_;
}
template<class T>
Cursor<T>
-Cursor<T>::operator =( const Cursor<T>& c)
+Cursor<T>::operator =(const Cursor<T>& c)
{
assert (&list_ == &c.list_);
pointer_ = c.pointer_;
inline bool
Cursor<T>::backward() const
{
- return ( pointer_ != 0);
+ return (pointer_ != 0);
}
template<class T>
inline bool
Cursor<T>::forward() const
{
- return ( pointer_ != 0);
+ return (pointer_ != 0);
}
template<class T>
inline bool
Cursor<T>::ok() const
{
- return ( pointer_ != 0);
+ return (pointer_ != 0);
}
template<class T>
inline void
template<class T>
inline Cursor<T>
-Cursor<T>::operator ++( int)
+Cursor<T>::operator ++(int)
{
Cursor<T> r (*this);
next();
template<class T>
inline Cursor<T>
-Cursor<T>::operator --( int)
+Cursor<T>::operator --(int)
{
Cursor<T> r (*this);
previous();
Cursor<T>::backspace()
{
Cursor<T> c (*this);
- if ( c.ok())
+ if (c.ok())
c--;
list_.remove (*this);
}
Cursor<T>::del()
{
Cursor<T> c (*this);
- if ( c.ok())
+ if (c.ok())
c++;
list_.remove (*this);
*this = c;
template<class T>
Cursor<T>
-Cursor<T>::operator -=( int j)
+Cursor<T>::operator -=(int j)
{
while (j--)
(*this)--;
}
template<class T>
Cursor<T>
-Cursor<T>::operator +=( int j)
+Cursor<T>::operator +=(int j)
{
while (j++)
(*this)++;
template<class T>
Cursor<T>
-Cursor<T>::operator +( int i) const
+Cursor<T>::operator +(int i) const
{
Cursor<T> r = *this;
template<class T>
Cursor<T>
-Cursor<T>::operator -( int i) const
+Cursor<T>::operator -(int i) const
{
Cursor<T> r = *this;
if (i<0)
--- /dev/null
+/*
+ dictionary-iter.hh -- declare
+
+ source file of the Flower Library
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef DICTIONARY_ITER_HH
+#define DICTIONARY_ITER_HH
+
+#include "string.hh"
+#include "assoc-iter.hh"
+#include "dictionary.hh"
+
+template<class V>
+class Dictionary_iter : public Assoc_iter<String, V>
+{
+public:
+ Dictionary_iter (Dictionary<V> const &d)
+ : Assoc_iter<String, V> (d)
+ {
+ }
+};
+
+#endif // DICTIONARY_ITER_HH
--- /dev/null
+/*
+ dictionary.hh -- declare Dictionary
+
+ source file of the Flower Library
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef DICTIONARY_HH
+#define DICTIONARY_HH
+
+#include "string.hh"
+#include "assoc.hh"
+
+template<class T>
+class Dictionary : public Assoc<String, T>
+{
+public:
+
+};
+
+#endif // DICTIONARY_HH
extern Dstream *flower_dstream;
extern bool flower_check_debug;
#ifdef NPRINT
-#define fdebug if ( 0) *flower_dstream
+#define fdebug if (0) *flower_dstream
#else
#define fdebug if (flower_check_debug) \
flower_dstream->identify_as (__PRETTY_FUNCTION__)
char const * flower_version_sz();
// what the F*** is "int" ?
-// depreciate int, long, etc., use i32, i64, remember: linux-16/linux-64 ?
+// deprecate int, long, etc., use i32, i64, remember: linux-16/linux-64 ?
/// (i32)
typedef int i32;
/// (i64)
template<class T> struct Array;
template<class T> struct sstack;
template<class T,class K> struct Assoc;
+template<class T> struct Dictionary;
+template<class T> struct Dictionary_iter;
template<class T> struct List;
template<class T> struct Link_list;
template<class T> struct Pointer_list;
struct String;
struct Matrix_storage;
struct Vector ;
+struct Rational;
struct Text_stream;
struct Data_file;
struct Text_db;
struct Scalar;
typedef unsigned char Byte;
+
+
#endif // FPROTO_HH
template<class T>
inline
Link<T>::Link (const T& thing) :
- thing_( thing)
+ thing_(thing)
{
previous_ = next_ = 0;
}
template<class T>
inline
Link<T>::Link (Link<T>* previous, Link<T>* next, const T& thing) :
- thing_( thing)
+ thing_(thing)
{
previous_ = previous;
next_ = next;
Link<T>::add (const T& thing)
{
- Link<T>* l = new Link<T>( this, next_, thing);
- if ( next_)
+ Link<T>* l = new Link<T>(this, next_, thing);
+ if (next_)
next_->previous_ = l;
next_ = l;
}
inline void
Link<T>::insert (const T& thing)
{
- // Link<T>* l = new Link<T>( next_, this, thing);
+ // Link<T>* l = new Link<T>(next_, this, thing);
// bugfix hwn 16/9/96
- Link<T>* l = new Link<T>( previous_, this, thing);
- if ( previous_)
+ Link<T>* l = new Link<T>(previous_, this, thing);
+ if (previous_)
previous_->next_ = l;
previous_ = l;
}
inline void
Link<T>::remove (List<T> &l)
{
- if ( previous_)
+ if (previous_)
previous_->next_ = next_;
else
l.top_ = next_;
- if ( next_)
+ if (next_)
next_->previous_ = previous_;
else
l.bottom_ = previous_;
{\bf note:}
retrieving "invalid" cursors, i.e.
#top()/bottom ()# from empty list, #find ()# without success,
- results in a nonvalid Cursor ( #!ok()#)
+ results in a nonvalid Cursor (#!ok()#)
INVARIANTEN!
-// -*-c++-*-
+/*
+ list.icc -- implement List inline functions
-#ifndef LIST_INL
-#define LIST_INL
+ source file of the Flower Library
+
+ (c) 1996,1997
+ Jan Nieuwenhuizen <jan@digicash.com>
+ Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef LIST_ICC
+#define LIST_ICC
template<class T>
inline
inline void
List<T>::remove (Cursor<T> me)
{
- if ( me.ok())
+ if (me.ok())
{
Link<T> *lp = me.pointer();
lp->remove (*this);
inline Cursor<T>
List<T>::top() const
{
- return Cursor<T>( *this, top_);
+ return Cursor<T>(*this, top_);
}
inline Cursor<T>
List<T>::bottom() const
{
- return Cursor<T>( *this, bottom_);
+ return Cursor<T>(*this, bottom_);
}
#endif
+
List<T>::add (T const & thing, Cursor<T> &after_me)
{
if (!size_) { // not much choice if list is empty
- bottom_ = top_ = new Link<T>( thing);
+ bottom_ = top_ = new Link<T>(thing);
if (!after_me.ok())
after_me = bottom();
}
{
if (!size_)
{
- bottom_ = top_ = new Link<T>( thing);
+ bottom_ = top_ = new Link<T>(thing);
if (!before_me.ok())
before_me = top();
--- /dev/null
+/*
+ scalar.hh -- declare
+
+ source file of the Flower Library
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef SCALAR_HH
+#define SCALAR_HH
+
+struct Scalar {
+ String str_;
+ // Real real_;
+ int int_;
+ // Rational rational_;
+
+
+ struct typebits {
+ string_bit: 1;
+ int_bit:1;
+ };
+private:
+
+
+ // operator Real();
+ operator int();
+
+ /** perl -like string to bool conversion.
+ */
+ // operator bool() const;
+
+ //Scalar (Real r) : String (r) {}
+ Scalar (int i) : String (i) {}
+ // Scalar (char c) : String (c) {}
+ Scalar (char const *c) : String (c) {}
+ Scalar (String s):String (s) {}
+ //Scalar (Rational);
+ static Scalar undefined ();
+};
+
+#endif // SCALAR_HH
PCursor<T> operator-=(int i) { return Cursor<void*>::operator-=(i); }
PCursor<T> operator -(int no) const { return Cursor<void*>::operator-(no);}
int operator -(PCursor<T> op) const { return Cursor<void*>::operator-(op);}
- PCursor<T> operator +( int no) const {return Cursor<void*>::operator+(no);} PCursor (const Link_list<T> & l) : Cursor<void*> (l) {}
+ PCursor<T> operator +(int no) const {return Cursor<void*>::operator+(no);} PCursor (const Link_list<T> & l) : Cursor<void*> (l) {}
PCursor() : Cursor<void*> () {}
PCursor (const Cursor<void*>& cursor) : Cursor<void*>(cursor) { }
void* vptr() const { return *((Cursor<void*> &) *this); }
int mini=2;
int lasti=1;
- while ( mini < size()) {
+ while (mini < size()) {
if (compare (elt (mini + 1), elt (mini)) <0)
mini++;
if (compare (last,elt (mini)) < 0)
/*
- rational.hh -- declare
+ rational.hh -- declare rational helpers
source file of the Flower Library
/*
- scalar.hh -- part of LilyPond
+ scalar.hh -- declare Scalar
- (c) 1996 Han-Wen Nienhuys
+ source file of the Flower Library
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
+
#ifndef SCALAR_HH
#define SCALAR_HH
+
#include "string.hh"
#include "real.hh"
/// Perl -like scalar type.
struct Scalar : public String {
- Scalar (Real r) : String (r) {}
- Scalar (int i) : String (i) {}
- Scalar (char c) : String (c) {}
- Scalar (char const *c) : String (c) {}
- Scalar (String s):String (s) {}
- Scalar (Rational);
- operator Rational();
- Scalar() {}
- bool isnum();
- operator Real();
- operator int();
-
- /** perl -like string to bool conversion.
- */
- operator bool() const;
+ Scalar (Real r) : String (r) {}
+ Scalar (int i) : String (i) {}
+ Scalar (char c) : String (c) {}
+ Scalar (char const *c) : String (c) {}
+ Scalar (String s):String (s) {}
+ Scalar (Rational);
+ operator Rational();
+ Scalar() {}
+ bool isnum();
+ operator Real();
+ operator int();
+ /** perl -like string to bool conversion.
+ */
+ operator bool() const;
};
#endif // SCALAR_HH
/// concatenation.
void append (Byte const* byte_C, int length_i);
- void operator += ( char const* ch_C);
+ void operator += (char const* ch_C);
char const* ch_C() const;
if (j > maxlen)
{
Byte *p = new Byte[j + 1];
- memcpy (p, data_byte_p_, ( maxlen <? length_i_) + 1 );
+ memcpy (p, data_byte_p_, (maxlen <? length_i_) + 1 );
maxlen = j;
delete[] data_byte_p_;
data_byte_p_ = p;
INLINE
void
-String_data::operator += ( char const* ch_C)
+String_data::operator += (char const* ch_C)
{
append ((Byte const*)ch_C, strlen (ch_C) );
}
String_data::is_binary_bo() const
{
// return !memchr (data_byte_p_, length_i_, 0);
- return ( (int)strlen ((char const*)data_byte_p_) != length_i_ );
+ return ((int)strlen ((char const*)data_byte_p_) != length_i_ );
}
INLINE Byte&
String (char c, int n = 1);
String (int i , char const *fmt=0);
- String ( double f , char const* fmt =0);
+ String (double f , char const* fmt =0);
/// 'true' or 'false'
String (bool);
/// deprecated; use ch_C()
operator char const*() const { return ch_C(); }
- String &operator =( String const & source);
+ String &operator =(String const & source);
/// concatenate s
void operator += (char const* s) { strh_ += s; }
void operator += (String s);
- operator bool ()
+ /// is the string empty?
+ operator bool () const
{
return length_i ();
}
void append (String);
void prepend (String);
- char operator []( int n) const { return strh_[n]; }
+ char operator [](int n) const { return strh_[n]; }
/// return n leftmost chars
String left_str (int n) const;
}
inline ostream &
-operator << ( ostream& os, String d)
+operator << (ostream& os, String d)
{
d.print_on (os);
return os;
size_--;
}
// quicksort.
- void sort (int (*compare)( T const&,T const&),
+ void sort (int (*compare)(T const&,T const&),
int lower = -1, int upper = -1) {
if (lower < 0) {
lower = 0 ;
}
inline Vector
-operator*( Real a,Vector v) {
+operator*(Real a,Vector v) {
v *= a;
return v;
}
return 0;
if (argument_C[1] == '-') {// what to do with "command -- bla"
- if ( argument_C[2])
+ if (argument_C[2])
return parselong();
else
return 0;
Diagonal_storage *L = (Diagonal_storage*)dat;
Diagonal_storage* R = (Diagonal_storage*) right;
- if ( R->band_size_i() > L->band_size_i ())
+ if (R->band_size_i() > L->band_size_i ())
{
L->set_band_size (R->band_size_i());
}
Matrix_storage::set_product_result (Matrix_storage*&dest,
Matrix_storage*left, Matrix_storage*right)
{
- if ( left->name() == Diagonal_storage::static_name ()
+ if (left->name() == Diagonal_storage::static_name ()
&& right->name() == Diagonal_storage::static_name ())
{
Diagonal_storage *L = (Diagonal_storage*)left;
}
}
- if ( dest && dest->name() == Full_storage::static_name ())
+ if (dest && dest->name() == Full_storage::static_name ())
{
dest->set_size (left->rows(), right->cols ());
}
void
Matrix::set_full() const
{
- if ( dat->name() != Full_storage::static_name ())
+ if (dat->name() != Full_storage::static_name ())
{
Matrix_storage::set_full (((Matrix*)this)->dat);
}
return;
int b = band_i();
- if ( b > dim()/2)
+ if (b > dim()/2)
return;
// it only looks constant
Matrix*self = (Matrix*)this;
int
Matrix::band_i() const
{
- if ( band_b())
+ if (band_b())
{
Diagonal_storage const * diag = (Diagonal_storage*) dat;
return diag->band_size_i();
int starty = dim();
while (starty >= 0)
{
- for ( int i = starty, j = 0; i < dim(); i++, j++)
+ for (int i = starty, j = 0; i < dim(); i++, j++)
if (dat->elem (i,j))
goto gotcha;
- for ( int i=0, j = starty; j < dim(); i++,j++)
+ for (int i=0, j = starty; j < dim(); i++,j++)
if (dat->elem (i,j))
goto gotcha;
starty --;
--- /dev/null
+/*
+ scalar.cc -- implement
+
+ source file of the Flower Library
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
{
fdebug << "looking for " << nm << ": ";
- if ( !nm.length_i() || ( nm == "-") )
+ if (!nm.length_i() || (nm == "-") )
return nm;
for (int i=0; i < size(); i++)
{
String path = elem(i);
- if ( path.length_i() )
+ if (path.length_i() )
path += "/";
path += nm;
+/*
+ scalar.cc -- implement
+
+ source file of the Flower Library
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
#include <assert.h>
#include <stdio.h>
#include "scalar.hh"
{
int p = index_i ('/');
if (p == -1)
- return int (*this);
+ return int (*this);
String s2 = right_str (len()-p-1);
String s1 = left_str (p);
int conv = false;
if (len())
{
- long l =0;
- conv = sscanf (strh_.ch_C(), "%ld", &l);
+ long l =0;
+ conv = sscanf (strh_.ch_C(), "%ld", &l);
}
return len() && conv;
}
Scalar::operator int()
{
+ if (!length_i ())
+ return 0; // ugh
+
assert (isnum());
return value_i();
}
Scalar::operator bool() const
{
if (!len())
- return false;
+ return false;
if (*this == "0")
- return false;
+ return false;
String u (*this);
- if ( u.upper_str() == "FALSE")
- return false;
+ if (u.upper_str() == "FALSE")
+ return false;
return true;
}
{
String str;
Byte const* byte_C = bin_str.byte_C();
- for ( int i = 0; i < bin_str.length_i(); i++)
+ for (int i = 0; i < bin_str.length_i(); i++)
{
str += (char)nibble2hex_byte (*byte_C >> 4);
str += (char)nibble2hex_byte (*byte_C++);
assert (bin_str.length_i() <= (int)sizeof(unsigned));
unsigned result_u = 0;
- for ( int i = 0; i < bin_str.length_i(); i++)
+ for (int i = 0; i < bin_str.length_i(); i++)
{
result_u <<= 8;
result_u += (Byte)bin_str[ i ];
int
String_convert::dec2_i (String dec_str)
{
- if ( !dec_str.length_i())
+ if (!dec_str.length_i())
return 0;
long l = 0;
double
String_convert::dec2_f (String dec_str)
{
- if ( !dec_str.length_i())
+ if (!dec_str.length_i())
return 0;
double d = 0;
int conv = sscanf (dec_str.ch_C(), "%lf", &d);
int
String_convert::hex2bin_i (String hex_str, String& bin_str_r)
{
- if ( hex_str.length_i() % 2)
+ if (hex_str.length_i() % 2)
hex_str = "0" + hex_str;
bin_str_r = "";
Byte const* byte_C= hex_str.byte_C();
int i = 0;
- while ( i < hex_str.length_i())
+ while (i < hex_str.length_i())
{
int high_i = hex2nibble_i (*byte_C++);
int low_i = hex2nibble_i (*byte_C++);
- if ( high_i < 0 || low_i < 0)
+ if (high_i < 0 || low_i < 0)
return 1; // illegal char
- bin_str_r += String ((char)( high_i << 4 | low_i), 1 );
+ bin_str_r += String ((char)(high_i << 4 | low_i), 1 );
i += 2;
}
return 0;
int
String_convert::hex2nibble_i (Byte byte)
{
- if ( byte >= '0' && byte <= '9')
+ if (byte >= '0' && byte <= '9')
return byte - '0';
- if ( byte >= 'A' && byte <= 'F')
+ if (byte >= 'A' && byte <= 'F')
return byte - 'A' + 10;
- if ( byte >= 'a' && byte <= 'f')
+ if (byte >= 'a' && byte <= 'f')
return byte - 'a' + 10;
return -1;
}
String_convert::i2dec_str (int i, int length_i, char ch)
{
char fill_ch = ch;
- if ( fill_ch)
+ if (fill_ch)
fill_ch = '0';
// ugh
String_convert::u2hex_str (unsigned u, int length_i, char fill_ch)
{
String str;
- if ( !u)
+ if (!u)
str = "0";
#if 1 // both go...
- while ( u)
+ while (u)
{
- str = String ((char)( ( u % 16)["0123456789abcdef"] ) ) + str;
+ str = String ((char)((u % 16)["0123456789abcdef"] ) ) + str;
u /= 16;
}
#else
#endif
str = String (fill_ch, length_i - str.length_i()) + str;
- while ( ( str.length_i() > length_i) && ( str[ 0 ] == 'f' ) )
+ while ((str.length_i() > length_i) && (str[ 0 ] == 'f' ) )
str = str.mid_str (2, INT_MAX);
return str;
Byte
String_convert::nibble2hex_byte (Byte byte)
{
- if ( ( byte & 0x0f) <= 9 )
- return ( byte & 0x0f) + '0';
+ if ((byte & 0x0f) <= 9 )
+ return (byte & 0x0f) + '0';
else
- return ( byte & 0x0f) - 10 + 'a';
+ return (byte & 0x0f) - 10 + 'a';
}
/**
Convert an integer to a string
if (!strh_.is_binary_bo())
os << ch_C();
else
- for ( int i = 0; i < length_i(); i++)
+ for (int i = 0; i < length_i(); i++)
os << (Byte)(*this)[ i ];
}
\f
{
Byte const* p1 = s1.byte_C();
Byte const* p2 = s2.byte_C();
- if ( p1 == p2)
+ if (p1 == p2)
return 0;
int i1 = s1.length_i();
int
String::index_last_i (char const c) const
{
- if ( !length_i())
+ if (!length_i())
return -1;
char const* me = strh_.ch_C();
char const* p = memrchr (me, length_i(), c);
- if ( p)
+ if (p)
return p - me;
return -1;
}
{
assert (false); // broken
int length = strlen (string); // ugrh
- if ( !length_i() || !length)
+ if (!length_i() || !length)
return -1;
int next_i = index_i (string);
- if ( next_i == -1)
+ if (next_i == -1)
return -1;
int index_i = 0;
{
char const* me = strh_.ch_C();
char const* p = (char const *) memchr (me,c, length_i());
- if ( p)
+ if (p)
return p - me;
return -1;
}
char const* p = (char const *) memmem (
me, length_i(), searchfor.ch_C(), searchfor.length_i ());
- if ( p)
+ if (p)
return p - me;
else
return -1;
String::index_any_i (String set) const
{
int n = length_i();
- if ( !n)
+ if (!n)
return -1;
void const * me_l = (void const *) strh_.ch_C();
if (n > length_i())
return *this;
- if ( n < 1)
+ if (n < 1)
return "";
return String (strh_.byte_C() + length_i() - n, n);
String
String::nomid_str (int index_i, int n) const
{
- if ( index_i < 0)
+ if (index_i < 0)
{
n += index_i;
index_i = 0;
}
- if ( n <= 0)
+ if (n <= 0)
return *this;
return
index_i=0;
}
- if ( !length_i() || ( index_i < 0) || ( index_i >= length_i () ) || ( n < 1 ) )
+ if (!length_i() || (index_i < 0) || (index_i >= length_i () ) || (n < 1 ) )
return String();
- if ( ( n > length_i()) || ( index_i + n > length_i () ) )
+ if ((n > length_i()) || (index_i + n > length_i () ) )
n = length_i() - index_i;
return String (byte_C() + index_i, n);
cout << "up: " << str.upper_str() << " down: " << str.lower_str ()<<endl;
- if ( str == String ("") )
+ if (str == String ("") )
cout << str << " is empty" << endl;
else
cout << str << " is not empty"<<endl;
String fn = "";
- if ( fn == "")
+ if (fn == "")
cout << fn << " is empty" << endl;
else
assert (false);
% setup for Request->Element conversion. Guru-only
%
-staff_engraver = \requesttranslator {
- Engraver "Engraver_group_engraver"
- \alias "Staff";
- \consists "Bar_engraver";
- \consists "Clef_engraver";
- \consists "Key_engraver";
- \consists "Meter_engraver";
- \consists "Local_key_engraver";
- \consists "Staff_sym_engraver";
- \consists "Collision_engraver";
- \consists "Rest_collision_engraver";
-
- \consists "Line_group_engraver";
- \contains \requesttranslator {
- Engraver "Voice_group_engravers"
- \alias "Voice_group";
- \consists "Dynamic_engraver";
- \consists "Stem_engraver";
- \consists "Beam_engraver";
- \consists "Script_engraver";
- \consists "Note_column_engraver";
- \consists "Slur_engraver";
- \contains \requesttranslator {
- Engraver "Engraver_group_engraver"
- \alias "Voice";
- \consists "Note_head_engraver" ;
- \consists "Tie_engraver";
- }
- }
- }
-
-piano_staff_engraver = \requesttranslator {
- Engraver "Engraver_group_engraver"
- \alias "Piano";
- \alias "Hoenoemjedat";
+Staff = \translator {
+ \type "Engraver_group_engraver";
+ defaultclef = violin;
+
+ \consists "Bar_engraver";
+ \consists "Clef_engraver";
+ \consists "Key_engraver";
+ \consists "Meter_engraver";
+ \consists "Local_key_engraver";
+ \consists "Staff_sym_engraver";
+ \consists "Collision_engraver";
+ \consists "Rest_collision_engraver";
+
+ \consists "Line_group_engraver";
+ \accepts "Voice";
+}
+
+Voice = \translator {
+ \type "Engraver_group_engraver";
+ \consists "Dynamic_engraver";
+ \consists "Rest_engraver";
+ \consists "Stem_engraver";
+ \consists "Beam_engraver";
+ \consists "Abbreviation_beam_engraver";
+ \consists "Script_engraver";
+ \consists "Rhythmic_column_engraver";
+ \consists "Slur_engraver";
+ \accepts "Thread";
+}
+
+Thread = \translator {
+ \type "Engraver_group_engraver";
+ \consists "Skip_req_swallow_translator";
+ \consists "Note_head_engraver" ;
+ \consists "Tie_engraver";
+}
+
+Grandstaff = \translator {
+ \type "Engraver_group_engraver";
+
\consists "Span_bar_engraver";
\consists "Vertical_align_engraver";
\consists "Piano_bar_engraver";
% This should come last
\consists "Line_group_engraver";
- \contains\requesttranslator { \staff_engraver }
+ \accepts "Staff";
}
-staff_group_engraver = \requesttranslator {
- Engraver "Engraver_group_engraver"
- \alias "Staff_group";
+Staff_group = \translator {
+ \type "Engraver_group_engraver";
\consists "Span_bar_engraver";
\consists "Vertical_align_engraver";
\consists "Line_group_engraver";
- \contains\requesttranslator { \staff_engraver }
+ \accepts "Staff";
+ \accepts "Grandstaff";
}
-lyric_engraver = \requesttranslator {
- Engraver "Engraver_group_engraver"
- \alias "Lyric";
+Lyric_voice =
+\translator{
+ \type "Engraver_group_engraver";
+
+ \consists "Lyric_engraver";
+ \consists "Line_group_engraver";
+ \consists "Swallow_engraver";
+}
- \contains\requesttranslator{
- Engraver "Engraver_group_engraver"
- \consists "Lyric_engraver";
- \consists "Line_group_engraver";
- \consists "Swallow_engraver";
- }
+Lyrics = \translator {
+ \type "Engraver_group_engraver";
\consists "Vertical_align_engraver";
\consists "Line_group_engraver";
+ \accepts "Lyric_voice";
}
-orchestral_score_translator = \requesttranslator {
- Engraver Score_engraver
- \alias "Score";
+Score = \translator {
+ \type Score_engraver;
\consists "Timing_engraver";
\consists "Bar_column_engraver";
- \consists "Bar_number_grav";
+ \consists "Bar_number_engraver";
\consists "Bar_align_engraver";
\consists "Clef_align_engraver";
\consists "Span_score_bar_engraver";
- \contains \requesttranslator { \staff_group_engraver }
- \contains \requesttranslator { \lyric_engraver }
- \contains \requesttranslator { \piano_staff_engraver }
+ \accepts "Staff_group";
+ \accepts "Staff";
+ \accepts "Lyrics";
+ \accepts "Grandstaff";
}
-stupid_engraver = \requesttranslator {
- Engraver Score_engraver
+Stupid_score = \translator {
+ \type Score_engraver;
\consists "Staff_sym_engraver";
}
-\include "performer.ly"
default_midi = \midi {
\tempo 4=60;
- \requesttranslator{ \default_midi_perf }
+ \include "performer.ly"
}
\include "table16.ly"
+%{
+
+TODO make this somehow parametric. for example the linewidth was
+chosen to look good on A4 paper. This probably looks less good on US
+paper sizes.
+
+
+%}
paper_sixteen = \paper {
- linewidth = 15.0 \cm;
+ linewidth = 15.5 \cm;
rule_thickness = 0.4\pt;
bar_size = 16.0 \pt;
interline = 4.\pt;
gourlay_maxmeasures = 14.;
castingalgorithm = \Gourlay;
\symboltables { \table_sixteen }
- \requesttranslator { \orchestral_score_translator }
+ \include "engraver.ly"
}
arithmetic_multiplier = 6.\pt;
%
- interbeam = 2.667\pt;
+ interbeam = 3.333\pt;
gourlay_energybound = 100000.;
gourlay_maxmeasures = 12.;
castingalgorithm = \Gourlay;
\symboltables { \table_twenty }
- \requesttranslator { \orchestral_score_translator }
+\include "engraver.ly"
}
%
% setup for Request->Element conversion. Guru-only
%
-staff_perf = \requesttranslator {
- Performer "Staff_performer"
- \alias "Staff";
-
- \contains\requesttranslator{
- Performer "Performer_group_performer"
- \alias "Voice_group";
- \contains\requesttranslator{
- Performer "Performer_group_performer"
- \consists "Note_performer";
- }
- }
- \consists "Key_performer";
- \consists "Meter_performer";
- }
-
-default_midi_perf = \requesttranslator {
- Performer "Score_performer"
- \alias "Score";
-
-% \consists "Tempo_performer";
-
- \contains \requesttranslator{ \staff_perf }
- \contains\requesttranslator{
- Performer "Performer_group_performer"
- \alias "Piano";
- \contains\requesttranslator{\staff_perf}
- }
- \contains\requesttranslator{
- Performer "Staff_performer"
- \alias "Lyric";
- \contains\requesttranslator {
- Performer "Performer_group_performer"
- \contains\requesttranslator{
- Performer "Performer_group_performer"
- \consists "Lyric_performer";
- }
- }
- \consists "Meter_performer";
- }
+
+Staff = \translator {
+ \type "Staff_performer";
+ \accepts Voice;
+ \consists "Key_performer";
+ \consists "Meter_performer";
+}
+
+
+Thread =\translator
+{
+ \type "Performer_group_performer";
+ \consists "Note_performer";
+}
+
+Voice = \translator
+{
+ \type "Performer_group_performer";
+ \accepts Thread;
+}
+
+Grandstaff = \translator
+{
+ \type "Performer_group_performer";
+ \accepts Staff;
+}
+
+Lyric_voice = \translator {
+ \type "Performer_group_performer";
+ \consists "Lyric_performer";
+}
+
+
+Lyrics = \translator {
+ \type "Staff_performer";
+ \accepts Lyric_voice;
+ \consists "Meter_performer";
+}
+
+Score = \translator {
+ \type "Score_performer";
+ instrument = piano;
+ \accepts Staff;
+ \accepts Grandstaff;
+ \accepts Lyrics;
\consists "Swallow_performer";
}
% symbol.ly
-\version "0.1.1";
+\version "0.1.5";
breve = \duration { -1 0 }
longa = \duration { -2 0 }
\include "dynamic.ly"
\include "dutch.ly"
\include "script.ly"
-\include "engraver.ly"
+
Gourlay = 1.0
Wordwrap = 0.0
right = 1
up = 1
down = -1
-
+center=0
+
+
+stemup = {
+ \skip 1*0;
+ % Stupid hack to make < { \stemup } > work
+% \property Thread.cocktailbar = 1
+ \property Voice.ydirection = \up
+ }
+stemboth= {
+ \skip 1*0;
+ % \property Thread.cocktailbar = 0
+ \property Voice.ydirection = \center
+}
+stemdown = {
+ \skip 1*0;
+ %\property Thread.cocktailbar = -1
+ \property Voice.ydirection = \down
+}
}
"balls" = \table {
+ "-2" "\longaball" 0.0\pt 6.0\pt -2.0\pt 2.0\pt
"-1" "\breveball" 0.0\pt 6.0\pt -2.0\pt 2.0\pt
"0" "\wholeball" 0.0\pt 6.0\pt -2.0\pt 2.0\pt
"1" "\halfball" 0.0\pt 5.0\pt -2.0\pt 2.0\pt
}
"rests" = \table {
+ "-2o" "\longarest" 0.0\pt 6.0\pt 0.0\pt 4.0\pt
+ "-2" "\longarest" 0.0\pt 6.0\pt 0.0\pt 4.0\pt
"-1o" "\breverest" 0.0\pt 6.0\pt 0.0\pt 4.0\pt
"-1" "\breverest" 0.0\pt 6.0\pt 0.0\pt 4.0\pt
"0o" "\outsidewholerest" 0.0\pt 6.0\pt 0.0\pt 2.0\pt
#
LYFILES = $(wildcard *.ly)
TEXFILES = $(wildcard *.tex)
-DISTFILES = Makefile $(LYFILES) $(TEXFILES)
+DISTFILES = Makefile $(LYFILES) $(TEXFILES) $(wildcard *.m4)
#
--- /dev/null
+%{MudelaHeader
+
+ filename: abbrev.ly
+ title:
+ description:
+ composer(s):
+ entered-by: jcn
+ copyright: PD
+
+ Tested Features: simple abbreviations
+EndMudelaHeader
+%}
+
+\version "0.1.5";
+
+\score{
+ \melodic{
+ \octave c'';
+ \meter 4/4;
+ 'a1
+ 'a1:32
+ 'c4:8 c' 'c4:16 c'
+ [ 'c8:16 'c 'c 'c ] [ a a a a ]
+ [ 'c 'f 'b e ]
+ [ 'c16:32 'c 'c 'c ] [ a16:32 a a a ]
+%% % there's still some hairy beam bugfixing todo
+%% [ c'8:16 g d 'a ]
+%% [ c'16:32 g d 'a ]
+%% [ 'c8:32 'f 'b e ]
+ [:16 c4 e]
+ [:16 e4 g]
+ [:16 e2 g]
+ [:16 e1 g]
+ }
+ \paper{
+ }
+% oeps
+ \midi{ }
+}
+
Tested Features: beams and beamflags
EndMudelaHeader
%}
+\version "0.1.5"
\score{
\melodic <\multi 3;
{ \octave c';
\meter 8/4;
\duration8;
- \stem \up; [c c'' a' f']
+ \stemup [c c'' a' f']
\duration16;
- \stem \up; [c c'' a' f']
+ \stemup [c c'' a' f']
\duration32;
- \stem \up; [c c'' a' f']
+ \stemup [c c'' a' f']
\duration64;
- \stem \up; [c c'' a' f']
+ \stemup [c c'' a' f']
\duration128;
- \stem \up; [c c'' a' f']
+ \stemup [c c'' a' f']
\duration 8;
- \stem \up; ['g 'g 'g 'g]
+ \stemup ['g 'g 'g 'g]
\duration 16;
- \stem \up; ['g 'g 'g 'g]
+ \stemup ['g 'g 'g 'g]
\duration 32;
- \stem \up; ['g 'g 'g 'g]
+ \stemup ['g 'g 'g 'g]
\duration 64;
- \stem \up; ['g 'g 'g 'g]
+ \stemup ['g 'g 'g 'g]
\duration 128;
- \stem \up; ['g 'g 'g 'g]
+ \stemup ['g 'g 'g 'g]
}
{ \octave c';
\meter 8/4;
\duration8;
- \stem \down; [a' 'a c e]
+ \stemdown [a' 'a c e]
\duration16;
- \stem \down; [a' 'a c e]
+ \stemdown [a' 'a c e]
\duration32;
- \stem \down; [a' 'a c e]
+ \stemdown [a' 'a c e]
\duration64;
- \stem \down; [a' 'a c e]
+ \stemdown [a' 'a c e]
\duration128;
- \stem \down; [a' 'a c e]
+ \stemdown [a' 'a c e]
\octave c;
\duration 8;
- \stem \down; [d'' d'' d'' d'']
+ \stemdown [d'' d'' d'' d'']
\duration 16;
- \stem \down; [d'' d'' d'' d'']
+ \stemdown [d'' d'' d'' d'']
\duration 32;
- \stem \down; [d'' d'' d'' d'']
+ \stemdown [d'' d'' d'' d'']
\duration 64;
- \stem \down; [d'' d'' d'' d'']
+ \stemdown [d'' d'' d'' d'']
\duration 128;
- \stem \down; [d'' d'' d'' d'']
+ \stemdown [d'' d'' d'' d'']
}
>}
Tested Features: cadenza mode
%}
-\version "0.1.1";
+\version "0.1.5";
-cad = \melodic {\id "Staff" "french horn";
- \cadenza 1;
- \grouping 1*4;\duration 8;\octave c';
+cad = \melodic {
+ \property Score.instrument = "french horn"
+ \type Staff {
+ \cadenza 1;
+ \grouping 1*4;
+ \duration 8;
+ \octave c';
\clef "violin";
c'4.\mf g8
a4. g8 [f8 e8 d8 c8]
'g2 d2^"\tr"
c4
- }
+ }}
\score {
\melodic { \cad }
+ \midi { \tempo 4 = 90; }
\paper {
}
- \midi { \tempo 4 = 90; }
}
Tested Features:test the Collision resolution
EndMudelaHeader
%}
-\version "0.1.1";
+\version "0.1.5";
two_voice = \melodic
< \multi 2;
- { \octave c'; \stem \down;
+ { \stemdown \octave c';
c4 d e f g2~ g4 a [c8 d e f] c2| }
- { \stem \up;
+ { \stemup
g4 f e g ~ g2 g2 c4 g4 g2 }
>
two_voice_steminvert = \melodic
< \multi 2;
- { \octave c'; \stem \up;
+ {
+ \octave c'; \stemup
% the f and g on 4th beat are exceptionally ugh.
c4 d e f g2 g4 a | }
- { \stem \down;
+ { \stemdown
g4 f e g g2 g2 }
>
three_voice = \melodic
< \multi 2;
- { \stem \up;
+ { \stemup
g4 f e f g a g2 }
- { \hshift 1; \stem \up;
+ { \stemup \property Voice.hshift = 1
e2 e2 e2 e2 }
- { \stem \down;
+ { \stemdown
c4 d e d c d es }
>
rests = \melodic
< \multi 2;
- { \stem \up;
+ { \stemup
| r8 r r r r r r r
[c' b a g] [f e d c]
}
- { \stem \down;
+ { \stemdown
[c8 d e f] [g a b c']
r r r r r r r r
}
restsII = \melodic {
\octave c';
< \multi2;
- { \stem \up; g' f' e' d' c' b a g f e d c }
- { \stem \down; r r r r r r r r r r r r }
+ { \stemup g' f' e' d' c' b a g f e d c }
+ { \stemdown r r r r r r r r r r r r }
>
< \multi2;
- { \stem \up; r r r r r r r r r r r r }
- { \stem \down; c d e f g a b c' d' e' f' g' }
+ { \stemup r r r r r r r r r r r r }
+ { \stemdown c d e f g a b c' d' e' f' g' }
>
r8 r4
< \multi2; r8 r8 >
< \multi2; r8 r8 r8 r8 >
< \multi2; r r >
< \multi2; r r r >
- \stem \up;
+ \stemup
[c''8 r8 c''8 c''8]
[c8 r8 c8 c8]
- \stem \down;
+ \stemdown
[c8 r8 c8 c8]
[c''8 r8 c''8 c''8]
}
\score{
- \melodic { \$two_voice \$two_voice_steminvert
- \$three_voice \rests \restsII }
+ { \two_voice \two_voice_steminvert
+ \three_voice \rests \restsII }
% (maybe even sooner :-)
%
-\version "0.1.1";
+\version "0.1.5";
alto = \melodic{
%33
[ ) c8 c-. ] c4. c-. c4
\group "+bla";
- \stem 1 ;[ c16^"div." c16 c16 c16 ] c4 c2
+ \stemup[ c16^"div." c16 c16 c16 ] c4 c2
\group "-";
}
%30:2
%
\octave 'c ;
\textstyle "italic";
- \stem -1 ;
+ \stemdown
[ as16 \ff as16 as16 as16 ] as4_"simile" as2
\textstyle "roman";
\group "-";
%}
+\version "0.1.5";
+
vi1=\melodic{
\meter 4/4;
\octave c'';
\meter 3/2;
g1. | c |
% 30
- f | d^"\sharp" |
+ f | d^"\textsharp" |
g | c |
- A | d^"\sharp" |
+ A | d^"\textsharp" |
G | c |
- d^"\sharp" | e |
+ d^"\textsharp" | e |
f | g1 B2 |
d1.^"3 4 3" |
\meter 4/4;
g1^"3 4 3" | c |
G^"3 4 3" | c2 G |
d1^"3 4 3" | G^"3 4 3" |
- c2 G | d1^"\sharp" ( |
+ c2 G | d1^"\textsharp" ( |
) d^"3 4 3" |
\cadenza 1;
G\breve
\output "gallina.out";
gourlay_maxmeasures=7.;
}
- \midi{
+ \midi{
\tempo 4=90;
-}
+ }
}
Tested Features: local key, key, forced accidentals
EndMudelaHeader
%}
-\version "0.1.1";
+\version "0.1.5";
blah = \melodic{
Tested Features: example file with comments
%}
-\version "0.1.1";
+\version "0.1.5";
% the % is a comment.
}
\score{
- \melodic < \id "Piano" ""; \multi 3;
+ \melodic \type Grandstaff = <
\melodie
\begeleiding
>
%}
-\version "0.1.1";
+\version "0.1.5";
\score{
\melodic
{ \octave c'; c4 c4
< \multi 1; { c2 c2 } { c'2 c'2 } >
- < \multi 2; { \stem \down; c2 c2 } { \stem \up; c'2 c'2 } >
+ < \multi 2; { \stemdown c2 c2 } { \stemup c'2 c'2 } >
< \multi 3; { \clef "bass"; c2 c2 } { \meter 2/4;\bar "||"; \key fis cis gis; c'2 c'2 } >
c2 c1
c1 c1
% \lbheel \lbheel \lfheel \lftoe
% \rbheel \rbtoe \rfheel \rftoe
-\version "0.1.1";
+\version "0.1.5";
\score{
\melodic {
-
\header{
- filename rhythm.ly
- entered-by HWN
- copyright public domain
- Tested Features multiple meters, beaming
- unsynced bars
+filename rhythm.ly
+enteredby HWN
+copyright public domain
+TestedFeatures multiple meters, beaming, unsynced bars, userdefd engravers
}
-%{
-has to be revised for 0.1.12
-%}
-\version "0.1.1";
+\version "0.1.5";
ritme = \melodic{ %\octave ;
\partial 8;
>
\paper{
+
+ %% remove Timing_engraver and Bar_number_engraver
+ Score = \translator {
+ \type Score_engraver;
+
+ \consists "Bar_align_engraver";
+ \consists "Clef_align_engraver";
+ \consists "Key_align_engraver";
+ \consists "Meter_align_engraver";
+ \consists "Score_horizontal_align_engraver";
+ \consists "Vertical_align_engraver";
+ \consists "Span_score_bar_engraver";
+
+
+ \accepts "Staff_group";
+ \accepts "Staff";
+ \accepts "Lyrics";
+ \accepts "Grandstaff";
+ }
+
+ %% add Timing_engraver to the staff
+ Staff = \translator {
+ \type "Engraver_group_engraver";
+
+ \consists "Timing_engraver";
+ \consists "Bar_engraver";
+ \consists "Clef_engraver";
+ \consists "Key_engraver";
+ \consists "Meter_engraver";
+ \consists "Local_key_engraver";
+ \consists "Staff_sym_engraver";
+ \consists "Collision_engraver";
+ \consists "Rest_collision_engraver";
+
+ \consists "Line_group_engraver";
+ \accepts "Voice";
+ }
}
}
% scales with accents.
%
-\version "0.1.1";
+\version "0.1.5";
blah = \melodic {
\meter 6/8;
\octave 'c ;
Tested Features: scripts, text.
EndMudelaHeader
%}
-\version "0.1.1";
+\version "0.1.5";
blah = \melodic {
Tested Features:breaking algorithm, chords, multivoice, accents
%}
-\version "0.1.1";
+\version "0.1.5";
%% Stuff from MPP version
% \lefttitle{Menuetto}
IImenuetto = \melodic{
\clef"alto";
+ \property Staff.instrument = cello
\meter 3/4;
\key bes;
\octave c';
\duration 8;
< a2 f2 d2 \f > bes4-. |
%%2
- < [ bes8^"1" e c_"2"_"4" >
- a bes-. g-. ] a4-.^"4" |
+ < [ bes8^"1" e8 c8_"2"_"4" >
+ a8 bes8-. g8-. ] a4-.^"4" |
%%3
- < d4 'bes4-. > g4-. [ f8-. e-. ] |
+ < d4 'bes4-. > g4-. [ f8-. e8-. ] |
%%4
- < [ f 'a > e d cis-. 'b-. 'a-. ]
+ < [ f8 'a > e8 d8 cis8-. 'b8-. 'a8-. ]
%%5
< a2 f2 d2 > bes!4-. |
%%6
- < [ bes8 e > a bes-. g-. ]
+ < [ bes8 e8 > a8 bes8-. g8-. ]
c'!4-. |
%%7
< a4-. f4>
< e'2 a2 \f >
[ d'8( e'16 )f'16 ] |
%%10
- < [ e'8 g > d' cis'_"2" e' a~ g ] |
+ < [ e'8 g8 > d' cis'_"2" e' a~ g8 ] |
%%11
< \multi 2;
- {\stem \up; a4~ d'4 cis'4-. }
- { \stem \down; f2 e4 } > |
+ {\stemup a4~ d'4 cis'4-. }
+ { \stemdown f2 e4 } > |
%%12
- < [ g'8^"4" d > f' e' f' d'^"3"~ c' ] |
+ < [ g'8^"4" d8 > f' e' f' d'^"3"~ c' ] |
%%13
\clef "alto";
< \multi 2;
- { \stem \up; bes2 c'4 }
- { \stem \down; g4~ f4 e4 }% ugh
+ { \stemup bes2 c'4 }
+ { \stemdown g4~ f4 e4 }% ugh
> |
%%14
- < [ a8 f > g a f ] < d'4-\upbow e4 'bes4 > |
+ < [ a8 f8 > g8 a8 f8 ] < d'4-\upbow e4 'bes4 > |
%%15
- < c'4-\downbow f4 'a4 > [ bes8~ a g a ] |
+ < c'4-\downbow f4 'a4 > [ bes8~ a8 g8 a8 ] |
%%16
- [ f( e )f a-. g-. bes-. ] |
+ [ f( e8 )f a8-. g8-. bes8-. ] |
%%17
< a2^"0" fis2_"3" > bes4 |
%%18
- < { [ c'8~ bes c' a ] } { [ es ] } > fis4 |
+ < { [ c'8~ bes8 c' a8 ] } es8 > fis4 |
%%19
- < d'4-\downbow g4 'bes4 > < c'4-\upbow g4 c4 > < [ bes8 d > a ] |
+ < d'4-\downbow g4 'bes4 > < c'4-\upbow g4 c4 > < [ bes8 d8 > a8 ] |
%%20
- < { [ c'8 ( bes a )bes g~ bes ] } { [ d ] } { [ g ] } > |
+ < { [ c'8 ( bes8 a8 )bes g~ bes8 ] } d8 g8 > |
%%21
< \multi 2;
- {\stem \up; d'4 (\stem \up; ) cis'4 d'4 }
- { \stem \down; g2 f4 }
+ {\stemup d'4 (\stemup ) cis'4 d'4 }
+ { \stemdown g2 f4 }
> |
%%22
- < { [ g8 ~ f g e ] } { [ cis ] } > < f4 d4 > |
+ < { [ g8 ~ f8 g8 e8 ] } cis8 > < f4 d4 > |
%%23
- [ 'g8 g ] < e4. 'a4. > d-\upbow |
+ [ 'g8 g8 ] < e4. 'a4. > d8-\upbow |
%%24
< d2.^"fine" 'a2. 'd2._"3 mins.">
\bar ":|";
-%% \tighten % use one line less
-
}
\score{
\melodic{
- \id "Staff" "cello"; \IImenuetto
+ \IImenuetto
}
\paper{
linewidth= 150.0\mm;
EndMudelaHeader
%}
-\version "0.1.1";
+\version "0.1.5";
\score{
\melodic{\octave c';
{ e ~ f }
>
< \multi 2;
- { \stem \up; c'8 ~g ~e( ~c~ [c'~ g' e' )c'] c'' ~ c'' c~c }
- { \stem \down; c (e g )c'~( [b a g )d] r2 }
+ { \stemup c'8 ~g ~e( ~c~ [c'~ g' e' )c'] c'' ~ c'' c~c }
+ { \stemdown c (e g )c'~( [b a g )d] r2 }
>
}
multiple \paper{}s in one \score
%}
-\version "0.1.1";
+\version "0.1.5";
commands = \melodic{
\skip 2.*4;
<
{ fis2.~
%\group "+1";
- \stem \down; f2. }
- { d'2. ~ \stem \up;
+ \stemdown f2. }
+ { d'2. ~ \stemup
d'4 r4_"decresc." d'4 }
>
\textstyle "roman"; |
''a r4 |
%%5
\duration 8;
- < \multi 2; { \stem \up;
+ < \multi 2; { \stemup
[ 'f 'a d 'a d 'a ]
[ 'd 'e 'g 'e 'g 'e ]
[ 'cis 'e 'g 'e 'g 'e ]
[ 'd 'a d 'a d 'a ]
}
- { \stem \down;
+ { \stemdown
'd2 r4
''bes2 r4
''a2 r4
'd2 r4
} >
%%9
- \stem 0;
+ \stemboth
[ 'a e g e g e ] |
%%10
[ 'd 'a d 'a d 'a ] |
%%11
< \multi 2;
- { \stem \up;
+ { \stemup
[ 'f 'a d 'a d 'a ]
[ 'd 'e 'g 'e 'g 'e ]
[ 'e 'g 'bes 'g 'bes 'g ]
[ 'a c f c f c ]
- } { \stem \down;
+ } { \stemdown
'd2 r4
''bes2 r4
'c2 r4
'f2 r4 }
>
%%15
- \stem 0;
+ \stemboth
[ 'c 'g 'bes 'g 'bes 'g ] |
%%16
[ ''f 'c 'f 'c 'f 'c ] |
< \multi 2;
- { \stem \up;
+ { \stemup
[ ''a 'e 'g 'e 'g 'e ][ 'd 'a d 'a d 'a ]
[ ''bes 'f 'bes 'f 'bes 'f ][ ''f 'c 'f 'c 'f 'c ] }
- { \stem \down;
+ { \stemdown
''a2 r4
'd2 r4
''bes2 r4
''f2 r4
} >
%%21
- \stem 0;
+ \stemboth
< [ 'e 'c > 'g c 'g c 'g ] |
%%22
[ 'f 'a c 'a 'f 'c ] |
< \multi 2; {
- \stem \up;
+ \stemup
[ ''a 'e 'g 'e 'g 'e ]
[ 'd 'fis 'a 'fis 'a 'fis ]
[ ''g 'd 'b 'd 'b 'd ]
[ 'd 'a d 'a d 'a ]
}
- {\stem \down;
+ {\stemdown
''a2 r4
'd2 r4
''g2 r4
'd2 r4
}
>
- \stem 0;
+ \stemboth
< [ 'cis ''a > 'e 'a 'e 'a 'e ] |
%%28
[ 'd 'a d 'a d 'a ] |
%%44
< [ 'd ''b > 'fis 'b 'fis 'b 'fis ] |
%%45
- < \multi 2; { \stem \up;
+ < \multi 2; { \stemup
[ ''g 'd 'b 'd 'b 'd ]
[ 'd 'a d 'a d 'a ]
} {
- \stem \down;
+ \stemdown
''g2 r4
'd2 r4
} >
%%47
- \stem 0;
+ \stemboth
< [ 'cis ''a > 'e 'a 'e 'a 'e ] |
%%48
[ 'd 'fis 'a 'fis 'a 'fis ] |
themusic =
<
- < \id "Lyric" "1";
+ \type Lyrics <
\tekstI
\tekstII
>
- < \id "Piano" "";
+ \type Grandstaff <
\multi 2;
\melodic < \melodie \commands >
\melodic < \begeleiding \commands >
\score{
\themusic
+ \midi{
+ \tempo 4 = 54;
+ }
\paper{
\paper_twenty
% 20pt music uses whole pagewidth
gourlay_maxmeasures = 9.;
\output "standchen-16.out";
}
- \midi{
- \tempo 4 = 54;
- }
}
%}
-\version "0.1.1";
+\version "0.1.5";
toccata_commands = \melodic{
\meter 4/4;
% 13 -- how to type -- where to split -- this more neatly ?
\octave c';
<\multi 2;
- { \stem \up; r4 dis'4 e'4.-. e'8( | \hshift 1; )e'4 [d'8 fis'8] \hshift 0; gis'4 [gis'8 fis'16 e'16] | fis'4~ [fis'8 e'16 dis'16] e'4 r8 e'8 }
- { \stem \up; \hshift 1; r4 bis4 cis'4-. cis'4 | \hshift 0; a'4~ [a'16 gis'16 a'16 b'16] \hshift 1; dis'4 cis'4~ [cis'8 dis'16 a16] bis4 cis'4 r8 b8 }
- { \stem \down; r4 < gis4 fis4 dis4 > gis4-. gis4 | a4. cis'8 gis2 | fis4 gis4 gis4 r8 e8 }
+ { \stemup r4 dis'4 e'4.-. e'8( | \property Voice.hshift = 1 )e'4 [d'8 fis'8] \property Voice.hshift = 0 gis'4 [gis'8 fis'16 e'16] | fis'4~ [fis'8 e'16 dis'16] e'4 r8 e'8 }
+ { \stemup \property Voice.hshift = 1 r4 bis4 cis'4-. cis'4 | \property Voice.hshift = 0 a'4~ [a'16 gis'16 a'16 b'16] \property Voice.hshift = 1 dis'4 cis'4~ [cis'8 dis'16 a16] bis4 cis'4 r8 b8 }
+ { \stemdown r4 < gis4 fis4 dis4 > gis4-. gis4 | a4. cis'8 gis2 | fis4 gis4 gis4 r8 e8 }
> |
% 16
}
\clef bass;
% 13
<\multi 2;
- { \stem \up; bis2 cis'4-. cis'4~ [cis'8 a8 d'8 cis'8] [bis8 gis8] cis'4 | dis'2 cis'4 r8 cis'8 }
- { \stem \up; \hshift 1; r4 gis4. gis8~ gis4 | \stem \down; \hshift 0; a4. fis8 gis4. a8~ a4 gis4-. gis4 r8 gis8 }
- { \stem \down; r4 < dis4 fis4 > < cis4 e4 > }
+ { \stemup bis2 cis'4-. cis'4~ [cis'8 a8 d'8 cis'8] [bis8 gis8] cis'4 | dis'2 cis'4 r8 cis'8 }
+ { \stemup \property Voice.hshift = 1 r4 gis4. gis8~ gis4 | \stemdown \property Voice.hshift = 0 a4. fis8 gis4. a8~ a4 gis4-. gis4 r8 gis8 }
+ { \stemdown r4 < dis4 fis4 > < cis4 e4 > }
> |
% 16
}
% 15
\octave c';
<\multi 2;
- { \stem \up; [b8 fis8] b4 }
- { \stem \down; fis2 }
+ { \stemup [b8 fis8] b4 }
+ { \stemdown fis2 }
>
%{ this chord is usually set like this:
|
|
%}
< \multi 2;
- { \stem \up; \hshift 0; e'4 }
- { \stem \up; \hshift 1; cis'4 }
- { \stem \up; \hshift 2; ais4 }
- { \stem \down; fis4 }
+ { \stemup \property Voice.hshift = 0 e'4 }
+ { \stemup \property Voice.hshift = 1 cis'4 }
+ { \stemup \property Voice.hshift = 2 ais4 }
+ { \stemdown fis4 }
> |
% 16
<\multi 2;
- { \stem \up; dis'2 dis'4 | cis'2 cis'4 | b4~ [b8 cis'8 dis'8 e'8] }
- { \stem \up; \hshift 1; [b8 fis8] b2~ [b8 a16 g16] a2 | a4 gis2 }
- { \stem \down; fis2.~ fis2.~ fis4 e2 }
+ { \stemup dis'2 dis'4 | cis'2 cis'4 | b4~ [b8 cis'8 dis'8 e'8] }
+ { \stemup \property Voice.hshift = 1 [b8 fis8] b2~ [b8 a16 g16] a2 | a4 gis2 }
+ { \stemdown fis2.~ fis2.~ fis4 e2 }
> |
% 19
}
% 15
b2
<\multi 2;
- { \stem \up; ais4 | bes2. }
- { \stem \down; e4 | fis2 fis4 }
+ { \stemup ais4 | bes2. }
+ { \stemdown e4 | fis2 fis4 }
>
% 17
cis'2 e'4 |
% these should be two separate scores...
\score{
- \melodic < \multi 1;
-
- < \id Piano ""; \multi 3;
- {\$toccata_right \break \$fuga2_right }
- { \$toccata_left \break \$fuga2_left }
+ < \multi 1;
+ \type Grandstaff = "" < \multi 3;
+ {\toccata_right \break \fuga2_right }
+ { \toccata_left \break \fuga2_left }
>
-
- { \$toccata_pedal \break \$fuga2_pedal }
-
-
+ { \toccata_pedal \break \fuga2_pedal }
>
\paper{}
\midi{
Tested Features lyrics and chords
%}
-\version "0.1.1";
+\version "0.1.5";
melodie = \melodic {
\clef"violin";
f4^"F" f | e^"C" e | d^"G7" d | c2^"C" |
}
-texte = \lyric{
-
+text = \lyric{
\textstyle "italic";
Ah!4 vous dir- ai_- je ma man2
Ce4 qui cau- se mon tour- ment2
}
\score {
- < \melodic < \id "Piano" ""; \melodie >
- \lyric < \id "Lyric" ""; \texte >
+ < \melodic \type Staff \melodie
+ \lyric \type Lyrics \text
>
\paper { }
}
Tested Features: lyrics
%}
-\version "0.1.1";
+\version "0.1.5";
melody = \melodic{
\clef violin;
\score{
<
\melodic <
- \id "Piano" "";\multi 2;
- < \global
+ \type Grandstaff
+ < \multi 2; \global
\melody >
< \global
\accompany >
>
% ugh
- \lyric < \id "Lyric" "1";
+ \lyric \type Lyrics <
\global \tekst >
- \lyric < \id "Lyric" "2"; \global
+ \lyric \type Lyrics < \global
\texte >
- \lyric < \id "Lyric" "3"; \global
+ \lyric \type Lyrics < \global
\texti \textii \textiii >
>
--- /dev/null
+\header{
+filename fugue1.ly
+title Fuga a 4
+description Das Wohltemperierte Clavier I, Fuga I (c-major)
+opus BWV 846
+composer Johann Sebastian Bach (1685-1750)
+enteredby Shay Rojansky
+copyright Public Domain
+}
+
+%{
+
+%}
+\version "0.1.5";
+
+
+global =
+ \melodic {
+ \meter 4/4; % should be \meter C
+ }
+
+tenor =
+ \melodic {
+ \clef "violin";
+ \octave c';
+
+ \stemdown
+ r8 [c8 d e] [f. g32 f] [e8 a] |
+ [d g] ~ [g16 a g f] [e f e d] [c d c 'b] |
+ ['a8 fis] g4 ~ [g8 fis16 e] [f8 d] |
+ [g f! e d] c r r g ~ |
+%% 5
+ [g f16 e] f4 ~ [f16 f e8] d4 |
+ [c8 f] r16 [g f e] [f8 d] g4 ~ |
+ g4 r4 r2 |
+ r1 |
+ r8 [g8 a b] [c'. d'32 c'] [b8 e']
+%% 10
+ [a d'] ~ [d'16 e' d' c'] b8 r8 r d |
+ [e fis] [g. a32 g] [fis8 b e a] ~ |
+ [a16 b a gis] [fis8 f!] [e d] ~ [d16 e fis gis] |
+ [a gis a b] [gis fis gis a] b8 r8 r4 |
+ r8 [c8 d e] \stemup [f. g32 f] [e8 a] |
+%% 15
+ [d g] ~ [g16 a g f] e8 \stemdown [e fis g] ~ |
+ [g8 fis] [gis8 a] ~ [a g! a b] |
+ \stemboth
+ [c'. d'32 c'] [b8 e'] [a d'] ~ [d'16 e' d' c'] |
+ [b8 g' cis' d'] [e' cis' d' e' ] |
+ \stemdown a8 r8 r e [fis g] \stemboth[a. b32 a] |
+%% 20
+ [g8 c' fis b] ~ [b16 c' b a] \stemdown [g fis e d] \stemboth|
+ e4 \stemdown d ~ [d16 a g f!] [e g f! a] |
+ g4 ~ [g16 a bes8] c'4 [d'8 g] |
+ \stembothg4. f8 ~ [f e] d4 |
+ \stemdown e8 a4 g8 ~ [g8 f g a] |
+%% 25
+ [bes8. c'32 b] [a8 d'] [g c'] ~ [c'16 d' c' bes] |
+ [a bes a g] [f g f e] d4 ~ [d8. g16] |
+ a4 r16 [f'16 d'8] e'2 |
+ }
+
+
+soprane =
+ \melodic {
+ \octave c';
+ \stemup
+ r1 |
+ r2 r8 [g8 a b] |
+ [c'. d'32 c'] [b8 e'] [a d'] ~ [d'16 e' d' c'] |
+ [b g a b] [c' b c' d'] [e' d' e' fis'] [g'8 b] |
+%% 5
+ [c' a] [d'16 c' b a] [g8. g16] [f e f g] |
+ [a g a b] c'2 b4 |
+ \octave c'';
+ r8 [c8 d e] [f. g32 f] [e8 a] |
+ [d g] ~ [g16 a g f] [e8 a] ~ [a16 b a g] |
+ f2 [e8. fis16] g4 ~
+%% 10
+ g4 fis [g16 f! e d] [c d c 'b] |
+ ['a16 c 'b 'a] 'g8 r8 r16 [c16 'b 'a] ['gis8 e] |
+ [d c16 'b16] ['a 'gis 'a 'b] [c 'fis 'a 'gis] ['b8 'a16 'b]
+ [c8 f e d] ~ [d c16 'b] ['b8. 'a16] |
+ 'a4 r4 r2 |
+%% 15
+ r2 r8 ['g8 'a 'b] |
+ [c8. d32 c] ['b8 c] [d e] [f!. g32 f!] |
+ [e8 a d g] ~ [g16 a g f] [e8 a] |
+ [d8 bes] [a g16 f] [g f g e] [f g g f32 g] |
+ [a16 cis d g] [e8. d16] d8 r8 r4 |
+%% 20
+ r2 r4 r8 'g |
+ ['a 'b] [c. d32 c] ['b8 e 'a d] ~ |
+ [e16 e d c] ['b c d e] [f g a g] [f e d c] |
+ 'b4 [c8 d] 'g c4 'b8 |
+ c4 ['b8 'bes8] 'a d4 c8 |
+%% 25
+ [d8 e] f4 ~ [f16 a g f] [e f e d] |
+ c2 r16 ['g32 'a 'b!16 c] [d e f8] ~ |
+ [f32 c d e f16 g] [a8. b16] <g2 c'2> |
+ }
+
+alt =
+ \melodic {
+ \clef "bass";
+ \octave c;
+
+ \stemup
+ r1 |
+ r |
+ r |
+ r8 [g8 a b] [c'. d'32 c'] [b8 e'] |
+%% 5
+ [a d'] ~ [d'16 e' d' c'] [b8 c' ~ c' bes8] |
+ [a d' g c'] r16 [a16 b c'] d'4 |
+ g4 r8 g8 [a b] [c'. d'32 c'] |
+ [b8 e' a d'] ~ [d'16 e' d' c'!] [b!8 e'] ~ |
+ e'4 d'4 [c'16 b c' a] [e' d' c' b] |
+%% 10
+ [c'16 a b c'] [d' c' b a] g4 r4 |
+ r1 |
+ r8 [e8 fis gis] [a. b32 a] [gis8 c'] |
+ [fis b] ~ [b16 c' b a] gis8 a4 gis8 |
+ a4 r8 g8 [a b] c'. [d'32 c'] |
+%% 15
+ [b8 e' a d'] ~ [d' g] d'4 |
+ [c'8 a] e'4 d'8 r8 r4 |
+ r8 [a8 b cis'] [d'. e'32 d'] [c'!8 f'] |
+ [b8 e'] ~ [e'16 f' e' d'] cis'8 r8 r4 |
+ r8 [a8 b cis'] [d'. e'32 d'] [c'!8 fis'] |
+%% 20
+ [b e'] ~ [e'16 fis' e' d'] c'2 ~ |
+ [c'16 d' c' b] [a g a fis] [g8 b c' d'] |
+ [e'. f'32 e'] [d'8 g'] [c' f'] ~ [f'16 g' f' e'] |
+ d'4 [e'8 d'] ~ [d' g] g4 ~
+ [g8 c d e] [f. g32 f] [e8 a] |
+%% 25
+ [d g] ~ [g16 a g f] [e d e f] [g a bes g] |
+ [a e f g] [a b c' a] b2 |
+ c'1 |
+ }
+
+bass =
+ \melodic {
+ \clef "bass";
+ \octave c;
+
+ \stemdown
+ r1 |
+ r |
+ r |
+ r |
+%% 5
+ r2 r8 [c8 d e] |
+ [f. g32 f] [e8 a] [d g] ~ [g16 a g f] |
+ [e f e d] [c d c 'b] ['a8 d a fis] |
+ [g16 a bes g] [cis8 d] a4 e4 |
+ [a16 b c' d'] [c' b a g] c'8 r8 r4 |
+%% 10
+ r2 r8 ['g8 'a 'b] |
+ [c. d32 c] ['b8 e] ['a d] ~ [d16 e d c] |
+ 'b8 e4 d8 c f!4 e8 ~ |
+ e d4 e8 [f! e16 d] e4 |
+ 'a4 r4 r2 |
+%% 15
+ r8 ['g8 'a 'b] [c. d32 c] ['b8 e] |
+ ['a8 d] ~ [d16 e d c] ['b8 'bes 'a g'] |
+ ['a8 fis g e] d4 [e8 f!] |
+ [g8. a32 g] [f8 bes] [e a] ~ [a16 bes a g] |
+ [f e f d] [g8 a] d2 ~ |
+%% 20
+ [d16 e d c] ['b 'a 'g 'fis] ['e8 e fis g] ~ |
+ [g a16 g16] [fis8 d] g2 ~ |
+ g2 a4 [b8 c'] |
+ [f16 a g f] [e d c 'b] [c d e f] [g8 'g] |
+ c1 ~ |
+%% 25
+ c1 ~ |
+ c1 ~ |
+ c1 |
+ }
+
+
+\score {
+ \melodic \type Grandstaff <
+ \multi 1;
+ < \multi 2;
+ \global
+ \soprane
+ \tenor
+ >
+ < \multi 2;
+ \global
+ \alt
+ \bass
+ >
+ >
+
+ \paper{
+ gourlay_maxmeasures =5.;
+% castingalgorithme = \Wordwrap
+ }
+ \midi {
+ \tempo 4 = 84;
+ }
+}
+
+% EOF
--- /dev/null
+\header{
+filename wohltemperirt.ly
+title Fuga a 3
+description Das Wohltemperierte Clavier I, Fuga II (c-minor)
+opus BWV 847-Fuga
+source Henle's Urtext
+composer Johann Sebastian Bach (1685-1750)
+enteredby HWN and Werner Lemberg
+copyright Public Domain
+}
+%{
+ Tested Features: stem direction, multivoice, forced accidentals.
+%}
+
+\version "0.1.5";
+
+ % should add \need{dutch.ini} for
+ % correct parsing of note names
+
+global =
+ \melodic {
+ \meter 4/4; % should be \meter C
+ \keyCminor
+ }
+
+dux =
+ \melodic {
+ \clef "violin";
+ \octave c';
+
+ \stemdown
+ r8 [c'16 b] [c'8 g] [as c'16 b] [c'8 d'] |
+ [g c'16 b] [c'8 d'] [f16 g] as4 [g16 f] |
+ [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!] |
+ % 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
+ as4 r8 a [bes bes16 a] [bes8 f] |
+ g4 r8 g [as as g f] |
+ \translator Staff=bass \stemup
+ \octave c; r8 [as bes c'] r8 [as16 g] [as8 f8] |
+ [bes8 c' bes as] [bes g f es] |
+ [f des' c' bes] [c' as g f] |
+%% 15
+ \translator Staff=treble \stemdown
+ 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] |
+%% 20
+ [c16 f es d] [c Bes! As G] [F8 as g f] |
+ [es d es f] [B c d B] |
+ c4 r8 e8 [f f16 e] [f8 c] |
+ d4 r8 d8 [es8 es16 d] [es8 Bes] |
+ c2 ~ [c8 d16 es][ f es f d] |
+%% 25
+ B8 r8 r B c r r es |
+ d r r f~ f r r f |
+ [es as g f] [es d es f] |
+ [B c d B] [B c] r c |
+ [f16 d es c]~ [c8 B] c4 r8 e |
+%% 30
+ f4 r8 f [f es16 d] [es8 <f as]> |
+ <B d> r <B d> r <G2 c> |
+ }
+
+
+comes =
+ \melodic {
+ \octave c'';
+ \stemup
+ r1 |
+ r1 |
+ r8 [g16 fis] [g8 c] [es g16 fis] [g8 a] |
+ [d8 g16 fis] [g8 a] [c16 d] es4 [d16 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]
+ [es d es f] ['b c d 'b] |
+ [c g16 fis] [g8 d] es4 r8 e8 |
+%% 10
+ [f f16 e] [f8 c8] d4 r8 d |
+ [es8 es16 d] [es8 'bes] [c es16 d] [es8 f] |
+ ['bes es16 d] [es8 f] ['as16 'bes] c4 ['bes16 'as] |
+ [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] |
+ [Bes A Bes c] [Fis! G A Fis] |
+ % 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 |
+%% 20
+ r8 [c16 'b] [c8 'g] [As c16 'b] [c8 d] |
+ [G c16 B] [c8 d] [F16 G] As4 [G16 F] |
+ [Es8 c16 B] [c8 G] As4 r8 A |
+ [Bes8 Bes16 A] [Bes8 F8] 'g4 r8 G~ |
+ [G As16 Bes] [c B c As] F2~ |
+%% 25
+ [F8 d16 c] [d8 F] [Es es16 d] [es8 G] |
+ [F f16 es] [f8 As] [G16 f es d] [c B A G] |
+ [c8 f es d] r [As G F] |
+ [G F16 Es] [F8 D] [As G] r A |
+ [B c] [F16 Es D C] C8 [c16 B] [c8 G] |
+%% 30
+ [As c16 B] [c8 <d 'b! 'as!]> [G8 c16 B] [c8 d] |
+ [F16 G] As4 [G16 F] E2 |
+ }
+
+bassdux =
+ \melodic {
+ \clef "bass";
+ \octave c';
+ r1 |
+ r |
+ r |
+ r |
+%% 5
+ r |
+ r1 |
+ 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] |
+ % -> \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] |
+ [g8 f g as] [d es f d] |
+ [es as g f] [g es d c] |
+ [d bes as g] [as f es d!] |
+%% 15
+ es8 r8 r4 r8 [c Bes A] |
+ r [es d c] [d c16 Bes] [c8 d] |
+ [G8 bes16 a] [bes8 d] [es c'16 bes] [c'8 e] |
+ [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] | % -> \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] |
+ [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 |
+ [d c g G]
+%% 30
+ < \multi 2;
+ { \stemup c2~ | c1~ | c1 }
+ { \stemdown C2~ | C1~ | C1 }
+ >
+ }
+
+
+\score {
+ \melodic \type Grandstaff <
+ \type Staff=treble < \multi 2;
+ \global
+ \dux
+ \comes
+ >
+ \type Staff=bass < \multi 2;
+ \global
+ \bassdux
+ >
+ >
+
+ \paper{
+ gourlay_maxmeasures =5.;
+
+ }
+ \midi {
+ \tempo 4 = 84;
+ }
+}
+
+% EOF
--- /dev/null
+\header{
+filename prelude1.ly
+title Preludium
+description Das Wohltemperierte Clavier I, Prelude I (c-major)
+opus BWV 846
+composer Johann Sebastian Bach (1685-1750)
+enteredby Shay Rojansky
+copyright Public Domain
+}
+
+\version "0.1.5";
+
+global =
+ \melodic {
+ \meter 4/4; % should be \meter C
+ }
+
+
+% should do programmable input.
+
+soprane =
+ \melodic {
+ \clef "violin";
+ \octave c';
+
+ <\multi 2;
+ % Real soprane
+ {\stemup
+ r8 [g16 c'] [e' g c' e'] r8 [g16 c'] [e' g c' e'] |
+ r8 [a16 d'] [f' a d' f'] r8 [a16 d'] [f' a d' f'] |
+ r8 [g16 d'] [f' g d' f'] r8 [g16 d'] [f' g d' f'] |
+ r8 [g16 c'] [e' g c' e'] r8 [g16 c'] [e' g c' e'] |
+ r8 [a16 e'] [a' a e' a'] r8 [a16 e'] [a' a e' a'] |
+ r8 [fis16 a] [d' fis a d'] r8 [fis16 a] [d' fis a d'] |
+ r8 [g16 d'] [g' g d' g'] r8 [g16 d'] [g' g d' g'] |
+ r8 [e16 g] [c' e g c'] r8 [e16 g] [c' e g c'] |
+ r8 [e16 g] [c' e g c'] r8 [e16 g] [c' e g c'] |}
+ % Tenor
+ {\stemdown
+ r16 e8. ~ e4 r16 e8. ~ e4 |
+ r16 d8. ~ d4 r16 d8. ~ d4 |
+ r16 d8. ~ d4 r16 d8. ~ d4 |
+ r16 e8. ~ e4 r16 e8. ~ e4 |
+ r16 e8. ~ e4 r16 e8. ~ e4 |
+ r16 d8. ~ d4 r16 d8. ~ d4 |
+ r16 d8. ~ d4 r16 d8. ~ d4 |
+ r16 c8. ~ c4 r16 c8. ~ c4 |
+ r16 c8. ~ c4 r16 c8. ~ c4 |}>
+%% 10
+ r8 [d16 fis] [c' d fis c'] r8 [d16 fis] [c' d fis c'] |
+ r8 [d16 g] [b d g b] r8 [d16 g] [b d g b] |
+ r8 [e16 g] [cis' e g cis'] r8 [e16 g] [cis' e g cis'] |
+ r8 [d16 a] [d' d a d'] r8 [d16 a] [d' d a d'] |
+ r8 [d16 f] [b d f b] r8 [d16 f] [b d f b] |
+ r8 [c16 g] [c' c g c'] r8 [c16 g] [c' c g c'] |
+ r8 ['a16 c] [f 'a c f] r8 ['a16 c] [f 'a c f] |
+ r8 ['a16 c] [f 'a c f] r8 ['a16 c] [f 'a c f] |
+ r8 ['g16 'b] [f 'g 'b f] r8 ['g16 'b] [f 'g 'b f] |
+ r8 ['g16 c] [e 'g c e] r8 ['g16 c] [e 'g c e] |
+%% 20
+ r8 ['bes16 c] [e 'bes c e] r8 ['bes16 c] [e 'bes c e] |
+ r8 ['a16 c] [e 'a c e] r8 ['a16 c] [e 'a c e] |
+ r8 ['a16 c] [ees 'a c ees] r8 ['a16 c] [ees 'a c ees] |
+ r8 ['b16 c] [d 'b c d] r8 ['b16 c] [d 'b c d] |
+ r8 ['g16 'b] [d 'g 'b d] r8 ['g16 'b] [d 'g 'b d] |
+ r8 ['g16 c] [e 'g c e] r8 ['g16 c] [e 'g c e] |
+ r8 ['g16 c] [f 'g c f] r8 ['g16 c] [f 'g c f] |
+ r8 ['g16 'b] [f 'g 'b f] r8 ['g16 'b] [f 'g 'b f] |
+ r8 ['a16 c] [fis 'a c fis] r8 ['a16 c] [fis 'a c fis] |
+ r8 ['g16 c] [g 'g c g] r8 ['g16 c] [g 'g c g] |
+%% 30
+ r8 ['g16 c] [f 'g c f] r8 ['g16 c] [f 'g c f] |
+ r8 ['g16 'b] [f 'g 'b f] r8 ['g16 'b] [f 'g 'b f] |
+ r8 ['g16 'bes] [e 'g 'bes e] r8 ['g16 'bes] [e 'g 'bes e] |
+
+ r8 ['f16 'a] [c f c 'a] [c 'a 'f 'a] ['f 'd 'f 'd] |
+ r8 [g16 b] [d' f' d' b] [d' b g b] [d f e d] |
+ <e1 g c'> ||
+ }
+
+bass =
+ \melodic {
+ \clef "bass";
+ \octave c;
+
+ \stemdown
+ c'2 c' |
+ c' c' |
+ b b |
+ c' c' |
+ c' c' |
+ c' c' |
+ b b |
+ b b |
+ a a |
+%% 10
+ <\multi 2;
+ % Alt
+ {\stemup
+ r16 a8. ~ a4 r16 a8. ~ a4 |
+ r16 b8. ~ b4 r16 b8. ~ b4 |
+ r16 bes8. ~ bes4 r16 bes8. ~ bes4 |
+ r16 a8. ~ a4 r16 a8. ~ a4 |
+ r16 aes8. ~ aes4 r16 aes8. ~ aes4 |
+ r16 g8. ~ g4 r16 g8. ~ g4 |
+ r16 f8. ~ f4 r16 f8. ~ f4 |
+ r16 f8. ~ f4 r16 f8. ~ f4 |
+ r16 d8. ~ d4 r16 d8. ~ d4 |
+ r16 e8. ~ e4 r16 e8. ~ e4 |
+%% 20
+ r16 g8. ~ g4 r16 g8. ~ g4 |
+ r16 f8. ~ f4 r16 f8. ~ f4 |
+ r16 c8. ~ c4 r16 c8. ~ c4 |
+ r16 f8. ~ f4 r16 f8. ~ f4 |
+ r16 f8. ~ f4 r16 f8. ~ f4 |
+ r16 e8. ~ e4 r16 e8. ~ e4 |
+ r16 d8. ~ d4 r16 d8. ~ d4 |
+ r16 d8. ~ d4 r16 d8. ~ d4 |
+ r16 ees8. ~ ees4 r16 ees8. ~ ees4 |
+ r16 e!8. ~ e4 r16 e8. ~ e4 |
+%% 30
+ r16 d8. ~ d4 r16 d8. ~ d4 |
+ r16 d8. ~ d4 r16 d8. ~ d4 |
+ r16 c8. ~ c4 r16 c8. ~ c4 |
+
+ r16 c8. ~ c4 ~ c2 |
+ r16 'b8. ~ 'b4 ~ 'b2 |
+ c1 ||}
+
+ % Bass
+ {\stemdown
+ d2 d |
+ g g |
+ g g |
+ f f |
+ f f |
+ e e |
+ e e |
+ d d |
+ 'g 'g |
+ c c |
+%% 20
+ c c |
+ 'f 'f |
+ 'fis 'fis |
+ 'aes 'aes |
+ 'g 'g |
+ 'g 'g |
+ 'g 'g |
+ 'g 'g |
+ 'g 'g |
+ 'g 'g |
+%% 30
+ 'g 'g |
+ 'g 'g |
+ 'c 'c |
+
+ 'c 'c |
+ 'c 'c |
+ 'c1 }>
+ }
+
+
+\score {
+ \melodic \type Grandstaff <
+ \multi 1;
+ < \multi 2;
+ \global
+ \soprane
+ >
+ < \multi 2;
+ \global
+ \bass
+ >
+ >
+
+ \paper{
+ gourlay_maxmeasures =5.;
+ }
+ \midi {
+ \tempo 4 = 84;
+ }
+}
+
+% EOF
--- /dev/null
+%% under construction
+
+define(preludepattern, `[' $1 $2 $3 $2 `]')
+define(preludehalfmeasure, preludepattern($1, $2, $3)
+ preludepattern($4, $2, $3))
+
+define(intromeasure,
+ preludehalfmeasure($1, $2, $3, $4)
+ preludehalfmeasure($1, $2, $3, $4)|
+)
+define(handymeasure, `intromeasure(translit($*,` ', `,'))')
+
+
+
+trebleIntro=\melodic {
+\octave c';
+handymeasure(c' es d c)
+handymeasure(as f e c)
+handymeasure(b f es d)
+handymeasure(c g f es)
+handymeasure(es' as g es)
+handymeasure(d' fis e d)
+handymeasure(d' g fis d)
+handymeasure(c' e d c)
+handymeasure(c' f e c)
+handymeasure(bes f es d)
+handymeasure(bes g f es)
+handymeasure(as g f es)
+handymeasure(as d c Bes)
+handymeasure(g Bes As es)
+handymeasure(f c Bes A)
+handymeasure(f d c B)
+handymeasure(es c B G)
+handymeasure(F es d f)
+handymeasure(Fis c b es)
+handymeasure(es c B G)
+handymeasure(fis c B A)
+handymeasure(g c B d)
+handymeasure(as c B d)
+}
+
+bassIntro = \melodic {
+\octave c;
+handymeasure(c g f es)
+handymeasure(c as g f)
+handymeasure(c as g f)
+handymeasure(c es d g)
+handymeasure(c c' bes as)
+handymeasure(c a g fis)
+handymeasure(Bes bes a g)
+handymeasure(Bes g f e)
+handymeasure(As as g f)
+handymeasure(As d c f)
+handymeasure(G es d g)
+handymeasure(c es d As)
+handymeasure(d f es as)
+handymeasure(es g f as)
+handymeasure(es a g f)
+handymeasure(d f es as)
+handymeasure(c f e as)
+preludehalfmeasure(c, es, d, f)
+preludehalfmeasure(bes, es, d, f)|
+handymeasure(As c b d)
+handymeasure(A es d c)
+handymeasure(G es d f)
+handymeasure(G es d c)
+handymeasure(G es d f)
+handymeasure(G es d f)
+}
+
+
+middlepiece = \melodic
+{
+ \octave c;
+ \stemdown
+ [G B d]
+ \stemup f [as f ef] [b f d' b'] [as f e f] |
+ \stemdown [G c es]]
+ \stemup g [c' g fis g ] [es' c' g' es'] [c' as g as]|
+ \stemdown [G A fis]
+ \translator Staff=treble
+ \stemsboth \octave c';
+ c [es c B c] [fis c a fis] [es c B c] |
+}
+
+
+
+}
{
if (dur.ticks_i_)
return String("[") + String(dur.ticks_i_) + "]";
-
+
String str;
- if (dur.durlog_i_ <= 0)
- str="\\breve";
- else
- str= String(type2_i(dur.durlog_i_));
+ if (dur.durlog_i_ >= 0)
+ str = String( type2_i(dur.durlog_i_) );
+ else if (dur.durlog_i_ == -1)
+ str = "\\breve";
+ else if (dur.durlog_i_ == -2)
+ str = "\\longa";
str += String('.', dur.dots_i_);
if (dur.plet_b())
str += String("*") + String(dur.plet_.iso_i_)
if (state_stack_.empty())
{
return false;
- }else
+ }
+ else
{
yy_switch_to_buffer(state_stack_.pop());
return true;
class Binary_source_file : public Source_file {
public:
- Binary_source_file( String& filename_str );
+ Binary_source_file(String& filename_str );
virtual ~Binary_source_file();
- virtual String error_str( char const* pos_ch_c_l ) const;
- virtual int line_i( char const* pos_ch_c_l ) const;
+ virtual String error_str(char const* pos_ch_c_l ) const;
+ virtual int line_i(char const* pos_ch_c_l ) const;
};
#endif // BINARY_SOURCE_FILE_HH //
// static int const division_1_c_i = 384;
// /// Return (integer, division) representation.
-// static int dur2_i( Duration dur, int division_1_i = division_1_c_i );
+// static int dur2_i(Duration dur, int division_1_i = division_1_c_i );
/// Return number of ticks in (ticks, division_1) representation
- static int dur2ticks_i( Duration dur );
+ static int dur2ticks_i(Duration dur );
/// Return the type_i representation of note length i
static int i2_type(int i);
static int type2_i(int type);
/// Return Moment representation (fraction of whole note).
- static Moment dur2_mom( Duration dur );
+ static Moment dur2_mom(Duration dur );
/// Return Mudela string representation.
- static String dur2_str( Duration dur );
+ static String dur2_str(Duration dur );
// /// Return Moment from (integer, division) representation.
-// static Moment i2_mom( int i, int division_1_i = division_1_c_i );
+// static Moment i2_mom(int i, int division_1_i = division_1_c_i );
// /// Return Moment (fraction of whole) representation, best guess.
-// static Duration mom2_dur( Moment mom );
+// static Duration mom2_dur(Moment mom );
/// Return duration from Moment (fraction of whole) representation.
- static Duration mom2_dur( Moment mom );
+ static Duration mom2_dur(Moment mom );
/// Return standardised duration, best guess if not exact.
- static Duration mom2standardised_dur( Moment mom );
+ static Duration mom2standardised_dur(Moment mom );
/// Return plet factor (not a Moment: should use Rational?).
- static Moment plet_factor_mom( Duration dur );
+ static Moment plet_factor_mom(Duration dur );
static void set_array();
/** Return synchronisation factor for mom, so that
- mom2_dur( mom / sync_f ) will return the duration dur.
+ mom2_dur(mom / sync_f ) will return the duration dur.
*/
- static Real sync_f( Duration dur, Moment mom );
+ static Real sync_f(Duration dur, Moment mom );
/// Return exact duration, in midi-ticks if not-exact.
- static Duration ticks2_dur( int ticks_i );
+ static Duration ticks2_dur(int ticks_i );
/// Return standardised duration, best guess if not exact.
- static Duration ticks2standardised_dur( int ticks_i );
+ static Duration ticks2standardised_dur(int ticks_i );
};
/// (iter_dur)
void set_plet(int,int );
void set_plet(Duration );
static bool duration_type_b(int t);
- void set_ticks( int ticks_i );
+ void set_ticks(int ticks_i );
Moment length() const ; // zo naai mij
static int division_1_i_s;
String location_str() const;
Input(Source_file*, char const*);
Input();
- Input( Input const& );
+ Input(Input const& );
};
#endif // INPUT_HH
public:
/** Ugh! filename gets changed! The path to the opened file may
change, since it might be searched in multiple directories. */
- Source_file( String filename_str_r );
+ Source_file(String filename_str_r );
virtual ~Source_file();
char const* ch_C() const;
- virtual String error_str( char const* pos_ch_c_l ) const;
+ virtual String error_str(char const* pos_ch_c_l ) const;
istream * istream_l();
- bool in_b( char const* pos_ch_c_l ) const;
+ bool in_b(char const* pos_ch_c_l ) const;
int length_i() const;
- virtual int line_i( char const* pos_ch_c_l ) const;
+ virtual int line_i(char const* pos_ch_c_l ) const;
String name_str() const;
- String file_line_no_str( char const* ch_c_l ) const;
+ String file_line_no_str(char const* ch_c_l ) const;
private:
String name_str_;
public:
Sources();
- Source_file * get_file_l( String &filename );
- Source_file* sourcefile_l( char const* ch_C );
+ Source_file * get_file_l(String &filename );
+ Source_file* sourcefile_l(char const* ch_C );
void set_path(File_path*p_C);
void set_binary(bool);
private:
const File_path * path_C_;
- void add( Source_file* sourcefile_p );
+ void add(Source_file* sourcefile_p );
Pointer_list<Source_file*> sourcefile_p_list_;
bool binary_b_ ;
};
#include "string.hh"
-void warning( String message_str );
-void error( String message_str);
+void warning(String message_str );
+void error(String message_str);
#endif // WARN_HH
Simple_file_storage::Simple_file_storage(String s)
{
data_p_ =0;
+
/*
let's hope that "b" opens anything binary, and does not apply
CR/LF translation
*/
- FILE * f = fopen (s.ch_C(), "rb");
+ FILE * f = (s) ? fopen (s.ch_C(), "rb") : stdin;
+
if (!f)
{
- warning("can't open file\n");
+ warning("can't open file `" + s + "'");
return ;
}
ret = fread(data_p_, sizeof(char), len_i_, f);
-#if 1 // ugh, \r\n -> \n translation
- assert (ret==len_i_);
-#endif
- fclose(f);
+ if (ret!=len_i_)
+ warning ("Huh? got " + String(ret) + ", expected "
+ + String(len_i_) + " characters");
+
+ if (f != stdin)
+ fclose(f);
}
char const*
/*
- source-file.cc -- implement
+ source-file.cc -- implement Source_file
source file of the GNU LilyPond music typesetter
Source_file::Source_file(String filename_str)
{
- name_str_ = filename_str;
- istream_p_ = 0;
- storage_p_ = new Simple_file_storage(filename_str);
+ name_str_ = filename_str;
+ istream_p_ = 0;
+ storage_p_ = new Simple_file_storage(filename_str);
}
istream*
Source_file::istream_l()
{
+ /*
if (!name_str_.length_i())
- return &cin;
-
- if (!istream_p_)
- {
- if (length_i()) // can-t this be done without such a hack?
- istream_p_ = new istrstream(ch_C(), length_i());
- else
- {
- istream_p_ = new istrstream("", 0);
- istream_p_->set(ios::eofbit);
- }
- }
- return istream_p_;
+ return &cin;
+ */
+
+ if (!istream_p_)
+ {
+ if (length_i()) // can-t this be done without such a hack?
+ istream_p_ = new istrstream(ch_C(), length_i());
+ else
+ {
+ istream_p_ = new istrstream("", 0);
+ istream_p_->set(ios::eofbit);
+ }
+ }
+ return istream_p_;
}
String
return "(unknown)";
else
return name_str() + ": "
- + String(line_i(context_ch_C));
+ + String(line_i(context_ch_C));
}
String
Source_file::name_str() const
{
- return name_str_;
+ return name_str_;
}
Source_file::~Source_file()
{
- delete istream_p_;
- istream_p_ = 0;
- delete storage_p_;
+ delete istream_p_;
+ istream_p_ = 0;
+ delete storage_p_;
}
String
Source_file::error_str(char const* pos_ch_C) const
{
- char const* data_ch_C = ch_C();
- char const * eof_C_ = data_ch_C + length_i();
- if (!in_b(pos_ch_C))
- return "(position unknown)";
+ char const* data_ch_C = ch_C();
+ char const * eof_C_ = data_ch_C + length_i();
+ if (!in_b(pos_ch_C))
+ return "(position unknown)";
- if (pos_ch_C == eof_C_)
- pos_ch_C --;
- char const* begin_ch_C = pos_ch_C;
- while (begin_ch_C > data_ch_C)
- if (*--begin_ch_C == '\n')
- {
- begin_ch_C++;
- break;
- }
-
- char const* end_ch_C = pos_ch_C;
- while (end_ch_C < eof_C_)
- if (*end_ch_C++ == '\n')
- {
- end_ch_C--;
- break;
- }
+ if (pos_ch_C == eof_C_)
+ pos_ch_C --;
+ char const* begin_ch_C = pos_ch_C;
+ while (begin_ch_C > data_ch_C)
+ if (*--begin_ch_C == '\n')
+ {
+ begin_ch_C++;
+ break;
+ }
+
+ char const* end_ch_C = pos_ch_C;
+ while (end_ch_C < eof_C_)
+ if (*end_ch_C++ == '\n')
+ {
+ end_ch_C--;
+ break;
+ }
- // String(char const* p, int length) is missing!?
- String line_str((Byte const*)begin_ch_C, end_ch_C - begin_ch_C);
-
- int error_col_i = 0;
- char const* scan_ch_C = begin_ch_C;
- while (scan_ch_C < pos_ch_C)
- if (*scan_ch_C++ == '\t')
- error_col_i = (error_col_i / 8 + 1) * 8;
- else
- error_col_i++;
-
- String str = line_str.left_str(pos_ch_C - begin_ch_C)
- + String('\n')
- + String(' ', error_col_i)
- + line_str.mid_str(pos_ch_C - begin_ch_C, INT_MAX); // String::mid should take 0 arg..
- return str;
+ // String(char const* p, int length) is missing!?
+ String line_str((Byte const*)begin_ch_C, end_ch_C - begin_ch_C);
+
+ int error_col_i = 0;
+ char const* scan_ch_C = begin_ch_C;
+ while (scan_ch_C < pos_ch_C)
+ if (*scan_ch_C++ == '\t')
+ error_col_i = (error_col_i / 8 + 1) * 8;
+ else
+ error_col_i++;
+
+ String str = line_str.left_str(pos_ch_C - begin_ch_C)
+ + String('\n')
+ + String(' ', error_col_i)
+ + line_str.mid_str(pos_ch_C - begin_ch_C, INT_MAX); // String::mid should take 0 arg..
+ return str;
}
bool
Source_file::in_b(char const* pos_ch_C) const
{
- return (pos_ch_C && (pos_ch_C >= ch_C()) && (pos_ch_C <= ch_C() + length_i()));
+ return (pos_ch_C && (pos_ch_C >= ch_C()) && (pos_ch_C <= ch_C() + length_i()));
}
int
Source_file::line_i(char const* pos_ch_C) const
{
- if (!in_b(pos_ch_C))
- return 0;
+ if (!in_b(pos_ch_C))
+ return 0;
- int i = 1;
- char const* scan_ch_C = ch_C();
- if (!scan_ch_C)
- return 0;
+ int i = 1;
+ char const* scan_ch_C = ch_C();
+ if (!scan_ch_C)
+ return 0;
- while (scan_ch_C < pos_ch_C)
- if (*scan_ch_C++ == '\n')
- i++;
- return i;
+ while (scan_ch_C < pos_ch_C)
+ if (*scan_ch_C++ == '\n')
+ i++;
+ return i;
}
int
Source_file::length_i() const
{
- return storage_p_->length_i();
+ return storage_p_->length_i();
}
char const *
Source_file::ch_C() const
{
- return storage_p_->ch_C();
+ return storage_p_->ch_C();
}
MAJOR_VERSION = 0
MINOR_VERSION = 1
-PATCH_LEVEL = 12
+PATCH_LEVEL = 13
# use to send patches, always empty for released version:
# include separator: ".postfix", "-pl" makes rpm barf
--- /dev/null
+/*
+ abbreviation-beam-engraver.cc -- implement Abbreviation_beam_engraver
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+ Jan Nieuwenhuizen <jan@digicash.com>
+*/
+
+#include "duration-convert.hh"
+#include "time-description.hh"
+#include "abbreviation-beam-engraver.hh"
+#include "stem.hh"
+#include "abbreviation-beam.hh"
+#include "musical-request.hh"
+#include "misc.hh"
+
+IMPLEMENT_IS_TYPE_B1(Abbreviation_beam_engraver, Engraver);
+ADD_THIS_TRANSLATOR(Abbreviation_beam_engraver);
+
+Abbreviation_beam_engraver::Abbreviation_beam_engraver ()
+{
+ span_reqs_drul_[LEFT] = span_reqs_drul_[RIGHT] = 0;
+ abeam_p_ = 0;
+}
+
+bool
+Abbreviation_beam_engraver::do_try_request (Request*r)
+{
+ Musical_req* mus_l = r->musical ();
+ if (!mus_l)
+ return false;
+
+ Abbreviation_beam_req * b = mus_l->abbrev_beam ();
+
+ if (!b)
+ return false;
+
+ if (bool (abeam_p_) == bool (b->spantype == Span_req::START))
+ return false;
+
+ Direction d = (!abeam_p_) ? LEFT : RIGHT;
+ if (span_reqs_drul_[d] && !span_reqs_drul_[d]->equal_b (mus_l))
+ return false;
+
+ span_reqs_drul_[d] = b;
+ return true;
+}
+
+void
+Abbreviation_beam_engraver::do_process_requests ()
+{
+ if (!abeam_p_ && span_reqs_drul_[LEFT]) {
+ abeam_p_ = new Abbreviation_beam;
+ announce_element (Score_elem_info (abeam_p_, span_reqs_drul_[LEFT]));
+ }
+}
+
+void
+Abbreviation_beam_engraver::do_pre_move_processing ()
+{
+ if (abeam_p_ && span_reqs_drul_[RIGHT]) {
+ typeset_element (abeam_p_);
+ abeam_p_ = 0;
+
+ span_reqs_drul_[RIGHT] =
+ span_reqs_drul_[LEFT] = 0;
+ }
+}
+
+void
+Abbreviation_beam_engraver::do_removal_processing ()
+{
+ if (abeam_p_)
+ {
+ span_reqs_drul_[LEFT]->warning ("unterminated beam");
+ typeset_element (abeam_p_);
+ abeam_p_ = 0;
+ }
+}
+
+
+void
+Abbreviation_beam_engraver::acknowledge_element (Score_elem_info i)
+{
+ if (!abeam_p_ || !i.elem_l_->is_type_b (Stem::static_name ()))
+ return;
+
+ Stem* s = (Stem*)i.elem_l_->item ();
+
+ int type_i = span_reqs_drul_[LEFT]->type_i_;
+ s->flag_i_ = intlog2 (type_i) - 2;
+ if (span_reqs_drul_[RIGHT])
+ s->beams_left_i_ = s->flag_i_;
+ else
+ s->beams_right_i_ = s->flag_i_;
+ abeam_p_->add (s);
+}
--- /dev/null
+/*
+ abbreviation-beam.cc -- implement Abbreviation_beam
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+ Jan Nieuwenhuizen <jan@digicash.com>
+*/
+
+#include "p-col.hh"
+#include "varray.hh"
+#include "proto.hh"
+#include "dimen.hh"
+#include "abbreviation-beam.hh"
+#include "misc.hh"
+#include "debug.hh"
+#include "symbol.hh"
+#include "molecule.hh"
+#include "leastsquares.hh"
+#include "stem.hh"
+#include "paper-def.hh"
+#include "lookup.hh"
+#include "stem-info.hh"
+
+
+IMPLEMENT_IS_TYPE_B1 (Abbreviation_beam, Spanner);
+
+Abbreviation_beam::Abbreviation_beam ()
+ : Beam ()
+{
+}
+
+Molecule*
+Abbreviation_beam::brew_molecule_p () const
+{
+ /*
+ todo
+ */
+ return Beam::brew_molecule_p ();
+#if 0
+ Molecule *mol_p = new Molecule;
+ // huh? inter-what
+ // Real inter_f = paper ()->interbeam_f ();
+ Real inter_f = paper ()->internote_f ();
+ Real x0 = stems[0]->hpos_f ();
+ for (int j=0; j <stems.size (); j++)
+ {
+ Stem *i = stems[j];
+ Stem * prev = (j > 0)? stems[j-1] : 0;
+ Stem * next = (j < stems.size ()-1) ? stems[j+1] :0;
+
+ Molecule sb = stem_beams (i, next, prev);
+ Real x = i->hpos_f ()-x0;
+ sb.translate (Offset (x, (x * slope + left_pos)* inter_f));
+ mol_p->add (sb);
+ }
+ mol_p->translate (x0 - spanned_drul_[LEFT]->absolute_coordinate (X_AXIS), X_AXIS);
+ return mol_p;
+#endif
+}
+
+void
+Abbreviation_beam::do_print () const
+{
+#ifndef NPRINT
+ Beam::do_print ();
+ Spanner::do_print ();
+#endif
+}
+
+/*
+ beams to go with one stem.
+ */
+Molecule
+Abbreviation_beam::stem_beams (Stem *here, Stem *next, Stem *prev) const
+{
+ /*
+ todo
+ - shorter beams (not reaching outer "stems")
+ for [:16 c4 c4] and [:16 c1 c1]
+ - centered beam on [:16 c1 c1] heads, rather than "stems"
+ */
+ return Beam::stem_beams (here, next, prev);
+}
String
Atom::TeX_string() const
{
+ String tex_str = sym_.tex;
+ Offset off = off_;
+
/* infinity checks. */
- assert (abs (off_.x()) < 100 CM);
- assert (abs (off_.y()) < 100 CM);
-
+ for (int a =X_AXIS; a < NO_AXES; a++)
+ {
+ Axis ax = (Axis)a;
+ if (abs (off[ax]) >= 100 CM)
+ {
+ warning ("ridiculous dimension " + axis_name_str (ax) + ", "
+ +print_dimen(off[ax]));
+ off[ax] = 0.0;
+ tex_str += "\errormark";
+ }
+ }
// whugh.. Hard coded...
- String s ("\\placebox{%}{%}{%}");
- Array<String> a;
- a.push (print_dimen (off_.y()));
- a.push (print_dimen (off_.x()));
- a.push (sym_.tex);
- return substitute_args (s, a);
+ String s ("\\placebox{");
+ s += print_dimen (off[Y_AXIS])+"}{";
+ s += print_dimen (off[X_AXIS]) + "}{";
+ s += tex_str + "}";
+ return s;
}
#include "audio-column.hh"
#include "audio-item.hh"
-#include "audio-score.hh"
+#include "performance.hh"
#include "debug.hh"
Audio_column::Audio_column (Moment at_mom)
{
at_mom_ = at_mom;
- audio_score_l_ = 0;
+ performance_l_ = 0;
}
void
{
#ifndef NPRINT
DOUT << "Audio_column {";
- DOUT << "at: " << at_mom_ << "\n";
- DOUT << "}\n";
+ DOUT << "at: " << at_mom_ << ". Contains:";
+ for (PCursor<Audio_item*> i (audio_item_l_list_.top ()); i.ok (); i++)
+ DOUT << i->name () << ", ";
+ DOUT << "\n}\n";
#endif
}
*/
#include "audio-element.hh"
-
+#include "debug.hh"
+
IMPLEMENT_IS_TYPE_B(Audio_element);
+
Audio_element::~Audio_element()
-{}
+{
+}
+
+void
+Audio_element::print () const
+{
+#ifndef NPRINT
+ DOUT << name () << "{ ";
+ do_print ();
+ DOUT << "}";
+#endif
+}
+
+void
+Audio_element::do_print ()const
+{
+}
(c) 1997 Jan Nieuwenhuizen <jan@digicash.com>
*/
-
+#include "debug.hh"
#include "audio-item.hh"
#include "midi-item.hh"
+#include "request.hh"
+#include "audio-column.hh"
Audio_instrument::Audio_instrument (String instrument_str)
- : Audio_item (0)
+ : Audio_item (0)
{
str_ = instrument_str;
}
{
return str_.length_i() ? new Midi_instrument(0, str_) : 0;
}
-
+IMPLEMENT_IS_TYPE_B1(Audio_instrument, Audio_item);
+
Audio_item::Audio_item (Request* req_l)
{
audio_column_l_ = 0;
}
Audio_key::Audio_key (Request* req_l)
- : Audio_item (req_l)
+ : Audio_item (req_l)
{
}
{
return new Midi_key (this);
}
-
+IMPLEMENT_IS_TYPE_B1 (Audio_key, Audio_item);
Audio_note::Audio_note (Request* req_l)
- : Audio_item (req_l)
+ : Audio_item (req_l)
{
}
return new Midi_note (this);
}
+IMPLEMENT_IS_TYPE_B1(Audio_note, Audio_item);
+
Audio_tempo::Audio_tempo (int per_minute_4_i)
- : Audio_item (0)
+ : Audio_item (0)
{
per_minute_4_i_ = per_minute_4_i;
}
return new Midi_tempo (this);
}
+IMPLEMENT_IS_TYPE_B1(Audio_tempo, Audio_item);
+
Audio_meter::Audio_meter (Request* req_l)
- : Audio_item (req_l)
+ : Audio_item (req_l)
{
}
{
return new Midi_meter (this);
}
+IMPLEMENT_IS_TYPE_B1(Audio_meter, Audio_item);
Audio_text::Audio_text (Audio_text::Type type, String text_str)
- : Audio_item (0)
+ : Audio_item (0)
{
- text_str_ = text_str;
- type_ = type;
+ text_str_ = text_str;
+ type_ = type;
}
Midi_item*
return text_str_.length_i() ? new Midi_text(this) : 0;
}
+IMPLEMENT_IS_TYPE_B1(Audio_text, Audio_item);
IMPLEMENT_IS_TYPE_B1(Audio_item, Audio_element);
+
+void
+Audio_item::do_print () const
+{
+#ifndef NPRINT
+ if (audio_column_l_)
+ {
+ DOUT << "at: "<< audio_column_l_->at_mom ();
+ }
+ if (req_l_)
+ {
+ DOUT << "from: ";
+ req_l_->print ();
+ }
+#endif
+}
+
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
#include "interval.hh"
-#include "axis-group.hh"
+#include "axis-group-administration.hh"
#include "score-elem.hh"
#include "debug.hh"
Axis_group_administration::add_element (Score_elem*e,
Axis_group_element*g, Axis a1, Axis a2)
{
- assert (! e->axis_group_l_a_[a1] && !e->axis_group_l_a_[a2]);
- e->axis_group_l_a_[a1] = g;
- e->axis_group_l_a_[a2] = g;
+ Axis_group_element *& g1=e->axis_group_l_a_[a1];
+ Axis_group_element *& g2 = e->axis_group_l_a_[a2];
+
+ assert (!g1 || g1 == g);
+ assert (!g2 || g2 == g);
+ g1 = g;
+ g2 = g;
elem_l_arr_.push (e);
}
}
IMPLEMENT_IS_TYPE_B1(Bar_column_engraver, Engraver);
-ADD_THIS_ENGRAVER(Bar_column_engraver);
+ADD_THIS_TRANSLATOR(Bar_column_engraver);
Script_column::do_substitute_dependency (o,n);
if (o == bar_l_)
{
- bar_l_ = n ? (Bar*)n->item() : 0;
+ bar_l_ = n ? (Bar*)n->item() : 0;
}
}
void
Bar_engraver::do_process_requests()
{
+ if (bar_p_)
+ return ;
+
if (bar_req_l_)
{
bar_p_ = new Bar;
else
{
Disallow_break_req r;
- daddy_grav_l_->try_request (&r);
+ daddy_grav_l()->try_request (&r);
}
}
IMPLEMENT_IS_TYPE_B1(Bar_engraver,Engraver);
-ADD_THIS_ENGRAVER(Bar_engraver);
+ADD_THIS_TRANSLATOR(Bar_engraver);
/*
- bar-number-grav.cc -- implement Bar_number_grav
+ bar-number-grav.cc -- implement Bar_number_engraver
source file of the GNU LilyPond music typesetter
#include "bar.hh"
#include "time-description.hh"
-Bar_number_grav::Bar_number_grav()
+Bar_number_engraver::Bar_number_engraver()
{
script_p_ =0;
}
static Command_script_req dummy;
void
-Bar_number_grav::acknowledge_element (Score_elem_info i)
+Bar_number_engraver::acknowledge_element (Score_elem_info i)
{
if (i.origin_grav_l_arr_.size() == 1 &&
i.elem_l_->is_type_b (Bar::static_name()) && !script_p_)
}
void
-Bar_number_grav::do_pre_move_processing()
+Bar_number_engraver::do_pre_move_processing()
{
if (script_p_)
{
}
}
-IMPLEMENT_IS_TYPE_B1(Bar_number_grav,Engraver);
-ADD_THIS_ENGRAVER(Bar_number_grav);
+IMPLEMENT_IS_TYPE_B1(Bar_number_engraver,Engraver);
+ADD_THIS_TRANSLATOR(Bar_number_engraver);
/*
span_score_bar needs dims, so don't do
- transparent_b_ = empty_b_ = (type_str_ == "");
+ transparent_b_ = empty_b_ = (!type_str_);
*/
}
void
Beam_engraver::acknowledge_element (Score_elem_info i)
{
- if (beam_p_ && i.elem_l_->is_type_b (Stem::static_name()))
+ if (!beam_p_ || !i.elem_l_->is_type_b (Stem::static_name ()))
+ return;
+
+ Stem* s = (Stem*)i.elem_l_->item();
+ Rhythmic_req *rhythmic_req = i.req_l_->musical ()->rhythmic ();
+ if (rhythmic_req->duration_.durlog_i_<= 2)
{
- Stem * s = (Stem*)i.elem_l_->item();
- Rhythmic_req *rhythmic_req = i.req_l_->musical ()->rhythmic ();
- if (rhythmic_req->duration_.durlog_i_<= 2)
- {
- rhythmic_req->warning ("Stem doesn't fit in Beam");
- return ;
- }
-
- /*
- TODO: do something sensible if it doesn't fit in the beam.
- */
- current_grouping_p_->add_child (get_staff_info().time_C_->whole_in_measure_,
- rhythmic_req->duration());
- /*
- TODO
- should change rep. of flags too.k
- */
- s->flag_i_ = Duration_convert::type2_i
- (rhythmic_req->duration_.durlog_i_);
- s->print_flag_b_ = false;
- beam_p_->add (s);
+ rhythmic_req->warning ("Stem doesn't fit in Beam");
+ return;
}
+
+ /*
+ TODO: do something sensible if it doesn't fit in the beam.
+ */
+ current_grouping_p_->add_child (get_staff_info().time_C_->whole_in_measure_,
+ rhythmic_req->duration ());
+ /*
+ TODO
+ should change repr. of flags too.
+ */
+ s->flag_i_ = Duration_convert::type2_i (rhythmic_req->duration_.durlog_i_);
+ beam_p_->add (s);
}
-
+
IMPLEMENT_IS_TYPE_B1(Beam_engraver, Engraver);
-ADD_THIS_ENGRAVER(Beam_engraver);
+ADD_THIS_TRANSLATOR(Beam_engraver);
#include "paper-def.hh"
#include "lookup.hh"
#include "grouping.hh"
+#include "stem-info.hh"
+IMPLEMENT_IS_TYPE_B1(Beam, Spanner);
-struct Stem_info {
- Real x;
- int dir_;
- Real idealy_f_;
- Real miny_f_;
- int beams_i_;
-
- Stem_info(){}
- Stem_info (Stem const *);
-};
-
-Stem_info::Stem_info (Stem const *s)
+Beam::Beam()
{
- x = s->hpos_f();
- dir_ = s->dir_;
- beams_i_ = intlog2(s->flag_i_) - 2;
+ slope = 0;
+ left_pos = 0.0;
+}
- /*
- [todo]
- * get algorithm
- * runtime
-
- Breitkopf + H\"artel:
- miny_f_ = interline + #beams * interbeam
- ideal8 = 2 * interline + interbeam
- ideal16,32,64,128 = 1.5 * interline + #beams * interbeam
-
- * B\"arenreiter:
- miny_f_ = interline + #beams * interbeam
- ideal8,16 = 2 interline + #beams * interbeam
- ideal32,64,128 = 1.5 interline + #beams * interbeam
-
- */
+void
+Beam::add (Stem*s)
+{
+ stems.push (s);
+ s->add_dependency (this);
+ s->beam_l_ = this;
- Real notehead_y = s->paper()->interline_f ();
- // huh? why do i need the / 2
- // Real interbeam_f = s->paper()->interbeam_f ();
- Real interbeam_f = s->paper()->interbeam_f () / 2;
-
- /* well eh, huh?
- idealy_f_ = dir_ * s->stem_start_f() + beams_i_ * interbeam_f;
- if (beams_i_ < 3)
- idealy_f_ += 2 * interline_f;
- else
- idealy_f_ += 1.5 * interline_f;
- */
-
- idealy_f_ = dir_ * s->stem_end_f();
-
- miny_f_ = dir_ * s->stem_start_f() + notehead_y + beams_i_ * interbeam_f;
-
- idealy_f_ = miny_f_ >? idealy_f_;
- // assert (miny_f_ <= idealy_f_);
+ if (!spanned_drul_[LEFT])
+ set_bounds(LEFT,s);
+ else
+ set_bounds(RIGHT,s);
}
+Molecule*
+Beam::brew_molecule_p() const
+{
+ Molecule *mol_p = new Molecule;
+ // huh? inter-what
+ // Real inter_f = paper()->interbeam_f ();
+ Real inter_f = paper()->internote_f ();
+ Real x0 = stems[0]->hpos_f();
+ for (int j=0; j <stems.size(); j++)
+ {
+ Stem *i = stems[j];
+ Stem * prev = (j > 0)? stems[j-1] : 0;
+ Stem * next = (j < stems.size()-1) ? stems[j+1] :0;
-/* *************** */
-
+ Molecule sb = stem_beams (i, next, prev);
+ Real x = i->hpos_f()-x0;
+ sb.translate (Offset (x, (x * slope + left_pos)* inter_f));
+ mol_p->add (sb);
+ }
+ mol_p->translate (x0 - spanned_drul_[LEFT]->absolute_coordinate(X_AXIS), X_AXIS);
+ return mol_p;
+}
Offset
Beam::center() const
return Offset (w, (left_pos + w* slope)*paper()->internote_f ());
}
+void
+Beam::do_pre_processing()
+{
+ if (!dir_)
+ set_default_dir();
+}
-Beam::Beam()
+void
+Beam::do_print() const
{
- slope = 0;
- left_pos = 0.0;
+#ifndef NPRINT
+ DOUT << "slope " <<slope << "left ypos " << left_pos;
+ Spanner::do_print();
+#endif
}
void
-Beam::add (Stem*s)
+Beam::do_post_processing()
{
- stems.push (s);
- s->add_dependency (this);
- s->print_flag_b_ = false;
+ if (stems.size() < 2)
+ {
+ warning ("Beam with less than 2 stems");
+ transparent_b_ = true;
+ return ;
+ }
+ solve_slope();
+ set_stemlens();
+}
- if (!spanned_drul_[LEFT])
- set_bounds(LEFT,s);
- set_bounds(RIGHT,s);
+void
+Beam::do_substitute_dependent (Score_elem*o,Score_elem*n)
+{
+ if (o->is_type_b (Stem::static_name()))
+ stems.substitute ((Stem*)o->item(), n?(Stem*) n->item ():0);
+}
+
+Interval
+Beam::do_width() const
+{
+ return Interval (stems[0]->hpos_f(),
+ stems.top()->hpos_f ());
}
void
}
}
-
-void
-Beam::do_post_processing()
-{
- if (stems.size() < 2)
- {
- warning ("Beam with less than 2 stems");
- transparent_b_ = true;
- return ;
- }
- solve_slope();
- set_stemlens();
-}
-
void
Beam::set_grouping (Rhythmic_grouping def, Rhythmic_grouping cur)
{
}
}
-void
-Beam::do_pre_processing()
-{
- if (!dir_)
- set_default_dir();
-
-}
-
-
-Interval
-Beam::do_width() const
-{
- return Interval (stems[0]->hpos_f(),
- stems.top()->hpos_f ());
-}
-
/*
beams to go with one stem.
*/
leftbeams.add (rightbeams);
return leftbeams;
}
-
-
-Molecule*
-Beam::brew_molecule_p() const
-{
-
- Molecule *mol_p = new Molecule;
- // huh? inter-what
- // Real inter_f = paper()->interbeam_f ();
- Real inter_f = paper()->internote_f ();
- Real x0 = stems[0]->hpos_f();
- for (int j=0; j <stems.size(); j++)
- {
- Stem *i = stems[j];
- Stem * prev = (j > 0)? stems[j-1] : 0;
- Stem * next = (j < stems.size()-1) ? stems[j+1] :0;
-
- Molecule sb = stem_beams (i, next, prev);
- Real x = i->hpos_f()-x0;
- sb.translate (Offset (x, (x * slope + left_pos)* inter_f));
- mol_p->add (sb);
- }
- mol_p->translate (x0 - spanned_drul_[LEFT]->absolute_coordinate(X_AXIS), X_AXIS);
- return mol_p;
-}
-
-
-IMPLEMENT_IS_TYPE_B1(Beam, Spanner);
-
-void
-Beam::do_print() const
-{
-#ifndef NPRINT
- DOUT << "slope " <<slope << "left ypos " << left_pos;
- Spanner::do_print();
-#endif
-}
-
-void
-Beam::do_substitute_dependent (Score_elem*o,Score_elem*n)
-{
- if (o->is_type_b (Stem::static_name()))
- {
- stems.substitute ((Stem*)o->item(), n?(Stem*) n->item ():0);
- }
-}
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
-#include "translator.hh"
+#include "translator-group.hh"
#include "debug.hh"
#include "chord-iterator.hh"
{
clef_p_ = 0;
clef_req_l_ =0;
-
- set_type ("violin");
+ clef_type_str_ = 0;
+ c0_position_i_ =0;
}
bool
clef_type_str_ = s;
if (clef_type_str_ == "violin")
{
- c0_position_i_= -2;
+ c0_position_i_= -2;
}
else if (clef_type_str_ == "alto")
{
- c0_position_i_= 4;
+ c0_position_i_= 4;
}
else if (clef_type_str_ == "tenor")
{
- c0_position_i_= 6;
+ c0_position_i_= 6;
}
else if (clef_type_str_ == "bass")
{
- c0_position_i_= 10;
+ c0_position_i_= 10;
}
else
- return false;
+ return false;
return true;
}
Clef_engraver::read_req (Clef_change_req*c_l)
{
if (!set_type (c_l->clef_str_))
- c_l->error ("unknown clef type ");
+ c_l->error ("unknown clef type ");
}
void
Clef_engraver::acknowledge_element (Score_elem_info info)
{
if (info.elem_l_->name() == Bar::static_name ())
{
- create_clef();
- if (!clef_req_l_)
- clef_p_->default_b_ = true;
+ create_clef();
+ if (!clef_req_l_)
+ clef_p_->default_b_ = true;
}
}
void
Clef_engraver::do_creation_processing()
{
- create_clef();
+ Scalar def = get_property ("defaultclef");
+ if (def)
+ set_type (def);
+ else
+ set_type ("violin");
+ create_clef();
clef_p_->default_b_ = false;
}
{
Command_req* creq_l= r_l->command();
if (!creq_l || !creq_l->clefchange())
- return false;
+ return false;
clef_req_l_ = creq_l->clefchange();
{
if (!clef_p_)
{
- clef_p_ = new Clef_item;
+ clef_p_ = new Clef_item;
announce_element (Score_elem_info (clef_p_,clef_req_l_));
}
clef_p_->read (*this);
{
if (clef_req_l_)
{
- create_clef();
- clef_p_->default_b_ = false;
+ create_clef();
+ clef_p_->default_b_ = false;
}
}
Clef_engraver::do_pre_move_processing()
{
if (!clef_p_)
- return;
+ return;
typeset_element (clef_p_);
clef_p_ = 0;
}
IMPLEMENT_IS_TYPE_B1(Clef_engraver,Engraver);
-ADD_THIS_ENGRAVER(Clef_engraver);
+ADD_THIS_TRANSLATOR(Clef_engraver);
void
Collision_engraver::acknowledge_element (Score_elem_info i)
{
- if (!(i.elem_l_->name() == Note_column::static_name ()))
- return;
-
- if (!col_p_)
+ if (i.elem_l_->is_type_b (Note_column::static_name ()))
{
- col_p_ = new Collision;
- announce_element (Score_elem_info (col_p_,0));
+ Note_column * c = (Note_column*) i.elem_l_->item ();
+ if (c->rest_b ())
+ return ;
+ if (!col_p_)
+ {
+ col_p_ = new Collision;
+ announce_element (Score_elem_info (col_p_,0));
+ }
+ col_p_->add (c);
}
- col_p_->add ((Note_column*)i.elem_l_->item());
}
-
void
Collision_engraver::do_pre_move_processing()
{
if (col_p_)
{
- typeset_element (col_p_);
- col_p_ =0;
+ typeset_element (col_p_);
+ col_p_ =0;
}
}
Collision_engraver::Collision_engraver()
IMPLEMENT_IS_TYPE_B1(Collision_engraver,Engraver);
-ADD_THIS_ENGRAVER(Collision_engraver);
+ADD_THIS_TRANSLATOR(Collision_engraver);
/*
[stem up, stem up shifted, stem down shifted, stem down]
- */
+ */
Array<Note_column*> clash_group_arr_a[4];
for (int i=0; i < clash_l_arr_.size(); i++)
{
- Note_column* c_l = clash_l_arr_[i];
- if (! c_l->dir_)
- {
- warning ("No stem direction set. Ignoring column in clash. ");
- continue;
- }
- int d = (c_l->dir_);
+ Note_column* c_l = clash_l_arr_[i];
+ if (! c_l->dir_)
+ {
+ warning ("No stem direction set. Ignoring column in clash. ");
+ continue;
+ }
+ int d = (c_l->dir_);
- clash_group_arr_a[idx (d, c_l->h_shift_b_)].push (c_l);
+ clash_group_arr_a[idx (d, c_l->h_shift_b_)].push (c_l);
}
for (int j=0; j < 4; j++)
{
- if (clash_group_arr_a[j].size() > 1)
- {
- warning ("Too many clashing notecolumns. Ignoring them.");
- return;
- }
+ if (clash_group_arr_a[j].size() > 1)
+ {
+ warning ("Too many clashing notecolumns. Ignoring them.");
+ return;
+ }
}
int d = 1;
do
{
- if (!clash_group_arr_a[idx (d, false)].size())
- {
- clash_group_arr_a[idx (d, false)] = clash_group_arr_a[idx (d, true)];
- clash_group_arr_a[idx (d, true)].clear();
- }
- } while ((d *= -1) != 1);
+ if (!clash_group_arr_a[idx (d, false)].size())
+ {
+ clash_group_arr_a[idx (d, false)] = clash_group_arr_a[idx (d, true)];
+ clash_group_arr_a[idx (d, true)].clear();
+ }
+ }
+ while ((d *= -1) != 1);
Interval_t<int> y_extent[4];
for (int j =0 ; j < 4; j++)
{
- if (clash_group_arr_a[j].size())
- col_l_a[j] = clash_group_arr_a[j][0];
- else
- col_l_a[j] = 0;
+ if (clash_group_arr_a[j].size())
+ col_l_a[j] = clash_group_arr_a[j][0];
+ else
+ col_l_a[j] = 0;
- if (col_l_a[j])
- {
- y_extent[j] = col_l_a[j]->head_positions_interval();
- }
+ if (col_l_a[j])
+ {
+ y_extent[j] = col_l_a[j]->head_positions_interval();
+ }
- x_off [j] = 0.0;
- y_off[j] = 0;
+ x_off [j] = 0.0;
+ y_off[j] = 0;
}
do
{
- x_off[idx (d, true)] = d*0.5;
- } while ((d *= -1) != 1);
+ x_off[idx (d, true)] = d*0.5;
+ }
+ while ((d *= -1) != 1);
// y_extent: smallest y-pos noteball interval containing all balls
// 4 (0..3) groups: stem up/down; shift on/off;
Interval_t<int> middle (y_extent[idx (-1,0)].max(),
- y_extent[idx (1,0)].min());
+ y_extent[idx (1,0)].min());
Interval_t<int> open_middle (y_extent[idx (-1,0)].max()+1, y_extent[idx (1,0)].min ()-1);
do
{
- if (!open_middle.contains_b (y_extent[idx (d,true)]))
- x_off[idx (d, true)] = d *1.0 ;
- } while ((d *= -1) != 1);
+ if (!open_middle.contains_b (y_extent[idx (d,true)]))
+ x_off[idx (d, true)] = d *1.0 ;
+ } while ((d *= -1) != 1);
if (!middle.empty_b()
- && middle.length() < 2 && col_l_a[idx (1,0)] && col_l_a[idx (-1,0)]) {
-// reproduction of bugfix at 3am ?
- Note_head * nu_l= col_l_a[idx (1,0)]->head_l_arr_[0];
- Note_head * nd_l = col_l_a[idx (-1,0)]->head_l_arr_.top();
- if (! (nu_l->balltype_i_ == nd_l->balltype_i_
- && nu_l->dots_i_ == nd_l->dots_i_ && middle.length() == 0))
- {
- x_off[idx (1,0)] -= 0.5;
- x_off[idx (1,1)] -= 0.5;
- x_off[idx (-1,1)] += 0.5;
- x_off[idx (-1,0)] += 0.5;
- }
+ && middle.length() < 2 && col_l_a[idx (1,0)] && col_l_a[idx (-1,0)]) {
+ // reproduction of bugfix at 3am ?
+ Note_head * nu_l= col_l_a[idx (1,0)]->head_l_arr_[0];
+ Note_head * nd_l = col_l_a[idx (-1,0)]->head_l_arr_.top();
+ if (! (nu_l->balltype_i_ == nd_l->balltype_i_
+ && nu_l->dots_i_ == nd_l->dots_i_ && middle.length() == 0))
+ {
+ x_off[idx (1,0)] -= 0.5;
+ x_off[idx (1,1)] -= 0.5;
+ x_off[idx (-1,1)] += 0.5;
+ x_off[idx (-1,0)] += 0.5;
+ }
- }
+ }
Real inter_f = paper()->internote_f ();
Real wid_f = paper()->note_width ();
for (int j=0; j < 4; j++)
{
- if (col_l_a[j])
- {
- /* collision.cc:138: request for method `translate' is ambiguous
+ if (col_l_a[j])
+ {
+ /* collision.cc:138: request for method `translate' is ambiguous
- (shaddup)
+ (shaddup)
*/
- Offset o (x_off[j] * wid_f, y_off[j] * inter_f);
- ((Score_elem*)col_l_a[j])->translate (o);
- }
+ Offset o (x_off[j] * wid_f, y_off[j] * inter_f);
+ ((Score_elem*)col_l_a[j])->translate (o);
+ }
}
}
Collision::do_substitute_dependency (Score_elem*o_l,Score_elem*n_l)
{
clash_l_arr_.substitute ((Note_column*)o_l->item(),
- (Note_column*)(n_l?n_l->item():0));
+ (Note_column*)(n_l?n_l->item():0));
}
{
clef_str_ = s;
}
-/* *************** */
-
-IMPLEMENT_IS_TYPE_B1(Group_feature_req,Command_req);
-
-void
-Group_feature_req::do_print() const
-{
-#ifndef NPRINT
- DOUT << type_str_ << "=" << value_str_;
-#endif
-}
/* *************** */
--- /dev/null
+/*
+ dot-column-grav.cc -- implement
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
--- /dev/null
+/*
+ dot-column.cc -- implement Dot_column
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "dots.hh"
+#include "dot-column.hh"
+#include "rhythmic-head.hh"
+
+void
+Dot_column::add (Dots *d)
+{
+ dot_l_arr_.push (d);
+ add_dependency (d);
+ add_element (d);
+}
+
+void
+Dot_column::add (Rhythmic_head *r)
+{
+ if (!r->dots_l_)
+ return ;
+
+ head_l_arr_.push (r);
+ add_dependency (r);
+ add (r->dots_l_);
+}
+
+void
+Dot_column::do_substitute_dependency (Score_elem*o,Score_elem*n)
+{
+ Item *oi =o->item ();
+ Item *ni = n?n->item ():0;
+
+ if (oi&&oi->is_type_b (Rhythmic_head::static_name ()))
+ head_l_arr_.substitute ((Rhythmic_head*)oi, (Rhythmic_head*)ni);
+ else if (oi && oi->is_type_b (Dots::static_name ()))
+ dot_l_arr_.substitute ((Dots*) oi, (Dots*) ni);
+}
+
+void
+Dot_column::do_pre_processing ()
+{
+ Interval w;
+ for (int i=0; i < head_l_arr_.size (); i++)
+ w.unite (head_l_arr_[i]->width ());
+
+ if (!w.empty_b ())
+ translate (w[RIGHT] - width() [LEFT],X_AXIS);
+}
+
+IMPLEMENT_IS_TYPE_B1(Dot_column, Horizontal_group_item);
--- /dev/null
+/*
+ dots.cc -- implement Dots
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "dots.hh"
+#include "molecule.hh"
+#include "paper-def.hh"
+#include "lookup.hh"
+
+Dots::Dots ()
+{
+ no_dots_i_ =0;
+ position_i_ =0;
+}
+
+void
+Dots::do_post_processing ()
+{
+ if (!(position_i_ % 2))
+ position_i_ ++;
+}
+
+Molecule*
+Dots::brew_molecule_p () const
+{
+ Symbol d = paper ()->lookup_l ()->dots (no_dots_i_);
+ Molecule *out = new Molecule (Atom (d));
+ Real inter_f = paper ()->internote_f ();
+ out->translate (inter_f * position_i_, Y_AXIS);
+ return out;
+}
+
+IMPLEMENT_IS_TYPE_B1(Dots, Item);
Dynamic_engraver::Dynamic_engraver()
{
- dir_ = CENTER;
do_post_move_processing();
+ dir_ = CENTER;
dynamic_p_ =0;
to_end_cresc_p_ = cresc_p_ = 0;
cresc_req_l_ = 0;
}
}
-void
-Dynamic_engraver::set_feature (Feature i)
-{
- if (i.type_ == "vdir")
- dir_ = (Direction) int(i.value_);
-}
-
IMPLEMENT_IS_TYPE_B1(Dynamic_engraver,Engraver);
-ADD_THIS_ENGRAVER(Dynamic_engraver);
+ADD_THIS_TRANSLATOR(Dynamic_engraver);
-Dynamic_engraver::~Dynamic_engraver()
+void
+Dynamic_engraver::do_removal_processing ()
{
- delete dynamic_p_;
- delete to_end_cresc_p_;
- if (cresc_p_)
+ if (cresc_p_)
{
+ typeset_element (cresc_p_ );
+ cresc_p_ =0;
+ }
+ if (to_end_cresc_p_)
+ {
+ typeset_element (to_end_cresc_p_);
cresc_req_l_->warning ("unended crescendo");
+ to_end_cresc_p_ =0;
+ }
+ if (dynamic_p_)
+ {
+ typeset_element (dynamic_p_);
+ dynamic_p_ =0;
}
- delete cresc_p_;
}
+
void
Dynamic_engraver::acknowledge_element (Score_elem_info i)
{
#include "debug.hh"
#include "p-score.hh"
#include "score-elem.hh"
-#include "input-translator.hh"
-Engraver* get_engraver_p (String);
-
-void
-Engraver_group_engraver::print() const
-{
- Engraver::print();
-}
-
-Engraver_group_engraver::~Engraver_group_engraver()
-{
- assert (removable_b());
-}
-
-void
-Engraver_group_engraver::check_removal()
-{
- for (int i =0; i < group_l_arr_.size();)
- {
- group_l_arr_[i]->check_removal();
- if (group_l_arr_[i]->removable_b())
- terminate_engraver (group_l_arr_[i]);
- else
- i++;
- }
-}
-
-bool
-Engraver_group_engraver::removable_b() const
-{
- return !iterator_count_&& !group_l_arr_.size() ;
-}
-
-Engraver_group_engraver::Engraver_group_engraver()
-{
- itrans_l_ = 0;
-}
-
-void
-Engraver_group_engraver::set_feature (Feature d)
-{
- PCursor<Engraver*> i (grav_list_.top());
- // why the while construct?
- while (i.ok())
- {
- // this construction to ensure clean deletion
- Engraver *grav_l = i++;
- grav_l->set_feature (d);
- }
-}
-
-void
-Engraver_group_engraver::sync_features()
-{
- PCursor<Engraver*> i (grav_list_.top());
- while (i.ok())
- {
- Engraver *grav_l = i++;
- grav_l->sync_features();
- }
-}
-
-void
-Engraver_group_engraver::do_pre_move_processing()
-{
- PCursor<Engraver*> i (grav_list_.top());
- while (i.ok())
- {
- Engraver *grav_l = i++;
- grav_l->pre_move_processing();
- }
-}
-
-void
-Engraver_group_engraver::do_process_requests()
-{
- PCursor<Engraver*> i (grav_list_.top());
- while (i.ok())
- {
- Engraver *grav_l = i++;
- grav_l->process_requests();
- }
-}
-
-
-void
-Engraver_group_engraver::do_post_move_processing()
-{
- PCursor<Engraver*> i (grav_list_.top());
- while (i.ok())
- {
- // this construction to ensure clean deletion
- Engraver *grav_l = i++;
- grav_l->post_move_processing();
- }
-}
-
-
-bool
-Engraver_group_engraver::contains_b (Engraver* grav_l) const
-{
- bool parent_b = Engraver::contains_b (grav_l);
-
- if (parent_b)
- return true;
- for (PCursor<Engraver*> i (grav_list_.top()); i.ok (); i++)
- if (i->contains_b (grav_l))
- return true;
- return false;
-}
-
-
-
-bool
-Engraver_group_engraver::do_try_request (Request*req_l)
-{
- bool hebbes_b =false;
- for (int i =0; !hebbes_b && i < nongroup_l_arr_.size() ; i++)
- hebbes_b =nongroup_l_arr_[i]->try_request (req_l);
- if (!hebbes_b && daddy_grav_l_)
- hebbes_b = daddy_grav_l_->try_request (req_l);
- return hebbes_b ;
-}
-
-bool
-Engraver_group_engraver::try_request (Request* r)
-{
- return Engraver::try_request (r);
-}
-
-void
-Engraver_group_engraver::add (Engraver *grav_p)
-{
- grav_list_.bottom().add (grav_p);
- grav_p->daddy_grav_l_ = this;
-
- if (grav_p->is_type_b (Engraver_group_engraver::static_name()))
- {
- group_l_arr_.push ((Engraver_group_engraver*)grav_p);
- }
- else
- {
- nongroup_l_arr_ .push (grav_p);
- }
-}
-
-
-Engraver *
-Engraver_group_engraver::remove_engraver_p (Engraver*grav_l)
-{
- group_l_arr_.substitute ((Engraver_group_engraver*)grav_l,0);
- nongroup_l_arr_.substitute (grav_l,0);
- PCursor<Engraver*> grav_cur (grav_list_.find (grav_l));
-
- return grav_cur.remove_p();
-}
-
-void
-Engraver_group_engraver::terminate_engraver (Engraver*r_l)
-{
- DOUT << "Removing " << r_l->name() << " at " << get_staff_info ().when () << "\n";
- r_l->removal_processing();
- Engraver * grav_p =remove_engraver_p (r_l);
-
- delete grav_p;
-}
-
-IMPLEMENT_IS_TYPE_B2(Engraver_group_engraver,Engraver, Translator);
-
-ADD_THIS_ENGRAVER(Engraver_group_engraver);
-
-void
-Engraver_group_engraver::do_print() const
-{
-#ifndef NPRINT
- if (!check_debug)
- return ;
- DOUT << "ID: " << id_str_ ;
- DOUT << " iterators: " << iterator_count_<< "\n";
- for (PCursor<Engraver*> i (grav_list_.top()); i.ok (); i++)
- i->print();
-#endif
-}
-
-
-Engraver_group_engraver*
-Engraver_group_engraver::find_engraver_l (String n, String id)
-{
- if (name() == n && id_str_ == id)
- return this;
- Engraver_group_engraver * r = 0;
- for (int i =0; !r && i< group_l_arr_.size(); i++)
- {
- r = group_l_arr_[i]->find_engraver_l (n,id);
- }
-
- return r;
-}
-
-Translator*
-Engraver_group_engraver::find_get_translator_l (String n,String id)
-{
- Translator * ret=0;
- Input_translator * itrans_l= itrans_l_-> recursive_find (n);
- if (itrans_l)
- {
- ret = find_engraver_l (n,id);
- if (!ret)
- {
- Engraver_group_engraver * group =
- itrans_l-> get_group_engraver_p();
-
- add (group);
- ret = group;
-
- if (group->itrans_l_->is_name_b (n))
- ret ->id_str_ = id;
- else
- return ret->find_get_translator_l (n,id);
-
- }
- }
- else if (daddy_grav_l_)
- ret =daddy_grav_l_->find_get_translator_l (n,id);
- else
- {
- warning ("Can't find or create `" + n + "' called `" + id + "'\n");
- ret =0;
- }
- return ret;
-}
-
-int
-Engraver_group_engraver::depth_i() const
-{
- return daddy_grav_l_->depth_i() + 1;
-}
-
-Translator*
-Engraver_group_engraver::ancestor_l (int l)
-{
- if (!l || !daddy_grav_l_)
- return this;
-
- return daddy_grav_l_->ancestor_l (l-1);
-}
+IMPLEMENT_IS_TYPE_B2(Engraver_group_engraver,Engraver, Translator_group);
+ADD_THIS_TRANSLATOR(Engraver_group_engraver);
void
Engraver_group_engraver::announce_element (Score_elem_info info)
void
Engraver_group_engraver::do_announces()
{
- for (int i=0; i < group_l_arr_.size(); i++)
+ Link_array<Translator_group> groups = group_l_arr ();
+ for (int i=0; i < groups.size(); i++)
{
- group_l_arr_[i]->do_announces();
+ Engraver * eng = groups[i]->engraver_l ();
+ if (eng)
+ {
+ Engraver_group_engraver * group =
+ (Engraver_group_engraver*) eng;
+ group->do_announces();
+ }
}
Request dummy_req;
-
+
+ Link_array<Translator> nongroups = nongroup_l_arr ();
for (int j =0; j < announce_info_arr_.size(); j++)
{
Score_elem_info info = announce_info_arr_[j];
-
+
if (!info.req_l_)
info.req_l_ = &dummy_req;
- for (int i=0; i < nongroup_l_arr_.size(); i++) { // Is this good enough?6
- if (nongroup_l_arr_[i] != info.origin_grav_l_arr_[0])
- nongroup_l_arr_[i]->acknowledge_element (info);
- }
+ for (int i=0; i < nongroups.size(); i++)
+ { // Is this good enough?
+ Engraver * eng = nongroups[i]->engraver_l ();
+ if (eng && eng!= info.origin_grav_l_arr_[0])
+ eng->acknowledge_element (info);
+ }
}
announce_info_arr_.clear();
}
-void
-Engraver_group_engraver::do_removal_processing()
-{
- for (PCursor<Engraver*> i (grav_list_.top()); i.ok (); i++)
- i->removal_processing();
-}
-
Staff_info
Engraver_group_engraver::get_staff_info() const
{
Staff_info inf = Engraver::get_staff_info();
- for (int i=0; i < nongroup_l_arr_.size(); i++)
- nongroup_l_arr_[i]->fill_staff_info (inf);
-
+ Link_array<Translator> simple_translators = nongroup_l_arr ();
+ for (int i=0; i < simple_translators.size(); i++)
+ {
+ Engraver * eng = simple_translators[i]->engraver_l ();
+ if (eng)
+ eng->fill_staff_info (inf);
+ }
return inf;
}
-Translator*
-Engraver_group_engraver::get_default_interpreter()
-{
- // ?
- if (is_bottom_engraver_b())
- return daddy_grav_l_->get_default_interpreter();
- Engraver_group_engraver *grav_p= itrans_l_->
- get_default_itrans_l()->get_group_engraver_p ();
- add (grav_p);
- if (grav_p->is_bottom_engraver_b())
- return grav_p;
- else
- return grav_p->get_default_interpreter();
-}
-bool
-Engraver_group_engraver::is_bottom_engraver_b() const
+Engraver_group_engraver::~Engraver_group_engraver ()
{
- return !itrans_l_->get_default_itrans_l();
}
-Engraver*
-Engraver_group_engraver::get_simple_engraver (char const *type) const
+Engraver_group_engraver::Engraver_group_engraver ()
{
- for (int i=0; i < nongroup_l_arr_.size(); i++)
- {
- if (nongroup_l_arr_[i]->name() == type)
- return nongroup_l_arr_[i];
- }
- if (daddy_grav_l_)
- return daddy_grav_l_->get_simple_engraver (type);
- return 0;
}
-
#include "engraver-group.hh"
#include "debug.hh"
-void
-Engraver::post_move_processing()
-{
- if (status < CREATION_INITED)
- {
- do_creation_processing();
- status = CREATION_INITED;
- }
- if (status >= MOVE_INITED)
- return;
-
- do_post_move_processing();
- status = MOVE_INITED;
-}
-
-void
-Engraver::removal_processing()
-{
- if (status < CREATION_INITED)
- do_creation_processing();
-
- do_removal_processing();
-}
-
-bool
-Engraver::try_request (Request * r)
-{
- if (status < MOVE_INITED)
- post_move_processing();
-
- return do_try_request (r);
-}
-
-void
-Engraver::process_requests()
-{
- if (status < PROCESSED_REQS)
- post_move_processing();
- else if (status >= PROCESSED_REQS)
- return;
-
- status = PROCESSED_REQS;
- do_process_requests();
-}
-
-void
-Engraver::pre_move_processing()
-{
- do_pre_move_processing();
- status = CREATION_INITED;
-}
-
void
Engraver::fill_staff_info (Staff_info&)
{
}
-Scalar
-Engraver::get_feature (String t)
-{
- return daddy_grav_l_->get_feature (t);
-}
-
-bool
-Engraver::do_try_request (Request*)
-{
- return false;
-}
-
-Engraver::Engraver()
-{
- status = VIRGIN;
- daddy_grav_l_ = 0;
-}
void
Engraver::announce_element (Score_elem_info i)
{
i.origin_grav_l_arr_.push (this);
- daddy_grav_l_->announce_element (i);
+ daddy_grav_l()->announce_element (i);
}
void
Engraver::typeset_element (Score_elem*p)
{
- daddy_grav_l_->typeset_element (p);
+ daddy_grav_l()->typeset_element (p);
}
Paper_def*
Engraver::paper() const
{
- return daddy_grav_l_->paper();
+ return (Paper_def*)output_def_l_;
}
-bool
-Engraver::contains_b (Engraver *grav_l) const
-{
- return this == grav_l;
-}
Staff_info
Engraver::get_staff_info() const
{
- if (daddy_grav_l_)
- return daddy_grav_l_->get_staff_info();
+ if (daddy_grav_l())
+ return daddy_grav_l()->get_staff_info();
Staff_info info;
return info;
}
-void
-Engraver::print() const
-{
-#ifndef NPRINT
- DOUT << "\n" << name() << " {";
- do_print();
- DOUT << "}";
-#endif
-}
+IMPLEMENT_IS_TYPE_B1(Engraver, Translator);
-IMPLEMENT_IS_TYPE_B(Engraver);
-void
-Engraver::do_print() const
+Engraver_group_engraver*
+Engraver::daddy_grav_l () const
{
+ return (daddy_trans_l_ )
+ ? (Engraver_group_engraver*) daddy_trans_l_->engraver_l ()
+ : 0;
}
-
last_mom_ = 0;
}
-Translator*
-Global_translator::ancestor_l (int)
-{
- return this;
-}
-
void
Global_translator::add_moment_to_process (Moment m)
{
if (m > last_mom_)
- return;
+ return;
for (int i=0; i < extra_mom_pq_.size(); i++)
- if (extra_mom_pq_[i] == m)
- return;
+ if (extra_mom_pq_[i] == m)
+ return;
extra_mom_pq_.insert (m);
}
-int
-Global_translator::depth_i() const
-{
- return 0;
-}
-
void
Global_translator::modify_next (Moment &w)
{
while (extra_mom_pq_.size() &&
- extra_mom_pq_.front() <= w)
+ extra_mom_pq_.front() <= w)
- w =extra_mom_pq_.get();
+ w =extra_mom_pq_.get();
}
int
}
void
-Global_translator::prepare (Moment)
+Global_translator::prepare (Moment m)
{
+ now_mom_ = m;
}
+Moment
+Global_translator::now_moment () const
+{
+ return now_mom_;
+}
-IMPLEMENT_IS_TYPE_B1(Global_translator, Translator);
+IMPLEMENT_IS_TYPE_B1(Global_translator, Translator_group);
Music_output*
Global_translator::get_output_p()
#include "head-grav.hh"
#include "paper-def.hh"
#include "musical-request.hh"
+#include "dots.hh"
Note_head_engraver::Note_head_engraver()
{
+ dot_p_=0;
note_p_ = 0;
- do_post_move_processing();
+ note_req_l_ =0;
}
bool
Note_head_engraver::do_try_request (Request *req_l)
{
if (note_req_l_)
- return false;
+ return false;
- if (req_l->musical() && (req_l->musical ()->note () || req_l->musical ()->rest ()))
- note_req_l_=req_l->musical()->rhythmic ();
- else
- return false;
+ if (!(req_l->musical() && req_l->musical ()->note ()))
+ return false;
+
+ note_req_l_=req_l->musical()->rhythmic ();
return true;
}
void
Note_head_engraver::do_process_requests()
{
- if (!note_req_l_)
- return;
+ if (!note_req_l_ || note_p_)
+ return;
- Note_head*n_p = new Note_head (8); // ugh
- note_p_ = n_p;
- n_p->set_rhythmic (note_req_l_->rhythmic());
-
- if (note_req_l_->note())
+ note_p_ = new Note_head;
+ note_p_->balltype_i_ = note_req_l_->duration_.durlog_i_;
+ note_p_->dots_i_ = note_req_l_->duration_.dots_i_;
+ if (note_p_->dots_i_)
{
- n_p->position_i_ = note_req_l_->note()->height ();
- Staff_info inf = get_staff_info();
- if (inf.c0_position_i_l_)
- n_p->position_i_ += *inf.c0_position_i_l_;
- }
- else if (note_req_l_->rest())
- {
- n_p->rest_b_ = true;
+ dot_p_ = new Dots;
+ note_p_->dots_l_ = dot_p_;
+ announce_element (Score_elem_info (dot_p_,0));
}
+ note_p_->position_i_ = note_req_l_->note()->height ();
+
+ Staff_info inf = get_staff_info();
+ if (inf.c0_position_i_l_)
+ note_p_->position_i_ += *inf.c0_position_i_l_;
+
+
Score_elem_info itinf (note_p_,note_req_l_);
announce_element (itinf);
}
{
if (note_p_)
{
- typeset_element (note_p_);
- note_p_ = 0;
+ typeset_element (note_p_);
+ note_p_ = 0;
+ }
+ if (dot_p_)
+ {
+ typeset_element (dot_p_);
+ dot_p_ =0;
}
}
void
IMPLEMENT_IS_TYPE_B1(Note_head_engraver,Engraver);
-ADD_THIS_ENGRAVER(Note_head_engraver);
+ADD_THIS_TRANSLATOR(Note_head_engraver);
*/
#include "string.hh"
-#include "assoc-iter.hh"
+#include "dictionary-iter.hh"
#include "header.hh"
String
s+= "\\def\\LilyIdString{" + lily_id_str_ + "}";
- for (Assoc_iter<String, String> i(*this); i.ok(); i++)
+ for (Dictionary_iter<String> i(*this); i.ok(); i++)
{
s += "\\def\\mudela" + i.key() + "{" + i.val() + "}";
}
#include "lookup.hh"
#include "script-def.hh"
#include "request.hh"
-#include "input-translator.hh"
+#include "translator.hh"
IMPLEMENT_IS_TYPE_B(Identifier);
DEFAULT_PRINT(Script_id, General_script_def, script);
DEFAULT_PRINT(Lookup_id, Lookup, lookup);
-DEFAULT_PRINT(Input_translator_id, Input_trans, input_translator);
+DEFAULT_PRINT(Translator_id, Translator, translator);
DEFAULT_PRINT(Symtables_id, Symtables, symtables);
DEFAULT_PRINT(Music_id,Music , music);
DEFAULT_PRINT(Request_id, Request, request);
Idclass::Idclass (Class*st, int code):Identifier (code) { data_p_ = st; }\
IMPLEMENT_ID_CLASS(Duration_id, Duration, duration);
-IMPLEMENT_ID_CLASS(Input_translator_id, Input_translator, input_translator);
+IMPLEMENT_ID_CLASS(Translator_id, Translator, translator);
IMPLEMENT_ID_CLASS(Int_id, int, intid);
IMPLEMENT_ID_CLASS(Real_id, Real, real);
IMPLEMENT_ID_CLASS(Script_id, General_script_def, script);
}
DEFAULT_ACCESSOR(Duration_id, Duration, duration);
-DEFAULT_ACCESSOR(Input_translator_id,Input_translator, input_translator);
+VIRTUAL_ACCESSOR(Translator_id,Translator, translator);
DEFAULT_ACCESSOR(Int_id, int, intid);
DEFAULT_ACCESSOR(Real_id, Real, real);
VIRTUAL_ACCESSOR(Script_id, General_script_def, script);
--- /dev/null
+/*
+ abbreviation-beam-engraver.hh -- declare Abbreviation_beam_engraver
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+ Jan Nieuwenhuizen <jan@digicash.com>
+*/
+
+
+#ifndef ABBREVIATION_BEAM_ENGRAVER_HH
+#define ABBREVIATION_BEAM_ENGRAVER_HH
+
+#include "engraver.hh"
+#include "drul-array.hh"
+
+/**
+ Generate an abbreviation beam. Eat stems.
+ */
+class Abbreviation_beam_engraver : public Engraver
+{
+public:
+ TRANSLATOR_CLONE(Abbreviation_beam_engraver);
+ DECLARE_MY_RUNTIME_TYPEINFO;
+
+ Abbreviation_beam_engraver();
+
+protected:
+ virtual void do_removal_processing();
+ virtual void do_process_requests();
+ virtual bool do_try_request (Request*);
+ virtual void acknowledge_element (Score_elem_info);
+ virtual void do_pre_move_processing();
+
+private:
+ Drul_array<Abbreviation_beam_req *> span_reqs_drul_;
+ Abbreviation_beam* abeam_p_;
+};
+
+#endif // ABBREVIATION_BEAM_ENGRAVER_HH
--- /dev/null
+/*
+ abbreviation-beam-engraver.hh -- declare Abbreviation_beam_engraver
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+ Jan Nieuwenhuizen <jan@digicash.com>
+*/
+
+#ifndef ABBREVIATION_BEAM_HH
+#define ABBREVIATION_BEAM_HH
+
+#include "beam.hh"
+
+/** a beam connects multiple stems Beam adjusts the stems its owns to
+ make sure that they reach the beam and that point in the correct
+ direction */
+class Abbreviation_beam : public Beam {
+public:
+ DECLARE_MY_RUNTIME_TYPEINFO;
+
+ Abbreviation_beam();
+
+ SCORE_ELEM_CLONE(Abbreviation_beam);
+
+protected:
+ virtual void do_print() const;
+ virtual Molecule stem_beams (Stem *here, Stem *next, Stem *prev) const;
+ virtual Molecule* brew_molecule_p() const;
+};
+
+#endif // ABBREVIATION_BEAM_HH
+
void print() const;
Link_list<Audio_item *> audio_item_l_list_;
- Audio_score * audio_score_l_;
+ Performance * performance_l_;
private:
Audio_column (Audio_column const&);
#include "virtual-methods.hh"
struct Audio_element {
- virtual ~Audio_element();
- DECLARE_MY_RUNTIME_TYPEINFO;
+ void print ()const;
+
+ virtual ~Audio_element();
+ DECLARE_MY_RUNTIME_TYPEINFO;
+protected:
+ virtual void do_print () const;
};
#endif // AUDIO_ELEMENT_HH
virtual CSound_item* score_item_p() = 0;
*/
struct Audio_item : public Audio_element {
- Audio_item (Request* req_l);
+ Audio_item (Request* req_l);
- /// Create a midi-item from myself.
- virtual Midi_item* midi_item_p() = 0;
+ /// Create a midi-item from myself.
+ virtual Midi_item* midi_item_p() = 0;
- Audio_column* audio_column_l_;
- Request* req_l_;
+ Audio_column* audio_column_l_;
+ /*
+ THIS SUX. This ties the output system to the input system. Bad move.
+ */
+ Request* req_l_;
- DECLARE_MY_RUNTIME_TYPEINFO;
-
+ DECLARE_MY_RUNTIME_TYPEINFO;
+protected:
+ virtual void do_print () const;
+
private:
- Audio_item (Audio_item const&);
- Audio_item& operator=( Audio_item const&);
+ Audio_item (Audio_item const&);
+ Audio_item& operator=( Audio_item const&);
};
struct Audio_key : public Audio_item {
- Audio_key (Request* req_l);
-
- virtual Midi_item* midi_item_p();
+ Audio_key (Request* req_l);
+ DECLARE_MY_RUNTIME_TYPEINFO;
+ virtual Midi_item* midi_item_p();
};
struct Audio_instrument : public Audio_item {
- Audio_instrument (String instrument_str);
- virtual Midi_item* midi_item_p();
- String str_;
+ Audio_instrument (String instrument_str);
+ virtual Midi_item* midi_item_p();
+ String str_;
+ DECLARE_MY_RUNTIME_TYPEINFO;
};
struct Audio_note : public Audio_item {
- Audio_note (Request* req_l);
- virtual Midi_item* midi_item_p();
+ DECLARE_MY_RUNTIME_TYPEINFO;
+ Audio_note (Request* req_l);
+ virtual Midi_item* midi_item_p();
};
struct Audio_text : Audio_item {
- enum Type {
- TEXT = 1, COPYRIGHT, TRACK_NAME, INSTRUMENT_NAME, LYRIC,
- MARKER, CUE_POINT
- };
-
- Audio_text (Audio_text::Type type, String text_str);
- virtual Midi_item* midi_item_p();
-
- Type type_;
- String text_str_;
+ enum Type {
+ TEXT = 1, COPYRIGHT, TRACK_NAME, INSTRUMENT_NAME, LYRIC,
+ MARKER, CUE_POINT
+ };
+ DECLARE_MY_RUNTIME_TYPEINFO;
+ Audio_text (Audio_text::Type type, String text_str);
+ virtual Midi_item* midi_item_p();
+
+ Type type_;
+ String text_str_;
};
struct Audio_tempo : Audio_item {
- Audio_tempo (int per_minute_4_i);
- virtual Midi_item* midi_item_p();
-
- int per_minute_4_i_;
+ Audio_tempo (int per_minute_4_i);
+ virtual Midi_item* midi_item_p();
+ DECLARE_MY_RUNTIME_TYPEINFO;
+ int per_minute_4_i_;
};
struct Audio_meter : Audio_item {
- Audio_meter (Request* req_l);
- virtual Midi_item* midi_item_p();
+ Audio_meter (Request* req_l);
+ virtual Midi_item* midi_item_p();
+ DECLARE_MY_RUNTIME_TYPEINFO;
};
#endif // AUDIO_ITEM_HH
-
/*
- axes.hh -- declare
+ axes.hh -- declare Axis
source file of the GNU LilyPond music typesetter
--- /dev/null
+/*
+ axis-group-administration.hh -- declare Axis_group_administration
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef AXIS_GROUP_ADMINISTRATION_HH
+#define AXIS_GROUP_ADMINISTRATION_HH
+
+
+#include "parray.hh"
+#include "axes.hh"
+#include "real.hh"
+#include "lily-proto.hh"
+
+/**
+ Do the dirty work for Axis_group_element.
+ */
+struct Axis_group_administration {
+ Link_array<Score_elem> elem_l_arr_;
+
+ Interval extent (Axis) const;
+ void print() const ;
+ Axis_group_administration (Axis_group_administration const&);
+ Axis_group_administration(){}
+ void remove_all (Axis a1, Axis a2);
+
+ bool contains_b (Score_elem const *) const;
+ void add_element (Score_elem*, Axis_group_element*, Axis a1, Axis a2);
+ void remove_element (Score_elem*, Axis a1, Axis a2);
+};
+
+#endif // AXIS_GROUP_ADMINISTRATION_HH
--- /dev/null
+/*
+ axis-group-element.hh -- declare Axis_group_element
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef AXIS_GROUP_ELEMENT_HH
+#define AXIS_GROUP_ELEMENT_HH
+
+#include "score-elem.hh"
+#include "axis-group-administration.hh"
+/**
+ Treat a group of elements a unity in either or both axis sense .
+ This is a wrapper around Axis_group_administration
+ */
+class Axis_group_element : public virtual Score_elem {
+protected:
+ Axis_group_administration axis_admin_;
+ virtual void do_print() const;
+ virtual Link_array<Score_elem> get_extra_dependencies() const;
+ virtual void do_unlink();
+ virtual void do_junk_links();
+
+public:
+ Axis_group_element();
+ virtual void remove_all()=0;
+ virtual void add_element (Score_elem*)=0;
+ virtual void remove_element (Score_elem*)=0;
+ virtual bool contains_b (Score_elem const *) const;
+ DECLARE_MY_RUNTIME_TYPEINFO;
+};
+
+#endif // AXIS_GROUP_ELEMENT_HH
#ifndef AXIS_ITEM_HH
#define AXIS_ITEM_HH
-#include "axis-group.hh"
+#include "axis-group-element.hh"
#include "item.hh"
/**
#define SPAN_AXIS_GROUP_HH
#include "spanner.hh"
-#include "axis-group.hh"
+#include "axis-group-element.hh"
/** An element which groups a line in a certain direction. The most
useful example of this is the Vertical_group_spanner */
/*
-axis-group.hh -- declare Axis_group_administration, Axis_group_element
+axis-group-element.hh -- declare Axis_group_administration, Axis_group_element
source file of the GNU LilyPond music typesetter
*/
+#error
#ifndef Axis_group_administration_HH
-#define Axis_group_administration_HH
-
-#include "parray.hh"
-#include "axes.hh"
-#include "real.hh"
-#include "lily-proto.hh"
-#include "score-elem.hh"
-
-/**
- Do the dirty work for Axis_group_element.
- */
-struct Axis_group_administration {
- Link_array<Score_elem> elem_l_arr_;
-
- Interval extent (Axis) const;
- void print() const ;
- Axis_group_administration (Axis_group_administration const&);
- Axis_group_administration(){}
- void remove_all (Axis a1, Axis a2);
-
- bool contains_b (Score_elem const *) const;
- void add_element (Score_elem*, Axis_group_element*, Axis a1, Axis a2);
- void remove_element (Score_elem*, Axis a1, Axis a2);
-};
-
-/**
- Treat a group of elements a unity in either or both axis sense .
- This is a wrapper around Axis_group_administration
- */
-class Axis_group_element : public virtual Score_elem {
-protected:
- Axis_group_administration axis_admin_;
- virtual void do_print() const;
- virtual Link_array<Score_elem> get_extra_dependencies() const;
- virtual void do_unlink();
- virtual void do_junk_links();
-
-public:
- Axis_group_element();
- virtual void remove_all()=0;
- virtual void add_element (Score_elem*)=0;
- virtual void remove_element (Score_elem*)=0;
- virtual bool contains_b (Score_elem const *) const;
- DECLARE_MY_RUNTIME_TYPEINFO;
-};
-#endif // Axis_group_administration_HH
+#define Axis_group_administration_HH#endif // Axis_group_administration_HH
#define BAR_COLUMN_GRAV_HH
#include "engraver.hh"
+#include "parray.hh"
/// couple bars and appropriate scripts
class Bar_column_engraver :public Engraver {
- Bar_column *barcol_p_;
- Array< Script * > script_l_arr_;
+ Bar_column *barcol_p_;
+ Link_array<Script> script_l_arr_;
- Bar *bar_l_;
+ Bar *bar_l_;
protected:
- virtual void acknowledge_element (Score_elem_info);
- virtual void do_pre_move_processing();
- virtual void do_post_move_processing();
+ virtual void acknowledge_element (Score_elem_info);
+ virtual void do_pre_move_processing();
+ virtual void do_post_move_processing();
public:
- Bar_column_engraver();
- DECLARE_MY_RUNTIME_TYPEINFO;
+ TRANSLATOR_CLONE(Bar_column_engraver);
+ Bar_column_engraver();
+ DECLARE_MY_RUNTIME_TYPEINFO;
};
#endif // BAR_COLUMN_GRAV_HH
generate bars. Either user ("|:"), or default (new measure)
*/
class Bar_engraver : public Engraver {
- Bar_req * bar_req_l_;
- Bar * bar_p_;
+ Bar_req * bar_req_l_;
+ Bar * bar_p_;
public:
- Bar_engraver();
- DECLARE_MY_RUNTIME_TYPEINFO;
+ TRANSLATOR_CLONE(Bar_engraver);
+ Bar_engraver();
+ DECLARE_MY_RUNTIME_TYPEINFO;
protected:
- virtual bool do_try_request (Request *req_l);
- virtual void do_process_requests();
- virtual void do_pre_move_processing();
- virtual void do_post_move_processing();
+ virtual bool do_try_request (Request *req_l);
+ virtual void do_process_requests();
+ virtual void do_pre_move_processing();
+ virtual void do_post_move_processing();
};
#endif // BARGRAV_HH
/**
catch bars, and put a number over them.
*/
-class Bar_number_grav : public Engraver {
+class Bar_number_engraver : public Engraver {
Script * script_p_;
protected:
void acknowledge_element (Score_elem_info);
void do_pre_move_processing();
public:
- Bar_number_grav();
+ TRANSLATOR_CLONE(Bar_number_engraver);
+ Bar_number_engraver();
DECLARE_MY_RUNTIME_TYPEINFO;
};
#endif // BAR_NUMBER_GRAV_HH
Rhythmic_grouping *current_grouping_p_;
public:
+ TRANSLATOR_CLONE(Beam_engraver);
DECLARE_MY_RUNTIME_TYPEINFO;
Beam_engraver();
protected:
void set_grouping (Rhythmic_grouping def, Rhythmic_grouping current);
void set_stemlens();
SCORE_ELEM_CLONE(Beam);
+
protected:
- virtual Interval do_width() const;
- virtual Offset center() const;
- virtual void set_default_dir();
+ Interval do_width() const;
+ Offset center() const;
+ void set_default_dir();
virtual void do_pre_processing();
virtual void do_post_processing();
virtual void do_substitute_dependent (Score_elem*, Score_elem*);
virtual void do_print() const;
-private:
- Molecule stem_beams (Stem *here, Stem *next, Stem *prev) const;
- void solve_slope();
- Molecule*brew_molecule_p() const;
+ virtual Molecule stem_beams (Stem *here, Stem *next, Stem *prev) const;
+ virtual void solve_slope();
+ virtual Molecule*brew_molecule_p() const;
};
#endif // BEAM_HH
/*
- clef.hh -- part of GNU LilyPond
+ clef-grav.hh -- declare Clef_engraver
- (c) 1996,97 Han-Wen Nienhuys
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1996, 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
-#ifndef CLEF_HH
-#define CLEF_HH
+
+#ifndef CLEF_GRAV_HH
+#define CLEF_GRAV_HH
#include "scalar.hh"
#include "varray.hh"
/// where is c-0 in the staff?
class Clef_engraver : public Engraver {
- Clef_item *clef_p_;
- Clef_change_req * clef_req_l_;
- void create_clef();
- void read_req (Clef_change_req*);
- bool set_type (String);
+ Clef_item *clef_p_;
+ Clef_change_req * clef_req_l_;
+ void create_clef();
+ void read_req (Clef_change_req*);
+ bool set_type (String);
protected:
- virtual void do_process_requests();
- virtual void fill_staff_info (Staff_info&);
- virtual void do_pre_move_processing();
- virtual void do_removal_processing();
- virtual void do_creation_processing();
- virtual void do_post_move_processing();
- virtual bool do_try_request (Request*);
- virtual void acknowledge_element (Score_elem_info);
+ virtual void do_process_requests();
+ virtual void fill_staff_info (Staff_info&);
+ virtual void do_pre_move_processing();
+ virtual void do_removal_processing();
+ virtual void do_creation_processing();
+ virtual void do_post_move_processing();
+ virtual bool do_try_request (Request*);
+ virtual void acknowledge_element (Score_elem_info);
public:
- int c0_position_i_;
- String clef_type_str_;
+ TRANSLATOR_CLONE(Clef_engraver);
+ int c0_position_i_;
+ String clef_type_str_;
- /* ************** */
+ /* ************** */
- Clef_engraver();
- DECLARE_MY_RUNTIME_TYPEINFO;
+ Clef_engraver();
+ DECLARE_MY_RUNTIME_TYPEINFO;
};
-#endif // CLEF_HH
-
+#endif
#include "engraver.hh"
class Collision_engraver : public Engraver {
- Collision* col_p_;
+ Collision* col_p_;
protected:
- virtual void acknowledge_element (Score_elem_info);
- virtual void do_pre_move_processing();
+ virtual void acknowledge_element (Score_elem_info);
+ virtual void do_pre_move_processing();
public:
- Collision_engraver();
- DECLARE_MY_RUNTIME_TYPEINFO;
+ TRANSLATOR_CLONE(Collision_engraver);
+ Collision_engraver();
+ DECLARE_MY_RUNTIME_TYPEINFO;
};
#endif // COLLISION_GRAV_HH
class Command_req : public virtual Request {
public:
REQUESTMETHODS(Command_req, command);
- virtual Group_feature_req * groupfeature() { return 0; }
virtual Measure_grouping_req * measuregrouping() { return 0; }
virtual Clef_change_req * clefchange() { return 0; }
virtual Key_change_req * keychange() { return 0; }
REQUESTMETHODS(Bar_req,bar);
};
-class Group_feature_req : public Command_req {
-public:
- String type_str_;
- String value_str_;
-
- REQUESTMETHODS(Group_feature_req, groupfeature);
-};
-
/**
Handle key changes.
--- /dev/null
+/*
+ dot-column-grav.hh -- declare Dot_column_engraver
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef DOT_COLUMN_GRAV_HH
+#define DOT_COLUMN_GRAV_HH
+
+#include "engraver.hh"
+
+class Dot_column_engraver : public Engraver
+{
+
+};
+
+#endif // DOT_COLUMN_GRAV_HH
--- /dev/null
+/*
+ dot-column.hh -- declare Dot_column Dot_column
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef DOT_COLUMN_HH
+#define DOT_COLUMN_HH
+
+#include "horizontal-group-item.hh"
+
+/**
+ Group dots. This is needed because, the dots have to be aligned per voice
+ */
+class Dot_column : public Horizontal_group_item
+{
+ Link_array<Rhythmic_head> head_l_arr_;
+ Link_array<Dots> dot_l_arr_;
+ void add (Dots*);
+
+public:
+ DECLARE_MY_RUNTIME_TYPEINFO;
+ void add (Rhythmic_head*);
+protected:
+ virtual void do_pre_processing ();
+ virtual void do_substitute_dependency (Score_elem *o, Score_elem*n);
+};
+#endif // DOT_COLUMN_HH
--- /dev/null
+/*
+ dots.hh -- declare Dots
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef DOTS_HH
+#define DOTS_HH
+
+#include "item.hh"
+
+/**
+ The dots to go with a notehead/rest. A separate class, since they
+ are a party in collision resolution.
+ */
+class Dots : public Item
+{
+protected:
+ virtual Molecule * brew_molecule_p () const;
+ virtual void do_post_processing ();
+public:
+ int no_dots_i_;
+ int position_i_;
+
+ DECLARE_MY_RUNTIME_TYPEINFO;
+ Dots ();
+};
+
+#endif // DOTS_HH
#include "engraver.hh"
class Dynamic_engraver : public Engraver {
- Direction dir_;
- Text_item * dynamic_p_;
- Crescendo * to_end_cresc_p_;
- Crescendo * cresc_p_;
- Span_dynamic_req * cresc_req_l_;
- Array<Dynamic_req*> dynamic_req_l_arr_;
- /* ************** */
+ Direction dir_;
+ Text_item * dynamic_p_;
+ Crescendo * to_end_cresc_p_;
+ Crescendo * cresc_p_;
+ Span_dynamic_req * cresc_req_l_;
+ Array<Dynamic_req*> dynamic_req_l_arr_;
+ /* ************** */
public:
- Dynamic_engraver();
- ~Dynamic_engraver();
- DECLARE_MY_RUNTIME_TYPEINFO;
+ TRANSLATOR_CLONE(Dynamic_engraver);
+ Dynamic_engraver();
+ DECLARE_MY_RUNTIME_TYPEINFO;
protected:
- virtual void acknowledge_element (Score_elem_info);
- virtual bool do_try_request (Request *req_l);
- virtual void do_process_requests();
- virtual void do_pre_move_processing();
- virtual void do_post_move_processing();
- virtual void set_feature (Feature);
+ virtual void do_removal_processing ();
+ virtual void acknowledge_element (Score_elem_info);
+ virtual bool do_try_request (Request *req_l);
+ virtual void do_process_requests();
+ virtual void do_pre_move_processing();
+ virtual void do_post_move_processing();
};
#endif // DYNAMIC_GRAV_HH
#define ELEM_GROUP_HH
#include "score-elem.hh"
-#include "axis-group.hh"
+#include "axis-group-element.hh"
/*
- engravergroup.hh -- declare Engraver_group_engraver
+ engraver-group.hh -- declare Engraver_group_engraver
source file of the GNU LilyPond music typesetter
#include "plist.hh"
#include "score-elem-info.hh"
#include "engraver.hh"
-#include "translator.hh"
+#include "translator-group.hh"
/**
Group a number of engravers. Usually delegates everything to its contents.
Postfix: group
*/
-class Engraver_group_engraver : public Engraver, public virtual Translator {
+class Engraver_group_engraver : public Engraver, public virtual Translator_group {
protected:
- Pointer_list<Engraver*> grav_list_;
- Link_array<Engraver_group_engraver> group_l_arr_;
- Link_array<Engraver> nongroup_l_arr_;
-
- Array<Score_elem_info> announce_info_arr_;
-
- virtual void do_print() const;
- virtual bool removable_b() const;
+ Array<Score_elem_info> announce_info_arr_;
public:
- Engraver*get_simple_engraver (char const*typeinfo) const;
- virtual void print() const ;
-
- Input_translator * itrans_l_;
- void check_removal();
- Engraver_group_engraver();
- ~Engraver_group_engraver();
-
- bool is_bottom_engraver_b() const;
-
-
- /**
- Junk #grav_l#.
- Pre:
- #grav_l# is in #grav_list_#
- */
- virtual void terminate_engraver (Engraver * grav_l);
+ TRANSLATOR_CLONE(Engraver_group_engraver);
+ Engraver_group_engraver();
+ ~Engraver_group_engraver();
+ DECLARE_MY_RUNTIME_TYPEINFO;
- DECLARE_MY_RUNTIME_TYPEINFO;
-
- /**
- Remove #grav_l# from the list, and return it.
- */
- virtual Engraver * remove_engraver_p (Engraver*grav_l);
- virtual void set_feature (Feature i);
- virtual void sync_features();
-
- virtual void do_pre_move_processing();
- virtual void do_post_move_processing();
- virtual void do_removal_processing();
- virtual bool do_try_request (Request*);
- virtual bool try_request (Request*);
- virtual void do_process_requests();
-
- virtual Staff_info get_staff_info() const;
-
- virtual Engraver_group_engraver * find_engraver_l (String name,String id);
- virtual void do_announces();
- virtual void announce_element (Score_elem_info);
- virtual void add (Engraver* grav_p);
- virtual bool contains_b (Engraver*) const;
-
- virtual Translator* find_get_translator_l (String name, String id);
- virtual Translator * get_default_interpreter();
- /**
- Go up in the tree. default: choose next parent
- */
- Translator * ancestor_l (int l=1);
- int depth_i() const;
+ virtual Staff_info get_staff_info() const;
+ virtual void do_announces();
+ virtual void announce_element (Score_elem_info);
};
#endif // ENGRAVERGROUP_HH
#include "request.hh"
#include "score-elem-info.hh"
#include "staff-info.hh"
-
-
+#include "translator.hh"
/**
It may use derived classes. Hungarian postfix: grav
*/
-
-class Engraver {
+class Engraver : public virtual Translator {
- friend class Engraver_group_engraver;
- /**
- You cannot copy a Engraver
- */
- Engraver (const Engraver&){}
-
- enum {
- VIRGIN,
- CREATION_INITED,
- MOVE_INITED,
- ACCEPTED_REQS,
- PROCESSED_REQS,
- ACKED_REQS,
- MOVE_DONE
- } status;
+ friend class Engraver_group_engraver;
protected:
- /// utility
- virtual Paper_def * paper() const;
-
+ /// utility
+ Paper_def * paper() const;
+ /**
+ Invoke walker method to typeset element. Default: pass on to daddy.
+ */
+ virtual void typeset_element (Score_elem*elem_p);
- /// make items/spanners with the requests you got
- virtual void do_process_requests(){}
-
- /** typeset any items/spanners. Default: do nothing
- */
- virtual void do_pre_move_processing(){}
- /** reset any appropriate data. Default: do nothing
- */
- virtual void do_post_move_processing(){}
+ /**
+ take note of item/spanner
+ put item in spanner. Adjust local key; etc.
+
+ Default: ignore the info
+ */
+ virtual void acknowledge_element (Score_elem_info) {}
+ /**
+ Announce element. Default: pass on to daddy. Utility
+ */
+ virtual void announce_element (Score_elem_info);
+ /**
+ Get information on the staff. Default: ask daddy.
+ */
+ virtual Staff_info get_staff_info() const;
+ virtual void fill_staff_info (Staff_info&);
- virtual void do_creation_processing() {}
- virtual void do_removal_processing() {}
-
- /**
- Invoke walker method to typeset element. Default: pass on to daddy.
- */
- virtual void typeset_element (Score_elem*elem_p);
-
- /**
- take note of item/spanner
- put item in spanner. Adjust local key; etc.
-
- Default: ignore the info
- */
- virtual void acknowledge_element (Score_elem_info) {}
- /**
- Announce element. Default: pass on to daddy. Utility
- */
- virtual void announce_element (Score_elem_info);
- /**
- Set Feature of the engraver (s). Default: ignore Feature.
- */
- virtual void set_feature (Feature){}
- /**
- ask daddy for a feature
- */
- virtual Scalar get_feature (String type_str);
- /**
- Does this equal or contain a certain engraver?
- */
-
- virtual void sync_features() {}
-
- virtual bool contains_b (Engraver*grav_l) const;
- /**
- Get information on the staff. Default: ask daddy.
- */
- virtual Staff_info get_staff_info() const;
- virtual void fill_staff_info (Staff_info&);
-
-
- virtual void do_print() const;
- /*
- @see{try_request}
- Default: always return false
- */
- virtual bool do_try_request (Request *req_l);
public:
- void pre_move_processing();
- void process_requests();
- /**
- try to fit the request in this engraver
-
- @return
- false: not noted, not taken.
-
- true: request swallowed. Don't try to put the request elsewhere.
-
- */
- bool try_request (Request*);
- bool is_bottom_engraver() const;
-
- void post_move_processing();
- void removal_processing();
-
- Engraver_group_engraver * daddy_grav_l_;
-
- Engraver();
- virtual ~Engraver(){}
- DECLARE_MY_RUNTIME_TYPEINFO;
- void print() const;
+ TRANSLATOR_CLONE(Engraver);
+ Engraver_group_engraver * daddy_grav_l() const;
+ /**
+ override other ctor
+ */
+ Engraver () {}
+
+ DECLARE_MY_RUNTIME_TYPEINFO;
+ void print() const;
+ virtual Engraver * engraver_l () { return this; }
};
-/**
- A macro to automate administration of engravers.
- */
-#define ADD_THIS_ENGRAVER(c) \
-struct c ## init { \
- static Engraver * globalctor(){ \
- return new c; \
- } \
- c ## init() { \
- add_engraver (c::static_name(), globalctor); \
- \
- } \
-} _ ## c ## init;
-
-typedef Engraver*(*Grav_ctor)(void);
-void add_engraver (String s, Grav_ctor f);
#endif // ENGRAVER_HH
#ifndef GLOBAL_TRANSLATOR_HH
#define GLOBAL_TRANSLATOR_HH
-#include "translator.hh"
+#include "translator-group.hh"
#include "pqueue.hh"
-class Global_translator : public virtual Translator {
+class Global_translator : public virtual Translator_group{
PQueue<Moment> extra_mom_pq_;
public:
+ TRANSLATOR_CLONE(Global_translator);
Moment last_mom_;
+ Moment now_mom_;
Global_translator();
+
int moments_left_i() const;
void modify_next (Moment&);
void add_moment_to_process (Moment);
virtual void process() {}
virtual void finish() {}
virtual void start() {}
-
+
DECLARE_MY_RUNTIME_TYPEINFO;
protected:
-
+ virtual Moment now_moment () const;
virtual Global_translator *global_l() { return this; }
- virtual int depth_i() const;
- virtual Translator *ancestor_l (int);
};
make balls and rests
*/
class Note_head_engraver : public Engraver {
- Note_head* note_p_;
- Rhythmic_req * note_req_l_;
+ Note_head* note_p_;
+ Dots * dot_p_;
+ Rhythmic_req * note_req_l_;
public:
- Note_head_engraver();
- DECLARE_MY_RUNTIME_TYPEINFO;
+ TRANSLATOR_CLONE(Note_head_engraver);
+ Note_head_engraver();
+ DECLARE_MY_RUNTIME_TYPEINFO;
protected:
- virtual bool do_try_request (Request *req_l) ;
- virtual void do_process_requests();
- virtual void do_pre_move_processing();
- virtual void do_post_move_processing();
+ virtual bool do_try_request (Request *req_l) ;
+ virtual void do_process_requests();
+ virtual void do_pre_move_processing();
+ virtual void do_post_move_processing();
};
#define HEADER_HH
#include "string.hh"
-#include "assoc.hh"
+#include "dictionary.hh"
-struct Header : Assoc<String, String>
+struct Header : Dictionary<String>
{
String lily_id_str_;
String TeX_string() const;
void print() const;
DECLARE_MY_RUNTIME_TYPEINFO;
void error (String);
- IDACCESSOR(Input_translator, input_translator)
+ IDACCESSOR(Translator, translator)
IDACCESSOR(Music, music)
IDACCESSOR(General_script_def, script)
IDACCESSOR(Symtables, symtables)
}\
-DECLARE_ID_CLASS(Input_translator_id, Input_translator, input_translator);
+DECLARE_ID_CLASS(Translator_id, Translator, translator);
DECLARE_ID_CLASS(Duration_id, Duration, duration);
DECLARE_ID_CLASS(Real_id, Real, real);
DECLARE_ID_CLASS(Script_id, General_script_def, script);
#include "lily-proto.hh"
#include "input.hh"
#include "string.hh"
+#error
#include "varray.hh"
struct Input_translator_list : public Pointer_list<Input_translator*>
{
- Input_translator_list (Input_translator_list const &);
- Input_translator_list(){}
- ~Input_translator_list(){}
+ Input_translator_list (Input_translator_list const &);
+ Input_translator_list(){}
+ ~Input_translator_list(){}
};
/** Define a intereter for music. This is an runtime interface to the
typesystem */
class Input_translator : public Input {
public:
- Input_translator_list contains_itrans_p_list_;
- Array<String> consists_str_arr_;
- Array<String> alias_str_arr_;
- String base_str_;
- String type_str_;
- String default_id_str_;
-
- void add (Input_translator *);
- bool is_name_b (String);
- bool accept_req_b();
- bool accepts_b (String);
- void print() const;
- Engraver_group_engraver * get_group_engraver_p();
- Performer_group_performer * get_group_performer_p();
- Input_translator * get_default_itrans_l();
- Input_translator * recursive_find (String nm);
- Input_translator * find_itrans_l (String nm);
+ Input_translator_list contains_itrans_p_list_;
+ Array<String> consists_str_arr_;
+ Array<String> alias_str_arr_;
+ String base_str_;
+ String type_str_;
+ String default_id_str_;
+
+ void add (Input_translator *);
+ bool is_name_b (String);
+ bool accept_req_b();
+ bool accepts_b (String);
+ void print() const;
+ Translator_group * get_group_translator_p();
+ Input_translator * get_default_itrans_l();
+ Input_translator * recursive_find (String nm);
+ Input_translator * find_itrans_l (String nm);
};
-Engraver* get_engraver_p (String);
-Performer* get_performer_p (String);
#endif // Input_translator_HH
Make the key signature.
*/
class Key_engraver : public Engraver {
- void create_key();
- void read_req (Key_change_req * r);
+ void create_key();
+ void read_req (Key_change_req * r);
public:
- Key key_;
- Key_change_req * keyreq_l_;
- Key_item * kit_p_;
- Array<int> accidental_idx_arr_;
- bool default_key_b_;
- bool change_key_b_;
+ Key_engraver();
+ DECLARE_MY_RUNTIME_TYPEINFO;
+ TRANSLATOR_CLONE(Key_engraver);
+ Key key_;
+ Key_change_req * keyreq_l_;
+ Key_item * kit_p_;
+ Array<int> accidental_idx_arr_;
+ bool default_key_b_;
+ bool change_key_b_;
protected:
- virtual bool do_try_request (Request *req_l);
- virtual void do_process_requests();
- virtual void do_pre_move_processing();
- virtual void do_post_move_processing();
- virtual void acknowledge_element (Score_elem_info);
-public:
- Key_engraver();
- DECLARE_MY_RUNTIME_TYPEINFO;
+ virtual bool do_try_request (Request *req_l);
+ virtual void do_process_requests();
+ virtual void do_pre_move_processing();
+ virtual void do_post_move_processing();
+ virtual void acknowledge_element (Score_elem_info);
};
#endif // KEYGRAV_HH
class Key_performer : public Performer {
public:
- DECLARE_MY_RUNTIME_TYPEINFO;
- Key_performer();
- ~Key_performer();
+ TRANSLATOR_CLONE(Key_performer);
+ DECLARE_MY_RUNTIME_TYPEINFO;
+ Key_performer();
+ ~Key_performer();
protected:
- void do_print() const;
- virtual bool do_try_request (Request* req_l);
- virtual void process_requests();
+ void do_print() const;
+ virtual bool do_try_request (Request* req_l);
+ virtual void do_process_requests();
private:
- Key_change_req* key_req_l_;
+ Key_change_req* key_req_l_;
};
#endif // KEY_PERFOMER_HH
struct Absolute_dynamic_req;
+struct Abbreviation_req;
+struct Abbreviation_beam_req;
+struct Abbreviation_beam_engraver;
struct Axis_group_element;
struct Axis_group;
+struct Translator_group;
struct Translator;
+struct Abbreviation_beam;
struct Audio_element;
struct Audio_column;
struct Audio_item;
struct Audio_meter;
struct Audio_note;
struct Audio_note_off;
-struct Audio_score;
+struct Performance;
struct Audio_staff;
struct Audio_tempo;
struct Atom;
struct Bar_req;
struct Barcheck_req;
struct Beam;
+struct Beam_engraver;
struct Beam_req;
struct Blank_req;
struct Box;
struct Cresc_req;
struct Crescendo ;
struct Decresc_req;
-
+struct Dots;
+struct Dot_column;
struct Directional_spanner;
struct Disallow_break_req;
struct Durational_req;
struct Dynamic_req;
struct Element_group;
struct Element_group_item;
-struct Feature;
struct General_script_def;
+struct Music_output;
+struct Music_output_def;
struct Global_translator;
struct Group_change_req;
-struct Group_feature_req;
struct Head_column;
struct Header;
struct Horizontal_align_item;
struct Horizontal_vertical_group;
struct Idealspacing;
struct Identifier;
-struct Interpreter;
struct Input_file;
-struct Input_score;
-struct Input_translator;
struct Item;
struct Key;
struct Key_change_req;
struct Offset;
struct Output;
struct Performer;
-struct PCol;
+struct Paper_column;
struct Paper_score;
struct Paper_def;
struct Partial_measure_req;
struct Engraver_group_engraver;
struct Performer;
struct Performer_group_performer;
+struct Property_iterator;
struct Request;
struct Request_column;
struct Engraver;
struct Rest_column;
struct Rest_req;
struct Rhythmic_grouping;
+struct Rhythmic_head;
struct Rhythmic_grouping_req;
struct Rhythmic_req;
struct Score;
struct Symtables;
struct Super_elem;
struct Terminate_voice_req;
+struct Translation_property;
struct Tempo_req;
struct Tex_stream;
struct Text_def;
Engravers put elements on the same or lowel level in a line
*/
class Line_group_engraver : public Engraver{
- Vertical_group_spanner *staffline_p_;
+ Vertical_group_spanner *staffline_p_;
protected:
- virtual void do_creation_processing();
- virtual void do_removal_processing();
- virtual void acknowledge_element (Score_elem_info);
+ virtual void do_creation_processing();
+ virtual void do_removal_processing();
+ virtual void acknowledge_element (Score_elem_info);
public:
- DECLARE_MY_RUNTIME_TYPEINFO;
- Line_group_engraver();
+ TRANSLATOR_CLONE(Line_group_engraver);
+ DECLARE_MY_RUNTIME_TYPEINFO;
+ Line_group_engraver();
};
#include "parray.hh"
struct Local_key_engraver : Engraver {
- Key local_key_;
- Key const *key_C_;
- Array<Note_req* > mel_l_arr_;
- Array<Item* > support_l_arr_;
- Link_array<Item > forced_l_arr_;
- Link_array<Item > tied_l_arr_;
- /* *************** */
- virtual void do_process_requests();
- virtual void acknowledge_element (Score_elem_info);
- virtual void do_pre_move_processing();
- Local_key_engraver();
- DECLARE_MY_RUNTIME_TYPEINFO;
+protected:
+ TRANSLATOR_CLONE(Local_key_engraver);
+ virtual void do_process_requests();
+ virtual void acknowledge_element (Score_elem_info);
+ virtual void do_pre_move_processing();
+public:
+ Key local_key_;
+ Key const *key_C_;
+ Array<Note_req* > mel_l_arr_;
+ Array<Item* > support_l_arr_;
+ Link_array<Item > forced_l_arr_;
+ Link_array<Item > tied_l_arr_;
+ Local_key_engraver();
+ DECLARE_MY_RUNTIME_TYPEINFO;
};
#endif // LOCALKEYGRAV_HH
virtual void do_process_requests();
virtual void do_post_move_processing();
public:
+ TRANSLATOR_CLONE(Lyric_engraver);
DECLARE_MY_RUNTIME_TYPEINFO;
Lyric_engraver();
};
class Lyric_performer : public Performer {
public:
+ TRANSLATOR_CLONE(Lyric_performer);
DECLARE_MY_RUNTIME_TYPEINFO;
Lyric_performer();
~Lyric_performer();
protected:
void do_print() const;
virtual bool do_try_request (Request* req_l);
- virtual void process_requests();
+ virtual void do_process_requests();
private:
Array<Lyric_req*> lreq_arr_;
void do_scores();
void add_score (Score* s);
void set_default_output (String s);
-Input_score* current_iscore_l();
String find_file (String);
String get_version_str();
String get_version_number_str();
virtual void do_process_requests();
virtual void do_pre_move_processing();
public:
+ TRANSLATOR_CLONE(Meter_engraver);
Meter * meter_p_;
Meter_engraver();
class Meter_performer : public Performer {
public:
- DECLARE_MY_RUNTIME_TYPEINFO;
- Meter_performer();
- ~Meter_performer();
+ TRANSLATOR_CLONE(Meter_performer);
+ DECLARE_MY_RUNTIME_TYPEINFO;
+ Meter_performer();
+ ~Meter_performer();
protected:
- void do_print() const;
- virtual bool do_try_request (Request* req_l);
- virtual void process_requests();
+ void do_print() const;
+ virtual bool do_try_request (Request* req_l);
+ virtual void do_process_requests();
private:
- Meter_change_req* meter_req_l_;
+ Meter_change_req* meter_req_l_;
};
#endif // METER_PERFOMER_HH
#ifndef MIDI_DEF_HH
#define MIDI_DEF_HH
+
#include "lily-proto.hh"
#include "real.hh"
#include "string.hh"
*/
class Midi_def : public Music_output_def {
public:
- // ugh!
- static int den_i_s;
- static int num_i_s;
VIRTUAL_COPY_CONS(Midi_def, Music_output_def);
DECLARE_MY_RUNTIME_TYPEINFO;
- Input_translator* itrans_p_;
/// duration of whole note
Real whole_seconds_f_;
Real duration_to_seconds_f (Moment);
int get_tempo_i (Moment moment);
void print() const;
- void set (Input_translator* itrans_p);
void set_tempo (Moment moment, int count_per_minute_i);
-protected:
- virtual Global_translator * get_global_translator_p ();
};
#endif // MIDI_DEF_HH
+/*
+ molecule.hh -- declare Molecule
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
#ifndef MOLECULE_HH
#define MOLECULE_HH
#include "lily-proto.hh"
#include "plist.hh"
#include "boxes.hh"
-
+#include "axes.hh"
+#include "direction.hh"
/** a group of individually translated symbols. You can add molecules
to the top, to the right, etc. */
struct Molecule {
- Pointer_list<Atom*> ats; // change to List<Atom>?
+ Pointer_list<Atom*> ats; // change to List<Atom>?
- /* *************** */
+ /* *************** */
- Molecule() { }
- Molecule (Atom const &a) { add (a) ;}
-
- void add_right (const Molecule &m);
- void add_left (const Molecule &m);
- void add_top (const Molecule &m);
- void add_bottom (const Molecule &m);
- void add (Molecule const &m);
- void translate (Offset);
- void translate (Real,Axis);
- void add (Atom const & a) ;
- /// how big is #this#?
- Box extent() const;
-
- String TeX_string() const;
-
- Molecule (const Molecule&s);
- void print() const;
+ Molecule() { }
+ Molecule (Atom const &a) { add (a) ;}
+
+ void add_at_edge (Axis a, Direction d, const Molecule &m);
+
+ void add (Molecule const &m);
+ void translate (Offset);
+ void translate (Real,Axis);
+ void add (Atom const & a) ;
+ /// how big is #this#?
+ Box extent() const;
+
+ String TeX_string() const;
+
+ Molecule (const Molecule&s);
+ void print() const;
private:
- void operator=(const Molecule&);
+ void operator=(const Molecule&);
};
#endif
#include "virtual-methods.hh"
class Music_iterator {
- Array<Translator *>report_to_l_arr_;
- void push_translator (Translator*);
+ Array<Translator_group*>report_to_l_arr_;
+ void push_translator (Translator_group*);
void pop_translator();
protected:
bool first_b_;
virtual void do_print() const;
- virtual Translator * get_req_translator_l();
+ virtual Translator_group* get_req_translator_l();
Music_iterator* get_iterator_p (Music*) const;
- void set_translator (Translator*);
+ void set_translator (Translator_group*);
Music_iterator *daddy_iter_l_;
public:
- Translator *report_to_l() const;
+ Translator_group*report_to_l() const;
DECLARE_MY_RUNTIME_TYPEINFO;
- static Music_iterator* static_get_iterator_p (Music*,Translator*);
+ static Music_iterator* static_get_iterator_p (Music*,Translator_group*);
Music_iterator();
virtual void process_and_next (Moment until);
virtual Moment next_moment() const;
virtual bool ok() const;
virtual ~Music_iterator();
+
+ /**
+ Construct sub-iterators, and set the translator to
+ report to
+ */
virtual void construct_children();
void print() const;
};
#ifndef Music_output_DEF_HH
#define Music_output_DEF_HH
+
#include "string.hh"
#include "lily-proto.hh"
#include "virtual-methods.hh"
+#include "plist.hh"
+#include "dictionary.hh"
/**
Definition of how to output mudela.
class Music_output_def
{
public:
+ Dictionary<Translator*> translator_p_dict_;
+
+ Music_output_def (Music_output_def const&);
+ Music_output_def ();
+ virtual ~Music_output_def ();
+
VIRTUAL_COPY_CONS(Music_output_def, Music_output_def);
DECLARE_MY_RUNTIME_TYPEINFO;
- virtual void print () const {}
- virtual ~Music_output_def () {}
- virtual Global_translator * get_global_translator_p () { return 0; }
+ virtual void print () const;
+
+ Global_translator *get_global_translator_p ();
+ Translator_group *get_group_translator_p (String type) const;
+ void assign_translator (String, Translator*);
String outfile_str_;
+ Translator * find_translator_l (String) const;
};
+
#endif // Music_output_DEF_HH
*/
class Music:public Input {
public:
- Music_list * parent_music_l_;
+ Music_list * parent_music_l_;
- /** The kind of iterator needed to walk this music. This doesn't
- make sense for simple (ie non-list) music, but it does no harm
- here. Yes, it did harm Music_list: you can forget to copy it.
+ /** The kind of iterator needed to walk this music. This doesn't
+ make sense for simple (ie non-list) music, but it does no harm
+ here. Yes, it did harm Music_list: you can forget to copy it.
- */
- String type_str_;
-
- /// what name (or look for this name)
- String id_str_;
-
- virtual MInterval time_int() const;
- virtual ~Music(){}
- void print() const;
- virtual void transpose (Melodic_req const *);
- virtual void translate (Moment dt);
- VIRTUAL_COPY_CONS(Music,Music);
- DECLARE_MY_RUNTIME_TYPEINFO;
- Music();
+ */
+ String translator_type_str_;
+
+ /// what name (or look for this name)
+ String translator_id_str_;
+
+ virtual MInterval time_int() const;
+ virtual ~Music(){}
+ void print() const;
+ virtual void transpose (Melodic_req const *);
+ virtual void translate (Moment dt);
+ VIRTUAL_COPY_CONS(Music,Music);
+ DECLARE_MY_RUNTIME_TYPEINFO;
+ Music();
protected:
- virtual void do_print() const;
-
+ virtual void do_print() const;
};
#endif // MUSIC_HH
virtual Melodic_req *melodic() { return 0; }
virtual Slur_req *slur() { return 0 ; }
virtual Beam_req *beam() { return 0 ; }
+ virtual Abbreviation_beam_req* abbrev_beam() { return 0 ; }
virtual Rhythmic_req*rhythmic() { return 0; }
virtual Musical_script_req*musicalscript() { return 0; }
virtual Text_req*text() { return 0; }
virtual Absolute_dynamic_req * absdynamic() { return 0; }
virtual Tie_req * tie() { return 0; }
virtual Span_dynamic_req * span_dynamic() { return 0; }
+ virtual Abbreviation_req* abbrev() { return 0; }
REQUESTMETHODS(Musical_req, musical);
};
public:
REQUESTMETHODS(Skip_req, skip);
};
+
struct Spacing_req :virtual Request {
Moment next;
Real distance;
REQUESTMETHODS(Spacing_req, spacing);
};
+struct Abbreviation_req : public Musical_req {
+ REQUESTMETHODS (Abbreviation_req, abbrev);
+ Abbreviation_req ();
+ int type_i_;
+};
+
class Blank_req : public Spacing_req, Rhythmic_req {
public:
REQUESTMETHODS(Spacing_req, spacing);
Beam_req();
};
+/**
+ Start / stop an abbreviation beam at this note.
+ */
+class Abbreviation_beam_req : public Span_req {
+public:
+ REQUESTMETHODS (Abbreviation_beam_req, abbrev_beam);
+
+ Abbreviation_beam_req ();
+
+ int type_i_;
+};
+
/**
Start a tie at this voice element, end it at the next
*/
void * lexval_l;
Notename_table *note_tab_p_;
- Assoc<String, Identifier*> *identifier_assoc_p_;
+ Dictionary<Identifier*> *identifier_p_dict_p_;
Keyword_table * keytable_p_;
int errorlevel_i_;
void set_last_duration (Duration const *);
void set_default_duration (Duration const *);
+ void set_last_abbrev (int type_i);
+ void set_abbrev_beam (int type_i);
void set_duration_mode (String s);
friend int yyparse (void*);
+
public:
+ int abbrev_beam_type_i_;
+ int default_abbrev_type_i_;
int default_octave_i_;
Duration default_duration_;
Plet plet_;
#define NOTE_COLUMN_HH
#include "item.hh"
-#include "head-column.hh"
+#include "script-column.hh"
/** a struct for treating a group of noteheads (noteheads, stem
(chord) and scripts) as a single entity. */
-class Note_column : public Head_column {
+class Note_column : public Script_column {
protected:
virtual void do_pre_processing();
-
+ virtual void do_print () const;
+ virtual void do_substitute_dependency (Score_elem*,Score_elem*);
public:
+ /** The relative position of the "voice" containing this
+ chord. Normally this would be the same as the stem direction,
+ but rests do not have stems.
+ */
+ Direction dir_;
bool h_shift_b_;
+ Stem* stem_l_;
+
+
+ Link_array<Note_head> head_l_arr_;
+ Link_array<Rest> rest_l_arr_;
Interval_t<int> head_positions_interval() const;
+ void translate_rests(int dy);
DECLARE_MY_RUNTIME_TYPEINFO;
- Note_column();
- void sort();
+ Note_column ();
+ void set (Stem*);
+ void set (Dot_column*);
+ void add (Rhythmic_head*);
+ bool rest_b () const;
+ virtual void add (Script*s);
+ void sort ();
};
#endif // NOTE_COLUMN_HH
#ifndef NOTEHEAD_HH
#define NOTEHEAD_HH
-#include "item.hh"
+#include "rhythmic-head.hh"
-/** ball at the end of the stem takes care of:
+/** ball at the end of the stem. Takes care of:
* help lines
- * proper placing of dots
- It also is the item for a Rest
-
*/
-class Note_head : public Item {
+class Note_head : public Rhythmic_head {
public:
- DECLARE_MY_RUNTIME_TYPEINFO;
+ DECLARE_MY_RUNTIME_TYPEINFO;
- bool rest_b_;
- int position_i_;
+ int position_i_;
- /// -1 = lowest, 0 = inside, 1 = top
- int extremal_i_;
+ /// -1 = lowest, 0 = inside, 1 = top
+ int extremal_i_;
- /// needed for the help-lines
- int staff_size_i_;
- int dots_i_;
- int balltype_i_;
- int dot_delta_y_i_;
- Direction x_dir_;
+ /// needed for the help-lines
+ int staff_size_i_;
+ Direction x_dir_;
- /* *************** */
-
- void set_rhythmic (Rhythmic_req *);
-
- /**
- position of top line (5 linestaff: 8)
- */
- Note_head (int staff_size);
- void set_dots();
- static int compare (Note_head * const &a, Note_head *const &b) ;
+ /**
+ position of top line (5 linestaff: 8)
+ */
+ Note_head ();
+ static int compare (Note_head * const &a, Note_head *const &b) ;
protected:
- virtual void do_print() const;
- virtual void do_pre_processing();
- virtual Molecule* brew_molecule_p() const;
+ virtual void do_pre_processing();
+ virtual Molecule* brew_molecule_p() const;
};
#endif // NOTEHEAD_HH
class Note_performer : public Performer {
public:
- DECLARE_MY_RUNTIME_TYPEINFO;
+ TRANSLATOR_CLONE(Note_performer);
+ DECLARE_MY_RUNTIME_TYPEINFO;
- Note_performer();
+ Note_performer();
protected:
- virtual void process_requests();
+ virtual void do_process_requests();
- virtual bool do_try_request (Request *req_l) ;
- virtual void do_print() const;
+ virtual bool do_try_request (Request *req_l) ;
+ virtual void do_print() const;
private:
- Melodic_req * note_req_l_;
+ Melodic_req * note_req_l_;
};
#endif // NOTE_PERFORMER_HH
#include "pointer.hh"
#include "string.hh"
#include "lily-proto.hh"
-#include "assoc.hh"
+#include "dictionary.hh"
-class Notename_table : Assoc<String, P<Melodic_req> >{
+class Notename_table : Dictionary< P<Melodic_req> >{
public:
void add (String, Melodic_req*);
Melodic_req*get_l (String);
*/
class Paper_def : public Music_output_def {
Lookup *lookup_p_;
- Assoc<String, Real> *real_vars_p_;
+ Dictionary<Real> *real_vars_p_;
- Input_translator * itrans_p_;
protected:
- virtual Global_translator * get_global_translator_p();
VIRTUAL_COPY_CONS(Paper_def,Music_output_def);
- DECLARE_MY_RUNTIME_TYPEINFO;
public:
virtual ~Paper_def();
+ DECLARE_MY_RUNTIME_TYPEINFO;
void set_var (String, Real);
Real get_var (String) const;
void reinit();
Paper_def();
void set (Lookup*);
- void set (Input_translator *);
Paper_def (Paper_def const&);
/// The distance between beams
Request* get_script_req (char);
Request*get_script_req (int d , Script_def*def);
Request*get_text_req (int d , Text_def*def);
-Request* get_stemdir_req (int);
Request*get_grouping_req (Array<int> i_arr);
-Request* get_hshift_req (int);
#endif // PARSECONSTRUCT_HH
--- /dev/null
+/*
+ performance.hh -- declare Performance
+
+ (c) 1997 Jan Nieuwenhuizen <jan@digicash.com>
+ */
+
+#ifndef PERFORMANCE_HH
+#define PERFORMANCE_HH
+
+#include "lily-proto.hh"
+#include "plist.hh"
+#include "music-output.hh"
+
+/** all stuff which goes onto midi. notes, signs, symbols in a score
+ #Performance# contains the items, the columns.
+ */
+
+class Performance : public Music_output {
+public:
+ Performance ();
+ ~Performance () {}
+
+ void add (Audio_column*);
+ void add_staff (Audio_staff* l);
+ void add (Audio_element*p);
+
+
+ void output (Midi_stream& midi_stream_r);
+ void output_header_track (Midi_stream& midi_stream_r);
+
+ void print() const;
+ void process();
+
+ Pointer_list<Audio_column*> audio_column_p_list_;
+ Link_list<Audio_staff*> audio_staff_l_list_;
+ Pointer_list<Audio_element*> audio_elem_p_list_;
+ Midi_def * midi_l_;
+};
+
+#endif // PERFORMANCE_HH
#include "parray.hh"
#include "plist.hh"
#include "performer.hh"
-#include "translator.hh"
+#include "translator-group.hh"
/**
Group a number of performers. Usually delegates everything to its contents.
*/
-class Performer_group_performer : public Performer, public virtual Translator {
+class Performer_group_performer : public Performer, public virtual Translator_group {
public:
- DECLARE_MY_RUNTIME_TYPEINFO;
- Input_translator* itrans_l_;
-
- virtual void add (Performer* perf_p);
- virtual bool do_try_request (Request* req_l);
- virtual void print() const;
- virtual bool try_request (Request* r);
-
-
-protected:
- virtual ~Performer_group_performer();
- virtual Translator* find_get_translator_l (String name, String id);
- virtual Translator* get_default_interpreter();
-
- Translator * ancestor_l (int l = 1);
- virtual int depth_i() const;
-
- virtual void process_requests();
- virtual void do_removal_processing();
- virtual void do_creation_processing();
-
- bool is_bottom_performer_b() const;
- virtual Performer_group_performer* find_performer_l (String name, String id);
- virtual void do_print() const;
-
-private:
- Pointer_list<Performer*> perf_p_list_;
-
- Link_array<Performer_group_performer> group_l_arr_;
- Link_array<Performer> nongroup_l_arr_;
+ TRANSLATOR_CLONE(Performer_group_performer);
+ DECLARE_MY_RUNTIME_TYPEINFO;
};
#endif // PERFORMER_GROUP_PERFORMER_HH
#include "request.hh"
#include "score-elem-info.hh"
#include "staff-info.hh"
+#include "translator.hh"
/**
Convert a music definition into a audio representation.
A baseclass
*/
-class Performer {
- bool init_b_;
+class Performer : public virtual Translator{
public:
- DECLARE_MY_RUNTIME_TYPEINFO;
- Performer_group_performer* daddy_perf_l_;
-
- Performer();
- virtual ~Performer();
-
- void print() const;
- virtual void process_requests();
-
- virtual bool try_request (Request* req_l);
-
- virtual void do_removal_processing();
- void creation_processing();
-
+ TRANSLATOR_CLONE(Performer);
+ DECLARE_MY_RUNTIME_TYPEINFO;
+ Performer_group_performer* daddy_perf_l() const;
protected:
- virtual void do_creation_processing();
- virtual bool do_try_request (Request*);
- virtual int get_tempo_i() const;
- virtual void do_print() const;
- virtual void play (Audio_element * elem_p );
+ virtual int get_tempo_i() const;
+ virtual void play (Audio_element * elem_p );
+ Performer * performer_l () { return this; }
};
-#include "global-performers.hh"
#endif // PERFORMER_HH
--- /dev/null
+/*
+ property-iterator.hh -- declare Property_iterator
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef PROPERTY_ITERATOR_HH
+#define PROPERTY_ITERATOR_HH
+
+#include "music-iterator.hh"
+
+class Property_iterator : public Music_iterator
+{
+ Translation_property *property_l_;
+
+public:
+ DECLARE_MY_RUNTIME_TYPEINFO;
+ Property_iterator (Translation_property* prop_l);
+protected:
+ virtual void process_and_next (Moment);
+};
+
+#endif // PROPERTY_ITERATOR_HH
#include "engraver.hh"
class Rest_collision_engraver : public Engraver {
- Rest_collision* rest_collision_p_;
+ Rest_collision* rest_collision_p_;
- void make_collision();
protected:
- virtual void acknowledge_element (Score_elem_info);
- virtual void do_print() const;
- virtual void do_pre_move_processing();
+ virtual void acknowledge_element (Score_elem_info);
+ virtual void do_pre_move_processing();
public:
- Rest_collision_engraver();
- DECLARE_MY_RUNTIME_TYPEINFO;
+ TRANSLATOR_CLONE(Rest_collision_engraver);
+ Rest_collision_engraver();
+ DECLARE_MY_RUNTIME_TYPEINFO;
};
#endif // REST_COLLISION_GRAV_HH
#include "item.hh"
class Rest_collision : public Item {
- Link_array<Rest_column> rest_l_arr_;
+ Link_array<Note_column> rest_l_arr_;
Link_array<Note_column> ncol_l_arr_;
public:
void add (Note_column*);
- void add (Rest_column*);
DECLARE_MY_RUNTIME_TYPEINFO;
Rest_collision();
protected:
--- /dev/null
+/*
+ rest-grav.hh -- declare Engraver
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef REST_GRAV_HH
+#define REST_GRAV_HH
+
+#include "engraver.hh"
+
+class Rest_engraver : public Engraver
+{
+ Rest_req *rest_req_l_;
+ Dots * dot_p_;
+ Rest * rest_p_;
+protected:
+ virtual bool do_try_request (Request *);
+ virtual void do_pre_move_processing ();
+ virtual void do_post_move_processing ();
+ virtual void do_process_requests ();
+public:
+ DECLARE_MY_RUNTIME_TYPEINFO;
+ TRANSLATOR_CLONE(Rest_engraver);
+ Rest_engraver ();
+};
+#endif // REST_GRAV_HH
--- /dev/null
+/*
+ rest.hh -- declare Rest
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef REST_HH
+#define REST_HH
+
+#include "rhythmic-head.hh"
+
+class Rest : public Rhythmic_head
+{
+public:
+ DECLARE_MY_RUNTIME_TYPEINFO;
+
+ int position_i_;
+ Rest ();
+ void add (Dots*);
+protected:
+ virtual void do_add_processing ();
+ virtual Molecule * brew_molecule_p () const;
+};
+#endif // REST_HH
--- /dev/null
+/*
+ rhythmic-column-grav.hh -- declare Rhythmic_column_engraver
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef RHYTHMIC_COLUMN_GRAV_HH
+#define RHYTHMIC_COLUMN_GRAV_HH
+
+#include "engraver.hh"
+#include "parray.hh"
+
+class Rhythmic_column_engraver :public Engraver {
+ Link_array<Script> script_l_arr_;
+ Stem * stem_l_;
+ Note_column *ncol_p_;
+ Dot_column *dotcol_p_;
+protected:
+ TRANSLATOR_CLONE(Rhythmic_column_engraver);
+ virtual void acknowledge_element (Score_elem_info);
+ virtual void do_pre_move_processing();
+ virtual void do_post_move_processing();
+public:
+ Rhythmic_column_engraver();
+ DECLARE_MY_RUNTIME_TYPEINFO;
+};
+#endif // RHYTHMIC_COLUMN_GRAV_HH
+
+
+
--- /dev/null
+/*
+ rhythmic-head.hh -- declare
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef RHYTHMIC_HEAD_HH
+#define RHYTHMIC_HEAD_HH
+
+#include "item.hh"
+
+class Rhythmic_head : public Item
+{
+public:
+ DECLARE_MY_RUNTIME_TYPEINFO;
+
+ int balltype_i_;
+ int dots_i_;
+ Dots * dots_l_;
+
+ void add (Dots *);
+ Rhythmic_head ();
+protected:
+ virtual void do_add_processing ();
+ virtual void do_print () const;
+ virtual void do_substitute_dependent (Score_elem*,Score_elem*);
+};
+
+#endif // RHYTHMIC_HEAD_HH
/*
- score-align-grav.hh -- declare Score_align_reg
+ score-align-grav.hh -- declare Type_align_engraver
source file of the GNU LilyPond music typesetter
/**
Group a number of items across staffs
*/
-class Score_align_engraver: public Engraver
+class Type_align_engraver: public Engraver
{
- Horizontal_group_item * align_p_;
+ Horizontal_group_item * align_p_;
public:
+ TRANSLATOR_CLONE(Type_align_engraver);
- const char* type_ch_C_;
- int priority_i_;
- Score_align_engraver();
- DECLARE_MY_RUNTIME_TYPEINFO;
+ const char* type_ch_C_;
+ int priority_i_;
+ Type_align_engraver();
+ DECLARE_MY_RUNTIME_TYPEINFO;
protected:
- virtual void acknowledge_element (Score_elem_info);
- virtual void do_pre_move_processing();
+ virtual void acknowledge_element (Score_elem_info);
+ virtual void do_pre_move_processing();
};
#endif // SCORE_ALIGN_GRAV_HH
};
-struct Feature {
- Scalar type_;
- Scalar value_;
-};
#endif // STAFFELEMINFO_HH
void typeset_all();
public:
+ TRANSLATOR_CLONE(Score_engraver);
Paper_score * pscore_p_;
DECLARE_MY_RUNTIME_TYPEINFO;
virtual void finish();
virtual void process();
virtual int depth_i() const { return Global_translator::depth_i ();}
- virtual Translator* ancestor_l (int l) { return Global_translator::ancestor_l (l);}
protected:
/* Engraver_group_engraver interface */
virtual void announce_element (Score_elem_info);
virtual void do_announces();
virtual void typeset_element (Score_elem*elem_p);
- virtual Paper_def * paper() const;
virtual void do_pre_move_processing();
+ virtual void add_processing ();
};
#endif // SCORE_GRAV_HH
#define SCORE_HALIGN_GRAV_HH
#include "engraver.hh"
class Score_horizontal_align_engraver : public Engraver {
- Break_align_item * halign_p_;
+ Break_align_item * halign_p_;
public:
- DECLARE_MY_RUNTIME_TYPEINFO;
- Score_horizontal_align_engraver();
+ TRANSLATOR_CLONE(Score_horizontal_align_engraver);
+ DECLARE_MY_RUNTIME_TYPEINFO;
+ Score_horizontal_align_engraver();
protected:
- virtual void acknowledge_element (Score_elem_info);
- virtual void do_pre_move_processing();
+ virtual void acknowledge_element (Score_elem_info);
+ virtual void do_pre_move_processing();
};
#endif // SCORE_HALIGN_GRAV_HH
public Performer_group_performer, public Global_translator
{
public:
+ TRANSLATOR_CLONE(Score_performer);
DECLARE_MY_RUNTIME_TYPEINFO;
Score_performer();
~Score_performer();
- Audio_score *performance_p_;
+ Performance *performance_p_;
protected:
- virtual Translator* ancestor_l (int l);
- virtual int depth_i() const;
-
virtual void finish();
virtual void prepare (Moment mom);
virtual void process();
virtual void start();
+ virtual void add_processing ();
virtual int get_tempo_i() const;
virtual void play (Audio_element* p);
virtual Music_output *get_output_p ();
private:
void header (Midi_stream&);
- Moment now_mom_;
Audio_column* audio_column_l_;
};
class Script_engraver : public Engraver {
- Array<Script *> script_p_arr_;
- Array<Script_req *> script_req_l_arr_;
+ Array<Script *> script_p_arr_;
+ Array<Script_req *> script_req_l_arr_;
public:
- DECLARE_MY_RUNTIME_TYPEINFO;
- Script_engraver();
+ TRANSLATOR_CLONE(Script_engraver);
+ DECLARE_MY_RUNTIME_TYPEINFO;
+ Script_engraver();
protected:
- virtual bool do_try_request (Request*);
- virtual void do_process_requests();
- virtual void do_pre_move_processing();
- virtual void do_post_move_processing();
+ virtual bool do_try_request (Request*);
+ virtual void do_process_requests();
+ virtual void do_pre_move_processing();
+ virtual void do_post_move_processing();
};
#include "engraver.hh"
class Slur_engraver :public Engraver {
- Array<Slur_req*> requests_arr_;
- Array<Slur_req*> new_slur_req_l_arr_;
- Array<Slur *> slur_l_stack_;
- Array<Slur*> end_slur_l_arr_;
- Direction dir_;
- /* *************** */
+ Array<Slur_req*> requests_arr_;
+ Array<Slur_req*> new_slur_req_l_arr_;
+ Array<Slur *> slur_l_stack_;
+ Array<Slur*> end_slur_l_arr_;
+ Direction dir_;
+ /* *************** */
protected:
- virtual ~Slur_engraver();
- virtual bool do_try_request (Request*);
- virtual void set_feature (Feature);
- virtual void do_process_requests();
- virtual void acknowledge_element (Score_elem_info);
- virtual void do_pre_move_processing();
- virtual void do_post_move_processing();
+ virtual ~Slur_engraver();
+ virtual bool do_try_request (Request*);
+ virtual void do_process_requests();
+ virtual void acknowledge_element (Score_elem_info);
+ virtual void do_pre_move_processing();
+ virtual void do_post_move_processing();
public:
- Slur_engraver();
- DECLARE_MY_RUNTIME_TYPEINFO;
+ TRANSLATOR_CLONE(Slur_engraver);
+ Slur_engraver();
+ DECLARE_MY_RUNTIME_TYPEINFO;
};
#endif // SLURGRAV_HH
*/
class Span_bar_engraver : public Engraver
{
- Span_bar * spanbar_p_;
- Array<Bar*> bar_l_arr_;
- Vertical_align_element * valign_l_;
+ Span_bar * spanbar_p_;
+ Array<Bar*> bar_l_arr_;
+ Vertical_align_element * valign_l_;
public:
- DECLARE_MY_RUNTIME_TYPEINFO;
+ TRANSLATOR_CLONE(Span_bar_engraver);
+ DECLARE_MY_RUNTIME_TYPEINFO;
- Span_bar_engraver();
+ Span_bar_engraver();
protected:
- virtual void acknowledge_element (Score_elem_info);
- virtual void do_pre_move_processing();
- virtual Span_bar* get_span_bar_p() const;
+ virtual void acknowledge_element (Score_elem_info);
+ virtual void do_pre_move_processing();
+ virtual Span_bar* get_span_bar_p() const;
};
#endif // SPAN_BAR_GRAV_HH
class Span_score_bar_engraver : public Span_bar_engraver
{
public:
- DECLARE_MY_RUNTIME_TYPEINFO;
- virtual Span_bar* get_span_bar_p() const;
+ TRANSLATOR_CLONE(Span_score_bar_engraver);
+ DECLARE_MY_RUNTIME_TYPEINFO;
+ virtual Span_bar* get_span_bar_p() const;
};
/**
class Piano_bar_engraver : public Span_score_bar_engraver
{
public:
- DECLARE_MY_RUNTIME_TYPEINFO;
- virtual Span_bar * get_span_bar_p() const;
+ TRANSLATOR_CLONE(Piano_bar_engraver);
+ DECLARE_MY_RUNTIME_TYPEINFO;
+ virtual Span_bar * get_span_bar_p() const;
};
#endif // SPAN_SCORE_BAR_GRAV_HH
int *c0_position_i_l_;
Staff_symbol*staff_sym_l_;
- /// when is now?
Time_description const *time_C_;
Rhythmic_grouping const *rhythmic_C_;
Score_column *musical_l_;
///
bool break_allowed_b_;
Score * score_l_;
- Moment when();
Score *score_l();
Paper_column * command_pcol_l();
Score_column* musical_l();
class Staff_performer : public Performer_group_performer
{
public:
- DECLARE_MY_RUNTIME_TYPEINFO;
+ TRANSLATOR_CLONE(Staff_performer);
+ DECLARE_MY_RUNTIME_TYPEINFO;
- Staff_performer();
- ~Staff_performer();
+ Staff_performer();
+ ~Staff_performer();
- String instrument_str();
+ String instrument_str();
protected:
- virtual void play (Audio_element* p);
- virtual void do_removal_processing();
- virtual void do_creation_processing();
+ virtual void play (Audio_element* p);
+ virtual void do_removal_processing();
+ virtual void do_creation_processing();
private:
- Audio_staff* audio_staff_p_;
+ Audio_staff* audio_staff_p_;
};
#endif // STAFF_PERFORMER_HH
class Staff_sym_engraver : public Engraver {
Staff_symbol *span_p_;
public:
- Staff_sym_engraver();
- DECLARE_MY_RUNTIME_TYPEINFO;
+ TRANSLATOR_CLONE(Staff_sym_engraver);
+ Staff_sym_engraver();
+ DECLARE_MY_RUNTIME_TYPEINFO;
protected:
- virtual ~Staff_sym_engraver();
- virtual void fill_staff_info (Staff_info&);
- virtual void do_removal_processing();
- virtual void do_creation_processing();
+ virtual ~Staff_sym_engraver();
+ virtual void fill_staff_info (Staff_info&);
+ virtual void do_removal_processing();
+ virtual void do_creation_processing();
};
#endif // STAFF_SYM_GRAV_HH
Direction dir_;
Stem *stem_p_;
Rhythmic_req *rhythmic_req_l_;
+ Abbreviation_req* abbrev_req_l_;
protected:
virtual void acknowledge_element (Score_elem_info);
virtual void do_pre_move_processing ();
- virtual void set_feature (Feature dir_i_);
+ virtual bool do_try_request (Request*);
public:
+ TRANSLATOR_CLONE(Stem_engraver);
Stem_engraver();
DECLARE_MY_RUNTIME_TYPEINFO;
};
--- /dev/null
+/*
+ stem-info.hh -- declare Stem_info
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Jan Nieuwenhuizen <jan@digicash.com>
+*/
+
+
+#ifndef STEM_INFO_HH
+#define STEM_INFO_HH
+
+#include "real.hh"
+
+struct Stem_info {
+ Real x;
+ int dir_;
+ Real idealy_f_;
+ Real miny_f_;
+ int beams_i_;
+
+ Stem_info();
+ Stem_info (Stem const *);
+};
+
+#endif // STEM_INFO_HH
#include "item.hh"
#include "varray.hh"
#include "moment.hh"
+#include "molecule.hh"
/**the rule attached to the ball.
Stem size depends on flag.
*/
class Stem : public Item {
+
+ Molecule abbrev_mol () const;
Real stem_bottom_f_, stem_top_f_;
-1 stem points down, +1: stem points up
*/
Real stem_xoffset_f_;
- /**
- store the wholes (for vapourware tremolo)
- */
- Link_array<Note_head> whole_l_arr_;
+
Link_array<Note_head> head_l_arr_;
- Link_array<Note_head> rest_l_arr_;
+ Link_array<Rest> rest_l_arr_;
public:
+ /// abbrev flag? + count
+ int abbrev_flag_i_;
+
/// flagtype? 4 none, 8 8th flag, 0 = beam.
int flag_i_;
+ /**
+ don't print flag when in beam.
+ our beam, for aligning abbrev flags
+ */
+ Beam* beam_l_;
+
int beams_left_i_;
int beams_right_i_;
- /// false if in beam
- bool print_flag_b_;
-
Direction dir_;
-
/* *************** */
Stem ();
/// ensure that this Stem also encompasses the Notehead #n#
void add (Note_head*n);
+ void add (Rest*);
DECLARE_MY_RUNTIME_TYPEINFO;
*/
class Swallow_engraver : public Engraver {
protected:
- bool acceptable_request_b (Request*) const;
- bool do_try_request (Request*) ;
+ bool acceptable_request_b (Request*) const;
+ bool do_try_request (Request*) ;
public:
- DECLARE_MY_RUNTIME_TYPEINFO;
+ TRANSLATOR_CLONE(Swallow_engraver);
+ DECLARE_MY_RUNTIME_TYPEINFO;
};
#endif // SWALLOW_GRAV_HH
class Swallow_performer : public Performer {
public:
- DECLARE_MY_RUNTIME_TYPEINFO;
+ TRANSLATOR_CLONE(Swallow_performer);
+ DECLARE_MY_RUNTIME_TYPEINFO;
protected:
- virtual bool do_try_request (Request*) { return true; }
+ virtual bool do_try_request (Request*) { return true; }
};
#endif // SWALLOW_PERF_HH
*/
#ifndef SYMTABLE_HH
#define SYMTABLE_HH
-#include "assoc.hh"
+#include "dictionary.hh"
#include "string.hh"
#include "symbol.hh"
-struct Symtable : public Assoc<String, Symbol> {
+struct Symtable : public Dictionary<Symbol> {
String id_str;
Symbol lookup (String) const;
};
-struct Symtables : private Assoc<String, Symtable*> {
+struct Symtables : private Dictionary<Symtable*> {
Symtable* operator()(String s);
~Symtables();
virtual void acknowledge_element (Score_elem_info);
virtual bool do_try_request (Request*);
virtual bool acceptable_request_b (Request*);
- virtual void sync_features();
virtual void do_process_requests();
virtual void do_post_move_processing();
virtual void do_pre_move_processing();
- virtual void set_feature (Feature);
public:
+TRANSLATOR_CLONE(Tie_engraver);
Tie_engraver();
DECLARE_MY_RUNTIME_TYPEINFO;
};
#ifndef TIMING_GRAV_HH
#define TIMING_GRAV_HH
-#include "engraver.hh"
-#include "time-description.hh"
-#include "grouping.hh"
-#include "parray.hh"
+#include "timing-translator.hh"
/**
Do time bookkeeping
*/
-class Timing_engraver : public Engraver
+class Timing_engraver : public Timing_translator, public Engraver
{
-public:
- Time_description time_;
- Rhythmic_grouping default_grouping_;
- Link_array<Timing_req> timing_req_l_arr_;
-protected:
- virtual void do_creation_processing ();
+protected:
virtual void fill_staff_info (Staff_info&);
- virtual bool do_try_request (Request *req_l);
- virtual void do_process_requests();
- virtual void do_pre_move_processing();
- virtual void do_post_move_processing();
+ virtual Engraver * engraver_l () { return Engraver::engraver_l (); }
public:
- Meter_change_req * meter_req_l () const;
- Timing_engraver();
+ TRANSLATOR_CLONE(Timing_engraver);
DECLARE_MY_RUNTIME_TYPEINFO;
};
--- /dev/null
+/*
+ timing-translator.hh -- declare Timing_translator
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef TIMING_TRANSLATOR_HH
+#define TIMING_TRANSLATOR_HH
+
+#include "translator.hh"
+#include "time-description.hh"
+#include "grouping.hh"
+#include "parray.hh"
+
+class Timing_translator : public virtual Translator
+{
+public:
+ TRANSLATOR_CLONE(Timing_translator);
+ Meter_change_req * meter_req_l () const;
+ Timing_translator ();
+ DECLARE_MY_RUNTIME_TYPEINFO;
+ Time_description time_;
+ Rhythmic_grouping default_grouping_;
+ Link_array<Timing_req> timing_req_l_arr_;
+protected:
+ virtual void do_creation_processing ();
+ virtual bool do_try_request (Request *req_l);
+ virtual void do_process_requests();
+ virtual void do_pre_move_processing();
+ virtual void do_post_move_processing();
+};
+#endif // TIMING_TRANSLATOR_HH
--- /dev/null
+/*
+ translation-property.hh -- declare Translation_property
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef TRANSLATION_PROPERTY_HH
+#define TRANSLATION_PROPERTY_HH
+
+#include "music.hh"
+#include "scalar.hh"
+
+/**
+ Set a property of Translator
+ */
+class Translation_property : public Music
+{
+public:
+ String var_str_;
+ Scalar value_;
+ VIRTUAL_COPY_CONS(Translation_property, Music);
+ DECLARE_MY_RUNTIME_TYPEINFO;
+protected:
+ virtual void do_print () const;
+};
+
+#endif // PROPERTY_HH
--- /dev/null
+/*
+ translator-change.hh -- declare Translator_change
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef TRANSLATOR_CHANGE_HH
+#define TRANSLATOR_CHANGE_HH
+
+class Translator_change : public Music
+{
+
+}
+
+#endif // TRANSLATOR_CHANGE_HH
--- /dev/null
+/*
+ translator-group.hh -- declare Translator_group
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef TRANSLATOR_GROUP_HH
+#define TRANSLATOR_GROUP_HH
+
+#include "string.hh"
+#include "lily-proto.hh"
+#include "virtual-methods.hh"
+#include "translator.hh"
+#include "plist.hh"
+#include "parray.hh"
+
+typedef void (Translator::*Method_pointer)(void);
+
+/** Make some kind of #Element#s from Requests. Elements are made by
+ hierarchically grouped #Translator#s
+ */
+class Translator_group : public virtual Translator {
+public:
+ Pointer_list<Translator *> trans_p_list_;
+ String id_str_;
+ Array<String> consists_str_arr_;
+ Array<String> accepts_str_arr_;
+ int iterator_count_;
+
+ TRANSLATOR_CLONE(Translator_group);
+ DECLARE_MY_RUNTIME_TYPEINFO;
+
+ Translator_group(Translator_group const &);
+ Translator_group();
+ void add (Translator *);
+
+ Link_array<Translator> nongroup_l_arr () const;
+ Link_array<Translator_group> group_l_arr () const;
+
+ virtual Global_translator *global_l() { return 0; }
+
+ /// Score_register = 0, Staff_registers = 1, etc)
+ Translator_group* ancestor_l (int l=1);
+ int depth_i() const;
+ bool is_bottom_translator_b () const;
+ bool removable_b() const;
+ void terminate_translator (Translator*r_l);
+ Translator *remove_translator_p (Translator*trans_l);
+ void check_removal ();
+
+ Translator *get_simple_translator (char const *type) const;
+ Translator_group *find_existing_translator_l (String n, String id);
+ Translator_group *find_create_translator_l (String n, String id);
+ Link_array<Translator_group> path_to_acceptable_translator (String alias) const;
+
+ Translator_group*get_default_interpreter();
+protected:
+ virtual ~Translator_group ();
+ virtual Translator_group * group_l () { return this; }
+ virtual void do_print () const;
+ virtual void do_process_requests ();
+ virtual void add_processing ();
+ virtual bool do_try_request (Request* req_l);
+ virtual void do_pre_move_processing();
+ virtual void do_post_move_processing();
+ virtual void do_creation_processing();
+ virtual void do_removal_processing();
+ void each (Method_pointer) const;
+};
+
+#endif // TRANSLATOR_GROUP_HH
#include "string.hh"
#include "lily-proto.hh"
#include "virtual-methods.hh"
+#include "scalar.hh"
+#include "dictionary.hh"
+#include "parray.hh"
+#include "input.hh"
+
+#define TRANSLATOR_CLONE(c) VIRTUAL_COPY_CONS(c, Translator)
/** Make some kind of #Element#s from Requests. Elements are made by
hierarchically grouped #Translator#s
*/
-class Translator {
+class Translator : public Input {
+ Dictionary<Scalar> properties_dict_;
public:
- String id_str_;
-
- int iterator_count_;
-
- virtual Global_translator *global_l() { return 0; }
-
- virtual void print() const;
-
- /// Score_register = 0, Staff_registers = 1, etc)
- virtual int depth_i() const=0;
- virtual bool is_bottom_engraver_b() const { return false; }
- virtual bool try_request (Request*);
- virtual Translator *find_get_translator_l (String name, String id)=0;
- virtual Translator *ancestor_l (int l=1)=0;
- virtual ~Translator(){}
- DECLARE_MY_RUNTIME_TYPEINFO;
- Translator();
- virtual Translator *get_default_interpreter()=0;
+ Music_output_def * output_def_l_;
+ String type_str_;
+
+ bool is_alias_b (String) const;
+
+
+ DECLARE_MY_RUNTIME_TYPEINFO;
+ TRANSLATOR_CLONE(Translator);
+ Translator (Translator const &);
+ Translator ();
+ virtual ~Translator ();
+
+ Translator_group * daddy_trans_l_ ;
+
+ virtual void add_processing ();
+ void print () const;
+
+ /**
+ try to fit the request in this engraver
+
+ @return
+ false: not noted, not taken.
+
+ true: request swallowed. Don't try to put the request elsewhere.
+
+ */
+ bool try_request (Request*);
+ void pre_move_processing();
+ void creation_processing ();
+ void process_requests();
+ void post_move_processing();
+ void removal_processing();
+ /**
+ ask daddy for a feature
+ */
+ Scalar get_property (String type_str);
+ void set_property (String var_name, Scalar value);
+ Music_output_def *output_def_l () const;
+
+ virtual Moment now_moment () const;
+ virtual Engraver *engraver_l () { return 0; }
+ virtual Performer *performer_l() { return 0; }
+ virtual Translator_group * group_l () { return 0; }
+
+protected:
+ enum {
+ ORPHAN,
+ VIRGIN,
+ CREATION_INITED,
+ MOVE_INITED,
+ ACCEPTED_REQS,
+ PROCESSED_REQS,
+ ACKED_REQS,
+ MOVE_DONE
+ } status;
+
+ /*
+ @see{try_request}
+ Default: always return false
+ */
+ virtual bool do_try_request (Request *req_l);
+ virtual void do_print () const;
+ virtual void do_pre_move_processing(){}
+ virtual void do_post_move_processing(){}
+ virtual void do_process_requests () {}
+ virtual void do_creation_processing() {}
+ virtual void do_removal_processing() {}
};
+/**
+ A macro to automate administration of translators.
+ */
+#define ADD_THIS_TRANSLATOR(c) \
+struct c ## init { \
+ c ## init() { \
+ Translator *t = new c;\
+ t-> type_str_ = c::static_name ();\
+ add_translator (t);\
+ } \
+} _ ## c ## init;
+
+extern Dictionary<Translator*> *global_translator_dict_p;
+void add_translator (Translator*trans_p);
+
+Translator*get_translator_l (String s);
+
#endif // TRANSLATOR_HH
--- /dev/null
+/*
+ type-swallow-grav.hh -- declare Type_swallow_translator
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef TYPESWALLOW_GRAV_HH
+#define TYPESWALLOW_GRAV_HH
+
+#include "translator.hh"
+/// eat a certain type of request
+class Type_swallow_translator : public virtual Translator
+{
+protected:
+ const char * type_;
+ bool do_try_request (Request*);
+public:
+ DECLARE_MY_RUNTIME_TYPEINFO;
+ TRANSLATOR_CLONE(Type_swallow_translator);
+ Type_swallow_translator ();
+};
+
+#define DECLARE_REQUEST_SWALLOWER(TYPE) \
+struct TYPE ## _swallow_translator : public Type_swallow_translator {\
+ TYPE ## _swallow_translator() { \
+ type_ = TYPE::static_name ();\
+ }\
+ DECLARE_MY_RUNTIME_TYPEINFO;\
+ TRANSLATOR_CLONE(TYPE ## _swallow_translator);\
+};\
+IMPLEMENT_IS_TYPE_B1(TYPE ## _swallow_translator, Type_swallow_translator);\
+ADD_THIS_TRANSLATOR(TYPE ## _swallow_translator);\
+
+#endif // TYPESWALLOW_GRAV_HH
+
#include "engraver.hh"
class Vertical_align_engraver : public Engraver {
- Vertical_align_spanner * valign_p_;
+ Vertical_align_spanner * valign_p_;
public:
- DECLARE_MY_RUNTIME_TYPEINFO;
- Vertical_align_engraver();
+ TRANSLATOR_CLONE(Vertical_align_engraver);
+ DECLARE_MY_RUNTIME_TYPEINFO;
+ Vertical_align_engraver();
protected:
- virtual void acknowledge_element (Score_elem_info);
- virtual void do_creation_processing();
- virtual void do_removal_processing();
+ virtual void acknowledge_element (Score_elem_info);
+ virtual void do_creation_processing();
+ virtual void do_removal_processing();
};
#endif // VERTICAL_ALIGN_GRAV_HH
row.del (idx);
lin +=row ;
- for (int i=0; i < cons.size(); i++)
- {
- consrhs[i] -= cons[i](idx) *value;
- cons[i].del (idx);
- }
+ for (int i=0; i < cons.size(); i++)
+ {
+ consrhs[i] -= cons[i](idx) *value;
+ cons[i].del (idx);
+ }
}
void
int idx=-1;
for (int i = 0; i < v.dim(); i++)
{
- if (v (i) < m)
- {
- idx = i;
- m = v (i);
- }
- assert (v (i) <= infinity_f);
+ if (v (i) < m)
+ {
+ idx = i;
+ m = v (i);
+ }
+ assert (v (i) <= infinity_f);
}
return idx;
}
Ineq_constrained_qp::constraint_solve (Vector start) const
{
if (!dim())
- return Vector (0);
+ return Vector (0);
// experimental
if (quad.dim() > 10)
- quad.try_set_band();
+ quad.try_set_band();
Active_constraints act (this);
act.OK();
Vector x (start);
Vector gradient=quad*x+lin;
- // Real fvalue = x*quad*x/2 + lin*x + const_term;
- // it's no use.
+ // Real fvalue = x*quad*x/2 + lin*x + const_term;
+ // it's no use.
Vector last_gradient (gradient);
int iterations=0;
while (iterations++ < MAXITER)
{
- Vector direction= - act.find_active_optimum (gradient);
+ Vector direction= - act.find_active_optimum (gradient);
- DOUT << "gradient "<< gradient<< "\ndirection " << direction<<"\n";
+ DOUT << "gradient "<< gradient<< "\ndirection " << direction<<"\n";
- if (direction.norm() > EPS)
- {
- DOUT << act.status() << '\n';
+ if (direction.norm() > EPS)
+ {
+ DOUT << act.status() << '\n';
- Real minalf = infinity_f;
+ Real minalf = infinity_f;
- Inactive_iter minidx (act);
+ Inactive_iter minidx (act);
- /*
+ /*
we know the optimum on this "hyperplane". Check if we
bump into the edges of the simplex
*/
- for (Inactive_iter ia (act); ia.ok(); ia++)
- {
+ for (Inactive_iter ia (act); ia.ok(); ia++)
+ {
- if (ia.vec() * direction >= 0)
- continue;
- Real alfa= - (ia.vec()*x - ia.rhs ())/
- (ia.vec()*direction);
+ if (ia.vec() * direction >= 0)
+ continue;
+ Real alfa= - (ia.vec()*x - ia.rhs ())/
+ (ia.vec()*direction);
- if (minalf > alfa)
- {
- minidx = ia;
- minalf = alfa;
- }
- }
- Real unbounded_alfa = 1.0;
- Real optimal_step = min (minalf, unbounded_alfa);
-
- Vector deltax=direction * optimal_step;
- x += deltax;
- gradient += optimal_step * (quad * deltax);
+ if (minalf > alfa)
+ {
+ minidx = ia;
+ minalf = alfa;
+ }
+ }
+ Real unbounded_alfa = 1.0;
+ Real optimal_step = min (minalf, unbounded_alfa);
+
+ Vector deltax=direction * optimal_step;
+ x += deltax;
+ gradient += optimal_step * (quad * deltax);
- DOUT << "step = " << optimal_step<< " (|dx| = " <<
- deltax.norm() << ")\n";
+ DOUT << "step = " << optimal_step<< " (|dx| = " <<
+ deltax.norm() << ")\n";
- if (minalf < unbounded_alfa)
- {
- /* bumped into an edge. try again, in smaller space. */
- act.add (minidx.idx());
- DOUT << "adding cons "<< minidx.idx()<<'\n';
- continue;
- }
- /*ASSERT: we are at optimal solution for this "plane"*/
+ if (minalf < unbounded_alfa)
+ {
+ /* bumped into an edge. try again, in smaller space. */
+ act.add (minidx.idx());
+ DOUT << "adding cons "<< minidx.idx()<<'\n';
+ continue;
+ }
+ /*ASSERT: we are at optimal solution for this "plane"*/
- }
+ }
- Vector lagrange_mult=act.get_lagrange (gradient);
- int m= min_elt_index (lagrange_mult);
+ Vector lagrange_mult=act.get_lagrange (gradient);
+ int m= min_elt_index (lagrange_mult);
- if (m>=0 && lagrange_mult (m) > 0)
- {
- break; // optimal sol.
- }
- else if (m<0)
- {
- assert (gradient.norm() < EPS) ;
+ if (m>=0 && lagrange_mult (m) > 0)
+ {
+ break; // optimal sol.
+ }
+ else if (m<0)
+ {
+ assert (gradient.norm() < EPS) ;
- break;
- }
+ break;
+ }
- DOUT << "dropping cons " << m<<'\n';
- act.drop (m);
+ DOUT << "dropping cons " << m<<'\n';
+ act.drop (m);
}
if (iterations >= MAXITER)
- WARN<<"didn't converge!\n";
+ WARN<<"didn't converge!\n";
DOUT << ": found " << x<<" in " << iterations <<" iterations\n";
assert_solution (x);
/* no hassle if no constraints*/
if (! cons.size())
{
- Choleski_decomposition chol (quad);
- return - chol.solve (lin);
+ Choleski_decomposition chol (quad);
+ return - chol.solve (lin);
}
else
{
- return constraint_solve (start);
+ return constraint_solve (start);
}
}
IMPLEMENT_IS_TYPE_B1(Key_engraver,Engraver);
-ADD_THIS_ENGRAVER(Key_engraver);
+ADD_THIS_TRANSLATOR(Key_engraver);
Atom a (s);
a.translate ((c_position + pitch[i]) * inter, Y_AXIS);
Molecule m (a);
- output->add_right (m);
+ output->add_at_edge (X_AXIS, RIGHT, m);
}
if (pitch.size())
{
Interval (0, paper()->note_width ()),
Interval (0,0))));
- output->add_right (m);
+ output->add_at_edge (X_AXIS, RIGHT, m);
}
return output;
}
IMPLEMENT_IS_TYPE_B1(Key_performer,Performer);
-ADD_THIS_PERFORMER(Key_performer);
+ADD_THIS_TRANSLATOR(Key_performer);
Key_performer::Key_performer()
{
}
void
-Key_performer::process_requests()
+Key_performer::do_process_requests()
{
if (key_req_l_)
play (new Audio_key (key_req_l_));
IMPLEMENT_IS_TYPE_B1(Line_group_engraver,Engraver);
-ADD_THIS_ENGRAVER(Line_group_engraver);
+ADD_THIS_TRANSLATOR(Line_group_engraver);
IMPLEMENT_IS_TYPE_B1(Local_key_engraver,Engraver);
-ADD_THIS_ENGRAVER(Local_key_engraver);
+ADD_THIS_TRANSLATOR(Local_key_engraver);
l.name_i_ = p;
l.accidental_i_ = a;
for (int i=0; i< accs.size(); i++)
- if (!Local_acc::compare (l, accs[i]))
- return;
+ if (!Local_acc::compare (l, accs[i]))
+ return;
accs.push (l);
}
int lastoct = -100;
for (int i = 0; i < accs.size(); i++)
{
- // do one octave
- if (accs[i].octave_i_ != lastoct)
- {
- if (octmol)
- {
- Real dy =lastoct*7*paper()->internote_f ();
- octmol->translate (dy, Y_AXIS);
- output->add (*octmol);
- delete octmol;
- }
- octmol= new Molecule;
- }
- lastoct = accs[i].octave_i_;
- Symbol s =paper()->lookup_l ()->accidental (accs[i].accidental_i_);
- Atom a (s);
- Real dy = (accs[i].name_i_ + c0_position) * paper()->internote_f ();
- a.translate (dy, Y_AXIS);
-
- octmol->add_right (a);
+ // do one octave
+ if (accs[i].octave_i_ != lastoct)
+ {
+ if (octmol)
+ {
+ Real dy =lastoct*7*paper()->internote_f ();
+ octmol->translate (dy, Y_AXIS);
+ output->add (*octmol);
+ delete octmol;
+ }
+ octmol= new Molecule;
+ }
+ lastoct = accs[i].octave_i_;
+ Symbol s =paper()->lookup_l ()->accidental (accs[i].accidental_i_);
+ Atom a (s);
+ Real dy = (accs[i].name_i_ + c0_position) * paper()->internote_f ();
+ a.translate (dy, Y_AXIS);
+
+ octmol->add_at_edge (X_AXIS, RIGHT, a);
}
if (octmol)
{
- Real dy =lastoct*7*paper()->internote_f ();
- octmol->translate (dy, Y_AXIS);
- output->add (*octmol);
- delete octmol;
+ Real dy =lastoct*7*paper()->internote_f ();
+ octmol->translate (dy, Y_AXIS);
+ output->add (*octmol);
+ delete octmol;
}
Interval head_width=itemlist_width (support_items_);
Local_acc::compare (Local_acc&a, Local_acc&b)
{
if (a.octave_i_ - b.octave_i_)
- return a.octave_i_ - b.octave_i_;
+ return a.octave_i_ - b.octave_i_;
if (a.name_i_ - b.name_i_)
- return a.name_i_ - b.name_i_;
+ return a.name_i_ - b.name_i_;
return a.accidental_i_ - b.accidental_i_;
};
{
Musical_req * m =r->musical();
if (!m || ! m->lreq_l())
- return false;
+ return false;
lreq_l_ = m->lreq_l();
return true;
{
if (lreq_l_)
{
- lyric_item_p_ = new Text_item (lreq_l_->tdef_p_);
+ lyric_item_p_ = new Text_item (lreq_l_->tdef_p_);
- lyric_item_p_->translate (paper()->note_width ()/2 , X_AXIS);
- lyric_item_p_->dir_ = DOWN;
- lyric_item_p_->fat_b_ = true;
- announce_element (Score_elem_info (lyric_item_p_, lreq_l_));
+ lyric_item_p_->translate (paper()->note_width ()/2 , X_AXIS);
+ lyric_item_p_->dir_ = DOWN;
+ lyric_item_p_->fat_b_ = true;
+ announce_element (Score_elem_info (lyric_item_p_, lreq_l_));
}
}
{
if (lyric_item_p_)
{
- typeset_element (lyric_item_p_);
- lyric_item_p_ =0;
+ typeset_element (lyric_item_p_);
+ lyric_item_p_ =0;
}
}
IMPLEMENT_IS_TYPE_B1(Lyric_engraver,Engraver);
-ADD_THIS_ENGRAVER(Lyric_engraver);
+ADD_THIS_TRANSLATOR(Lyric_engraver);
IMPLEMENT_IS_TYPE_B1(Lyric_performer,Performer);
-ADD_THIS_PERFORMER(Lyric_performer);
+ADD_THIS_TRANSLATOR(Lyric_performer);
Lyric_performer::Lyric_performer()
{
}
void
-Lyric_performer::process_requests()
+Lyric_performer::do_process_requests()
{
if (lreq_arr_.size() && lreq_arr_[ 0 ]->tdef_p_->text_str_.length_i())
play (new Audio_text (Audio_text::LYRIC, lreq_arr_[ 0 ]->tdef_p_->text_str_));
void
do_one_file (String init_str, String file_str)
{
- if (init_str != "" && "" == path.find (init_str))
+ if (init_str && "" == path.find (init_str))
{
error ("Can not find `" + init_str +"\'");
return ;
}
- if (file_str!= "" && path.find (file_str) == "")
+ if (file_str && !path.find (file_str))
{
error ("Can not find `" + file_str + "'");
return ;
split_path (name_str_r,a,b,c,d);
// add extension if not present.
- if (d == "")
+ if (!d)
d = ".ly";
name_str_r = a+b+c+d;
}
#include "command-request.hh"
#include "timing-grav.hh"
#include "engraver-group.hh"
+
Meter_engraver::Meter_engraver()
{
meter_p_ =0;
Meter_engraver::do_process_requests()
{
Timing_engraver * timing_grav_l= (Timing_engraver*)
- daddy_grav_l_->get_simple_engraver (Timing_engraver::static_name());
+ daddy_grav_l()->get_simple_translator (Timing_engraver::static_name())
+ ->engraver_l ();
Meter_change_req *req = timing_grav_l->meter_req_l();
if (req)
}
-ADD_THIS_ENGRAVER(Meter_engraver);
+ADD_THIS_TRANSLATOR(Meter_engraver);
IMPLEMENT_IS_TYPE_B1(Meter_engraver,Engraver);
#include "audio-item.hh"
IMPLEMENT_IS_TYPE_B1(Meter_performer,Performer);
-ADD_THIS_PERFORMER(Meter_performer);
+ADD_THIS_TRANSLATOR(Meter_performer);
Meter_performer::Meter_performer()
{
}
void
-Meter_performer::process_requests()
+Meter_performer::do_process_requests()
{
if (meter_req_l_)
play (new Audio_meter (meter_req_l_));
#include <math.h>
#include "misc.hh"
#include "midi-def.hh"
-#include "input-translator.hh"
-#include "audio-score.hh"
+#include "translator.hh"
+#include "performance.hh"
#include "assoc-iter.hh"
#include "score-performer.hh"
#include "debug.hh"
// destructor
// routines, alphasorted
-// statics Midi_def
-// ugh
-
-int Midi_def::den_i_s = 4;
-int Midi_def::num_i_s = 4;
-
Midi_def::Midi_def()
{
outfile_str_ = "";
- itrans_p_ = 0;
// ugh
set_tempo (Moment (1, 4), 60);
}
Midi_def::Midi_def (Midi_def const& s)
+ : Music_output_def (s)
{
whole_seconds_f_ = s.whole_seconds_f_;
- itrans_p_ = s.itrans_p_ ? new Input_translator (*s.itrans_p_) : 0;
outfile_str_ = s.outfile_str_;
}
Midi_def::~Midi_def()
{
- delete itrans_p_;
}
Real
return Moment (whole_seconds_f_) * mom;
}
-Global_translator*
-Midi_def::get_global_translator_p()
-{
- Global_translator *g = itrans_p_->get_group_performer_p()->global_l ();
- assert (g->is_type_b (Score_performer::static_name()));
- Score_performer * perf = (Score_performer*)g;
- perf->performance_p_ = new Audio_score;
- perf->performance_p_->midi_l_ = this;
- return g;
-}
int
Midi_def::get_tempo_i (Moment moment)
#endif
}
-void
-Midi_def::set (Input_translator* itrans_p)
-{
- delete itrans_p_;
- itrans_p_ = itrans_p;
-}
void
Midi_def::set_tempo (Moment moment, int count_per_minute_i)
Midi_stream&
Midi_stream::operator <<(String str)
{
- if (check_debug)
- str = String_convert::bin2hex_str (str);
+ if (check_debug && !monitor->silence("Midistrings"))
+ str = String_convert::bin2hex_str (str);
*os_p_ << str;
- if (check_debug)
- *os_p_ << "\n";
+ if (check_debug && !monitor->silence("Midistrings"))
+ *os_p_ << "\n";
return *this;
}
Midi_stream&
Midi_stream::operator <<(Midi_item const& mitem_c_r)
{
-// *this << mitem_c_r.str();
+ // *this << mitem_c_r.str();
mitem_c_r.output (this);
- if (check_debug)
- *os_p_ << "\n";
+ if (check_debug && !monitor->silence("Midistrings"))
+ *os_p_ << "\n";
return *this;
}
{
os_p_ = new ofstream (filename_str_);
if (!*os_p_)
- error ("can't open `" + filename_str_ + "\'");
+ error ("can't open `" + filename_str_ + "\'");
}
{
String s;
for (iter_top (ats,c); c.ok(); c++)
- s+=c->TeX_string();
+ s+=c->TeX_string();
return s;
}
{
Box b;
for (iter_top (ats,c); c.ok(); c++)
- b.unite (c->extent());
+ b.unite (c->extent());
return b;
}
Molecule::translate (Offset o)
{
for (iter_top (ats,c); c.ok(); c++)
- c->translate (o);
+ c->translate (o);
}
void
Molecule::translate (Real x,Axis a)
{
for (iter_top (ats,c); c.ok(); c++)
- c->translate (x,a);
+ c->translate (x,a);
}
void
{
for (iter_top (m.ats,c); c.ok(); c++)
{
- add (**c);
+ add (**c);
}
}
-void
-Molecule::add_right (Molecule const &m)
-{
- if (!ats.size())
- {
- add (m);
- return;
- }
- Real xof=extent().x ().right - m.extent ().x ().left;
-
-
- Molecule toadd (m);
- toadd.translate (Offset (xof, 0.0));
- add (toadd);
-}
-
-void
-Molecule::add_left (Molecule const &m)
-{
- if (!ats.size())
- {
- add (m);
- return;
- }
- Real xof=extent().x ().left - m.extent ().x ().right;
-
- Molecule toadd (m);
- toadd.translate (Offset (xof, 0.0));
- add (toadd);
-}
-
-
-void
-Molecule::add_top (Molecule const &m)
-{
- if (!ats.size())
- {
- add (m);
- return;
- }
- Real yof=extent().y ().right - m.extent ().y ().left;
-
- Molecule toadd (m);
- toadd.translate (yof, Y_AXIS);
- add (toadd);
-}
void
-Molecule::add_bottom (Molecule const &m)
+Molecule::add_at_edge (Axis a, Direction d, Molecule const &m)
{
if (!ats.size())
{
- add (m);
- return;
+ add (m);
+ return;
}
- Real yof=extent().y ().left- m.extent ().y ().right;
+ Real offset = extent ()[a][d] - m.extent ()[a][-d];
Molecule toadd (m);
- toadd.translate (yof, Y_AXIS);
+ toadd.translate (offset, a);
add (toadd);
}
+
+
void
Molecule::operator = (Molecule const &)
{
{
#ifndef NPRINT
if (! check_debug)
- return;
+ return;
for (iter_top (ats,c); c.ok(); c++)
- c->print();
+ c->print();
#endif
}
#include "music-list.hh"
#include "music-iterator.hh"
#include "voice-iterator.hh"
+#include "property-iterator.hh"
#include "chord-iterator.hh"
#include "request-iterator.hh"
-#include "translator.hh"
-
+#include "translator-group.hh"
+#include "translation-property.hh"
IMPLEMENT_IS_TYPE_B(Music_iterator);
#endif
}
-Translator *
+Translator_group*
Music_iterator::get_req_translator_l()
{
assert (report_to_l());
- if (report_to_l()->is_bottom_engraver_b ())
+ if (report_to_l()->is_bottom_translator_b ())
return report_to_l();
set_translator (report_to_l()->get_default_interpreter ());
}
void
-Music_iterator::push_translator (Translator*t)
+Music_iterator::push_translator (Translator_group*t)
{
report_to_l_arr_.push (t);
t->iterator_count_ ++;
report_to_l_arr_.pop();
}
-Translator*
+Translator_group*
Music_iterator::report_to_l() const
{
if (! report_to_l_arr_.size())
void
-Music_iterator::set_translator (Translator*trans)
+Music_iterator::set_translator (Translator_group*trans)
{
if (report_to_l()==trans)
return;
Music_iterator*
Music_iterator::static_get_iterator_p (Music *m,
- Translator *report_l)
+ Translator_group*report_l)
{
Music_iterator * p =0;
if (m->is_type_b (Request_chord::static_name()))
p = new Chord_iterator ((Chord*) m);
else if (m->is_type_b (Voice::static_name()))
p = new Voice_iterator ((Voice*) m);
-
- if (m -> type_str_ != "")
+ else if (m->is_type_b (Translation_property::static_name ()))
+ p = new Property_iterator((Translation_property *) m);
+
+ if (m -> translator_type_str_)
{
- Translator * a =report_l->
- find_get_translator_l (m-> type_str_, m->id_str_);
+ Translator_group* a =report_l->
+ find_create_translator_l (m-> translator_type_str_, m->translator_id_str_);
p->set_translator (a);
}
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
+#include "debug.hh"
#include "music-output-def.hh"
+#include "global-translator.hh"
+#include "dictionary-iter.hh"
IMPLEMENT_IS_TYPE_B(Music_output_def);
+Music_output_def::Music_output_def ()
+{
+}
+
+Music_output_def::~Music_output_def ()
+{
+ for (Dictionary_iter<Translator*> i (translator_p_dict_); i.ok (); i++)
+ delete i.val ();
+}
+
+Music_output_def::Music_output_def (Music_output_def const &s)
+{
+ for (Dictionary_iter<Translator*> i (s.translator_p_dict_); i.ok (); i++)
+ assign_translator (i.key (), i.val ()->clone ());
+}
+
+Translator*
+Music_output_def::find_translator_l (String name) const
+{
+ if (translator_p_dict_.elt_b (name))
+ return translator_p_dict_[name];
+
+ if (global_translator_dict_p->elt_b (name))
+ return (*global_translator_dict_p)[name];
+
+ return 0;
+}
+
+
+Global_translator *
+Music_output_def::get_global_translator_p ()
+{
+ Translator * t = find_translator_l ("Score")->clone ();
+ Global_translator *g = t->group_l ()->global_l ();
+ t->add_processing ();
+
+ return g;
+}
+
+
+void
+Music_output_def::assign_translator (String s, Translator*t)
+{
+ t->type_str_ = s;
+ t->output_def_l_ = this;
+ if (translator_p_dict_.elt_b (s))
+ delete translator_p_dict_[s];
+ translator_p_dict_[s] = t;
+}
+
+void
+Music_output_def::print () const
+{
+#ifndef NPRINT
+ for (Dictionary_iter<Translator*> i (translator_p_dict_); i.ok (); i++)
+ {
+ DOUT << i.key () << " = ";
+ i.val ()->print ();
+ }
+#endif
+}
if (! check_debug)
return ;
DOUT << name() << "{";
- if (type_str_!="" || id_str_!="")
- DOUT << "`" <<type_str_ << " = " << id_str_<<"\'";
+ if (translator_type_str_)
+ DOUT << translator_type_str_ << " = " << translator_id_str_;
do_print();
DOUT << "}\n";
#endif
#endif
}
+IMPLEMENT_IS_TYPE_B1(Spacing_req,Request);
+
Spacing_req::Spacing_req()
{
next = 0;
strength = 0;
}
-IMPLEMENT_IS_TYPE_B1(Spacing_req,Request);
-
void
Spacing_req::do_print() const
{
#endif
}
+IMPLEMENT_IS_TYPE_B1 (Abbreviation_req, Musical_req);
+
+Abbreviation_req::Abbreviation_req ()
+{
+ type_i_ = 0;
+}
+
+void
+Abbreviation_req::do_print() const
+{
+#ifndef NPRINT
+ DOUT << "type " << type_i_ << "\n";
+#endif
+}
+
IMPLEMENT_IS_TYPE_B2(Blank_req,Spacing_req,Rhythmic_req);
}
/* *************** */
+
+IMPLEMENT_IS_TYPE_B1(Beam_req,Span_req);
+
Beam_req::Beam_req()
{
nplet = 0;
}
-IMPLEMENT_IS_TYPE_B1(Beam_req,Span_req);
void
-Beam_req::do_print() const{}
+Beam_req::do_print() const
+{
+}
+
/* *************** */
+IMPLEMENT_IS_TYPE_B1 (Abbreviation_beam_req, Span_req);
+
+Abbreviation_beam_req::Abbreviation_beam_req ()
+{
+ type_i_ = 0;
+}
+
+void
+Abbreviation_beam_req::do_print () const
+{
+}
+
IMPLEMENT_IS_TYPE_B1(Slur_req,Span_req);
+
void
-Slur_req::do_print() const{}
-/* *************** */
+Slur_req::do_print() const
+{
+}
+/* *************** */
bool
Span_req:: do_equal_b (Request*r) const
static Keyword_ent the_key_tab[]={
{"accepts", ACCEPTS},
- {"alias", ALIAS},
{"bar", BAR},
{"cadenza", CADENZA},
{"clear", CLEAR},
{"contains", CONTAINS},
{"duration", DURATION},
{"absdynamic", ABSDYNAMIC},
- {"group", GROUP},
- {"hshift", HSHIFT},
- {"id", ID},
{"in", IN_T},
- {"requesttranslator", REQUESTTRANSLATOR},
+ {"translator", TRANSLATOR},
+ {"type", TYPE},
{"lyric", LYRIC},
{"key", KEY},
{"melodic" , MELODIC},
{"partial", PARTIAL},
{"paper", PAPER},
{"plet", PLET},
+ {"property", PROPERTY},
{"pt", PT_T},
{"score", SCORE},
{"script", SCRIPT},
{"skip", SKIP},
{"staff", STAFF},
- {"stem", STEM},
{"table", TABLE},
{"spandynamic", SPANDYNAMIC},
{"symboltables", SYMBOLTABLES},
My_lily_lexer::My_lily_lexer()
{
keytable_p_ = new Keyword_table (the_key_tab);
- identifier_assoc_p_ = new Assoc<String, Identifier*>;
+ identifier_p_dict_p_ = new Dictionary<Identifier*>;
errorlevel_i_ = 0;
post_quotes_b_ = false;
note_tab_p_ = new Notename_table;
Identifier*
My_lily_lexer::lookup_identifier (String s)
{
- if (!identifier_assoc_p_->elt_b (s))
- return 0;
+ if (!identifier_p_dict_p_->elt_b (s))
+ return 0;
- return (*identifier_assoc_p_)[s];
+ return (*identifier_p_dict_p_)[s];
}
Identifier *old = lookup_identifier (name_str);
if (old)
{
- old->warning("redeclaration of \\" + name_str);
- delete old;
+ old->warning("redeclaration of \\" + name_str);
+ delete old;
}
- (*identifier_assoc_p_)[name_str] = i;
+ (*identifier_p_dict_p_)[name_str] = i;
}
My_lily_lexer::~My_lily_lexer()
delete keytable_p_;
for (Assoc_iter<String,Identifier*>
- ai (*identifier_assoc_p_); ai.ok(); ai++)
- {
- DOUT << "deleting: " << ai.key()<<'\n';
- delete ai.val();
+ ai (*identifier_p_dict_p_); ai.ok(); ai++)
+ {
+ DOUT << "deleting: " << ai.key()<<'\n';
+ delete ai.val();
}
delete note_tab_p_;
- delete identifier_assoc_p_;
+ delete identifier_p_dict_p_;
}
void
My_lily_lexer::print_declarations (bool init_b) const
{
- for (Assoc_iter<String,Identifier*> ai (*identifier_assoc_p_); ai.ok();
- ai++)
- {
- if (ai.val()->init_b_ == init_b)
- {
- DOUT << ai.key() << '=';
- ai.val()->print ();
- }
+ for (Assoc_iter<String,Identifier*> ai (*identifier_p_dict_p_);
+ ai.ok(); ai++)
+ {
+ if (ai.val()->init_b_ == init_b)
+ {
+ DOUT << ai.key() << '=';
+ ai.val()->print ();
+ }
}
}
{
if (include_stack_.empty())
{
- *mlog << "error at EOF" << s << '\n';
+ *mlog << "error at EOF" << s << '\n';
}
else
{
- errorlevel_i_ |= 1;
-
- Input spot (source_file_l(),here_ch_C());
-
- spot.error (s);
+ errorlevel_i_ |= 1;
+ Input spot (source_file_l(),here_ch_C());
+ spot.error (s);
}
}
#include "header.hh"
+My_lily_parser::My_lily_parser (Sources * source_l)
+{
+ first_b_ = true;
+ source_l_ = source_l;
+ lexer_p_ = 0;
+ abbrev_beam_type_i_ = 0;
+ default_abbrev_type_i_ = 0;
+ default_duration_.durlog_i_ = 2;
+ default_octave_i_ = 0;
+ textstyle_str_="roman"; // in lexer?
+ error_level_i_ = 0;
+ last_duration_mode_b_ = true;
+ fatal_error_i_ = 0;
+ default_header_p_ =0;
+}
+
+My_lily_parser::~My_lily_parser()
+{
+ delete lexer_p_;
+ delete default_header_p_;
+}
+
+
void
My_lily_parser::clear_notenames()
{
lexer_p_->clear_notenames();
}
+
void
My_lily_parser::set_version_check (bool ig)
{
set_debug();
lexer_p_->new_input (init, source_l_);
do_yyparse();
+
+ if (error_level_i_)
+ {
+ error ("Found errors in init files");
+ }
print_declarations();
init_parse_b_ = false;
}
}
-My_lily_parser::~My_lily_parser()
-{
- delete lexer_p_;
- delete default_header_p_;
-}
-
void
My_lily_parser::remember_spot()
{
last_duration_mode_b_ = (s== "LAST");
}
+void
+My_lily_parser::set_abbrev_beam (int type_i)
+{
+ abbrev_beam_type_i_ = type_i;
+}
+
+void
+My_lily_parser::set_last_abbrev (int type_i)
+{
+ default_abbrev_type_i_ = type_i;
+}
+
void
My_lily_parser::set_default_duration (Duration const *d)
{
last_duration_mode_b_ = false;
default_duration_ = *d;
+ set_last_abbrev (0);
}
{
if (last_duration_mode_b_)
default_duration_ = *d;
+ set_last_abbrev (0);
}
v->add (rq);
+ // too bad parser reads (default) duration via member access,
+ // this hack will do for now..
+ if (abbrev_beam_type_i_)
+ {
+ assert (!duration_p->plet_b ());
+ duration_p->set_plet (1, 2);
+ }
rq->set_duration (*duration_p);
rq->set_spot (here_input());
delete duration_p ;
case '[':
case ']':
{
- Beam_req*b = new Beam_req;
- int p_i=plet_.type_i_ ; // ugh . Should junk?
- if (p_i!= 1)
- b->nplet = p_i;
- req_p = b;
+ if (!abbrev_beam_type_i_)
+ {
+ Beam_req*b = new Beam_req;
+ int p_i=plet_.type_i_ ; // ugh . Should junk?
+ if (p_i!= 1)
+ b->nplet = p_i;
+ req_p = b;
+ }
+ else
+ {
+ Abbreviation_beam_req* a = new Abbreviation_beam_req;
+ a->type_i_ = abbrev_beam_type_i_;
+ if (c==']')
+ abbrev_beam_type_i_ = 0;
+ req_p = a;
+ }
}
break;
return req_p;
}
-My_lily_parser::My_lily_parser (Sources * source_l)
-{
- first_b_ = true;
- source_l_ = source_l;
- lexer_p_ = 0;
- default_duration_.durlog_i_ = 2;
- default_octave_i_ = 0;
- textstyle_str_="roman"; // in lexer?
- error_level_i_ = 0;
- last_duration_mode_b_ = true;
- fatal_error_i_ = 0;
- default_header_p_ =0;
-}
-
void
My_lily_parser::add_requests (Chord*v)
{
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
-
+#include "dot-column.hh"
#include "note-column.hh"
#include "script.hh"
#include "note-head.hh"
#include "stem.hh"
+#include "rest.hh"
+#include "debug.hh"
+IMPLEMENT_IS_TYPE_B1(Note_column,Script_column);
-IMPLEMENT_IS_TYPE_B1(Note_column,Head_column);
+bool
+Note_column::rest_b () const
+{
+ return rest_l_arr_.size ();
+}
Note_column::Note_column()
{
- h_shift_b_ =false;
+ stem_l_ = 0;
+ h_shift_b_ = false;
+ dir_ =CENTER;
}
void
{
((Note_column*)this)->sort();
return Interval_t<int> (head_l_arr_[0]->position_i_,
- head_l_arr_.top()->position_i_);
+ head_l_arr_.top()->position_i_);
}
-
void
Note_column::do_pre_processing()
{
- if (!dir_&& !stem_l_)
+
+ if (!dir_)
{
- dir_ = (head_positions_interval().center () >= 5) ? DOWN:UP;
+ if (stem_l_)
+ dir_ = stem_l_->dir_;
+ else if (head_l_arr_.size ())
+ {
+ dir_ = (head_positions_interval().center () >= 5) ? DOWN:UP;
+ }
}
- Head_column::do_pre_processing();
+ Script_column::do_pre_processing();
}
+
+void
+Note_column::set (Stem * stem_l)
+{
+ add_support (stem_l);
+ stem_l_ = stem_l;
+ /*
+ don't add stem to support; mostly invisible for rest-columns (and possibly taken . .)
+
+ */
+ Score_elem::add_dependency (stem_l);
+ for (int i=0; i < script_l_arr_.size(); i++)
+ script_l_arr_[i]->set_stem (stem_l);
+
+}
+
+void
+Note_column::add (Script *script_l)
+{
+ Script_column::add (script_l) ;
+ if (stem_l_)
+ script_l->set_stem (stem_l_);
+}
+
+void
+Note_column::do_substitute_dependency (Score_elem*o, Score_elem*n)
+{
+ if (stem_l_ == o)
+ {
+ stem_l_ = n ? (Stem*)n->item():0;
+ }
+ if (o->is_type_b (Note_head::static_name ()))
+ {
+ head_l_arr_.substitute ((Note_head*)o->item(),
+ (n)? (Note_head*)n->item() : 0);
+ }
+ Script_column::do_substitute_dependency (o,n);
+ if (o->is_type_b (Rest::static_name ()))
+ {
+ rest_l_arr_.substitute ((Rest*)o->item(),
+ (n)? (Rest*)n->item() : 0);
+ }
+}
+
+void
+Note_column::add (Rhythmic_head *h)
+{
+ if (h->is_type_b (Rest::static_name ()))
+ {
+ rest_l_arr_.push ((Rest*)h);
+ add_support (h);
+ }
+ if (h->is_type_b (Note_head::static_name ()))
+ {
+ head_l_arr_.push ((Note_head*) h);
+ add_support (h);
+ }
+}
+
+/**
+ translate the rest symbols
+ */
+void
+Note_column::translate_rests (int dy_i)
+{
+ for (int i=0; i < rest_l_arr_.size(); i++)
+ rest_l_arr_[i]->position_i_ += dy_i;
+}
+
+void
+Note_column::do_print() const
+{
+#ifndef NPRINT
+ DOUT << "rests: " << rest_l_arr_.size() << ", ";
+ DOUT << "heads: " << head_l_arr_.size();
+#endif
+}
+
+void
+Note_column::set (Dot_column *d)
+{
+ add_element (d);
+}
*/
#include "note-performer.hh"
-#include "translator.hh"
-#include "input-translator.hh"
#include "musical-request.hh"
#include "audio-item.hh"
#include "debug.hh"
IMPLEMENT_IS_TYPE_B1(Note_performer,Performer);
-
-ADD_THIS_PERFORMER(Note_performer);
+ADD_THIS_TRANSLATOR(Note_performer);
Note_performer::Note_performer()
{
#ifndef NPRINT
if (note_req_l_)
{
- note_req_l_->print();
+ note_req_l_->print();
}
#endif
}
void
-Note_performer::process_requests()
+Note_performer::do_process_requests()
{
// this is _really_ braindead, but it generates some output
if (!note_req_l_ || !note_req_l_->melodic() || !note_req_l_->rhythmic ())
- return;
+ return;
play (new Audio_note (note_req_l_));
note_req_l_ = 0;
Note_performer::do_try_request (Request* req_l)
{
if (note_req_l_)
- return false;
+ return false;
if (!req_l->musical() || !req_l->musical ()->note ())
- return false;
+ return false;
note_req_l_ = req_l->musical()->melodic ();
return true;
String s;
switch (c)
{
- case '^' : s = "marcato";
- break;
- case '+' : s = "stopped";
- break;
- case '-' : s = "tenuto";
- break;
- case '|': s = "staccatissimo";
- break;
- case 'o' : s = "";
- break;
- case '>' : s = "accent";
- break;
- case 'v' : s = "";
- break;
- case '.' : s = "staccato";
- break;
- default:
- assert (false);
+ case '^' : s = "marcato";
+ break;
+ case '+' : s = "stopped";
+ break;
+ case '-' : s = "tenuto";
+ break;
+ case '|': s = "staccatissimo";
+ break;
+ case 'o' : s = "";
+ break;
+ case '>' : s = "accent";
+ break;
+ case 'v' : s = "";
+ break;
+ case '.' : s = "staccato";
+ break;
+ default:
+ assert (false);
}
return new String (s);
}
-Request*
-get_stemdir_req (int d)
-{
- d = sign (long (d));
- Group_feature_req * gfreq_p = new Group_feature_req;
- gfreq_p->type_str_ = "vdir";
- gfreq_p->value_str_ = String (d);
- return gfreq_p;
-}
-Request*
-get_hshift_req (int i)
-{
- Group_feature_req * gfreq_p = new Group_feature_req;
- gfreq_p->type_str_ = "hshift";
- gfreq_p->value_str_ = String (i);
- return gfreq_p;
-}
+
Request*
get_grouping_req (Array<int> i_arr)
Measure_grouping_req * mr_p = new Measure_grouping_req;
for (int i=0; i <i_arr.size();)
{
- mr_p->elt_length_arr_.push (Moment (1, i_arr[i++]));
- mr_p->beat_i_arr_.push (i_arr[i++]);
+ mr_p->elt_length_arr_.push (Moment (1, i_arr[i++]));
+ mr_p->beat_i_arr_.push (i_arr[i++]);
}
return mr_p;
}
*/
#include "misc.hh"
+#include "dots.hh"
#include "note-head.hh"
#include "dimen.hh"
#include "debug.hh"
#include "molecule.hh"
#include "musical-request.hh"
-/*
- TODO
-
- Separate notehead into
-
-
- Rhythmic_head
- Note_head
- Rest
- and Stem takes Rhythmic_heads
- */
-
-
-Note_head::Note_head (int ss)
+Note_head::Note_head ()
{
x_dir_ = CENTER;
- staff_size_i_=ss;
+ staff_size_i_= 8; // UGH
position_i_ = 0;
- balltype_i_ = 0;
- dots_i_ = 0;
- dot_delta_y_i_ = 0;
extremal_i_ = 0;
- rest_b_ = false;
}
void
-Note_head::do_pre_processing()
+Note_head::do_pre_processing ()
{
// 8 ball looks the same as 4 ball:
- if (balltype_i_ > 2 && !rest_b_)
+ if (balltype_i_ > 2)
balltype_i_ = 2;
-
- if (rest_b_)
- {
- if (balltype_i_ == 0)
- position_i_ += 6;
- else if (balltype_i_ == 0)
- position_i_ += 4;
- }
+ if (dots_l_) // move into Rhythmic_head?
+ dots_l_->position_i_ = position_i_;
}
-void
-Note_head::set_rhythmic (Rhythmic_req*r_req_l)
-{
- balltype_i_ = r_req_l->duration_.durlog_i_;
- dots_i_ = r_req_l->duration_.dots_i_;
-}
-
-
-IMPLEMENT_IS_TYPE_B1(Note_head,Item);
-
-void
-Note_head::do_print() const
-{
-#ifndef NPRINT
- if (rest_b_)
- DOUT << "REST! ";
- DOUT << "balltype_i_ "<< balltype_i_ << ", position_i_ = "<< position_i_
- << "dots_i_ " << dots_i_;
-#endif
-}
+IMPLEMENT_IS_TYPE_B1(Note_head,Rhythmic_head);
int
return a->position_i_ - b->position_i_;
}
-void
-Note_head::set_dots()
-{
- if (!(position_i_ %2) && rest_b_ && balltype_i_ == 0)
- dot_delta_y_i_ = -1;
- else if (!(position_i_ %2))
- dot_delta_y_i_ = 1;
-}
-
-/*
- Ugh, hairy.
- */
Molecule*
Note_head::brew_molecule_p() const
{
- ((Note_head*)this)->set_dots(); // UGH GUH
Molecule*out = 0;
Paper_def *p = paper();
- Real inter_f = p->internote_f();
- Symbol s;
+ Real inter_f = p->internote_f ();
// ugh
bool streepjes_b = (position_i_<-1) || (position_i_ > staff_size_i_+1);
- if (!rest_b_)
- s = p->lookup_l()->ball (balltype_i_);
- else
- {
- s = p->lookup_l()->rest (balltype_i_, streepjes_b);
- }
+ Symbol s = p->lookup_l()->ball (balltype_i_);
out = new Molecule (Atom (s));
- out->translate (x_dir_ * s.dim.x().length () , X_AXIS);
- if (dots_i_)
- {
- Symbol d = p->lookup_l()->dots (dots_i_);
- Molecule dm;
- dm.add (Atom (d));
- dm.translate (inter_f * dot_delta_y_i_ , Y_AXIS);
- out->add_right (dm);
- }
+ out->translate (x_dir_ * s.dim.x().length (), X_AXIS);
-
- if (rest_b_)
- {
- streepjes_b = false;
- }
-
if (streepjes_b)
{
int dir = sign (position_i_);
- int s =(position_i_<-1) ? -((-position_i_)/2): (position_i_-staff_size_i_)/2;
+ int s =(position_i_<-1)
+ ? -((-position_i_)/2)
+ : (position_i_-staff_size_i_)/2;
Symbol str = p->lookup_l()->streepjes (s);
Molecule sm;
out->translate (inter_f*position_i_, Y_AXIS);
return out;
}
-
// output
String outname = paper_l_->outfile_str_ ;
- if (outname == "")
+ if (!outname)
outname = default_out_str_+ ".tex";
*mlog << "TeX output to " << outname << " ...\n";
#include "debug.hh"
#include "lookup.hh"
#include "dimen.hh"
-#include "input-translator.hh"
#include "assoc-iter.hh"
#include "score-grav.hh"
#include "p-score.hh"
#include "main.hh"
+
+Paper_def::Paper_def()
+{
+ lookup_p_ = 0;
+ real_vars_p_ = new Dictionary<Real>;
+}
+
+Paper_def::~Paper_def()
+{
+ delete real_vars_p_;
+ delete lookup_p_;
+}
+
+Paper_def::Paper_def (Paper_def const&s)
+ : Music_output_def (s)
+{
+ lookup_p_ = s.lookup_p_? new Lookup (*s.lookup_p_) : 0;
+ lookup_p_->paper_l_ = this;
+ real_vars_p_ = new Dictionary<Real> (*s.real_vars_p_);
+ outfile_str_ = s.outfile_str_;
+}
+
void
Paper_def::set_var (String s, Real r)
{
return get_var ("basicspace") + get_var ("unitspace") * dur_f;
}
-Paper_def::Paper_def()
-{
- itrans_p_ = 0;
- lookup_p_ = 0;
- real_vars_p_ = new Assoc<String,Real>;
-}
-
-Paper_def::~Paper_def()
-{
- delete itrans_p_;
- delete real_vars_p_;
- delete lookup_p_;
-}
-
-Paper_def::Paper_def (Paper_def const&s)
-{
- itrans_p_ = s.itrans_p_ ? new Input_translator (*s.itrans_p_):0;
- lookup_p_ = s.lookup_p_? new Lookup (*s.lookup_p_) : 0;
- lookup_p_->paper_l_ = this;
- real_vars_p_ = new Assoc<String,Real> (*s.real_vars_p_);
- outfile_str_ = s.outfile_str_;
-}
-
-void
-Paper_def::set (Input_translator * itrans_p)
-{
- delete itrans_p_;
- itrans_p_ = itrans_p;
-}
-
void
Paper_def::set (Lookup*l)
{
Paper_def::print() const
{
#ifndef NPRINT
+ Music_output_def::print ();
DOUT << "Paper {";
DOUT << "out: " <<outfile_str_;
lookup_p_->print();
- itrans_p_->print();
for (Assoc_iter<String,Real> i (*real_vars_p_); i.ok(); i++)
{
DOUT << i.key() << "= " << i.val () << "\n";
return lookup_p_;
}
-Global_translator*
-Paper_def::get_global_translator_p()
-{
- if (only_midi)
- {
- return 0;
- }
-
- Global_translator* g = itrans_p_->get_group_engraver_p()->global_l ();
- assert (g->is_type_b (Score_engraver::static_name()));
- Score_engraver*grav = (Score_engraver*) g;
- grav->pscore_p_ = new Paper_score;
- grav->pscore_p_->paper_l_ = this;
- return g;
-}
-
IMPLEMENT_IS_TYPE_B1(Paper_def, Music_output_def);
#include <iostream.h>
// mmm
-#define MUDELA_VERSION "0.1.1"
+#define MUDELA_VERSION "0.1.5"
+#include "scalar.hh"
+#include "translation-property.hh"
#include "script-def.hh"
#include "symtable.hh"
#include "lookup.hh"
#include "musical-request.hh"
#include "my-lily-parser.hh"
#include "text-def.hh"
-#include "input-translator.hh"
+#include "translator-group.hh"
#include "score.hh"
#include "music-list.hh"
#include "header.hh"
Chord * chord;
Duration *duration;
Identifier *id;
- Input_translator* itrans;
+ Translator* trans;
Music *music;
Music_list *musiclist;
Score *score;
Interval *interval;
Lookup*lookup;
Melodic_req * melreq;
+ Musical_req* musreq;
Music_output_def * outputdef;
Midi_def* midi;
Moment *moment;
Real real;
Request * request;
General_script_def * script;
+ Scalar *scalar;
String *string;
Symbol * symbol;
Symtable * symtable;
%{
int
-yylex(YYSTYPE *s, void * v_l)
+yylex (YYSTYPE *s, void * v_l)
{
My_lily_parser *pars_l = (My_lily_parser*) v_l;
My_lily_lexer * lex_l = pars_l->lexer_p_;
lex_l->lexval_l = (void*) s;
- return lex_l->yylex();
+ return lex_l->yylex ();
}
%token ABSDYNAMIC
%token END
%token GROUPING
-%token GROUP
-%token REQUESTTRANSLATOR
-%token HSHIFT
+%token TRANSLATOR
%token HEADER
%token IN_T
-%token ID
%token LYRIC
%token KEY
%token MELODIC
%token SPANDYNAMIC
%token STAFF
%token START_T
-%token STEM
%token SYMBOLTABLES
%token TABLE
%token TRANSPOSE
%token TEMPO
+%token TYPE
%token TEXID
%token TEXTSTYLE
%token TITLE
+%token PROPERTY
%token VERSION
/* escaped */
%token <id> SCRIPT_IDENTIFIER
%token <id> COMMAND_IDENTIFIER
%token <id> REAL_IDENTIFIER
-%token <id> INPUT_TRANS_IDENTIFIER
+%token <id> TRANS_IDENTIFIER
%token <id> INT_IDENTIFIER
%token <id> SCORE_IDENTIFIER
%token <id> MIDI_IDENTIFIER
%type <header> mudela_header mudela_header_body
%type <box> box
%type <c> open_request_parens close_request_parens
+%type <c> open_abbrev_parens
%type <c> open_plet_parens close_plet_parens
%type <music> simple_element music_elt full_element lyrics_elt command_elt
+%type <i> abbrev_type
%type <i> int
%type <i> script_dir
%type <id> identifier_init
%type <midi> midi_block midi_body
%type <moment> duration_length
+%type <scalar> scalar
%type <music> Music transposed_music
+%type <music> propertydef
%type <musiclist> Voice Voice_body
%type <chord> Chord Chord_body
%type <paper> paper_block paper_body
%type <real> dim real
%type <real> unit
-%type <request> post_request pre_request command_req verbose_command_req
%type <request> abbrev_command_req
+%type <request> post_request pre_request command_req verbose_command_req
%type <request> script_req dynamic_req
%type <score> score_block score_body
%type <script> script_definition script_body mudela_script gen_script_def
%type <string> script_abbreviation
%type <symbol> symboldef
%type <symtable> symtable symtable_body
-%type <itrans> input_translator_spec input_translator_spec_body
+%type <trans> translator_spec translator_spec_body
%type <tempo> tempo_request
%type <string> header_record
-%left PRIORITY
+%expect 2
+
%%
THIS->default_header_p_ = $2;
}
| mudela score_block {
- add_score($2);
+ add_score ($2);
}
| mudela add_declaration { }
| mudela error
check_version:
VERSION STRING ';' {
- if ( String( *$2 ) != MUDELA_VERSION) {
+ if (String (*$2) != MUDELA_VERSION) {
if (THIS->ignore_version_b_) {
- THIS->here_input().error("Incorrect mudela version");
+ THIS->here_input ().error ("Incorrect mudela version");
} else {
THIS->fatal_error_i_ = 1;
- THIS->parser_error("Incorrect mudela version");
+ THIS->parser_error ("Incorrect mudela version");
}
}
}
/**/ {
}
| notenames_body CLEAR {
- THIS->clear_notenames();
+ THIS->clear_notenames ();
}
| notenames_body STRING '=' melodic_request {
- THIS->add_notename(*$2, $4);
+ THIS->add_notename (*$2, $4);
delete $2;
}
;
mudela_header:
HEADER {
- THIS->lexer_p_->push_header_state();
+ THIS->lexer_p_->push_header_state ();
}
'{' mudela_header_body '}' {
$$ = $4;
- THIS->lexer_p_->pop_state();
+ THIS->lexer_p_->pop_state ();
}
;
add_declaration:
STRING {
- THIS->remember_spot();
+ THIS->remember_spot ();
}
/* cont */ '=' identifier_init {
- THIS->lexer_p_->set_identifier(*$1, $4);
+ THIS->lexer_p_->set_identifier (*$1, $4);
$4->init_b_ = THIS->init_parse_b_;
- $4->set_spot(THIS->pop_spot());
+ $4->set_spot (THIS->pop_spot ());
}
;
identifier_init:
score_block {
- $$ = new Score_id($1, SCORE_IDENTIFIER);
+ $$ = new Score_id ($1, SCORE_IDENTIFIER);
}
| paper_block {
- $$ = new Paper_def_id($1, PAPER_IDENTIFIER);
+ $$ = new Paper_def_id ($1, PAPER_IDENTIFIER);
}
| midi_block {
- $$ = new Midi_def_id($1, MIDI_IDENTIFIER);
+ $$ = new Midi_def_id ($1, MIDI_IDENTIFIER);
}
| script_definition {
- $$ = new Script_id($1, SCRIPT_IDENTIFIER);
+ $$ = new Script_id ($1, SCRIPT_IDENTIFIER);
}
| Music {
- $$ = new Music_id($1, MUSIC_IDENTIFIER);
+ $$ = new Music_id ($1, MUSIC_IDENTIFIER);
}
| symtables {
- $$ = new Lookup_id($1, IDENTIFIER);
+ $$ = new Lookup_id ($1, IDENTIFIER);
}
| real {
- $$ = new Real_id(new Real($1), REAL_IDENTIFIER);
+ $$ = new Real_id (new Real ($1), REAL_IDENTIFIER);
}
| int {
- $$ = new Int_id(new int($1), INT_IDENTIFIER);
+ $$ = new Int_id (new int ($1), INT_IDENTIFIER);
}
| post_request {
- $$ = new Request_id($1, POST_REQUEST_IDENTIFIER);
+ $$ = new Request_id ($1, POST_REQUEST_IDENTIFIER);
}
| melodic_request {
- $$ = new Request_id($1, MELODIC_REQUEST_IDENTIFIER);
+ $$ = new Request_id ($1, MELODIC_REQUEST_IDENTIFIER);
}
- | input_translator_spec {
- $$ = new Input_translator_id ( $1, INPUT_TRANS_IDENTIFIER);
+ | translator_spec {
+ $$ = new Translator_id ($1, TRANS_IDENTIFIER);
}
| explicit_duration {
- $$ = new Duration_id( $1, DURATION_IDENTIFIER);
+ $$ = new Duration_id ($1, DURATION_IDENTIFIER);
}
;
-input_translator_spec:
- REQUESTTRANSLATOR '{' input_translator_spec_body '}'
+translator_spec:
+ TRANSLATOR '{' translator_spec_body '}'
{ $$ = $3; }
;
-input_translator_spec_body:
- INPUT_TRANS_IDENTIFIER {
- $$ = $1->input_translator();
- $$-> set_spot( THIS->here_input() );
+translator_spec_body:
+ TRANS_IDENTIFIER {
+ $$ = $1->translator ();
+ $$-> set_spot (THIS->here_input ());
}
- | STRING STRING {
- $$ = new Input_translator;
- $$->base_str_ = *$1;
- $$->type_str_ =*$2;
- $$->set_spot ( THIS->here_input() );
- delete $1;
+ | TYPE STRING ';' {
+ $$ = get_translator_l (*$2)->clone ();
+ $$->set_spot (THIS->here_input ());
delete $2;
}
- | input_translator_spec_body ID STRING ';' {
- $$-> default_id_str_ = *$3;
- delete $3;
+ | translator_spec_body STRING '=' scalar ';' {
+ $$-> set_property (*$2, *$4);
+ delete $2;
+ delete $4;
}
- | input_translator_spec_body ALIAS STRING ';' {
- $$-> alias_str_arr_.push(*$3);
+ | translator_spec_body CONSISTS STRING ';' {
+ $$->group_l ()->consists_str_arr_.push (*$3);
delete $3;
}
- | input_translator_spec_body CONSISTS STRING ';' {
- $$-> consists_str_arr_.push(*$3);
+ | translator_spec_body ACCEPTS STRING ';' {
+ $$->group_l ()->accepts_str_arr_.push (*$3);
delete $3;
}
- | input_translator_spec_body CONTAINS input_translator_spec {
- $$->add($3);
- }
;
/*
SCORE
*/
score_block:
- SCORE { THIS->remember_spot();
+ SCORE { THIS->remember_spot ();
THIS->error_level_i_ =0;
}
/*cont*/ '{' score_body '}' {
$$ = $4;
- $$->set_spot(THIS->pop_spot());
+ $$->set_spot (THIS->pop_spot ());
if (!$$->def_p_arr_.size ())
- $$->add ( THIS->default_paper());
+ $$->add (THIS->default_paper ());
/* handle error levels. */
$$->errorlevel_i_ = THIS->error_level_i_;
THIS->error_level_i_ = 0;
if (!$$->header_p_ && THIS->default_header_p_)
- $$->header_p_ = new Header(*THIS->default_header_p_);
+ $$->header_p_ = new Header (*THIS->default_header_p_);
}
;
$$ = new Score;
}
| SCORE_IDENTIFIER {
- $$ = $1->score();
+ $$ = $1->score ();
}
| score_body mudela_header {
$$->header_p_ = $2;
$$->music_p_ = $2;
}
| score_body output_def {
- $$->add( $2);
+ $$->add ($2);
}
| score_body error {
intastint_list:
/* */ { $$ =new Array<int>; }
| intastint_list int '*' int {
- $$->push($2); $$->push($4);
+ $$->push ($2); $$->push ($4);
}
;
paper_body:
/* empty */ {
- $$ = THIS->default_paper(); // paper / video / engrave
+ $$ = THIS->default_paper (); // paper / video / engrave
}
| PAPER_IDENTIFIER {
- $$ = $1->paperdef();
+ $$ = $1->paperdef ();
}
| paper_body OUTPUT STRING ';' {
$$->outfile_str_ = *$3;
delete $3;
}
- | paper_body symtables { $$->set($2); }
+ | paper_body symtables { $$->set ($2); }
| paper_body STRING '=' dim ';' {
- $$->set_var(*$2, $4);
+ $$->set_var (*$2, $4);
}
| paper_body STRING '=' real ';' {
- $$->set_var(*$2, $4);
+ $$->set_var (*$2, $4);
}
- | paper_body input_translator_spec {
- $$->set( $2 );
+ | paper_body STRING '=' translator_spec {
+ $$-> assign_translator (*$2, $4);
+ delete $2;
}
| paper_body error {
;
midi_body: /* empty */ {
- $$ = THIS->default_midi();
+ $$ = THIS->default_midi ();
+ }
+ | midi_body STRING '=' translator_spec {
+ $$-> assign_translator (*$2, $4);
+ delete $2;
}
| midi_body OUTPUT STRING ';' {
$$->outfile_str_ = *$3;
delete $3;
}
| midi_body tempo_request ';' {
- $$->set_tempo( $2->dur_.length(), $2->metronome_i_ );
+ $$->set_tempo ($2->dur_.length (), $2->metronome_i_);
delete $2;
}
- | midi_body input_translator_spec {
- $$->set( $2 );
- }
| midi_body error {
}
/**/ {
$$ = new Voice;
}
- | Voice_body ID STRING STRING ';' {
- $$ = new Voice;
- $$->type_str_ = *$3;
- $$->id_str_ = *$4;
- delete $3;
- delete $4;
- }
| Voice_body Music {
- $$->add($2);
+ $$->add ($2);
}
;
Music:
full_element { $$ = $1; }
+ | TYPE STRING Music {
+ $$ = $3;
+ $$->translator_type_str_ = *$2;
+ delete $2;
+ }
+ | TYPE STRING '=' STRING Music {
+ $$ = $5;
+ $$->translator_type_str_ = *$2;
+ $$->translator_id_str_ = *$4;
+ delete $2;
+ delete $4;
+ }
| Voice { $$ = $1; }
| Chord { $$ = $1; }
| transposed_music { $$ = $1; }
- | MUSIC_IDENTIFIER { $$ = $1->music(); }
+ | MUSIC_IDENTIFIER { $$ = $1->music (); }
| MELODIC
- { THIS->lexer_p_->push_note_state(); }
+ { THIS->lexer_p_->push_note_state (); }
Music
- { $$=$3; THIS->lexer_p_->pop_state(); }
+ { $$=$3; THIS->lexer_p_->pop_state (); }
| LYRIC
- { THIS->lexer_p_->push_lyric_state(); }
+ { THIS->lexer_p_->push_lyric_state (); }
Music
- { $$ = $3; THIS->lexer_p_->pop_state(); }
+ { $$ = $3; THIS->lexer_p_->pop_state (); }
+ | propertydef
+ ;
+
+propertydef:
+ TRANSLATOR STRING '=' STRING {
+ /* kluge. Could use Music just as well */
+ Translation_property * t = new Translation_property;
+ t-> translator_type_str_ = *$2;
+ t-> translator_id_str_ = *$4;
+ $$ = t;
+ delete $2;
+ delete $4;
+ }
+ | PROPERTY STRING '.' STRING '=' scalar {
+ Translation_property *t = new Translation_property;
+ t-> translator_type_str_ = *$2;
+ t-> var_str_ = *$4;
+ t-> value_ = *$6;
+ $$ = t;
+ delete $2;
+ delete $4;
+ delete $6;
+ }
;
+scalar:
+ STRING { $$ = new Scalar (*$1); delete $1; }
+ | int { $$ = new Scalar ($1); }
+ ;
+
+
Chord:
'<' Chord_body '>' { $$ = $2; }
;
| Chord_body MULTI INT ';' {
$$->multi_level_i_=$3;
}
- | Chord_body ID STRING STRING ';' {
- $$->type_str_ = *$3;
- $$->id_str_ = *$4;
- delete $4;
- delete $3;
- }
| Chord_body Music {
- $$->add($2);
+ $$->add ($2);
}
;
transposed_music:
TRANSPOSE steno_melodic_req Music {
$$ = $3;
- $$ -> transpose($2);
+ $$ -> transpose ($2);
delete $2;
}
;
*/
full_element:
pre_requests simple_element post_requests {
- THIS->add_requests((Chord*)$2);//ugh
+ THIS->add_requests ((Chord*)$2);//ugh
$$ = $2;
}
| command_elt
command_elt:
command_req {
$$ = new Request_chord;
- $$-> set_spot( THIS->here_input());
- $1-> set_spot( THIS->here_input());
- ((Chord*)$$) ->add($1);//ugh
+ $$-> set_spot (THIS->here_input ());
+ $1-> set_spot (THIS->here_input ());
+ ((Chord*)$$) ->add ($1);//ugh
}
;
$$ = new Barcheck_req;
}
| COMMAND_IDENTIFIER {
- $$ = $1->request();
+ $$ = $1->request ();
}
;
verbose_command_req:
BAR STRING {
- $$ = new Bar_req(*$2);
+ $$ = new Bar_req (*$2);
delete $2;
}
| METER int '/' int {
Meter_change_req *m = new Meter_change_req;
- m->set($2,$4);
- // sorry hw, i need meter at output of track,
- // but don-t know where to get it... statics should go.
- // HW : default: 4/4, meterchange reqs may change it.
-
- Midi_def::num_i_s = $2;
- Midi_def::den_i_s = $4;
+ m->set ($2,$4);
$$ = m;
}
| SKIP duration_length {
Skip_req * skip_p = new Skip_req;
- skip_p->duration_.set_plet($2->numerator().as_long(),
- $2->denominator().as_long());
+ skip_p->duration_.set_plet ($2->numerator ().as_long (),
+ $2->denominator ().as_long ());
delete $2;
$$ = skip_p;
$$ = $1;
}
| CADENZA int {
- $$ = new Cadenza_req($2);
+ $$ = new Cadenza_req ($2);
}
| PARTIAL duration_length {
- $$ = new Partial_measure_req(*$2);
+ $$ = new Partial_measure_req (*$2);
delete $2;
}
- | STEM int {
- $$ = get_stemdir_req($2);
- }
- | HSHIFT int {
- $$ = get_hshift_req($2);
- }
| CLEF STRING {
- $$ = new Clef_change_req(*$2);
+ $$ = new Clef_change_req (*$2);
delete $2;
}
| KEY pitch_list {
delete $2;
}
| GROUPING intastint_list {
- $$ = get_grouping_req(*$2); delete $2;
+ $$ = get_grouping_req (*$2); delete $2;
}
;
post_requests:
{
- assert(THIS->post_reqs.empty());
+ assert (THIS->post_reqs.empty ());
}
| post_requests post_request {
- $2->set_spot( THIS->here_input());
- THIS->post_reqs.push($2);
+ $2->set_spot (THIS->here_input ());
+ THIS->post_reqs.push ($2);
}
;
post_request:
POST_REQUEST_IDENTIFIER {
- $$ = (Request*)$1->request();
+ $$ = (Request*)$1->request ();
}
|close_request_parens {
- $$ = THIS->get_parens_request($1);
+ $$ = THIS->get_parens_request ($1);
}
| script_req
| dynamic_req
+ | abbrev_type {
+ Abbreviation_req* a = new Abbreviation_req;
+ a->type_i_ = $1;
+ $$ = a;
+ }
;
*/
steno_melodic_req:
NOTENAME_ID {
- $$ = $1->clone()->musical()->melodic();
+ $$ = $1->clone ()->musical ()->melodic ();
$$->octave_i_ += THIS->default_octave_i_;
}
| steno_melodic_req POST_QUOTES {
}
;
+open_abbrev_parens:
+ '[' ':' INT {
+ $$ = '[';
+ if (!Duration::duration_type_b ($3))
+ THIS->parser_error ("Not a duration");
+ else if ($3 < 8)
+ THIS->parser_error ("Can't abbreviate");
+ else
+ THIS->set_abbrev_beam ($3);
+ }
+ ;
+
open_plet_parens:
'[' INT '/' INT {
$$ = '[';
| '[' {
$$='[';
}
+ | open_abbrev_parens {
+ }
| open_plet_parens {
}
;
script_body:
STRING int int int int int {
Script_def *s = new Script_def;
- s->set_from_input(*$1,$2, $3,$4,$5, $6);
+ s->set_from_input (*$1,$2, $3,$4,$5, $6);
$$ = s;
delete $1;
}
Musical_script_req *m = new Musical_script_req;
$$ = m;
m-> scriptdef_p_ = $2;
- m-> set_spot ( THIS->here_input() );
+ m-> set_spot (THIS->here_input ());
m-> dir_ = $1;
}
;
gen_script_def:
text_def { $$ = $1; }
| mudela_script { $$ = $1;
- $$-> set_spot( THIS->here_input() );
+ $$-> set_spot (THIS->here_input ());
}
;
t->text_str_ = *$1;
delete $1;
t->style_str_ = THIS->textstyle_str_;
- $$->set_spot( THIS->here_input() );
+ $$->set_spot (THIS->here_input ());
}
;
script_abbreviation:
- '^' { $$ = get_scriptdef('^'); }
- | '+' { $$ = get_scriptdef('+'); }
- | '-' { $$ = get_scriptdef('-'); }
- | '|' { $$ = get_scriptdef('|'); }
- | 'o' { $$ = get_scriptdef('o'); }
- | '>' { $$ = get_scriptdef('>'); }
+ '^' { $$ = get_scriptdef ('^'); }
+ | '+' { $$ = get_scriptdef ('+'); }
+ | '-' { $$ = get_scriptdef ('-'); }
+ | '|' { $$ = get_scriptdef ('|'); }
+ | 'o' { $$ = get_scriptdef ('o'); }
+ | '>' { $$ = get_scriptdef ('>'); }
| '.' {
- $$ = get_scriptdef('.');
+ $$ = get_scriptdef ('.');
}
;
mudela_script:
- SCRIPT_IDENTIFIER { $$ = $1->script(); }
+ SCRIPT_IDENTIFIER { $$ = $1->script (); }
| script_definition { $$ = $1; }
| script_abbreviation {
- $$ = THIS->lexer_p_->lookup_identifier(*$1)->script();
+ $$ = THIS->lexer_p_->lookup_identifier (*$1)->script ();
delete $1;
}
;
pre_requests:
| pre_requests pre_request {
- THIS->pre_reqs.push($2);
- $2->set_spot( THIS->here_input());
+ THIS->pre_reqs.push ($2);
+ $2->set_spot (THIS->here_input ());
}
;
pre_request:
open_request_parens {
- $$ = THIS->get_parens_request($1);
+ $$ = THIS->get_parens_request ($1);
}
;
voice_command:
PLET INT '/' INT {
- THIS->default_duration_.set_plet($2,$4);
+ THIS->default_duration_.set_plet ($2,$4);
}
| DURATION STRING {
- THIS->set_duration_mode(*$2);
+ THIS->set_duration_mode (*$2);
delete $2;
}
| DURATION entered_notemode_duration {
- THIS->set_default_duration($2);
+ THIS->set_default_duration ($2);
delete $2;
}
| OCTAVE {
duration_length:
{
- $$ = new Moment(0,1);
+ $$ = new Moment (0,1);
}
| duration_length explicit_steno_duration {
- *$$ += $2->length();
+ *$$ += $2->length ();
}
;
entered_notemode_duration:
/* */ {
- $$ = new Duration(THIS->default_duration_);
+ $$ = new Duration (THIS->default_duration_);
}
| dots {
- $$ = new Duration(THIS->default_duration_);
+ $$ = new Duration (THIS->default_duration_);
$$->dots_i_ = $1;
}
| explicit_steno_duration {
- THIS->set_last_duration($1);
+ THIS->set_last_duration ($1);
$$ = $1;
}
;
explicit_steno_duration:
int {
$$ = new Duration;
- if ( !Duration::duration_type_b($1) )
- THIS->parser_error("Not a duration");
+ if (!Duration::duration_type_b ($1))
+ THIS->parser_error ("Not a duration");
else {
- $$->durlog_i_ = Duration_convert::i2_type($1);
+ $$->durlog_i_ = Duration_convert::i2_type ($1);
}
}
| DURATION_IDENTIFIER {
- $$ = $1->duration();
+ $$ = $1->duration ();
}
| explicit_steno_duration '.' {
$$->dots_i_ ++;
;
+abbrev_type:
+ ':' int {
+ if (!Duration::duration_type_b ($2))
+ THIS->parser_error ("Not a duration");
+ else if ($2 < 8)
+ THIS->parser_error ("Can't abbreviate");
+ else
+ THIS->set_last_abbrev ($2);
+ $$ = THIS->default_abbrev_type_i_;
+ }
+ ;
+
music_elt:
- steno_note_req notemode_duration {
- if (!THIS->lexer_p_->note_state_b())
- THIS->parser_error("have to be in Note mode for notes");
+ steno_note_req notemode_duration {
+ if (!THIS->lexer_p_->note_state_b ())
+ THIS->parser_error ("have to be in Note mode for notes");
$1->set_duration (*$2);
- $$ = THIS->get_note_element($1, $2);
+ int durlog_i = $2->durlog_i_;
+ $$ = THIS->get_note_element ($1, $2);
}
| RESTNAME notemode_duration {
- $$ = THIS->get_rest_element(*$1, $2);
+ $$ = THIS->get_rest_element (*$1, $2);
delete $1;
}
;
lyrics_elt:
text_def notemode_duration {
/* this sux! text-def should be feature of lyric-engraver. */
- if (!THIS->lexer_p_->lyric_state_b())
- THIS->parser_error("Have to be in Lyric mode for lyrics");
- $$ = THIS->get_word_element($1, $2);
+ if (!THIS->lexer_p_->lyric_state_b ())
+ THIS->parser_error ("Have to be in Lyric mode for lyrics");
+ $$ = THIS->get_word_element ($1, $2);
};
$$ = new Array<Melodic_req*>;
}
| pitch_list NOTENAME_ID {
- $$->push($2->clone()->musical()->melodic());
+ $$->push ($2->clone ()->musical ()->melodic ());
}
;
$$ = $1;
}
| INT_IDENTIFIER {
- int *i_p = $1->intid();
+ int *i_p = $1->intid ();
$$ = *i_p;
delete i_p;
}
$$ = $1;
}
| REAL_IDENTIFIER {
- Real *r_p = $1->real();
+ Real *r_p = $1->real ();
$$ = * r_p;
delete r_p;
}
$$ = new Lookup;
}
| IDENTIFIER {
- $$ = $1->lookup();
+ $$ = $1->lookup ();
}
| symtables_body TEXID STRING {
$$->texsetting = *$3;
delete $3;
}
| symtables_body STRING '=' symtable {
- $$->add(*$2, $4);
+ $$->add (*$2, $4);
delete $2;
}
;
symtable_body:
{ $$ = new Symtable; }
| symtable_body STRING symboldef {
- $$->add(*$2, *$3);
+ $$->add (*$2, *$3);
delete $2;
delete $3;
}
symboldef:
STRING box {
- $$ = new Symbol(*$1, *$2);
+ $$ = new Symbol (*$1, *$2);
delete $1;
delete $2;
}
| STRING {
- Box b(Interval(0,0), Interval(0,0));
- $$ = new Symbol(*$1, b);
+ Box b (Interval (0,0), Interval (0,0));
+ $$ = new Symbol (*$1, b);
delete $1;
}
;
box:
dinterval dinterval {
- $$ = new Box(*$1, *$2);
+ $$ = new Box (*$1, *$2);
delete $1;
delete $2;
}
;
dinterval: dim dim {
- $$ = new Interval($1, $2);
+ $$ = new Interval ($1, $2);
}
;
%%
void
-My_lily_parser::set_yydebug(bool b )
+My_lily_parser::set_yydebug (bool b)
{
#ifdef YYDEBUG
yydebug = b;
#endif
}
void
-My_lily_parser::do_yyparse()
+My_lily_parser::do_yyparse ()
{
- yyparse((void*)this);
+ yyparse ((void*)this);
}
Paper_def*
-My_lily_parser::default_paper()
+My_lily_parser::default_paper ()
{
- Identifier *id = lexer_p_->lookup_identifier( "default_paper" );
- return id ? id->paperdef() : new Paper_def ;
+ Identifier *id = lexer_p_->lookup_identifier ("default_paper");
+ return id ? id->paperdef () : new Paper_def ;
}
Midi_def*
-My_lily_parser::default_midi()
+My_lily_parser::default_midi ()
{
- Identifier *id = lexer_p_->lookup_identifier( "default_midi" );
- return id ? id->mididef() : new Midi_def ;
+ Identifier *id = lexer_p_->lookup_identifier ("default_midi");
+ return id ? id->mididef () : new Midi_def ;
}
--- /dev/null
+/*
+ audio-score.cc -- implement Performance
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Jan Nieuwenhuizen <jan@digicash.com>
+*/
+
+#include <time.h>
+#include "debug.hh"
+#include "string.hh"
+#include "string-convert.hh"
+#include "main.hh"
+#include "midi-def.hh"
+#include "midi-item.hh"
+#include "midi-stream.hh"
+#include "audio-column.hh"
+#include "audio-staff.hh"
+#include "performance.hh"
+#include "score.hh"
+
+Performance::Performance ()
+{
+ midi_l_ =0;
+}
+
+void
+Performance::add (Audio_column* p)
+{
+ p->performance_l_ = this;
+ audio_column_p_list_.bottom().add (p);
+}
+
+void
+Performance::output (Midi_stream& midi_stream_r)
+{
+ int tracks_i = audio_staff_l_list_.size() + 1;
+ // ugh
+ int clocks_per_4_i = 384;
+ midi_stream_r << Midi_header (1, tracks_i, clocks_per_4_i);
+ output_header_track (midi_stream_r);
+ int n = 1;
+ for (PCursor<Audio_staff*> i (audio_staff_l_list_); i.ok(); i++)
+ i->output (midi_stream_r, n++);
+}
+
+void
+Performance::output_header_track (Midi_stream& midi_stream_r)
+{
+ Midi_track midi_track;
+
+ time_t t = time (0);
+
+ // perhaps multiple text events?
+ String str = String ("Creator: ") + get_version_str() + "\n";
+
+ Midi_text creator (Midi_text::TEXT, str);
+ midi_track.add (Moment (0), &creator);
+
+ str = "Automatically generated at ";
+ str += ctime (&t);
+ str = str.left_str (str.length_i() - 1);
+ str += "\n";
+ Midi_text generate (Midi_text::TEXT, str);
+ midi_track.add (Moment (0), &generate);
+
+ str = "from musical definition: ";
+
+ str += origin_str_;
+ Midi_text from (Midi_text::TEXT, str);
+ midi_track.add (Moment (0), &from);
+
+ Midi_text track_name (Midi_text::TRACK_NAME, "Track "
+ + String_convert::i2dec_str (0, 0, '0'));
+ midi_track.add (Moment (0), &track_name);
+
+ Midi_tempo tempo (midi_l_->get_tempo_i (Moment (1, 4)));
+ midi_track.add (Moment (0), &tempo);
+
+ midi_stream_r << midi_track;
+}
+
+void
+Performance::add_staff (Audio_staff* l)
+{
+ audio_staff_l_list_.bottom().add (l);
+}
+
+void
+Performance::add (Audio_element *p)
+{
+ audio_elem_p_list_.bottom().add (p);
+}
+
+void
+Performance::print() const
+{
+#ifndef NPRINT
+ DOUT << "Performance { ";
+ DOUT << "Items: ";
+ for (PCursor<Audio_element*> i (audio_elem_p_list_.top ()); i.ok (); i++)
+ i->print ();
+
+ DOUT << "\ncolumns: ";
+ for (PCursor<Audio_column*> i (audio_column_p_list_); i.ok(); i++)
+ i->print();
+ DOUT << "}\n";
+#endif
+}
+
+void
+Performance::process()
+{
+ print ();
+
+ String out=midi_l_->outfile_str_;
+ if (!out)
+ out = default_out_str_ + ".midi";
+
+ Midi_stream midi_stream (out);
+ *mlog << "MIDI output to " << out<< " ..." << endl;
+
+ output (midi_stream);
+ *mlog << endl;
+}
*/
#include "performer-group-performer.hh"
-#include "input-translator.hh"
-#include "debug.hh"
-
-IMPLEMENT_IS_TYPE_B2(Performer_group_performer,Performer, Translator);
-ADD_THIS_PERFORMER(Performer_group_performer);
-
-Performer_group_performer::~Performer_group_performer()
-{
-
-}
-
-void
-Performer_group_performer::add (Performer *perf_p)
-{
- perf_p_list_.bottom().add (perf_p);
- perf_p->daddy_perf_l_ = this;
-
- if (perf_p->is_type_b (Performer_group_performer::static_name()))
- {
- group_l_arr_.push ((Performer_group_performer*)perf_p);
- }
- else
- {
- nongroup_l_arr_ .push (perf_p);
- }
-}
-
-Translator*
-Performer_group_performer::ancestor_l (int l)
-{
- if (!l || !daddy_perf_l_)
- return this;
-
- return daddy_perf_l_->ancestor_l (l - 1);
-}
-
-int
-Performer_group_performer::depth_i() const
-{
- return daddy_perf_l_->depth_i() + 1;
-}
-
-void
-Performer_group_performer::do_creation_processing()
-{
- for (PCursor<Performer*> i (perf_p_list_.top()); i.ok (); i++)
- i->creation_processing();
-}
-
-void
-Performer_group_performer::do_print() const
-{
-#ifndef NPRINT
- if (!check_debug)
- return ;
- for (PCursor<Performer*> i (perf_p_list_.top()); i.ok (); i++)
- i->print();
-#endif
-}
-void
-Performer_group_performer::do_removal_processing()
-{
- for (PCursor<Performer*> i (perf_p_list_.top()); i.ok (); i++)
- i->do_removal_processing();
-}
-
-bool
-Performer_group_performer::do_try_request (Request* req_l)
-{
- bool hebbes_b =false;
- for (int i =0; !hebbes_b && i < nongroup_l_arr_.size() ; i++)
- hebbes_b =nongroup_l_arr_[i]->try_request (req_l);
- if (!hebbes_b && daddy_perf_l_)
- hebbes_b = daddy_perf_l_->try_request (req_l);
- return hebbes_b ;
-}
-
-Translator*
-Performer_group_performer::find_get_translator_l (String n,String id)
-{
- Translator * ret=0;
- Input_translator* itrans_l= itrans_l_-> recursive_find (n);
- if (itrans_l)
- {
- ret = find_performer_l (n,id);
- if (!ret)
- {
- Performer_group_performer * group =
- itrans_l-> get_group_performer_p();
-
- add (group);
- ret = group;
-
- if (group->itrans_l_->is_name_b (n))
- ret ->id_str_ = id;
- else
- return ret->find_get_translator_l (n,id);
-
- }
- }
- else if (daddy_perf_l_)
- ret =daddy_perf_l_->find_get_translator_l (n,id);
- else
- {
- warning ("Can't find or create `" + n + "' called `" + id + "'\n");
- ret =0;
- }
- return ret;
-}
-
-Performer_group_performer*
-Performer_group_performer::find_performer_l (String n, String id)
-{
- if (name() == n && id_str_ == id)
- return this;
- Performer_group_performer * r = 0;
- for (int i =0; !r && i< group_l_arr_.size(); i++)
- {
- r = group_l_arr_[i]->find_performer_l (n,id);
- }
-
- return r;
-}
-
-Translator*
-Performer_group_performer::get_default_interpreter()
-{
- // ?
- if (is_bottom_performer_b())
- return daddy_perf_l_->get_default_interpreter();
-
- Performer_group_performer *perf_p= itrans_l_->
- get_default_itrans_l()->get_group_performer_p ();
- add (perf_p);
- if (perf_p->is_bottom_performer_b())
- return perf_p;
- else
- return perf_p->get_default_interpreter();
-}
-
-bool
-Performer_group_performer::is_bottom_performer_b() const
-{
- return !itrans_l_->get_default_itrans_l();
-}
-
-void
-Performer_group_performer::print() const
-{
- Performer::print();
-}
+#include "debug.hh"
-void
-Performer_group_performer::process_requests()
-{
- for (PCursor<Performer*> i (perf_p_list_.top()); i.ok (); i++)
- i->process_requests();
-}
+IMPLEMENT_IS_TYPE_B2(Performer_group_performer,Performer, Translator_group);
+ADD_THIS_TRANSLATOR(Performer_group_performer);
-bool
-Performer_group_performer::try_request (Request* r)
-{
- return Performer::try_request (r);
-}
#include "debug.hh"
-IMPLEMENT_IS_TYPE_B(Performer);
+IMPLEMENT_IS_TYPE_B1(Performer, Translator);
Performer::Performer()
-{
- daddy_perf_l_ = 0;
- init_b_ =false;
-}
-
-Performer::~Performer()
-{
-}
-
-void
-Performer::do_print() const
{
}
void
Performer::play (Audio_element* p)
{
- daddy_perf_l_->play (p);
+ daddy_perf_l ()->play (p);
}
int
Performer::get_tempo_i() const
{
- return daddy_perf_l_->get_tempo_i();
-}
-
-void
-Performer::print() const
-{
-#ifndef NPRINT
- DOUT << "\n" << name() << " {";
- do_print();
- DOUT << "}";
-#endif
-}
-
-void
-Performer::process_requests()
-{
-}
-
-bool
-Performer::do_try_request (Request* req_l)
-{
- return false;
-}
-
-bool
-Performer::try_request (Request*r)
-{
- if (!init_b_)
- {
- creation_processing();
- }
- return do_try_request (r);
-}
-
-void
-Performer::creation_processing()
-{
- if (!init_b_)
- {
- do_creation_processing();
- init_b_ = true;
- }
-}
-
-void
-Performer::do_creation_processing()
-{
+ return daddy_perf_l ()->get_tempo_i();
}
-void
-Performer::do_removal_processing()
+Performer_group_performer*
+Performer::daddy_perf_l () const
{
+ return (daddy_trans_l_)
+ ?(Performer_group_performer*) daddy_trans_l_->performer_l ()
+ : 0;
}
--- /dev/null
+/*
+ property-iterator.cc -- implement Property_iterator
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "property-iterator.hh"
+#include "translation-property.hh"
+#include "translator-group.hh"
+
+Property_iterator::Property_iterator (Translation_property *prop_l)
+{
+ property_l_ = prop_l;
+}
+
+void
+Property_iterator::process_and_next (Moment m)
+{
+ if (property_l_->var_str_)
+ report_to_l ()->set_property (property_l_->var_str_, property_l_->value_);
+ Music_iterator::process_and_next (m);
+}
+
+IMPLEMENT_IS_TYPE_B1(Property_iterator, Music_iterator);
Mixed_qp::solve (Vector start) const
{
if (!dim())
- return Vector (0);
+ return Vector (0);
print();
Ineq_constrained_qp pure (*this);
for (int i= eq_cons.size()-1; i>=0; i--)
{
- pure.eliminate_var (eq_cons[i], eq_consrhs[i]);
- start.del (eq_cons[i]);
+ pure.eliminate_var (eq_cons[i], eq_consrhs[i]);
+ start.del (eq_cons[i]);
}
Vector sol = pure.solve (start);
for (int i= 0; i < eq_cons.size(); i++)
{
- sol.insert (eq_consrhs[i],eq_cons[i]);
+ sol.insert (eq_consrhs[i],eq_cons[i]);
}
return sol;
}
Array<int> binding;
for (int i=0; i < cons.size(); i++)
{
- Real R=cons[i] * sol- consrhs[i];
- assert (R> -EPS);
- if (R < EPS)
- binding.push (i);
+ Real R=cons[i] * sol- consrhs[i];
+ assert (R> -EPS);
+ if (R < EPS)
+ binding.push (i);
}
// KKT check...
// todo
#ifndef NPRINT
DOUT << "Quad " << quad;
DOUT << "lin " << lin <<"\n"
- << "const " << const_term<<"\n";
+ << "const " << const_term<<"\n";
for (int i=0; i < cons.size(); i++)
{
- DOUT << "constraint["<<i<<"]: " << cons[i] << " >= " << consrhs[i];
- DOUT << "\n";
+ DOUT << "constraint["<<i<<"]: " << cons[i] << " >= " << consrhs[i];
+ DOUT << "\n";
}
#endif
}
Ineq_constrained_qp::print();
for (int i=0; i < eq_cons.size(); i++)
{
- DOUT << "eq cons "<<i<<": x["<<eq_cons[i]<<"] == " << eq_consrhs[i]<<"\n";
+ DOUT << "eq cons "<<i<<": x["<<eq_cons[i]<<"] == " << eq_consrhs[i]<<"\n";
}
#endif
}
String s ("Active|Inactive [");
for (int i=0; i< active.size(); i++)
{
- s += String (active[i]) + " ";
+ s += String (active[i]) + " ";
}
s+="| ";
for (int i=0; i< inactive.size(); i++)
{
- s += String (inactive[i]) + " ";
+ s += String (inactive[i]) + " ";
}
s+="]";
Array<int> allcons;
for (int i=0; i < opt->cons.size(); i++)
- allcons.push (0);
+ allcons.push (0);
for (int i=0; i < active.size(); i++)
{
- int j = active[i];
- allcons[j]++;
+ int j = active[i];
+ allcons[j]++;
}
for (int i=0; i < inactive.size(); i++)
{
- int j = inactive[i];
- allcons[j]++;
+ int j = inactive[i];
+ allcons[j]++;
}
for (int i=0; i < allcons.size(); i++)
- assert (allcons[i] == 1);
+ assert (allcons[i] == 1);
#endif
}
Vector addrow (Ha.dim());
if (abs (aHa) > EPS)
{
- /*
- a != 0, so if Ha = O(EPS), then
- Ha * aH / aHa = O(EPS^2/EPS)
+ /*
+ a != 0, so if Ha = O(EPS), then
+ Ha * aH / aHa = O(EPS^2/EPS)
- if H*a == 0, the constraints are dependent.
+ if H*a == 0, the constraints are dependent.
*/
- H -= Matrix (Ha/aHa , Ha);
+ H -= Matrix (Ha/aHa , Ha);
- /*
+ /*
sorry, don't know how to justify this. ..
*/
- addrow=Ha;
+ addrow=Ha;
addrow/= aHa;
- A -= Matrix (A*a, addrow);
- A.insert_row (addrow,A.rows());
- }else
- WARN << "degenerate constraints";
+ A -= Matrix (A*a, addrow);
+ A.insert_row (addrow,A.rows());
+ }else
+ WARN << "degenerate constraints";
}
void
{
int q=active.size()-1;
- // drop indices
+ // drop indices
inactive.push (active[k]);
active.swap (k,q);
A.swap_rows (k,q);
Vector a (A.row (q));
if (a.norm() > EPS)
{
- /*
+ /*
- */
+ */
Real q = a*opt->quad*a;
- Matrix aaq (a,a/q);
- H += aaq;
- A -= A*opt->quad*aaq;
- }else
- WARN << "degenerate constraints";
+ Matrix aaq (a,a/q);
+ H += aaq;
+ A -= A*opt->quad*aaq;
+ }else
+ WARN << "degenerate constraints";
#ifndef NDEBUG
Vector rem_row (A.row (q));
assert (rem_row.norm() < EPS);
Active_constraints::Active_constraints (Ineq_constrained_qp const *op)
: A(0,op->dim()),
- H(op->dim()),
- opt (op)
+ H(op->dim()),
+ opt (op)
{
for (int i=0; i < op->cons.size(); i++)
- inactive.push (i);
+ inactive.push (i);
Choleski_decomposition chol (op->quad);
/*
ugh.
- */
+ */
H=chol.inverse();
OK();
}
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
-#include "translator.hh"
+#include "translator-group.hh"
#include "debug.hh"
#include "request-iterator.hh"
#include "music-list.hh"
IMPLEMENT_IS_TYPE_B1(Rest_collision_engraver, Engraver);
-ADD_THIS_ENGRAVER(Rest_collision_engraver);
+ADD_THIS_TRANSLATOR(Rest_collision_engraver);
Rest_collision_engraver::Rest_collision_engraver()
{
rest_collision_p_ =0;
}
-void
-Rest_collision_engraver::make_collision()
-{
- if (!rest_collision_p_)
- {
- rest_collision_p_ = new Rest_collision;
- announce_element (Score_elem_info (rest_collision_p_, 0));
- }
-}
void
Rest_collision_engraver::acknowledge_element (Score_elem_info i)
{
- char const * nC = i.elem_l_->name();
- if (nC == Note_column::static_name())
+ if (i.elem_l_->name()== Note_column::static_name())
{
- // what should i do, what should _engraver do?
- make_collision();
- rest_collision_p_->add ((Note_column*)i.elem_l_->item());
- }
- else if (nC == Rest_column::static_name())
- {
- make_collision();
- rest_collision_p_->add ((Rest_column*)i.elem_l_->item());
+ // what should i do, what should _engraver do?
+ if (!rest_collision_p_)
+ {
+ rest_collision_p_ = new Rest_collision;
+ announce_element (Score_elem_info (rest_collision_p_, 0));
+ }
+ rest_collision_p_->add ((Note_column*)i.elem_l_->item());
}
}
{
if (rest_collision_p_)
{
- typeset_element (rest_collision_p_);
- rest_collision_p_ = 0;
+ typeset_element (rest_collision_p_);
+ rest_collision_p_ = 0;
}
}
-
-void
-Rest_collision_engraver::do_print() const
-{
-#ifndef NPRINT
- if (rest_collision_p_)
- rest_collision_p_->print();
-#endif
-}
Rest_collision::add (Note_column *nc_l)
{
add_dependency (nc_l);
- ncol_l_arr_.push (nc_l);
-}
-
-void
-Rest_collision::add (Rest_column *rc_l)
-{
- add_dependency (rc_l);
- rest_l_arr_.push (rc_l);
+ if (nc_l->rest_b ())
+ rest_l_arr_.push (nc_l);
+ else
+ ncol_l_arr_.push (nc_l);
}
void
// can this happen?
Stem* stem_l = rest_l_arr_[0]->stem_l_;
if (!stem_l)
- return;
+ return;
// no beam
if (!(stem_l->beams_left_i_ || stem_l->beams_right_i_))
- return;
+ return;
int dir_i = rest_l_arr_[0]->dir_;
int midpos = 4;
#else // nogo: stem_start not set for rests?
int pos = (stem_l->stem_start_f() - midpos) + dir_i * 2;
#endif
- rest_l_arr_[0]->translate_heads (pos);
+ rest_l_arr_[0]->translate_rests (pos);
}
void
Rest_collision::do_pre_processing()
{
/*
- handle rest-rest and rest-note collisions
+ handle rest-rest and rest-note collisions
- [todo]
- decide not to print rest if too crowded?
+ [todo]
+ decide not to print rest if too crowded?
*/
// no rests to collide
if (!rest_l_arr_.size())
- return;
+ return;
// no partners to collide with
if (rest_l_arr_.size() + ncol_l_arr_.size () < 2)
- return;
+ return;
// meisjes met meisjes
if (!ncol_l_arr_.size())
{
- int dy = rest_l_arr_.size() > 2 ? 6 : 4;
+ int dy = rest_l_arr_.size() > 2 ? 6 : 4;
- rest_l_arr_[0]->translate_heads (rest_l_arr_[0]->dir_ *dy);
- // top is last element...
- rest_l_arr_.top()->translate_heads (rest_l_arr_.top ()->dir_* dy);
+ rest_l_arr_[0]->translate_rests (rest_l_arr_[0]->dir_ *dy);
+ // top is last element...
+ rest_l_arr_.top()->translate_rests (rest_l_arr_.top ()->dir_* dy);
}
// meisjes met jongetjes
else
{
#if 0 // breendet: rests go always under
- // geen gemug, trug op je rug
- int dir_i = -1;
- rest_l_arr_[0]->translate_heads (dir_i * 3);
+ // geen gemug, trug op je rug
+ int dir_i = -1;
+ rest_l_arr_[0]->translate_rests (dir_i * 3);
#else
- // int dir_i = - ncol_l_arr_[0]->dir_;
- int dir_i = rest_l_arr_[0]->dir_;
- // hope it's 4: if it works->doco
- int midpos = 4;
+ // int dir_i = - ncol_l_arr_[0]->dir_;
+ int dir_i = rest_l_arr_[0]->dir_;
+ // hope it's 4: if it works->doco
+ int midpos = 4;
// minimum move
- int minpos = 4;
+ int minpos = 4;
- // quart rest height
- // UGH Should get dims from table!
- int size_i = 6;
+ // quart rest height
+ // UGH Should get dims from table!
+ int size_i = 6;
- int sep_i = 3 + size_i / 2;
- for (int i = 0; i < ncol_l_arr_.size(); i++)
- {
- // how to know whether to sort?
- ncol_l_arr_[i]->sort();
- for (int j = 0; j < ncol_l_arr_[i]->head_l_arr_.size(); j++)
- minpos = minpos >? dir_i *
- (ncol_l_arr_[i]->head_l_arr_[j]->position_i_ -midpos) + sep_i;
- }
- rest_l_arr_[0]->translate_heads (dir_i * minpos);
+ int sep_i = 3 + size_i / 2;
+ for (int i = 0; i < ncol_l_arr_.size(); i++)
+ {
+ // how to know whether to sort?
+ ncol_l_arr_[i]->sort();
+ for (int j = 0; j < ncol_l_arr_[i]->head_l_arr_.size(); j++)
+ minpos = minpos >? dir_i *
+ (ncol_l_arr_[i]->head_l_arr_[j]->position_i_ -midpos) + sep_i;
+ }
+ rest_l_arr_[0]->translate_rests (dir_i * minpos);
#endif
}
}
Rest_collision::do_substitute_dependency (Score_elem*o,Score_elem*n)
{
Item*o_l = o->item();
- Item*n_l = n?n->item():0;
- rest_l_arr_.substitute ((Rest_column*)o_l,(Rest_column*)n_l);
- ncol_l_arr_.substitute ((Note_column*)o_l,(Note_column*)n_l);
+
+ if (o_l&&o_l->is_type_b (Note_column::static_name ()))
+ {
+ Note_column *n_l = n?(Note_column*)n->item():0;
+ rest_l_arr_.substitute ((Note_column*)o_l, n_l);
+ ncol_l_arr_.substitute ((Note_column*)o_l, n_l);
+ }
}
Rest_collision::Rest_collision()
--- /dev/null
+/*
+ rest-grav.cc -- implement Rest_engraver
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "rest-grav.hh"
+#include "musical-request.hh"
+#include "dots.hh"
+#include "rest.hh"
+/*
+ Should merge with Note_head_engraver
+ */
+Rest_engraver::Rest_engraver ()
+{
+ rest_req_l_ =0;
+ rest_p_ =0;
+ dot_p_ =0;
+}
+
+void
+Rest_engraver::do_post_move_processing ()
+{
+ rest_req_l_ =0;
+}
+
+void
+Rest_engraver::do_pre_move_processing ()
+{
+ if (rest_p_)
+ {
+ typeset_element (rest_p_);
+ rest_p_ =0;
+ }
+ if (dot_p_)
+ {
+ typeset_element (dot_p_);
+ dot_p_ =0;
+ }
+}
+
+void
+Rest_engraver::do_process_requests ()
+{
+ if (rest_req_l_ && !rest_p_)
+ {
+ rest_p_ = new Rest;
+ rest_p_->balltype_i_ = rest_req_l_->duration_.durlog_i_;
+ rest_p_->dots_i_ = rest_req_l_->duration_.dots_i_;
+ if (rest_p_->dots_i_)
+ {
+ dot_p_ = new Dots;
+ rest_p_->dots_l_ =dot_p_;
+ announce_element (Score_elem_info (dot_p_,0));
+ }
+ announce_element (Score_elem_info (rest_p_, rest_req_l_));
+ }
+}
+
+bool
+Rest_engraver::do_try_request (Request *r)
+{
+ Musical_req *m = r->musical ();
+ if (!m || !m->rest ())
+ return false;
+
+ rest_req_l_ = m->rest (); // ugh
+ return true;
+}
+
+IMPLEMENT_IS_TYPE_B1(Rest_engraver, Engraver);
+ADD_THIS_TRANSLATOR(Rest_engraver);
--- /dev/null
+/*
+ rest.cc -- implement
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "molecule.hh"
+#include "paper-def.hh"
+#include "lookup.hh"
+#include "rest.hh"
+#include "dots.hh"
+#include "axis-group-element.hh"
+#include "p-score.hh"
+
+void
+Rest::do_add_processing ()
+{
+ if (balltype_i_ == 0)
+ position_i_ += 6;
+ else if (balltype_i_ == 1)
+ position_i_ += 4;
+ Rhythmic_head::do_add_processing ();
+ if (dots_l_)
+ dots_l_->position_i_ = position_i_;
+}
+
+Rest::Rest ()
+{
+ position_i_ =0;
+}
+
+Molecule *
+Rest::brew_molecule_p () const
+{
+ int staff_size_i_ =8;
+ bool streepjes_b = (position_i_<-1) || (position_i_ > staff_size_i_+1);
+
+ Symbol s(paper ()->lookup_l()->rest (balltype_i_, streepjes_b));
+ Molecule * m = new Molecule ( Atom (s));
+ m->translate (position_i_ * paper ()->internote_f (), Y_AXIS);
+ return m;
+}
+
+IMPLEMENT_IS_TYPE_B1(Rest, Rhythmic_head);
--- /dev/null
+/*
+ rhythmic-column-grav.cc -- implement Rhythmic_column_engraver
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "rhythmic-column-grav.hh"
+#include "note-head.hh"
+#include "stem.hh"
+#include "note-column.hh"
+#include "script.hh"
+#include "dot-column.hh"
+
+Rhythmic_column_engraver::Rhythmic_column_engraver()
+{
+ stem_l_ =0;
+ ncol_p_=0;
+ dotcol_p_ =0;
+}
+
+
+void
+Rhythmic_column_engraver::acknowledge_element (Score_elem_info i)
+{
+ if (i.elem_l_->is_type_b (Script::static_name ())
+ && i.req_l_ && i.req_l_->musical ())
+ {
+ script_l_arr_.push ((Script*)i.elem_l_->item());
+ }
+ else if (i.elem_l_->is_type_b (Stem::static_name()))
+ {
+ stem_l_ = (Stem*) i.elem_l_->item();
+ }
+ else if (i.elem_l_->is_type_b (Rhythmic_head::static_name ()))
+ {
+ Rhythmic_head * r = (Rhythmic_head*)i.elem_l_->item ();
+ if (!ncol_p_)
+ {
+ ncol_p_ = new Note_column;
+ announce_element (Score_elem_info (ncol_p_, 0));
+ }
+ ncol_p_->add (r);
+
+ if (r->dots_l_)
+ {
+ if (!dotcol_p_)
+ {
+ dotcol_p_ = new Dot_column;
+ ncol_p_->set (dotcol_p_);
+ announce_element (Score_elem_info (dotcol_p_, 0));
+ }
+ dotcol_p_->add (r);
+ }
+ }
+
+ if (ncol_p_)
+ {
+ if (stem_l_&& !ncol_p_->stem_l_)
+ ncol_p_->set (stem_l_);
+
+ for (int i=0; i < script_l_arr_.size(); i++)
+ {
+ if (ncol_p_)
+ ncol_p_->add (script_l_arr_[i]);
+ }
+
+ script_l_arr_.clear();
+ }
+}
+
+void
+Rhythmic_column_engraver::do_pre_move_processing()
+{
+ if (ncol_p_)
+ {
+ if (! ncol_p_->h_shift_b_)
+ ncol_p_->h_shift_b_ = (bool) get_property ("hshift");
+ if (! ncol_p_->dir_)
+ ncol_p_->dir_ =(Direction) int(get_property ("ydirection"));
+
+ typeset_element (ncol_p_);
+ ncol_p_ =0;
+ }
+ if (dotcol_p_)
+ {
+ typeset_element (dotcol_p_);
+ dotcol_p_ =0;
+ }
+}
+
+void
+Rhythmic_column_engraver::do_post_move_processing()
+{
+ script_l_arr_.clear();
+ stem_l_ =0;
+}
+
+
+
+
+IMPLEMENT_IS_TYPE_B1(Rhythmic_column_engraver,Engraver);
+ADD_THIS_TRANSLATOR(Rhythmic_column_engraver);
--- /dev/null
+/*
+ rhythmic-head.cc -- implement
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "rhythmic-head.hh"
+#include "debug.hh"
+#include "molecule.hh"
+#include "paper-def.hh"
+#include "lookup.hh"
+#include "rest.hh"
+#include "dots.hh"
+#include "axis-group-element.hh"
+#include "p-score.hh"
+
+void
+Rhythmic_head::do_add_processing ()
+{
+ if (dots_i_ && !dots_l_)
+ {
+ Dots *d = new Dots;
+ add (d);
+ pscore_l_->typeset_element (d);
+ axis_group_l_a_[Y_AXIS]->add_element (d);
+ axis_group_l_a_[X_AXIS]->add_element (d);
+ }
+ if (dots_l_)
+ {
+ dots_l_->no_dots_i_ = dots_i_;
+ }
+}
+
+void
+Rhythmic_head::add (Dots *dot_l)
+{
+ dots_l_ = dot_l;
+ dot_l->add_dependency (this);
+}
+
+
+Rhythmic_head::Rhythmic_head ()
+{
+ dots_l_ =0;
+ balltype_i_ =0;
+ dots_i_ = 0;
+}
+
+void
+Rhythmic_head::do_substitute_dependent (Score_elem*o,Score_elem*n)
+{
+ if (o == dots_l_)
+ dots_l_ = n ? (Dots*)n->item () :0;
+}
+
+IMPLEMENT_IS_TYPE_B1(Rhythmic_head, Item);
+void
+Rhythmic_head::do_print () const
+{
+#ifndef NPRINT
+ DOUT << "balltype = "<< balltype_i_ << "dots = " << dots_i_;
+#endif
+}
+
/*
- score-align-reg.cc -- implement Score_align_engraver
+ score-align-reg.cc -- implement Type_align_engraver
source file of the GNU LilyPond music typesetter
#include "score-align-grav.hh"
#include "item.hh"
-Score_align_engraver::Score_align_engraver()
+Type_align_engraver::Type_align_engraver()
{
type_ch_C_ = 0;
priority_i_ =0;
}
void
-Score_align_engraver::do_pre_move_processing()
+Type_align_engraver::do_pre_move_processing()
{
if (align_p_)
{
- typeset_element (align_p_);
- align_p_ =0;
+ typeset_element (align_p_);
+ align_p_ =0;
}
}
void
-Score_align_engraver::acknowledge_element (Score_elem_info inf)
+Type_align_engraver::acknowledge_element (Score_elem_info inf)
{
if (inf.elem_l_->is_type_b (type_ch_C_))
{
- if (!align_p_)
- {
- align_p_ = new Horizontal_group_item;
- align_p_->breakable_b_ = true;
- announce_element (Score_elem_info (align_p_,0));
- }
- Score_elem * unbound_elem = inf.elem_l_;
- while (unbound_elem->axis_group_l_a_[X_AXIS])
- unbound_elem = unbound_elem->axis_group_l_a_[X_AXIS];
- align_p_->add_element (unbound_elem);
+ if (!align_p_)
+ {
+ align_p_ = new Horizontal_group_item;
+ align_p_->breakable_b_ = true;
+ announce_element (Score_elem_info (align_p_,0));
+ }
+ Score_elem * unbound_elem = inf.elem_l_;
+ while (unbound_elem->axis_group_l_a_[X_AXIS])
+ unbound_elem = unbound_elem->axis_group_l_a_[X_AXIS];
+ align_p_->add_element (unbound_elem);
}
}
-IMPLEMENT_IS_TYPE_B1(Score_align_engraver,Engraver);
+IMPLEMENT_IS_TYPE_B1(Type_align_engraver,Engraver);
#include "bar.hh"
#include "score-align-grav.hh"
-#define IMPLEMENT_ALIGN_REG(C,T,p)\
-class C ## _align_engraver : public Score_align_engraver \
+#define IMPLEMENT_ALIGN_GRAV(C,T,p)\
+class C ## _align_engraver : public Type_align_engraver \
{ \
public: \
DECLARE_MY_RUNTIME_TYPEINFO; \
- C ## _align_engraver() : Score_align_engraver () \
+ TRANSLATOR_CLONE(C ## _align_engraver);\
+ C ## _align_engraver() : Type_align_engraver () \
{ type_ch_C_ = T::static_name();\
priority_i_ = p;} \
}; \
-ADD_THIS_ENGRAVER(C ## _align_engraver); \
-IMPLEMENT_IS_TYPE_B1(C ## _align_engraver, Score_align_engraver) ;
+ADD_THIS_TRANSLATOR(C ## _align_engraver); \
+IMPLEMENT_IS_TYPE_B1(C ## _align_engraver, Type_align_engraver) ;
-IMPLEMENT_ALIGN_REG(Key,Key_item,3);
-IMPLEMENT_ALIGN_REG(Clef,Clef_item,2);
-IMPLEMENT_ALIGN_REG(Meter,Meter,4);
-IMPLEMENT_ALIGN_REG(Bar, Bar,0);
+IMPLEMENT_ALIGN_GRAV(Key,Key_item,3);
+IMPLEMENT_ALIGN_GRAV(Clef,Clef_item,2);
+IMPLEMENT_ALIGN_GRAV(Meter,Meter,4);
+IMPLEMENT_ALIGN_GRAV(Bar, Bar,0);
#include "item.hh"
#include "p-col.hh"
+Score_elem::Score_elem()
+{
+ transparent_b_ = empty_b_ = false;
+ axis_group_l_a_[0] = axis_group_l_a_[1] =0;
+ pscore_l_=0;
+ offset_ = Offset (0,0);
+ output = 0;
+ status_ = ORPHAN;
+}
+
+Score_elem::Score_elem (Score_elem const&s)
+{
+ /* called from derived ctor, so most info points to the same deps
+ as (Directed_graph_node&)s. Nobody points to us, so don't copy
+ dependents.
+ */
+ copy_edges_out (s);
+ transparent_b_ = s.transparent_b_;
+ empty_b_ = s.empty_b_;
+ axis_group_l_a_[0] = axis_group_l_a_[1] =0;
+ status_ = s.status_;
+ assert (!s.output);
+ output = 0;
+ pscore_l_ = s.pscore_l_;
+ offset_ = Offset (0,0);
+}
+
+Score_elem::~Score_elem()
+{
+ // some paranoia to prevent weird segv's
+ assert (status_ < DELETED);
+ delete output;
+ status_ = DELETED;
+ output = 0;
+}
+
Score_elem*
Score_elem::dependency (int i) const
{
a.push (print_dimen (o.y()));
a.push (print_dimen (o.x()));
String t = output->TeX_string();
- if (t == "")
+ if (!t)
return t;
a.push (t);
return make_TeX_string(absolute_offset());
}
-Score_elem::Score_elem (Score_elem const&s)
-{
- /* called from derived ctor, so most info points to the same deps
- as (Directed_graph_node&)s. Nobody points to us, so don't copy
- dependents.
- */
- copy_edges_out (s);
- transparent_b_ = s.transparent_b_;
- empty_b_ = s.empty_b_;
- axis_group_l_a_[0] = axis_group_l_a_[1] =0;
- status_ = s.status_;
- assert (!s.output);
- output = 0;
- pscore_l_ = s.pscore_l_;
- offset_ = Offset (0,0);
-}
-
-Score_elem::~Score_elem()
-{
- // some paranoia to prevent weird segv's
- assert (status_ < DELETED);
- delete output;
- status_ = DELETED;
- output = 0;
-}
-
/*
GEOMETRY
*/
#endif
}
-Score_elem::Score_elem()
-{
- transparent_b_ = empty_b_ = false;
- axis_group_l_a_[0] = axis_group_l_a_[1] =0;
- pscore_l_=0;
- offset_ = Offset (0,0);
- output = 0;
- status_ = ORPHAN;
-}
-
Paper_def*
Score_elem::paper() const
#include "super-elem.hh"
#include "scoreline.hh"
#include "debug.hh"
-#include "score-elem.hh"
-#include "bar.hh" // needed for Bar::static_name
+#include "item.hh"
#include "score-grav.hh"
-#include "p-col.hh"
#include "p-score.hh"
-#include "score.hh"
#include "musical-request.hh"
#include "score-column.hh"
#include "command-request.hh"
+#include "paper-def.hh"
Score_engraver::Score_engraver()
void
Score_engraver::prepare (Moment w)
{
+ Global_translator::prepare (w);
set_columns (new Score_column (w), new Score_column (w));
disallow_break_b_ = false;
return inf;
}
-Paper_def*
-Score_engraver::paper() const
-{
- return pscore_p_->paper_l_;
-}
Music_output*
}
IMPLEMENT_IS_TYPE_B1(Score_engraver,Engraver_group_engraver);
-ADD_THIS_ENGRAVER(Score_engraver);
+ADD_THIS_TRANSLATOR(Score_engraver);
-
+void
+Score_engraver::add_processing ()
+{
+ Translator_group::add_processing ();
+ assert (output_def_l_->is_type_b (Paper_def::static_name ()));
+ assert (!daddy_trans_l_);
+ pscore_p_ = new Paper_score;
+ pscore_p_->paper_l_ = (Paper_def*)output_def_l_;
+}
{
if (halign_p_)
{
- typeset_element (halign_p_);
- halign_p_ =0;
+ typeset_element (halign_p_);
+ halign_p_ =0;
}
}
{
Engraver* reg = i.origin_grav_l_arr_[0];
if (reg->is_type_b (
- Score_align_engraver::static_name()))
- {
- Score_align_engraver * align_grav_l = (Score_align_engraver*) reg;
- if (!halign_p_)
- {
- halign_p_ = new Break_align_item;
- halign_p_->breakable_b_ = true;
- announce_element (Score_elem_info (halign_p_,0));
- }
- Item * it = i.elem_l_->item();
- if (align_grav_l->type_ch_C_ == Bar::static_name())
- halign_p_->center_l_ = it;
+ Type_align_engraver::static_name()))
+ {
+ Type_align_engraver * align_grav_l = (Type_align_engraver*) reg;
+ if (!halign_p_)
+ {
+ halign_p_ = new Break_align_item;
+ halign_p_->breakable_b_ = true;
+ announce_element (Score_elem_info (halign_p_,0));
+ }
+ Item * it = i.elem_l_->item();
+ if (align_grav_l->type_ch_C_ == Bar::static_name())
+ halign_p_->center_l_ = it;
- halign_p_->add (it, align_grav_l->priority_i_);
+ halign_p_->add (it, align_grav_l->priority_i_);
}
}
IMPLEMENT_IS_TYPE_B1(Score_horizontal_align_engraver,Engraver);
-ADD_THIS_ENGRAVER(Score_horizontal_align_engraver);
+ADD_THIS_TRANSLATOR(Score_horizontal_align_engraver);
*/
#include "score-performer.hh"
-#include "input-translator.hh"
#include "midi-def.hh"
#include "audio-column.hh"
#include "audio-item.hh"
-#include "audio-score.hh"
+#include "performance.hh"
#include "midi-stream.hh"
#include "string-convert.hh"
#include "debug.hh"
#include "audio-staff.hh"
IMPLEMENT_IS_TYPE_B1(Score_performer,Performer_group_performer);
-
-ADD_THIS_PERFORMER(Score_performer);
+ADD_THIS_TRANSLATOR(Score_performer);
Score_performer::Score_performer()
{
}
-
-Translator*
-Score_performer::ancestor_l (int l)
-{
- return Global_translator::ancestor_l (l);
-}
-
-
-int
-Score_performer::depth_i() const
-{
- return Global_translator::depth_i();
-}
-
-
-
void
Score_performer::play (Audio_element * p)
{
if (p->is_type_b (Audio_item::static_name()))
{
- audio_column_l_->add ((Audio_item*)p);
+ audio_column_l_->add ((Audio_item*)p);
}
else if (p->is_type_b (Audio_staff::static_name()))
{
performance_p_->add (p);
}
-
void
Score_performer::prepare (Moment m)
{
- now_mom_ = m;
+ Global_translator::prepare (m);
audio_column_l_ = new Audio_column (m);
performance_p_->add (audio_column_l_);
+ post_move_processing ();
}
Score_performer::process()
{
process_requests();
+ pre_move_processing();
+ check_removal();
}
-
-
void
Score_performer::start()
{
void
Score_performer::finish()
{
- Performer_group_performer::do_removal_processing();
+ check_removal ();
+ removal_processing();
}
Music_output *
performance_p_ =0;
return o;
}
+
+void
+Score_performer::add_processing ()
+{
+ Translator_group::add_processing ();
+ assert (output_def_l_->is_type_b (Midi_def::static_name ()));
+ performance_p_ = new Performance;
+ performance_p_->midi_l_ = (Midi_def*) output_def_l_;
+}
{
#ifndef NPRINT
DOUT << "score {\n";
+ music_p_ -> print ();
for (int i=0; i < def_p_arr_.size (); i++)
def_p_arr_[i]->print();
DOUT << "}\n";
{
for (int i=0; i < global_score_array.size(); i++)
{
- Score *&is_p = global_score_array[i];
- if (is_p->header_p_)
- is_p->header_p_->lily_id_str_ = "Lily was here, " +
- get_version_number_str();
- if (is_p->errorlevel_i_)
- {
- is_p->warning ("Score contains errors. Will not process it. ");
- exit_status_i_ |= 1;
- }
- else
- {
- is_p->print();
- is_p->process();
- }
- delete is_p;
- is_p =0;
+ Score *&is_p = global_score_array[i];
+ if (is_p->header_p_)
+ is_p->header_p_->lily_id_str_ = "Lily was here, " +
+ get_version_number_str();
+ if (is_p->errorlevel_i_)
+ {
+ is_p->warning ("Score contains errors. Will not process it. ");
+ exit_status_i_ |= 1;
+ }
+ else
+ {
+ is_p->process();
+ }
+ delete is_p;
+ is_p =0;
}
global_score_array.clear();
IMPLEMENT_IS_TYPE_B1(Script_engraver,Engraver);
-ADD_THIS_ENGRAVER(Script_engraver);
+ADD_THIS_TRANSLATOR(Script_engraver);
}
}
-void
-Slur_engraver::set_feature (Feature f)
-{
- if (f.type_ == "vdir")
- dir_ = (Direction)int(f.value_);
-}
-
/*
abracadabra
*/
void
Slur_engraver::do_pre_move_processing()
{
+ dir_ = (Direction) int(get_property ("ydirection"));
for (int i = 0; i < end_slur_l_arr_.size(); i++)
{
if (dir_)
}
IMPLEMENT_IS_TYPE_B1(Slur_engraver,Engraver);
-ADD_THIS_ENGRAVER(Slur_engraver);
+ADD_THIS_TRANSLATOR(Slur_engraver);
IMPLEMENT_IS_TYPE_B1(Span_bar_engraver,Engraver);
-ADD_THIS_ENGRAVER(Span_bar_engraver);
+ADD_THIS_TRANSLATOR(Span_bar_engraver);
{
Bar * bold = 0;
if (o->is_type_b (Bar::static_name()))
- bold = (Bar*)o->item();
+ bold = (Bar*)o->item();
else
- return;
+ return;
bold->spanned_i_ --;
Bar * b =0;
if (n && n->is_type_b (Bar::static_name()))
{
- b = (Bar*)n->item();
- b->spanned_i_ ++;
+ b = (Bar*)n->item();
+ b->spanned_i_ ++;
}
spanning_l_arr_.substitute (bold , b);
{
if (spanning_l_arr_.size() < 1)
{
- transparent_b_ = true;
- empty_b_ =true;
+ transparent_b_ = true;
+ empty_b_ =true;
}
else
{
- if (type_str_ == "")
- type_str_ = spanning_l_arr_[0]->type_str_;
- if (type_str_ =="")
- {
- transparent_b_=true;
- empty_b_ = true;
- }
- else if (type_str_ == "|:")
- {
- type_str_ = ".|";
- }
- else if (type_str_ == ":|")
- {
- type_str_ = "|.";
- }
+ if (!type_str_)
+ type_str_ = spanning_l_arr_[0]->type_str_;
+ if (!type_str_)
+ {
+ transparent_b_=true;
+ empty_b_ = true;
+ }
+ else if (type_str_ == "|:")
+ {
+ type_str_ = ".|";
+ }
+ else if (type_str_ == ":|")
+ {
+ type_str_ = "|.";
+ }
}
}
Interval y_int;
for (int i=0; i < spanning_l_arr_.size(); i++)
{
- Axis_group_element *common =
- common_group (spanning_l_arr_[i], Y_AXIS);
+ Axis_group_element *common =
+ common_group (spanning_l_arr_[i], Y_AXIS);
- Real y = spanning_l_arr_[i]->relative_coordinate (common, Y_AXIS)
- -relative_coordinate (common,Y_AXIS);
+ Real y = spanning_l_arr_[i]->relative_coordinate (common, Y_AXIS)
+ -relative_coordinate (common,Y_AXIS);
- y_int.unite (y + spanning_l_arr_[i]->height());
+ y_int.unite (y + spanning_l_arr_[i]->height());
}
Symbol s = get_bar_sym (y_int.length());
return new Piano_brace;
}
-ADD_THIS_ENGRAVER(Piano_bar_engraver);
-ADD_THIS_ENGRAVER(Span_score_bar_engraver);
+ADD_THIS_TRANSLATOR(Piano_bar_engraver);
+ADD_THIS_TRANSLATOR(Span_score_bar_engraver);
void
Spanner::set_bounds(Direction d, Item*i)
{
+
if (spanned_drul_[d])
spanned_drul_[d]->attached_span_l_arr_.substitute(this,0);
spanned_drul_[d] =i;
if (i)
i->attached_span_l_arr_.push(this);
+
+ assert (!spanned_drul_[d] ||
+ spanned_drul_[Direction(-d)] != spanned_drul_[d]);
+
}
void
return musical_l();
}
-Moment
-Staff_info::when()
-{
- return command_l()->when ();
-}
-
*/
#include "staff-performer.hh"
-#include "translator.hh"
-#include "input-translator.hh"
+#include "translator-group.hh"
#include "debug.hh"
#include "audio-column.hh"
#include "audio-item.hh"
#include "audio-staff.hh"
IMPLEMENT_IS_TYPE_B1(Staff_performer,Performer_group_performer);
-ADD_THIS_PERFORMER(Staff_performer);
+ADD_THIS_TRANSLATOR(Staff_performer);
Staff_performer::Staff_performer()
{
if (instrument_str().length_i())
{
- // staff name
- play (new Audio_text (Audio_text::TRACK_NAME, instrument_str ()));
- // instrument description
- play (new Audio_text (Audio_text::INSTRUMENT_NAME, instrument_str ()));
+ // staff name
+ play (new Audio_text (Audio_text::TRACK_NAME, id_str_));
+ // instrument description
+ play (new Audio_text (Audio_text::INSTRUMENT_NAME, instrument_str ()));
}
// tempo
- play(new Audio_tempo(get_tempo_i()));
+ play (new Audio_tempo (get_tempo_i ()));
if (instrument_str ().length_i ())
- // instrument
- play (new Audio_instrument (instrument_str ()));
+ // instrument
+ play (new Audio_instrument (instrument_str ()));
+ Performer_group_performer::do_creation_processing ();
}
void
Staff_performer::do_removal_processing()
{
+ Performer_group_performer::do_removal_processing ();
Performer::play (audio_staff_p_);
audio_staff_p_ = 0;
}
String
Staff_performer::instrument_str()
{
- return Translator::id_str_;
+ return get_property ("instrument");
}
void
{
if (p->is_type_b (Audio_item::static_name()))
{
- audio_staff_p_->add ((Audio_item*)p);
+ audio_staff_p_->add ((Audio_item*)p);
}
Performer::play (p);
}
IMPLEMENT_IS_TYPE_B1(Staff_sym_engraver,Engraver);
-ADD_THIS_ENGRAVER(Staff_sym_engraver);
+ADD_THIS_TRANSLATOR(Staff_sym_engraver);
#include "stem.hh"
#include "musical-request.hh"
#include "duration-convert.hh"
+#include "misc.hh"
Stem_engraver::Stem_engraver()
{
- stem_p_ =0;
- dir_ =CENTER;
+ abbrev_req_l_ = 0;
+ stem_p_ = 0;
+ dir_ = CENTER;
}
void
{
Rhythmic_req * r = i.req_l_->musical()->rhythmic();
stem_p_ = new Stem;
- stem_p_->flag_i_ = Duration_convert::type2_i(r->duration_.durlog_i_);
+ int durlog_i = r->duration_.durlog_i_;
+ stem_p_->flag_i_ = Duration_convert::type2_i(durlog_i);
+ if (abbrev_req_l_)
+ stem_p_->abbrev_flag_i_ = intlog2 (abbrev_req_l_->type_i_)
+ - (durlog_i>? 2);
announce_element (Score_elem_info (stem_p_, r));
}
stem_p_->add (h);
{
if (stem_p_)
{
+ dir_ = (Direction) int(get_property ("ydirection"));
if (dir_)
stem_p_->dir_ = dir_;
-
+
typeset_element(stem_p_);
- stem_p_ =0;
+ stem_p_ = 0;
}
+ abbrev_req_l_ = 0;
}
-void
-Stem_engraver::set_feature (Feature i)
+bool
+Stem_engraver::do_try_request (Request* r)
{
- if (i.type_ == "vdir")
- dir_ = (Direction) int(i.value_);
+ Musical_req* mus_l = r->musical ();
+ if (!mus_l)
+ return false;
+
+ Abbreviation_req* a = mus_l->abbrev ();
+ if (!a)
+ return false;
+
+ abbrev_req_l_ = a;
+
+ return true;
}
IMPLEMENT_IS_TYPE_B1(Stem_engraver, Engraver);
-ADD_THIS_ENGRAVER(Stem_engraver);
+ADD_THIS_TRANSLATOR(Stem_engraver);
--- /dev/null
+/*
+ stem-info.cc -- implement Stem_info
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Jan Nieuwenhuizen <jan@digicash.com>
+
+*/
+
+#include "proto.hh"
+#include "dimen.hh"
+#include "misc.hh"
+#include "debug.hh"
+#include "symbol.hh"
+#include "stem.hh"
+#include "paper-def.hh"
+#include "lookup.hh"
+#include "stem-info.hh"
+
+Stem_info::Stem_info ()
+{
+}
+
+Stem_info::Stem_info (Stem const *s)
+{
+ x = s->hpos_f();
+ dir_ = s->dir_;
+ beams_i_ = intlog2(s->flag_i_) - 2;
+
+ /*
+ [todo]
+ * get algorithm
+ * runtime
+
+ Breitkopf + H\"artel:
+ miny_f_ = interline + #beams * interbeam
+ ideal8 = 2 * interline + interbeam
+ ideal16,32,64,128 = 1.5 * interline + #beams * interbeam
+
+ * B\"arenreiter:
+ miny_f_ = interline + #beams * interbeam
+ ideal8,16 = 2 interline + #beams * interbeam
+ ideal32,64,128 = 1.5 interline + #beams * interbeam
+
+ */
+
+ Real notehead_y = s->paper()->interline_f ();
+ // huh? why do i need the / 2
+ // Real interbeam_f = s->paper()->interbeam_f ();
+ Real interbeam_f = s->paper()->interbeam_f () / 2;
+
+ /* well eh, huh?
+ idealy_f_ = dir_ * s->stem_start_f() + beams_i_ * interbeam_f;
+ if (beams_i_ < 3)
+ idealy_f_ += 2 * interline_f;
+ else
+ idealy_f_ += 1.5 * interline_f;
+ */
+
+ idealy_f_ = dir_ * s->stem_end_f();
+
+ miny_f_ = dir_ * s->stem_start_f() + notehead_y + beams_i_ * interbeam_f;
+
+ idealy_f_ = miny_f_ >? idealy_f_;
+ // assert (miny_f_ <= idealy_f_);
+}
+
#include "molecule.hh"
#include "p-col.hh"
#include "misc.hh"
+#include "beam.hh"
+#include "rest.hh"
const int STEMLEN=7;
-int
-Stem::min_head_i() const
-{
- int m = 1000;
- for (int i =0; i < head_l_arr_.size(); i++)
- m = m <? head_l_arr_[i]->position_i_;
- return m;
-}
+IMPLEMENT_IS_TYPE_B1 (Stem,Item);
-int
-Stem::max_head_i() const
-{
- int m = -1000;
- for (int i =0; i < head_l_arr_.size(); i++)
- m = m >? head_l_arr_[i]->position_i_;
- return m;
-
-}
-/*
- TODO: staff-size
- */
Stem::Stem ()
{
+ /*
+ TODO: staff-size
+ */
+ abbrev_flag_i_ = 0;
+ beam_l_ = 0;
beams_left_i_ = 0;
beams_right_i_ = 0;
dir_ =CENTER;
staff_size_i_ = 8;
- print_flag_b_=true;
stem_xoffset_f_ =0;
}
+int
+Stem::min_head_i () const
+{
+ int m = 1000;
+ for (int i =0; i < head_l_arr_.size (); i++)
+ m = m <? head_l_arr_[i]->position_i_;
+ return m;
+}
-IMPLEMENT_IS_TYPE_B1(Stem,Item);
+int
+Stem::max_head_i () const
+{
+ int m = -1000;
+ for (int i =0; i < head_l_arr_.size (); i++)
+ m = m >? head_l_arr_[i]->position_i_;
+ return m;
+
+}
void
-Stem::do_print() const
+Stem::do_print () const
{
#ifndef NPRINT
- DOUT << "flag "<< flag_i_ << " print_flag_b_ " << print_flag_b_;
+ DOUT << "flag "<< flag_i_ << " print_flag? " << !(bool)beam_l_ << "abbrev_flag_i_" << abbrev_flag_i_;
#endif
}
Real
-Stem::stem_length_f() const
+Stem::stem_length_f () const
{
return stem_top_f_-stem_bottom_f_ ;
}
Real
-Stem::stem_start_f() const
+Stem::stem_start_f () const
{
return (dir_ < 0)? stem_top_f_ : stem_bottom_f_;
}
Real
-Stem::stem_end_f() const
+Stem::stem_end_f () const
{
return (dir_ < 0)? stem_bottom_f_ : stem_top_f_;
}
Stem::set_stemend (Real se)
{
// todo: margins
- if (! ((dir_ > 0 && se >= max_head_i()) ||
- (se <= min_head_i() && dir_ <0)))
+ if (! ((dir_ > 0 && se >= max_head_i ()) ||
+ (se <= min_head_i () && dir_ <0)))
warning ("Weird stem size; check for narrow beams");
- stem_top_f_ = (dir_ < 0) ? max_head_i() : se;
- stem_bottom_f_ = (dir_ < 0) ? se : min_head_i();
+ stem_top_f_ = (dir_ < 0) ? max_head_i () : se;
+ stem_bottom_f_ = (dir_ < 0) ? se : min_head_i ();
}
void
Stem::add (Note_head *n)
{
n->add_dependency (this);
- if (n->rest_b_)
- {
- rest_l_arr_.push (n);
- }
- else if (n->balltype_i_ == 0)
- {
- whole_l_arr_.push (n);
- return;
- }
- else
- {
head_l_arr_.push (n);
- }
+}
+
+void
+Stem::add (Rest *r)
+{
+ rest_l_arr_.push (r);
+ r->add_dependency (this); // ?
}
bool
-Stem::invisible_b() const
+Stem::invisible_b () const
{
- return !head_l_arr_.size();
+
+ return !head_l_arr_.size () ||
+ head_l_arr_[0]->balltype_i_ <= 0;
+
}
// if dir_ is set we return fake values.
int
-Stem::get_center_distance_from_top()
+Stem::get_center_distance_from_top ()
{
if (dir_)
return (dir_ > 0) ? 0 : 1;
int staff_center = staff_size_i_ / 2;
- int max = max_head_i() - staff_center;
+ int max = max_head_i () - staff_center;
return max >? 0;
}
// if dir_ is set we return fake values.
int
-Stem::get_center_distance_from_bottom()
+Stem::get_center_distance_from_bottom ()
{
if (dir_)
return (dir_ > 0) ? 1 : 0;
int staff_center = staff_size_i_ / 2;
- int min = staff_center - min_head_i();
+ int min = staff_center - min_head_i ();
return min >? 0;
}
Direction
-Stem::get_default_dir()
+Stem::get_default_dir ()
{
if (dir_)
return dir_;
- return (get_center_distance_from_top() >=
- get_center_distance_from_bottom()) ? -1 : 1;
+ return (get_center_distance_from_top () >=
+ get_center_distance_from_bottom ()) ?
+ (Direction)-1 : (Direction)1;
}
void
-Stem::set_default_dir()
+Stem::set_default_dir ()
{
- dir_ = get_default_dir();
+ dir_ = get_default_dir ();
}
void
-Stem::set_default_stemlen()
+Stem::set_default_stemlen ()
{
if (!dir_)
- set_default_dir();
+ set_default_dir ();
-
// ugh... how about non 5-line staffs?
- if ((max_head_i() < -2 && dir_ == 1)
- ||(min_head_i() > staff_size_i_ && dir_ == -1))
+ bool on_ledger_line_b = ((max_head_i () < -2 && dir_ == 1)
+// || (min_head_i () > staff_size_i_ && dir_ == -1));
+ || (min_head_i () > staff_size_i_ + 3 && dir_ == -1));
+ if (on_ledger_line_b)
{
- set_stemend (staff_size_i_ /2 -1);
+ set_stemend (staff_size_i_ / 2 - 1);
}
else
{
- set_stemend ((dir_ > 0) ? max_head_i() + STEMLEN :
- min_head_i() - STEMLEN);
-
+ Real dy = paper ()->interbeam_f ();
+ Real len = STEMLEN;
+ // ugh, should get nice *rule* for this
+ if (abbrev_flag_i_ > 1)
+ len += (abbrev_flag_i_ - 1)* dy / 2;
+ set_stemend ((dir_ > 0) ? max_head_i () + len :
+ min_head_i () - len);
}
}
-
void
-Stem::set_default_extents()
+Stem::set_default_extents ()
{
- if (!stem_length_f())
- set_default_stemlen();
+ if (!stem_length_f ())
+ set_default_stemlen ();
set_stemend ((dir_< 0) ?
- max_head_i()-stem_length_f (): min_head_i () +stem_length_f ());
+ max_head_i ()-stem_length_f (): min_head_i () +stem_length_f ());
if (dir_ > 0){
- stem_xoffset_f_ = paper()->note_width ()-paper ()->rule_thickness ();
+ stem_xoffset_f_ = paper ()->note_width ()-paper ()->rule_thickness ();
}
else
stem_xoffset_f_ = 0;
*/
void
-Stem::set_noteheads()
+Stem::set_noteheads ()
{
- if (!head_l_arr_.size())
+ if (!head_l_arr_.size ())
return;
head_l_arr_.sort (Note_head::compare);
if (dir_ < 0)
- head_l_arr_.reverse();
+ head_l_arr_.reverse ();
head_l_arr_[0]->extremal_i_ = -1;
- head_l_arr_.top()->extremal_i_ = 1;
+ head_l_arr_.top ()->extremal_i_ = 1;
int parity=1;
int lastpos = head_l_arr_[0]->position_i_;
- for (int i=1; i < head_l_arr_.size(); i ++)
+ for (int i=1; i < head_l_arr_.size (); i ++)
{
int dy =abs (lastpos- head_l_arr_[i]->position_i_);
}
void
-Stem::do_pre_processing()
+Stem::do_pre_processing ()
{
if (stem_bottom_f_== stem_top_f_)
- set_default_extents();
- set_noteheads();
- flag_i_ = dir_*abs (flag_i_);
- transparent_b_ = invisible_b();
- empty_b_ = invisible_b();
+ set_default_extents ();
+ set_noteheads ();
+ flag_i_ = dir_ * abs (flag_i_);
+ transparent_b_ = invisible_b ();
+ empty_b_ = invisible_b ();
}
Interval
-Stem::do_width() const
+Stem::do_width () const
{
- if (!print_flag_b_ || abs (flag_i_) <= 4)
+ if (beam_l_ || abs (flag_i_) <= 4)
return Interval (0,0); // TODO!
- Paper_def*p= paper();
- Interval r (p->lookup_l()->flag (flag_i_).dim.x ());
+ Paper_def*p= paper ();
+ Interval r (p->lookup_l ()->flag (flag_i_).dim.x ());
r+= stem_xoffset_f_;
return r;
}
+
+
+ Molecule
+ Stem::abbrev_mol () const
+ {
+ Real dy = paper ()->interbeam_f ();
+ Real w = 1.5 * paper ()->lookup_l ()->ball (2).dim.x ().length ();
+ Real beamdy = paper ()->interline_f () / 2;
+
+ int beams_i = 0;
+ Real slope = paper ()->internote_f () / 4;
+
+ if (beam_l_) {
+ // huh?
+ slope = 2 * beam_l_->slope;
+ // ugh, rather calc from Abbreviation_req
+ beams_i = beams_right_i_ >? beams_left_i_;
+ }
+ paper ()->lookup_l ()->beam (slope, 20 PT);
+
+ Molecule beams;
+ Atom a (paper ()->lookup_l ()->beam (slope, w));
+ a.translate (Offset(- w / 2, stem_end_f () - (w / 2 * slope)));
+ // ugh
+ if (!beams_i)
+ a.translate (dy + beamdy - dir_ * dy, Y_AXIS);
+ else
+ a.translate (2 * beamdy - dir_ * (beamdy - dy), Y_AXIS);
+
+ for (int i = 0; i < abbrev_flag_i_; i++)
+ {
+ Atom b (a);
+ b.translate (-dir_ * dy * (beams_i + i), Y_AXIS);
+ beams.add (b);
+ }
+
+ return beams;
+ }
+
Molecule*
-Stem::brew_molecule_p() const
+Stem::brew_molecule_p () const
{
- Molecule *out =0;
+ Molecule *mol_p =new Molecule;
Real bot = stem_bottom_f_;
Real top = stem_top_f_;
assert (bot!=top);
- Paper_def *p =paper();
-
- Real dy = p->internote_f();
- Symbol ss =p->lookup_l()->stem (bot*dy,top*dy);
-
- out = new Molecule (Atom (ss));
+ Paper_def *p =paper ();
- if (print_flag_b_&&abs (flag_i_) > 4)
+ Real dy = p->internote_f ();
+ if (!invisible_b ())
{
- Symbol fl = p->lookup_l()->flag (flag_i_);
+ Symbol ss =p->lookup_l ()->stem (bot*dy,top*dy);
+ mol_p->add (Atom (ss));
+ }
+
+ if (!beam_l_ &&abs (flag_i_) > 4)
+ {
+ Symbol fl = p->lookup_l ()->flag (flag_i_);
Molecule m (fl);
- if (flag_i_ < -4){
- out->add_bottom (m);
- }
+ if (flag_i_ < -4)
+ {
+ mol_p->add_at_edge (Y_AXIS, DOWN, m);
+ }
else if (flag_i_ > 4)
{
- out->add_top (m);
+ mol_p->add_at_edge (Y_AXIS, UP, m);
}
else
assert (false);
- }
+ assert (!abbrev_flag_i_);
+ }
- out->translate (stem_xoffset_f_, X_AXIS);
- return out;
+ if (abbrev_flag_i_)
+ mol_p->add (abbrev_mol ());
+
+ mol_p->translate (stem_xoffset_f_, X_AXIS);
+ return mol_p;
}
Real
-Stem::hpos_f() const
+Stem::hpos_f () const
{
- return Item::hpos_f() + stem_xoffset_f_;
+ return Item::hpos_f () + stem_xoffset_f_;
}
void
Stem::do_substitute_dependency (Score_elem*o,Score_elem*n)
{
- Item * o_l = o->item();
- Item * n_l = n? n->item():0;
- whole_l_arr_.substitute ((Note_head*)o_l, (Note_head*)n_l);
+ Item * o_l = o->item ();
+ Item * n_l = n? n->item () : 0;
head_l_arr_.substitute ((Note_head*)o_l, (Note_head*)n_l);
- rest_l_arr_.substitute ((Note_head*)o_l, (Note_head*)n_l);
+ rest_l_arr_.substitute ((Rest*)o_l, (Rest*)n_l);
}
IMPLEMENT_IS_TYPE_B1(Swallow_engraver,Engraver);
-ADD_THIS_ENGRAVER(Swallow_engraver);
+ADD_THIS_TRANSLATOR(Swallow_engraver);
bool
IMPLEMENT_IS_TYPE_B1(Swallow_performer, Performer);
-ADD_THIS_PERFORMER(Swallow_performer);
+ADD_THIS_TRANSLATOR(Swallow_performer);
Symtable*
Symtables::operator()(String s)
{
- return Assoc<String, Symtable*>::operator[](s);
+ return Dictionary<Symtable*>::operator[](s);
}
void
Symtables::print() const
Symtables::add (String s, Symtable*p)
{
p-> id_str = s;
- Assoc<String, Symtable*>::add (s,p);
+ Dictionary<Symtable*>::add (s,p);
}
*/
#include "symbol.hh"
-#include "request.hh"
-#include "input-translator.hh"
#include "molecule.hh"
#include "plist.tcc"
#include "pcursor.tcc"
template POINTERLIST_INSTANTIATE(Atom);
-template POINTERLIST_INSTANTIATE(Input_translator);
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
-#if 0
-#include "proto.hh"
-#include "list.tcc"
-#include "cursor.tcc"
-
-#endif
+// empty. Yes I know.
#include "proto.hh"
#include "plist.tcc"
-#include "engraver.hh"
-#include "performer.hh"
+#include "translator.hh"
+
+
+template POINTERLIST_INSTANTIATE(Translator);
-template POINTERLIST_INSTANTIATE(Engraver);
-template POINTERLIST_INSTANTIATE(Performer);
mol.add (l);
Atom a (m);
a.translate (slur_extra * internote_f, Y_AXIS);
- mol.add_right (m);
- mol.add_right (r);
+ mol.add_at_edge (X_AXIS, RIGHT, m);
+ mol.add_at_edge (X_AXIS, RIGHT, r);
mol.translate (l_dy * internote_f, Y_AXIS);
Symbol s;
s.tex = mol.TeX_string();
dir_ = CENTER;
}
-void
-Tie_engraver::sync_features()
-{
- dir_ = Direction (int (get_feature ("vdir")));
-}
-
-
void
Tie_engraver::do_post_move_processing()
{
- if (tie_p_ && get_staff_info().when () == end_mom_)
+ if (tie_p_ && now_moment () == end_mom_)
{
- end_tie_p_ = tie_p_;
- end_req_l_ = req_l_;
- end_melodic_req_l_ = melodic_req_l_;
- tie_p_ =0;
- req_l_ =0;
- end_mom_ = -1;
+ end_tie_p_ = tie_p_;
+ end_req_l_ = req_l_;
+ end_melodic_req_l_ = melodic_req_l_;
+ tie_p_ =0;
+ req_l_ =0;
+ end_mom_ = -1;
}
}
Tie_engraver::do_try_request (Request*r)
{
if (!acceptable_request_b (r))
- return false;
+ return false;
if (req_l_)
{
- return false;
+ return false;
}
req_l_ = r->musical()->tie ();
end_mom_ = r->parent_music_l_->time_int().length ()
- + get_staff_info().when ();
+ + now_moment ();
return true;
}
void
Tie_engraver::do_process_requests()
{
+ dir_ = (Direction) int (get_property ("ydirection"));
if (req_l_ && ! tie_p_)
{
- tie_p_ = new Tie;
+ tie_p_ = new Tie;
}
}
{
if (i.elem_l_->name() == Note_head::static_name ())
{
- if (tie_p_)
- {
- tie_p_->set_head (LEFT, (Note_head*)i.elem_l_->item());
- melodic_req_l_ = i.req_l_->musical()->melodic ();
- }
-
- if (end_tie_p_)
- {
- end_tie_p_->set_head (RIGHT, (Note_head*)i.elem_l_->item());
- if (!Melodic_req::compare (*end_melodic_req_l_, *melodic_req_l_))
- end_tie_p_->same_pitch_b_ = true;
- announce_element (Score_elem_info (end_tie_p_,end_req_l_));
- }
+ if (tie_p_)
+ {
+ tie_p_->set_head (LEFT, (Note_head*)i.elem_l_->item());
+ melodic_req_l_ = i.req_l_->musical()->melodic ();
+ }
+
+ if (end_tie_p_)
+ {
+ end_tie_p_->set_head (RIGHT, (Note_head*)i.elem_l_->item());
+ if (!Melodic_req::compare (*end_melodic_req_l_, *melodic_req_l_))
+ end_tie_p_->same_pitch_b_ = true;
+ announce_element (Score_elem_info (end_tie_p_,end_req_l_));
+ }
}
}
{
if (end_tie_p_)
{
- if (dir_)
- end_tie_p_->dir_ = dir_;
+ if (dir_)
+ end_tie_p_->dir_ = dir_;
- typeset_element (end_tie_p_);
- end_tie_p_ =0;
- end_req_l_ =0;
+ typeset_element (end_tie_p_);
+ end_tie_p_ =0;
+ end_req_l_ =0;
}
-
}
Tie_engraver::~Tie_engraver()
{
if (tie_p_)
{
- req_l_->warning ("unended Tie");
- delete tie_p_;
+ req_l_->warning ("unended Tie");
+ delete tie_p_;
}
}
-void
-Tie_engraver::set_feature (Feature f)
-{
- if (f.type_ == "vdir")
- dir_ = Direction (int (f.value_));
-}
IMPLEMENT_IS_TYPE_B1(Tie_engraver,Engraver);
-ADD_THIS_ENGRAVER(Tie_engraver);
+ADD_THIS_TRANSLATOR(Tie_engraver);
#include "tie.hh"
#include "note-head.hh"
#include "p-col.hh"
+#include "debug.hh"
void
void
Tie::do_add_processing()
{
- assert (head_l_drul_[LEFT] && head_l_drul_[RIGHT]);
+ if (!(head_l_drul_[LEFT] && head_l_drul_[RIGHT]))
+ warning ("Lonely tie.. ");
+
set_bounds(LEFT,head_l_drul_[LEFT]);
set_bounds(RIGHT,head_l_drul_[RIGHT]);
}
#include "command-request.hh"
-Timing_engraver::Timing_engraver()
-{
- default_grouping_ = Rhythmic_grouping (MInterval (0,4),4); // ugh
-}
void
Timing_engraver::fill_staff_info (Staff_info &inf)
inf.rhythmic_C_ = &default_grouping_;
}
-bool
-Timing_engraver::do_try_request(Request*r)
-{
- Command_req * c = r->command();
- if (!(c && c->timing()))
- return false;
- for (int i=0; i < timing_req_l_arr_.size (); i++)
- {
- if (timing_req_l_arr_[i]->equal_b(r))
- return true;
- if (timing_req_l_arr_[i]->name() == r->name())
- {
- r->warning ("conflicting timing request");
- return false;
- }
- }
-
- timing_req_l_arr_.push(c->timing());
- return true;
-}
-
-Meter_change_req*
-Timing_engraver::meter_req_l() const
-{
- Meter_change_req *m_l=0;
- for (int i=0; !m_l && i < timing_req_l_arr_.size (); i++)
- {
- m_l=timing_req_l_arr_[i]->meterchange();
- }
- return m_l;
-}
-
-void
-Timing_engraver::do_process_requests()
-{
- for (int i=0; i < timing_req_l_arr_.size (); i++)
- {
- Timing_req * tr_l = timing_req_l_arr_[i];
- Meter_change_req *m_l = tr_l->meterchange();
- if (m_l)
- {
- int b_i= m_l->beats_i_;
- int o_i = m_l->one_beat_i_;
- if (! time_.allow_meter_change_b())
- tr_l->warning ("Meter change not allowed here");
- else
- {
- time_.set_meter (b_i, o_i);
- default_grouping_ =
- Rhythmic_grouping (MInterval (0,Moment (b_i, o_i)), b_i);
- }
- }
- else if (tr_l->partial())
- {
- Moment m = tr_l->partial()->duration_;
- String error = time_.try_set_partial_str (m);
- if (error != "")
- {
- tr_l->warning (error);
- }
- else
- time_.setpartial (m);
- }
- else if (tr_l->barcheck())
- {
- if (time_.whole_in_measure_)
- {
- tr_l ->warning ("Barcheck failed");
-
- time_.whole_in_measure_ = 0; // resync
- time_.error_b_ = true;
- }
-
- }
- else if (tr_l->cadenza())
- {
- time_.set_cadenza (tr_l->cadenza()->on_b_);
-
- }
- else if (tr_l->measuregrouping())
- {
- default_grouping_ =
- parse_grouping (tr_l->measuregrouping()->beat_i_arr_,
- tr_l->measuregrouping()->elt_length_arr_);
-
- }
- }
-}
-
-
-void
-Timing_engraver::do_pre_move_processing()
-{
- timing_req_l_arr_.set_size (0);
- Engraver_group_engraver * grav_l = daddy_grav_l_;
- while (grav_l->daddy_grav_l_)
- {
- grav_l = grav_l->daddy_grav_l_;
- }
-
- assert (grav_l->name() == Score_engraver::static_name ());
- if (!time_.cadenza_b_)
- ((Score_engraver*)grav_l)->add_moment_to_process (time_.next_bar_moment());
-}
-
-IMPLEMENT_IS_TYPE_B1(Timing_engraver, Engraver);
-ADD_THIS_ENGRAVER(Timing_engraver);
-
-void
-Timing_engraver::do_creation_processing()
-{
- time_.when_ = get_staff_info().when ();
-}
-
-void
-Timing_engraver::do_post_move_processing()
-{
- time_.add (get_staff_info().when () - time_.when_);
-}
-
+IMPLEMENT_IS_TYPE_B1(Timing_engraver, Timing_translator);
+ADD_THIS_TRANSLATOR(Timing_engraver);
--- /dev/null
+
+/*
+ timing-translator.cc -- implement Timing_translator
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "timing-translator.hh"
+#include "command-request.hh"
+#include "translator-group.hh"
+#include "global-translator.hh"
+
+Timing_translator::Timing_translator()
+{
+ default_grouping_ = Rhythmic_grouping (MInterval (0,4),4); // ugh
+}
+
+bool
+Timing_translator::do_try_request(Request*r)
+{
+ Command_req * c = r->command();
+ if (!(c && c->timing()))
+ return false;
+ for (int i=0; i < timing_req_l_arr_.size (); i++)
+ {
+ if (timing_req_l_arr_[i]->equal_b(r))
+ return true;
+ if (timing_req_l_arr_[i]->name() == r->name())
+ {
+ r->warning ("conflicting timing request");
+ return false;
+ }
+ }
+
+ timing_req_l_arr_.push(c->timing());
+ return true;
+}
+
+Meter_change_req*
+Timing_translator::meter_req_l() const
+{
+ Meter_change_req *m_l=0;
+ for (int i=0; !m_l && i < timing_req_l_arr_.size (); i++)
+ {
+ m_l=timing_req_l_arr_[i]->meterchange();
+ }
+ return m_l;
+}
+
+void
+Timing_translator::do_process_requests()
+{
+ for (int i=0; i < timing_req_l_arr_.size (); i++)
+ {
+ Timing_req * tr_l = timing_req_l_arr_[i];
+ Meter_change_req *m_l = tr_l->meterchange();
+ if (m_l)
+ {
+ int b_i= m_l->beats_i_;
+ int o_i = m_l->one_beat_i_;
+ if (! time_.allow_meter_change_b())
+ tr_l->warning ("Meter change not allowed here");
+ else
+ {
+ time_.set_meter (b_i, o_i);
+ default_grouping_ =
+ Rhythmic_grouping (MInterval (0,Moment (b_i, o_i)), b_i);
+ }
+ }
+ else if (tr_l->partial())
+ {
+ Moment m = tr_l->partial()->duration_;
+ String error = time_.try_set_partial_str (m);
+ if (error)
+ {
+ tr_l->warning (error);
+ }
+ else
+ time_.setpartial (m);
+ }
+ else if (tr_l->barcheck())
+ {
+ if (time_.whole_in_measure_)
+ {
+ tr_l ->warning ("Barcheck failed");
+
+ time_.whole_in_measure_ = 0; // resync
+ time_.error_b_ = true;
+ }
+
+ }
+ else if (tr_l->cadenza())
+ {
+ time_.set_cadenza (tr_l->cadenza()->on_b_);
+
+ }
+ else if (tr_l->measuregrouping())
+ {
+ default_grouping_ =
+ parse_grouping (tr_l->measuregrouping()->beat_i_arr_,
+ tr_l->measuregrouping()->elt_length_arr_);
+
+ }
+ }
+}
+
+
+void
+Timing_translator::do_pre_move_processing()
+{
+ timing_req_l_arr_.set_size (0);
+ Global_translator *global_l =
+ daddy_trans_l_->ancestor_l (100)->global_l (); // ugh 100.
+
+ if (!time_.cadenza_b_)
+ global_l->add_moment_to_process (time_.next_bar_moment ());
+}
+
+IMPLEMENT_IS_TYPE_B1(Timing_translator, Translator);
+ADD_THIS_TRANSLATOR(Timing_translator);
+
+void
+Timing_translator::do_creation_processing()
+{
+ time_.when_ = now_moment ();
+}
+
+void
+Timing_translator::do_post_move_processing()
+{
+ time_.add (now_moment () - time_.when_);
+}
+
--- /dev/null
+/*
+ translation-property.cc -- implement Translation_property
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "translation-property.hh"
+#include "debug.hh"
+
+IMPLEMENT_IS_TYPE_B1(Translation_property, Music);
+
+void
+Translation_property::do_print () const
+{
+#ifndef NPRINT
+ DOUT << "." << var_str_ << " = " << String(value_);
+#endif
+}
--- /dev/null
+/*
+ translator-ctors.cc -- implement Translator construction
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "proto.hh"
+#include "plist.hh"
+#include "translator.hh"
+#include "dictionary.hh"
+#include "debug.hh"
+
+Dictionary<Translator*> *global_translator_dict_p=0;
+
+void
+add_translator (Translator *t)
+{
+ if (!global_translator_dict_p)
+ global_translator_dict_p = new Dictionary<Translator*>;
+
+ global_translator_dict_p->elem (t->name ()) = t;
+}
+
+Translator*
+get_translator_l (String s)
+{
+ if (global_translator_dict_p->elt_b (s))
+ {
+ return (*global_translator_dict_p)[s];
+ }
+
+ error ("Unknown translator `" + s +"\'");
+ return 0;
+}
--- /dev/null
+/*
+ Translator_group.cc -- implement Translator_group
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "music-output-def.hh"
+#include "translator-group.hh"
+#include "translator.hh"
+#include "debug.hh"
+#include "pcursor.hh"
+
+Translator_group::Translator_group (Translator_group const&s)
+ : Translator(s)
+{
+ consists_str_arr_ = s.consists_str_arr_;
+ accepts_str_arr_ = s.accepts_str_arr_;
+ iterator_count_ =0;
+}
+
+Translator_group::~Translator_group ()
+{
+ assert (removable_b());
+}
+
+
+Translator_group::Translator_group()
+{
+ iterator_count_ = 0;
+}
+
+void
+Translator_group::check_removal()
+{
+ for (int i =0; i < group_l_arr ().size();)
+ {
+ group_l_arr ()[i]->check_removal();
+ if (group_l_arr ()[i]->removable_b())
+ terminate_translator (group_l_arr ()[i]);
+ else
+ i++;
+ }
+}
+
+
+
+IMPLEMENT_IS_TYPE_B1(Translator_group, Translator);
+
+void
+Translator_group::add (Translator *trans_p)
+{
+ trans_p_list_.bottom().add (trans_p);
+ trans_p->daddy_trans_l_ = this;
+ trans_p->output_def_l_ = output_def_l_;
+ trans_p->add_processing ();
+}
+
+bool
+Translator_group::removable_b() const
+{
+ return !(iterator_count_ || group_l_arr ().size());
+}
+
+Translator_group *
+Translator_group::find_existing_translator_l (String n, String id)
+{
+ if (is_alias_b (n) && (id_str_ == id || !id))
+ return this;
+ Translator_group* r = 0;
+ for (int i =0; !r && i < group_l_arr ().size(); i++)
+ {
+ r = group_l_arr ()[i]->find_existing_translator_l (n,id);
+ }
+
+ return r;
+}
+
+Link_array<Translator_group>
+Translator_group::path_to_acceptable_translator (String type) const
+{
+ Link_array<Translator_group> retval;
+
+ if (type_str_ == type)
+ {
+ retval.push (output_def_l ()->find_translator_l (type)->group_l ());
+ }
+ else for (int i=0; i < accepts_str_arr_.size (); i++)
+ {
+ Translator *t = output_def_l ()->find_translator_l (accepts_str_arr_[i]);
+ if (!t || !t->group_l ())
+ continue;
+
+ Translator_group * g = t->group_l ();
+
+ Link_array<Translator_group> result
+ = g->path_to_acceptable_translator (type);
+ if (result.size ())
+ {
+ retval.push (output_def_l ()->find_translator_l (type_str_)->group_l ());
+ retval.concat (result);
+ break;
+ }
+ }
+
+ return retval;
+}
+
+Translator_group*
+Translator_group::find_create_translator_l (String n, String id)
+{
+ Translator_group * existing = find_existing_translator_l (n,id);
+ if (existing)
+ return existing;
+
+ Link_array<Translator_group> path = path_to_acceptable_translator (n);
+
+ if (path.size ())
+ {
+ Translator_group * current = this;
+
+ // start at 1. The first one will be us.
+ for (int i=1; i < path.size (); i++)
+ {
+ Translator_group * new_group = path[i]->clone ()->group_l ();
+ current->add (new_group);
+ current = new_group;
+ }
+ current->id_str_ = id;
+ return current;
+ }
+
+
+ Translator_group * ret =0;
+ if (daddy_trans_l_)
+ ret = daddy_trans_l_->find_create_translator_l (n,id);
+ else
+ {
+ warning ("Can't find or create `" + n + "' called `" + id + "'\n");
+ ret =0;
+ }
+ return ret;
+}
+
+
+bool
+Translator_group::do_try_request (Request* req_l)
+{
+ bool hebbes_b =false;
+ for (int i =0; !hebbes_b && i < nongroup_l_arr ().size() ; i++)
+ hebbes_b =nongroup_l_arr ()[i]->try_request (req_l);
+ if (!hebbes_b && daddy_trans_l_)
+ hebbes_b = daddy_trans_l_->try_request (req_l);
+ return hebbes_b ;
+}
+
+int
+Translator_group::depth_i() const
+{
+ return (daddy_trans_l_) ? daddy_trans_l_->depth_i() + 1 : 0;
+}
+
+Translator_group*
+Translator_group::ancestor_l (int level)
+{
+ if (!level || !daddy_trans_l_)
+ return this;
+
+ return daddy_trans_l_->ancestor_l (level-1);
+}
+
+Link_array<Translator_group>
+Translator_group::group_l_arr () const
+{
+ Link_array<Translator_group> groups;
+ for (PCursor<Translator*> i (trans_p_list_.top ()); i.ok (); i++)
+ {
+ if (i->group_l ())
+ groups.push (i->group_l ());
+ }
+ return groups;
+}
+
+Link_array<Translator>
+Translator_group::nongroup_l_arr () const
+{
+ Link_array<Translator> groups;
+ for (PCursor<Translator*> i (trans_p_list_.top ()); i.ok (); i++)
+ {
+ if (!i->group_l ())
+ groups.push (i.ptr ());
+ }
+ return groups;
+}
+
+void
+Translator_group::terminate_translator (Translator*r_l)
+{
+ DOUT << "Removing " << r_l->name() << " at " << now_moment () << "\n";
+ r_l->removal_processing();
+ Translator * trans_p =remove_translator_p (r_l);
+
+ delete trans_p;
+}
+
+Translator *
+Translator_group::remove_translator_p (Translator*trans_l)
+{
+ PCursor<Translator*> trans_cur (trans_p_list_.find (trans_l));
+ return trans_cur.remove_p();
+}
+
+
+Translator*
+Translator_group::get_simple_translator (char const *type) const
+{
+ for (int i=0; i < nongroup_l_arr ().size(); i++)
+ {
+ if (nongroup_l_arr ()[i]->name() == type)
+ return nongroup_l_arr ()[i];
+ }
+ if (daddy_trans_l_)
+ return daddy_trans_l_->get_simple_translator (type);
+ return 0;
+}
+
+
+bool
+Translator_group::is_bottom_translator_b () const
+{
+ return !accepts_str_arr_.size ();
+}
+
+
+
+Translator_group*
+Translator_group::get_default_interpreter()
+{
+ if (accepts_str_arr_.size())
+ {
+ Translator*t = output_def_l ()->find_translator_l (accepts_str_arr_[0]);
+ Translator_group * g= t->clone ()->group_l ();
+ add (g);
+
+ if (!g->is_bottom_translator_b ())
+ return g->get_default_interpreter ();
+ else
+ return g;
+ }
+ return this;
+}
+
+void
+Translator_group::each (Method_pointer method) const
+{
+ for (PCursor<Translator*> i (trans_p_list_.top ()); i.ok (); i++)
+ (i.ptr()->*method) ();
+}
+
+void
+Translator_group::do_print() const
+{
+#ifndef NPRINT
+ if (!check_debug)
+ return ;
+ if (status == ORPHAN)
+ {
+ DOUT << "consists of: ";
+ for (int i=0; i < consists_str_arr_.size (); i++)
+ DOUT << consists_str_arr_[i] << ", ";
+ DOUT << "\naccepts: ";
+ for (int i=0; i < accepts_str_arr_.size (); i++)
+ DOUT << accepts_str_arr_[i] << ", ";
+ }
+ else
+ {
+ if (id_str_)
+ DOUT << "ID: " << id_str_ ;
+ DOUT << " iterators: " << iterator_count_<< "\n";
+ }
+ each (&Translator::print);
+#endif
+}
+
+void
+Translator_group::do_pre_move_processing ()
+{
+ each (&Translator::pre_move_processing);
+}
+
+void
+Translator_group::do_post_move_processing ()
+{
+ each (&Translator::post_move_processing);
+}
+
+void
+Translator_group::do_process_requests ()
+{
+ each (&Translator::process_requests);
+}
+
+void
+Translator_group::do_creation_processing ()
+{
+ each (&Translator::creation_processing);
+}
+
+void
+Translator_group::do_removal_processing ()
+{
+ each (&Translator::removal_processing);
+}
+
+void
+Translator_group::add_processing ()
+{
+ Translator::add_processing ();
+ for (int i=0; i < consists_str_arr_.size(); i++)
+ {
+ Translator * t = output_def_l ()->find_translator_l (consists_str_arr_[i]);
+ if (!t)
+ warning ("Could not find `" +consists_str_arr_[i]+ "'");
+ else
+ add (t->clone ());
+ }
+}
/*
- Translator.cc -- implement Translator
+ translator.cc -- implement Translator
source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
+
#include "translator.hh"
+#include "debug.hh"
+#include "translator-group.hh"
+#include "dictionary-iter.hh"
-Translator::Translator()
+Translator::~Translator ()
{
- iterator_count_ = 0;
}
+Translator::Translator ()
+{
+ status = ORPHAN;
+ daddy_trans_l_ = 0;
+ output_def_l_ = 0;
+}
-IMPLEMENT_IS_TYPE_B(Translator);
+Translator::Translator (Translator const &s)
+{
+ status = ORPHAN;
+ daddy_trans_l_ =0;
+ output_def_l_ = s.output_def_l_;
+ properties_dict_ = s.properties_dict_;
+ type_str_ = s.type_str_;
+}
+
+bool
+Translator::is_alias_b (String s) const
+{
+ return s == type_str_;
+}
bool
-Translator::try_request (Request*)
+Translator::do_try_request (Request *)
{
return false;
}
+
+
+Moment
+Translator::now_moment () const
+{
+ return daddy_trans_l_->now_moment ();
+}
+
+
+void
+Translator::add_processing ()
+{
+ if (status == ORPHAN)
+ status = VIRGIN;
+}
+
+void
+Translator::print () const
+{
+#ifndef NPRINT
+ DOUT << name () << " {";
+ if (name () != type_str_)
+ DOUT << "type= " << type_str_;
+ for (Dictionary_iter<Scalar> i (properties_dict_); i.ok (); i++)
+ {
+ DOUT << i.key () << "=" << i.val () <<"\n";
+ }
+ do_print ();
+ DOUT << "}\n";
+#endif
+}
+
+void
+Translator::do_print () const
+{
+}
+
+IMPLEMENT_IS_TYPE_B(Translator);
+
+
+void
+Translator::creation_processing ()
+{
+ if (status >= CREATION_INITED)
+ return ;
+
+ do_creation_processing ();
+ status = CREATION_INITED;
+}
+
+void
+Translator::post_move_processing()
+{
+ if (status >= MOVE_INITED)
+ return;
+ creation_processing();
+ do_post_move_processing();
+ status = MOVE_INITED;
+}
void
-Translator::print() const
+Translator::removal_processing()
+{
+ creation_processing();
+ do_removal_processing();
+}
+
+
+bool
+Translator::try_request (Request * r)
{
+ if (status < MOVE_INITED)
+ post_move_processing();
+
+ return do_try_request (r);
+}
+void
+Translator::process_requests()
+{
+ if (status < PROCESSED_REQS)
+ post_move_processing();
+ else if (status >= PROCESSED_REQS)
+ return;
+
+ status = PROCESSED_REQS;
+ do_process_requests();
+}
+
+void
+Translator::pre_move_processing()
+{
+ do_pre_move_processing();
+ status = CREATION_INITED;
+}
+
+Scalar
+Translator::get_property (String id)
+{
+ if (properties_dict_.elt_b (id))
+ {
+ return properties_dict_[id];
+ }
+
+ if (daddy_trans_l_)
+ return daddy_trans_l_->get_property (id);
+
+ return "";
+}
+
+void
+Translator::set_property (String id, Scalar val)
+{
+ properties_dict_[id] = val;
+}
+
+
+Music_output_def *
+Translator::output_def_l () const
+{
+ return output_def_l_;
}
--- /dev/null
+/*
+ type-swallow-trans.cc -- implement Type_swallow_translator
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "type-swallow-trans.hh"
+#include "musical-request.hh"
+
+Type_swallow_translator::Type_swallow_translator ()
+{
+ type_ =0;
+}
+
+bool
+Type_swallow_translator::do_try_request (Request*r)
+{
+ if (type_&&r->is_type_b (type_))
+ return true;
+ return false;
+}
+
+IMPLEMENT_IS_TYPE_B1(Type_swallow_translator, Translator);
+
+DECLARE_REQUEST_SWALLOWER(Skip_req);
+
IMPLEMENT_IS_TYPE_B1(Vertical_align_engraver, Engraver);
-ADD_THIS_ENGRAVER(Vertical_align_engraver);
+ADD_THIS_TRANSLATOR(Vertical_align_engraver);
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
-#include "translator.hh"
+#include "translator-group.hh"
#include "debug.hh"
#include "voice-iterator.hh"
#include "music-list.hh"
# descent order into subdirectories:
#
-SUBDIRS = flower lib lily mi2mu \
+SUBDIRS = flower lib lily mf mi2mu \
Documentation bin init input tex make
#
--- /dev/null
+# mf/Makefile
+
+# subdir level:
+#
+depth = ..
+#
+#
+include ./$(depth)/make/Include.make
+#
+
+# list of distribution files:
+#
+TEXFILES = $(wildcard *.tex)
+MFFILES = $(wildcard *.mf)
+EXTRA_DISTFILES = $(MFFILES) $(TEXFILES) TODO
+#
+
+localinstall:
+ $(INSTALL) -d $(MFDIR)/lilypond
+ $(INSTALL) -m 644 $(MFFILES) $(MFDIR)/lilypond/
+
+localuninstall:
+ for i in $(MFFILES) ; do rm -f $(MFDIR)/lilypond/$$i; done
+ -rmdir $(MFDIR)/lilypond/
--- /dev/null
+ - move to OpusTeX fonts
+ - make own lilyfont{10,11,13,16,20} files
+ - opustex/lilypond fonts from the same generic driver files
+ - LilyPond fonts should generate TFM spacing info
+ - include important spaacing dims in TFM
+ - lilyrules.mf for different rules (lines) ?
+ - check out Adobe Sonata/Petrucci font layout. They are the
+standard for Music fonts
+ - rewrite : make a metafont iso font
+l
+
--- /dev/null
+%
+% A tex file to help determine dims.
+%
+
+\font\musicfont=musix16
+\font\slurfont=xslu16
+\font\specfont=musixspx
+\def\thefont{\musicfont}
+%\def\thefont{\specfont}
+
+\def\mb#1{{\thefont\char#1}}
+
+\newdimen\wid
+\newdimen\inc
+\newdimen\here
+\def\hruler#1{%
+ \wid=#1pt
+ \inc=\wid
+ \divide\inc by #1
+ \divide\wid by 2
+ \here=-\wid
+ \loop\ifdim\here<\wid\advance\here by\inc
+ \hbox to0pt{\kern\here\vrule width0.05pt height 1pt depth 1pt\hss}%
+ \repeat%
+}
+
+\def\vruler#1{%
+ \wid=#1pt
+ \inc=\wid
+ \divide\inc by #1
+ \divide\wid by 2
+ \here=-\wid
+ \loop\ifdim\here<\wid\advance\here by\inc
+ \hbox to0pt{\vbox to0pt{\vss\hrule width2pt height 0.05pt\kern\here}\hss}%
+ \repeat%
+}
+\def\twhrul{\hbox to 0pt{\hbox{\hruler{20}%
+ \vrule width0.1pt height 2pt depth 2pt}}}
+\def\twvrul{\vbox to0pt{\vss\hbox to0pt{\hss\vruler{12}}\vss}%
+ \kern-1pt\vrule width4pt height 0.1pt}%
+
+
+\def\doitem#1{
+ #1%
+ \vbox to12pt{\vfill\hbox to0pt{\qquad\kern-1pt\twvrul\hss}}%
+ \hbox to50pt{\qquad\twhrul\mb{#1}\hss}%
+ \setbox0=\hbox{\mb{#1}} width \the\wd0\ depth \the\dp0 \ height \the\ht0}
+
+\newcount\n
+\def\charn{\n=-1
+ \loop\ifnum\n<255\advance\n by1
+ \doitem{\number\n}\endgraf\repeat}
+
+
+ \charn
+
+\bye
--- /dev/null
+% dyn.tex
+% A tex file to help view dynamic letters
+%
+
+\font\dynfont=dyn10
+\def\thefont{\dynfont}
+
+\def\mb#1{{\thefont\char#1}}
+
+\def\doitem#1{
+ #1%
+% \vbox to12pt{\vfill\hbox to0pt{\qquad\kern-1pt\twvrul\hss}}%
+% \hbox to50pt{\qquad\twhrul\mb{#1}\hss}%
+ \hbox to 30pt{\qquad\mb{#1}\hss}
+ \setbox0=\hbox{\mb{#1}} width \the\wd0\ depth \the\dp0 \ height \the\ht0}
+
+\newcount\n
+\def\charn{\n=-1
+ \loop\ifnum\n<4\advance\n by1
+ \doitem{\number\n}\endgraf\repeat}
+
+ \charn
+
+%from lilyponddefs
+% dynamics take extra kerning
+\def\dyn{\dynfont}
+\def\kdynf{{\dynfont \char0\kern-.2ex}}
+\def\kdynm{{\dynfont \char1\kern-.18ex}}
+\def\kdynp{{\dynfont \char2\kern-.08ex}}
+\def\kdyns{{\dynfont \char3\kern-.22ex}}
+\def\kdynz{{\dynfont \char4\kern-.2ex}}
+
+\def\dynp{\kdynp}
+\def\dynpp{\dynp\kdynp}
+\def\dynppp{\dynpp\kdynp}
+\def\dynmp{\kdynm\kdynp}
+\def\dynmf{\kdynm\kdynf}
+\def\dynf{\kdynf}
+\def\dynff{\dynf\kdynf}
+\def\dynfff{\dynff\kdynf}
+
+\def\dynfp{\kdynf\kern.35ex\kdynp}
+\def\dynsf{\kdyns\kdynf}
+\def\dynsfz{\dynsf\kern.3ex\kdynz}
+
+\hbox{\dynp}
+\hbox{\dynpp}
+\hbox{\dynppp}
+\hbox{\dynmp}
+\hbox{\dynmf}
+\hbox{\dynff}
+\hbox{\dynf}
+\hbox{\dynfff}
+\hbox{\dynfp}
+\hbox{\dynsf}
+\hbox{\dynsfz}
+
+\bye
--- /dev/null
+% dyn10.mf
+% from cmbxti10.mf
+
+% Computer Modern Bold Extended Text Italic 10 point
+% if unknown cmbase: input cmbase fi
+
+% font_identifier:="CMBXTI"; font_size 10pt#;
+
+input cmbase;
+font_identifier:="DYN"; font_size 10pt#;
+
+u#:=21.2/36pt#; % unit width
+width_adj#:=11/36pt#; % width adjustment for certain characters
+serif_fit#:=0pt#; % extra sidebar near lowercase serifs
+cap_serif_fit#:=7/36pt#; % extra sidebar near uppercase serifs
+letter_fit#:=11/36pt#; % extra space added to all sidebars
+
+body_height#:=270/36pt#; % height of tallest characters
+asc_height#:=250/36pt#; % height of lowercase ascenders
+cap_height#:=247/36pt#; % height of caps
+fig_height#:=232/36pt#; % height of numerals
+x_height#:=160/36pt#; % height of lowercase without ascenders
+math_axis#:=90/36pt#; % axis of symmetry for math symbols
+bar_height#:=85/36pt#; % height of crossbar in lowercase e
+comma_depth#:=70/36pt#; % depth of comma below baseline
+desc_depth#:=70/36pt#; % depth of lowercase descenders
+
+crisp#:=13/36pt#; % diameter of serif corners
+tiny#:=13/36pt#; % diameter of rounded corners
+fine#:=10/36pt#; % diameter of sharply rounded corners
+thin_join#:=10/36pt#; % width of extrafine details
+hair#:=20/36pt#; % lowercase hairline breadth
+stem#:=38/36pt#; % lowercase stem breadth
+curve#:=43/36pt#; % lowercase curve breadth
+ess#:=35/36pt#; % breadth in middle of lowercase s
+flare#:=42/36pt#; % diameter of bulbs or breadth of terminals
+dot_size#:=53/36pt#; % diameter of dots
+cap_hair#:=22/36pt#; % uppercase hairline breadth
+cap_stem#:=49/36pt#; % uppercase stem breadth
+cap_curve#:=52/36pt#; % uppercase curve breadth
+cap_ess#:=50/36pt#; % breadth in middle of uppercase s
+rule_thickness#:=.6pt#; % thickness of lines in math symbols
+
+dish#:=1/36pt#; % amount erased at top or bottom of serifs
+bracket#:=10/36pt#; % vertical distance from serif base to tangent
+jut#:=27/36pt#; % protrusion of lowercase serifs
+cap_jut#:=39/36pt#; % protrusion of uppercase serifs
+beak_jut#:=10/36pt#; % horizontal protrusion of beak serifs
+beak#:=70/36pt#; % vertical protrusion of beak serifs
+vair#:=13/36pt#; % vertical diameter of hairlines
+notch_cut#:=10pt#; % maximum breadth above or below notches
+bar#:=17/36pt#; % lowercase bar thickness
+slab#:=17/36pt#; % serif and arm thickness
+cap_bar#:=17/36pt#; % uppercase bar thickness
+cap_band#:=17/36pt#; % uppercase thickness above/below lobes
+cap_notch_cut#:=10pt#; % max breadth above/below uppercase notches
+serif_drop#:=3/36pt#; % vertical drop of sloped serifs
+stem_corr#:=2/36pt#; % for small refinements of stem breadth
+vair_corr#:=1.5/36pt#; % for small refinements of hairline height
+apex_corr#:=0pt#; % extra width at diagonal junctions
+
+o#:=6/36pt#; % amount of overshoot for curves
+apex_o#:=6/36pt#; % amount of overshoot for diagonal junctions
+
+slant:=.25; % tilt ratio $(\Delta x/\Delta y)$
+fudge:=1; % factor applied to weights of heavy characters
+math_spread:=.5; % extra openness of math symbols
+superness:=8/11; % parameter for superellipses
+superpull:=1/8; % extra openness inside bowls
+beak_darkness:=.4; % fraction of triangle inside beak serifs
+ligs:=2; % level of ligatures to be included
+
+square_dots:=false; % should dots be square?
+hefty:=false; % should we try hard not to be overweight?
+serifs:=true; % should serifs and bulbs be attached?
+monospace:=false; % should all characters have the same width?
+variant_g:=true; % should an italic-style g be used?
+low_asterisk:=false; % should the asterisk be centered at the axis?
+math_fitting:=false; % should math-mode spacing be used?
+
+% generate textit % switch to the driver file
+
+% mode_setup; font_setup;
+
+% "f" obviously has a _lot_ bigger slant than "p" (see wanske p239)
+% however; perhaps we need two f symbols:
+% - a super-slanted one used in "f" "mf" "sfz" "sf", and
+% - a more normal-slanted in "ff" "fff" "fp" "fp" (see wanske p241)
+%
+% looking at professionally typeset music reveals that typesetters
+% are somewhat unsure about slanting in "mf", "fp", "sfz"
+
+% "f" and "p" (in any combination) are a lot (factor two) fatter than
+% "s", "m", and "z". sometimes the "m" and "z" are a bit fatter than
+% "s".
+
+slant:=.62; % tilt ratio $(\Delta x/\Delta y)$
+crisp#:=19/36pt#; % diameter of serif corners
+tiny#:=19/36pt#; % diameter of rounded corners
+fine#:=20/36pt#; % diameter of sharply rounded corners
+thin_join#:=20/36pt#; % width of extrafine details
+stem#:=57/36pt#; % lowercase stem breadth
+curve#:=64/36pt#; % lowercase curve breadth
+flare#:=64/36pt#; % diameter of bulbs or breadth of terminals
+
+mode_setup; font_setup;
+input ital-f;
+slant:=.38; % tilt ratio $(\Delta x/\Delta y)$
+mode_setup; font_setup;
+input ital-p;
+
+slant:=.28; % tilt ratio $(\Delta x/\Delta y)$
+stem#:=30/36pt#; % lowercase stem breadth
+ess#:=28/36pt#; % breadth in middle of lowercase s
+
+crisp#:=13/36pt#; % diameter of serif corners
+tiny#:=13/36pt#; % diameter of rounded corners
+fine#:=10/36pt#; % diameter of sharply rounded corners
+thin_join#:=10/36pt#; % width of extrafine details
+hair#:=20/36pt#; % lowercase hairline breadth
+% stem#:=38/36pt#; % lowercase stem breadth
+% curve#:=43/36pt#; % lowercase curve breadth
+flare#:=42/36pt#; % diameter of bulbs or breadth of terminals
+% ess#:=35/36pt#; % breadth in middle of lowercase s
+
+mode_setup; font_setup;
+
+input ital-m;
+input ital-s;
+input ital-z;
+
+font_slant slant; font_x_height x_height#;
+bye.
--- /dev/null
+% ital-f.mf
+% from itall.mf
+%
+% Computer Modern Italic lower case:
+% This lowercase italic alphabet was prepared by D. E. Knuth in December, 1979,
+% inspired by the Monotype faces used in {\sl The Art of Computer Programming}.
+% The programs were revised for the new \MF\ conventions in 1985.
+
+% Character codes \0141 through \0172 are generated.
+% not
+
+% cmchar "Italic letter f";
+% beginchar("f",max(1.5u#,stem#)+max(3.5u#,2flare#),asc_height#,desc_depth#);
+\"Dynamic letter f";
+beginchar(0,max(1.5u#,stem#)+max(3.5u#,2flare#),asc_height#,desc_depth#);
+italcorr asc_height#*slant+.75u#;
+adjust_fit(if monospace:u#,u# else: 0,0 fi); pickup fine.nib;
+numeric theta; z88=(.5w-.5u,h); z89=(.5w+.5u,-d); theta=angle(z88-z89);
+pos0(flare,0); pos1(hair,0); pos2(vair,90);
+pos3(.5[hair,stem],180); pos4(stem,theta+90);
+pos5(stem,theta-90); pos6(.5[hair,stem],0);
+pos7(vair,-90); pos8(hair,-180); pos9(flare,-180);
+rt x1r=hround(w+.25u); lft x8r=hround-.35u; x2=.6[x1,x4]; x7=.6[x8,x5];
+y9-.5flare=vround -.85d; y2-y0=y9-y7; top y2r=h+oo; bot y7r=-d-oo;
+y4=.25[x_height,h]; y5=.5[-d,y4];
+z4=whatever[z88,z89]; z5=whatever[z88,z89];
+x3=.8[x2+x4-x88,x88]; x6=.8[x7+x5-x89,x89]; y3=.8[y4,y2]; y6=.8[y5,y7];
+bulb(2,1,0); bulb(7,8,9); % bulbs
+filldraw stroke z2e{left}...z3e...{z89-z88}z4e; % upper arc
+filldraw z4r--z5l--z5r--z4l--cycle; % stem
+filldraw stroke z5e{z89-z88}...z6e...{left}z7e; % lower arc
+pickup crisp.nib; pos20(bar,90); pos21(bar,90);
+top y20r=top y21r=x_height;
+lft x20=lft x4r-.5stem-u; rt x21=rt x4l+.5stem+1.5u;
+filldraw stroke z20e--z21e; % crossbar
+math_fit(desc_depth#*slant+u#,x_height#*slant);
+penlabels(0,1,2,3,4,5,6,7,8,9,20,21,88,89); endchar;
--- /dev/null
+% ital-m.mf
+% from itall.mf
+%
+% Computer Modern Italic lower case:
+% This lowercase italic alphabet was prepared by D. E. Knuth in December, 1979,
+% inspired by the Monotype faces used in {\sl The Art of Computer Programming}.
+% The programs were revised for the new \MF\ conventions in 1985.
+
+% Character codes \0141 through \0172 are generated.
+% not
+
+% cmchar "Italic letter m";
+% beginchar("m",15u#,x_height#,0);
+\"Dynamic letter m";
+beginchar(1,15u#,x_height#,0);
+italcorr 1/3x_height#*slant+.5hair#+.5u#;
+adjust_fit(if monospace:-1.5u#,-2u# else: 0,0 fi); pickup fine.nib;
+numeric shaved_stem; shaved_stem=mfudged.stem;
+save stem; stem=shaved_stem;
+pos2(stem,0); x1=x2;
+if monospace: pos1(stem,0); lft x1l=hround(2.5u-.5stem); top y1=h;
+else: x0=0; lft x2l=hround(2.5u-.5stem);
+ hook_in(0,a,1); fi % opening hook
+y2-.5stem=-oo; filldraw circ_stroke z2e--z1e; % left stem
+x4+.5stem=hround(.5w+.5stem); ital_arch(2,3,4); % left arch
+pos5(stem,0); y5=y2; x5=x4;
+filldraw circ_stroke z5e--z4e; % middle stem
+x7+.5stem=hround(w-2.5u+.5stem);
+x8=x7-.25u; ital_arch(5,6,7); % right arch
+if monospace: pos9(vair,90); x9=good.x .5[x8,w]; bot y9l=0; y8=1/3h;
+ pos8(stem,0); filldraw stroke z8e{-u,-x_height}...{right}z9e; % terminal
+else: x9=w; hook_out(8,b,9)(skewed); fi % closing hook
+filldraw stroke z7e{down}..{-u,-x_height}z8e; % right stem
+math_fit(-2/3x_height#*slant+.5hair#+.5u#,ic#);
+penlabels(0,a,1,2,3,4,5,6,7,8,9); endchar;
--- /dev/null
+% ital-p.mf
+% from itall.mf
+%
+% Computer Modern Italic lower case:
+% This lowercase italic alphabet was prepared by D. E. Knuth in December, 1979,
+% inspired by the Monotype faces used in {\sl The Art of Computer Programming}.
+% The programs were revised for the new \MF\ conventions in 1985.
+
+% Character codes \0141 through \0172 are generated.
+% not
+
+% cmchar "Italic letter p";
+% beginchar("p",9u#,x_height#,desc_depth#);
+\"Dynamic letter p";
+beginchar(2,9u#,x_height#,desc_depth#);
+italcorr .7x_height#*slant+.5curve#-u# if math_fitting:-.5u# fi;
+adjust_fit(0,0); pickup fine.nib;
+x0=0; x2-.5stem=hround(2.5u-.5stem); hook_in(0,1,2); % opening hook
+pos4(hair,-180); pos5(vair,-90); pos6(curve,0); pos7(vair,90);
+x4=x2; rt x6r=hround(w-1.5u+.5curve); x5=x7=.5[x4,x6];
+bot y5r=-oo; top y7r=h+oo; y4=y6=.5[y5,y7];
+filldraw stroke super_arc.e(4,5) & pulled_arc.e(5,6)
+ & pulled_arc.e(6,7) & super_arc.e(7,4); % bowl
+pickup tiny.nib; pos2'(stem,0); pos3(stem,0);
+z2=z2'; x3=x2; bot y3=-d; filldraw stroke z2'e--z3e; % stem
+dish_serif(3,2',a,1/3,.75jut,b,1/3,jut); % serif
+math_fit(-min(2/3x_height#*slant-.5hair#-.5u#,
+ 2u#-.5stem#-desc_depth#*slant),ic#);
+penlabels(0,1,2,3,4,5,6,7); endchar;
--- /dev/null
+% ital-s.mf
+% from itall.mf
+%
+% Computer Modern Italic lower case:
+% This lowercase italic alphabet was prepared by D. E. Knuth in December, 1979,
+% inspired by the Monotype faces used in {\sl The Art of Computer Programming}.
+% The programs were revised for the new \MF\ conventions in 1985.
+
+% Character codes \0141 through \0172 are generated.
+% not
+
+% cmchar "Italic letter s";
+% beginchar("s",5.25u#+max(1.75u#,flare#),x_height#,0);
+\"Dynamic letter s";
+beginchar(3,5.25u#+max(1.75u#,flare#),x_height#,0);
+italcorr x_height#*slant-.5u#;
+adjust_fit(0,0); pickup fine.nib;
+numeric theta; theta=90-angle(40u,h); slope:=-h/40u; % angle at middle
+pos2(vair,-90); pos0(max(fine.breadth,ess),theta); pos7(vair,-90);
+x2l=x0=x7=.5w; top y2l=h+oo; bot y7r=-oo;
+y0-.5ess=y7l+.55(y2r-y7l-ess);
+lft x3l=hround u-eps; rt x6r=hround(w-.5u)+eps;
+x3r-x3l=x6r-x6l=hround .5[vair,ess]-fine;
+ellipse_set(2l,3l,4l,0l); ellipse_set(2r,3r,4r,0r); y3=y3r;
+ellipse_set(7l,6l,5l,0l); ellipse_set(7r,6r,5r,0r); y6=y6r;
+interim superness:=more_super;
+filldraw stroke super_arc.e(2,3) & z3e{down}
+ ..z4e---z5e..z6e{down} & super_arc.e(6,7); % main stroke
+pos1(hair,0); pos10(hround .75[hair,flare],0);
+pos2'(vair,90); z2'=z2;
+pos8(hair,-180); pos9(flare,-180);
+rt x10r=hround(w-u)+2eps; lft x9r=hround .5u-2eps; y10=.78h; y9=.25h;
+bulb(2',1,10); bulb(7,8,9); % bulbs
+math_fit(0,ic#); penlabels(0,1,2,3,4,5,6,7,8,9,10); endchar;
--- /dev/null
+% ital-z.mf
+% from itall.mf
+%
+% Computer Modern Italic lower case:
+% This lowercase italic alphabet was prepared by D. E. Knuth in December, 1979,
+% inspired by the Monotype faces used in {\sl The Art of Computer Programming}.
+% The programs were revised for the new \MF\ conventions in 1985.
+
+% Character codes \0141 through \0172 are generated.
+%not
+
+% cmchar "Italic letter z";
+% beginchar("z",5.5u#+max(1.5u#,stem#),x_height#,0);
+\"Dynamic letter z";
+beginchar(4,5.5u#+max(1.5u#,stem#),x_height#,0);
+italcorr x_height#*slant+.5hair#;
+adjust_fit(if monospace:.5u#,.5u# else: 0,0 fi); pickup fine.nib;
+pos1(hair,0); pos2(stem,-90); pos3(vair,-90); pos4(hair,0);
+lft x1l=hround(u-.5hair); x2=2.5u; x3=w-2u; rt x4r=hround(w-.5u);
+top y1=.78h; top y2l=top y4=h+oo; y3=.825h;
+pos5(hair,0); pos6(vair,-90); pos7(stem,-90); pos8(hair,0);
+x5=x1; x6=2.5u; x7=w-2u; x8+.5hair=hround(w+.5hair-eps);
+bot y5=bot y7r=-oo; y6=.175h; bot y8=.31h;
+pair p; p=(z4-z5) yscaled 2;
+filldraw stroke z1e{up}...z2e{right}..z3e{right}...{p}z4e; % upper bar
+filldraw stroke z5e{p}...z6e{right}..{right}z7e...{up}z8e; % lower bar
+filldraw stroke z5e{p}..{p}z4e; % diagonal
+math_fit(0,1/3x_height#*slant+.5hair#+.5u#);
+penlabels(1,2,3,4,5,6,7,8); endchar;
*os_p_ << filename_str_g;
*os_p_ << "\n\n";
// ugh
- *os_p_ << "\\version \"0.1.1\";\n";
+ *os_p_ << "\\version \"0.1.2\";\n";
}
void
\noteheight=5pt
\staffrulethickness=0.4pt
\musixtwentyfonts
+ \font\textmusic=cmmi12
\musixcalc
}
\notewidth=5pt
\noteheight=4pt
\musixsixteenfonts
+ \font\textmusic=cmmi10
\musixcalc
}
+\def\textsharp{\raise.4ex\hbox{\textmusic\char"5D}}
+\def\textflat{\raise.4ex\hbox{\textmusic\char"5B}}
+\def\flt{\raise.2ex\hbox{\mus\char"5B}}
+
+
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% do derivative calcs
\divide\interstaffrule by 4
}
-% dynamics take extra kerning
-\def\dyn{\dynfont}
-\def\kdynf{\dynfont f\kern-.1ex}
-\def\kdynm{\dynfont m\kern-.15ex}
-\def\kdynp{\dynfont p\kern-.15ex}
+\def\kdynf{{\dynfont \char0\kern-.2ex}}
+\def\kdynm{{\dynfont \char1\kern-.18ex}}
+\def\kdynp{{\dynfont \char2\kern-.08ex}}
+\def\kdyns{{\dynfont \char3\kern-.22ex}}
+\def\kdynz{{\dynfont \char4\kern-.2ex}}
-\def\dynp{\dynfont p}
+\def\dynp{\kdynp}
\def\dynpp{\dynp\kdynp}
\def\dynppp{\dynpp\kdynp}
-\def\dynmp{\dynfont m\kdynp}
-\def\dynmf{\dynfont m\kdynf}
-\def\dynf{\dynfont f}
+\def\dynmp{\kdynm\kdynp}
+\def\dynmf{\kdynm\kdynf}
+\def\dynf{\kdynf}
\def\dynff{\dynf\kdynf}
\def\dynfff{\dynff\kdynf}
+\def\dynfp{\kdynf\kern.35ex\kdynp}
+\def\dynsf{\kdyns\kdynf}
+\def\dynsfz{\dynsf\kern.3ex\kdynz}
\input taupindefs
% big fat marks, if errors are detected.
\def\columnerrormark{\placebox{-5pt}{0pt}{\bf C!}}
\def\scorelineerrormark{\placebox{0pt}{-10pt}{\bf L!}}
+\def\errormark{{\bf E!}}
\def\unknown{{\bf u}}
\def\postheader{}
{\hfil \LilyIdString
}\else{foo\hfil\the\pageno\hfil}\fi}}
\fi
+
+
\font\musicfnt=musix20
\font\musicdraw=musixsps
\font\italicfont=cmti10
- \font\dynfont=cmbxti10 scaled \magstep1
+ \font\dynfont=dyn10% scaled \magstep2
\font\musicmathfont=cmsy10
}
\font\hslurdfont=xslhd16
\font\hslurhfont=xslhz20
\font\musicfnt=musix16
- \font\dynfont=cmbxti10
+ \font\dynfont=dyn10% scaled \magstep1
\font\musicdraw=musixsps
\font\musicmathfont=cmsy8
}
\musicdef\halfball{'010}
\musicdef\wholeball{'011}
\musicdef\breveball{'040}
+\musicdef\longaball{'047}
\musicdef\halfrest{'074}
\musicdef\wholerest{'075}
+
\musicdef\breverest{'072}
+\musicdef\breverest{'073} %% <- Mats, is this cool?
+
%% hmm
\musicdef\outsidehalfrest{10}
\musicdef\outsidewholerest{11}