offset, this fixes right-padding of AccidentalPlacement.
* Documentation/user/tutorial.itely (An orchestral part): more
fixes for the tutorial.
* lily/parser.yy (context_def_spec_block): use \context instead of
\translator.
* Documentation/user/tutorial.itely (Automatic and manual beams):
editing of tutorial.
2004-03-08 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ * lily/accidental-placement.cc (position_accidentals): bugfix in
+ offset, this fixes right-padding of AccidentalPlacement.
+
+ * lily/[h-z]*.cc: () formatting.
+
+ * Documentation/user/tutorial.itely (An orchestral part): more
+ fixes for the tutorial.
+
* scm/translation-functions.scm (fraction-tuplet-formatter):
reverse fraction.
GUILE is not reset across invocations, so be careful not to change any
system defaults from within Scheme.}
+We strongly advise against making LilyPond formatting available
+through a webserver. That is, processing input from untrusted users,
+and returning the resulting PDF file. LilyPond is a big and complex
+program. It was not written with security in mind. Making it available
+to the outside world is a huge risk; consider the security
+implications of
+
+@verbatim
+ #(system "rm -rf /")
+ \score {
+ c4^#(ly:export (ly:gulp-file "/etc/passwd"))
+ }
+@end verbatim
+
@section Command line options
HINTS FOR STYLE
+* Try not to use punctuation between introductocing sentence and
+display material (verbatim, music, example code).
+
* don't refer to LilyPond in the text. The reader knows what the
manual is about
* if you do, capitalization is LilyPond.
-
* don't explicitly refer to the reader/user. There is no one else
besides the reader and the writer.
@aref{C clef}, @aref{F clef}, @aref{G clef}.
+@aitem{cluster}
+
+A @emph{cluster} is a range of simultaneously sounding pitches that
+may change over time. The set of available pitches to apply usually
+depends on the acoustic source. Thus, in piano music, a cluster
+typically consists of a continuous range of the semitones as provided
+by the piano's fixed set of a chromatic scale. In choral music, each
+singer of the choir typically may sing an arbitrary pitch within the
+cluster's range that is not bound to any diatonic, chromatic or other
+scale. In electronic music, a cluster (theoretically) may even cover
+a continuous range of pitches, thus resulting in colored noise, such
+as pink noise.
+
+Clusters can be denoted in the context of ordinary staff notation by
+engraving simple geometrical shapes that replace ordinary notation of
+notes. Ordinary notes as musical events specify starting time and
+duration of pitches; however, the duration of a note is expressed by
+the shape of the note head rather than by the horizontal graphical
+extent of the note symbol. In contrast, the shape of a cluster
+geometrically describes the development of a range of pitches
+(vertical extent) over time (horizontal extent). Still, the
+geometrical shape of a cluster covers the area in which any single
+pitch contained in the cluster would be notated as an ordinary note.
+
+@lilypond[relative=1,verbatim]
+ \apply #notes-to-clusters { <c e > <b f'> <b g'> <c g> <f e> }
+@end lilypond
+
+
@aitem{comma}
I: comma,
F: comma,
This chapter describes all the different types of notation supported
by LilyPond. It is intended as a reference for users that are already
-somewhat familiar with using LilyPond.
+somewhat familiar with LilyPond.
@menu
* Note entry::
@section Note entry
@cindex Note entry
-The basic elements of any piece of music are the notes. This section
-is about basic notation elements notes, rests and related constructs,
-such as stems, tuplets and ties.
+This section is about basic notation elements notes, rests and
+related constructs, such as stems, tuplets and ties.
@menu
* Notes::
@cindex entering notes
The most common syntax for pitch entry is used in @code{\chords} and
-@code{\notes} mode. In Note and Chord mode, pitches may be designated
-by names. The notes are specified by the letters @code{a} through
+@code{\notes} mode. In these modes, pitches may be designated by
+names. The notes are specified by the letters @code{a} through
@code{g}, while the octave is formed with notes ranging from @code{c}
to @code{b}. The pitch @code{c} is an octave below middle C and the
letters span the octave above that C:
@end lilypond
+@seealso
+
The automatic production of accidentals can be tuned in many
ways. For more information, refer to @ref{Accidentals}.
+
+@refbugs
+
+There are no generally accepted standards for denoting three quarter
+flats, so LilyPond's symbol does not conform to any standard.
+
@node Chords
@subsection Chords
@code{>}. A chord may be followed by a duration, and a set of
articulations, just like simple notes.
+@lilypond[relative]
+ <c e g>4 <c>8 <>8
+@end lilypond
@node Rests
@subsection Rests
@end lilypond
Whole bar rests, centered in middle of the bar,
-must be done with multi measure rests. They are discussed in
+must be done with multi-measure rests. They are discussed in
@ref{Multi measure rests}.
@lilypond[noindent]
\score {
\notes \relative c'' {
- a\breve \autoBeamOff
+ a\breve*1/2 \autoBeamOff
a1 a2 a4 a8 a16 a32 a64 a64
- r\longa r\breve
+ r\longa*1/4 r\breve *1/2
r1 r2 r4 r8 r16 r32 r64 r64
}
\paper {
+ raggedright = ##t
\context {
\StaffContext
\remove "Clef_engraver"
\override StaffSymbol #'transparent = ##t
- \override TimeSignature #'transparent = ##t
+ \override TimeSignature #'transparent = ##t
+ \override BarLine #'transparent = ##t
\consists "Pitch_squash_engraver"
}
}
is denoted by a set of alterations (flats or sharps) at the start of
the staff.
-@syntax
Setting or changing the key signature is done with the @code{\key}
command:
The clef indicates which lines of the staff correspond to which
pitches.
-@syntax
The clef can be set or changed with the @code{\clef} command:
@lilypond[fragment,verbatim]
strong and weak beats. It is denoted by a fraction at the start of the
staff.
-@syntax
The time signature is set or changed by the @code{\time}
command:
Normally, they are inserted automatically. Line breaks may only
happen on bar lines.
-@syntax
Special types
of bar lines can be forced with the @code{\bar} command:
A slur indicates that notes are to be played bound or @emph{legato}.
-@syntax
They are entered using parentheses:
@lilypond[relative=1,fragment,verbatim]
A glissando is a smooth change in pitch. It is denoted by a line or a
wavy line between two notes.
-@syntax
A glissando line can be requested by attaching a @code{\glissando} to
a note:
@node Repeat syntax
@subsection Repeat syntax
-@syntax
LilyPond has one syntactic construct for specifying different types of
repeats. The syntax is
@cindex percussion
@cindex drums
-@syntax
Percussion notes may be entered in @code{\drums} mode, which is
similar to @code{notes}. Each piece of percussion has a full name and
Pianos have pedals that alter the way sound are produced. Generally, a
piano has three pedals, sustain, una corda, and sostenuto.
-@syntax
Piano pedal instruction can be expressed by attaching
@code{\sustainDown}, @code{\sustainUp}, @code{\unaCorda},
applies to many wind instruments, for example, clarinets (B-flat, A and
E-flat), horn (F) and trumpet (B-flat, C, D and E-flat).
-@syntax
The transposition is entered after the keyword @code{\transposition}:
voices, and stem directions are set automatically. Also, solo and
@emph{a due} parts are identified and can be marked.
-@syntax
The syntax for part combining is
@cindex note heads
-@syntax
For ancient notation, a note head style other than the @code{default}
style may be chosen. This is accomplished by setting the @code{style}
@cindex accidentals
-@syntax
Use the @code{style} property of grob @internalsref{Accidental} to
select ancient accidentals. Supported styles are
@cindex rests
-@syntax
Use the @code{style} property of grob @internalsref{Rest} to select
ancient accidentals. Supported styles are @code{classical},
@cindex clefs
-@syntax
LilyPond supports a variety of clefs, many of them ancient.
@cindex flags
-@syntax
Use the @code{flag-style} property of grob @internalsref{Stem} to
select ancient flags. Besides the @code{default} flag style,
@cindex time signatures
-@syntax
There is limited support for mensural time signatures. The
glyphs are hard-wired to particular time fractions. In other words,
like the @emph{editio vaticana}. There are different custos glyphs
used in different flavors of notational style.
-@syntax
For typesetting custodes, just put a @internalsref{Custos_engraver} into the
@internalsref{Staff} context when declaring the @code{\paper} block,
a chant, but is also frequently used within a single
antiphonal/responsorial chant to mark the end of each section.
-@syntax
To use divisiones, include the file @code{gregorian-init.ly}. It
contains definitions that you can apply by just inserting
survived in contemporary editions of Gregorian chant such as the
Editio Vaticana from 1905/08.
-@syntax
Syntactically, ligatures are simply enclosed by @code{\[} and
@code{\]}. Some ligature styles (such as Editio Vaticana) may need
warnings or even crash in some cases or produce weird results on more
complex ligatures.
-@syntax
To engrave white mensural ligatures, in the paper block the
@internalsref{Mensural_ligature_engraver} has to be put into the
@end multitable
-@syntax
Unlike most other neumes notation systems, the input language for
neumes does not necessarily reflect directly the typographical
@c TODO: musicological blurb about FB
-@syntax
LilyPond has limited support for figured bass:
@cindex cluster
-In musical terminology, a @emph{cluster} denotes a range of
-simultaneously sounding pitches that may change over time. The set of
-available pitches to apply usually depends on the acoustic source.
-Thus, in piano music, a cluster typically consists of a continuous range
-of the semitones as provided by the piano's fixed set of a chromatic
-scale. In choral music, each singer of the choir typically may sing an
-arbitrary pitch within the cluster's range that is not bound to any
-diatonic, chromatic or other scale. In electronic music, a cluster
-(theoretically) may even cover a continuous range of pitches, thus
-resulting in colored noise, such as pink noise.
-
-Clusters can be denoted in the context of ordinary staff notation by
-engraving simple geometrical shapes that replace ordinary notation of
-notes. Ordinary notes as musical events specify starting time and
-duration of pitches; however, the duration of a note is expressed by the
-shape of the note head rather than by the horizontal graphical extent of
-the note symbol. In contrast, the shape of a cluster geometrically
-describes the development of a range of pitches (vertical extent) over
-time (horizontal extent). Still, the geometrical shape of a cluster
-covers the area in which any single pitch contained in the cluster would
-be notated as an ordinary note. From this point of view, it is
-reasonable to specify a cluster as the envelope of a set of notes.
-
-@syntax
-
-A cluster is engraved as the envelope of a set of
-cluster-notes. Cluster notes are created by applying the function
-@code{notes-to-clusters} to a sequence of chords, e.g.
+A cluster indicates a continuous range of pitches to be played. They
+can be denoted as the envelope of a set of notes. They are entered by
+applying the function @code{notes-to-clusters} to a sequence of
+chords, e.g.
@c
@lilypond[relative=1,verbatim]
\apply #notes-to-clusters { <c e > <b f'> }
@node First steps
@section First steps
-We start off by showing how very simple music is entered in LilyPond.
-A note is entered by typing its name, from @samp{a} through @samp{g},
-and a number. So, if you enter
-
+The first example demonstrates how to enter the very simple piece of
+music, a scale. A note can be entered by typing its name, from
+@samp{a} through @samp{g}. So, if you enter
+
@example
-c4 d4 e4 f4
+c d e f g a b
@end example
@noindent
-then the result looks like this:
+the result looks like this:
@lilypond[notime,relative]
-c4 d4 e4 f4
+c d e f g a b
@end lilypond
-The number specifies the length of the note, @samp{1} for a
-@rglos{whole note}, @samp{2} for a @rglos{half note}, and so on:
+The duration of a note is specfied by a number after the note name.
+@samp{1} for a @rglos{whole note}, @samp{2} for a @rglos{half note},
+and so on
@example
a1 a2 a4 a16 a32
\transpose c c' { a1 a2 a4 a16 a32 s16_" " }
@end lilypond
-If you do not specify a @rglos{duration}, the the first note is a
-quarter, and for others, the last entered duration is used.
+If you do not specify a @rglos{duration}, then the duration last
+entered is used, and the first note will be a quarter
@example
-a4 a a2 a
+a a8 a a2 a
@end example
@lilypond[notime]
\set Score.timing = ##f
-\transpose c c' { a a a2 a s16_" " }
+\transpose c c' { a a8 a a2 a s16_" " }
@end lilypond
The @rglos{clef} can be set using the @code{\clef} command:
@c what is more common name treble or violin?
-@c in Dutch, it's violin.
-@c in English it's definitely treble.
+@c in Dutch, it is violin.
+@c in English it is definitely treble.
@example
\clef treble
\clef bass
For more information on
@table @asis
-@item grace notes
+@item Grace notes
see @ref{Grace notes},
-@item tuplets
+@item Tuplets
see @ref{Tuplets},
-@item upsteps
+@item Pickups
see @ref{Partial measures}.
@end table
@cindex Lyrics
@cindex Songs
-Lyrics are entered by separating each syllable with a space, and
-surrounding them with @code{\lyrics @{ @dots{} @}}, for example,
+Lyrics are entered by separating each syllable with a space,
+
+@example
+ I want to break free
+@end example
+
+To prevent certain words (for example ``as'') as being read as a
+pitch, the input-mode must be switched. This is done with
+@code{\lyrics}. In @code{\lyrics} mode, all words are read as lyric
+syllables.
@example
\lyrics @{ I want to break free @}
@end example
-Like notes, lyrics are also a form of music, but they must not be
-printed on a staff, which is the default way to print music. To print
-them as lyrics, they must be marked with @code{ \new Lyrics}:
+@noindent
+Again, the braces @code{@{@}} signify that the syllables are sung in
+sequence.
+
+By default, music expressions are interpreted in @code{Staff} context. For
+lyrics, this is obviously not desirable, so it is necessary
+to explicitly specify a @code{Lyrics} context,
+
@example
\new Lyrics \lyrics @{ I want to break free @}
@end example
+
The melody for this song is as follows:
@lilypond[fragment,relative=1]
- \partial 8
- c8
- \times 2/3 { f4 g g } \times 2/3 { g4( a2) }
+ c4
+ \times 2/3 { f4 g g } \times 2/3 { g4( a2) }
@end lilypond
The lyrics can be set to these notes, combining both with the
empty.
The final result is
-@lilypond[verbatim,fragment]
+@lilypond[verbatim,fragment,raggedright]
\score {
\notes <<
- \relative c' \new Voice {
- \partial 8
- c8
- \times 2/3 { f g g } \times 2/3 { g4( a2) }
+ \partial 4
+ \relative c' {
+ c4
+ \times 2/3 { f g g } \times 2/3 { g4( a2) }
}
\lyricsto "" \new Lyrics \lyrics { I want to break free }
>>
@end example
@lilypond[raggedright]
\score {
- << \notes \relative f' { \time 2/4
+ << \notes \relative f'
+ \context Voice = bla { \time 2/4
f4 f c' c' }
- \new Lyrics \lyrics { Twin -- kle twin -- kle }
+ \new Lyrics \lyrics \lyricsto "bla" { Twin -- kle twin -- kle }
>>
\paper { raggedright = ##t }
}
@cindex chord names
In popular music, it is common to denote accompaniment as chord-names.
-Using them in LilyPond has two parts, just like lyrics: entering the
-chords (with @code{\chords}), and printing them (with @code{\new
-ChordNames}).
+Such chords can be entered like notes,
-Chord names are entered by starting chords mode (with @code{\chords}).
-In chords mode, you can enter chords with a letter (indicating the
-root of the chord), and a durations following that:
-@c
-@lilypond[verbatim]
- \chords { c2 f4. g8 }
-@end lilypond
+@example
+ c2 f4. g8
+@end example
@noindent
-The result of @code{\chords} is a list of chords, and is equivalent
-to entering chords with @code{<@dots{}>}.
+but now, each pitch is read as the root of a chord instead of a note.
+This mode is switched on with @code{\chords}:
+
+@lilypond[verbatim]
+\score {
+ \chords { c2 f4. g8 }
+}
+@end lilypond
Other chords can be created by adding modifiers after a colon. The
following example shows a few common modifiers:
\chords { c2 f4:m g4:maj7 gis1:dim7 }
@end lilypond
-Printing chords is done by adding @code{\new ChordNames}
-before the chords thus entered:
-@c
+For leadsheets, chords are not printed on staves, but as names on a
+line of themselves. Hence, we have to override the context with
+@code{\new}, rendering the music expression in a @code{ChordNames}
+context
+
@lilypond[verbatim]
\new ChordNames \chords { c2 f4.:m g4.:maj7 gis8:dim7 }
@end lilypond
@lilypond[]
\score {
<<
+ \partial 4
\new ChordNames \chords { r8 c2:sus4 f }
\notes \relative c' {
- \partial 8
- c8
+ c4
\times 2/3 { f g g } \times 2/3 { g4( a2) } }
\new Lyrics \lyricsto "" \lyrics { I want to break free __ }
>>
@cindex MIDI
MIDI (Musical Instrument Digital Interface) is a standard for
-connecting and recording digital instruments. A MIDI file is like a
-tape recording of a MIDI instrument. The @code{\midi} block causes LilyPond
-to create a MIDI file, so you can listen to the music you entered.
-It is great for checking the music: octaves that are off or
-accidentals that were mistyped stand out very much when listening to
-the musical transcription.
+connecting and controlling digital instruments. A MIDI file is like a
+tape recording of a MIDI instrument.
+
+To create a MIDI from a music piece of music, add a
+@code{\midi} block causes LilyPond to create a MIDI file, so you
+can listen to the music you entered. It is great for checking the
+music: octaves that are off or accidentals that were mistyped stand
+out very much when listening to the musical transcription.
The @code{\midi} block is added to @code{\score}, for example,
@example
@cindex composer
@cindex Engraved by LilyPond
-When the file is processed by the @code{lilypond} wrapper script
-the title and composer specified are printed above the music. The
-`tagline' is a short line printed at bottom of the last page which
-normally says ``Engraved by LilyPond, version @dots{}''. In the
-example above it is replaced by the line ``small is
-beautiful.''@footnote{Nicely printed parts are good PR for us, so do
-us a favor, and leave the tagline if you can.}
+When the file is processed the title and composer are printed above
+the music. The `tagline' is a short line printed at bottom of the last
+page which normally says ``Engraved by LilyPond, version @dots{}''. In
+the example above it is replaced by the line ``small is
+beautiful.''@footnote{Nicely printed parts are good PR for us, so
+please leave the tagline if you can.}
Normally, the @code{\header} is put at the top of the file. However,
for a document that contains multiple pieces (e.g. an etude book, or
@code{@{ .. @}}), and combining those simultaneously, separating the
voices with @code{\\}:
-@example
- << @{ a4 g2 f4~ f4 @} \\
- @{ r4 g4 f2 f4 @} >>
-@end example
-@lilypond[relative=1]
-\new Staff << { a4 g2 f4~ f4 } \\
- { r4 g4 f2 f4 } >>
-@end lilypond
+@lilypond[verbatim,relative=1]
+ << { a4 g2 f4~ f4 } \\
+ { r4 g4 f2 f4 } >>
+@end verbatim
For polyphonic music typesetting, spacer rests can also be convenient: these
are rests that do not print. It is useful for filling up voices that
-temporarily do not play:
-@example
- << @{ a4 g2 f4~ f4 @} \\
- @{ s4 g4 f2 f4 @} >>
-@end example
+temporarily do not play. Here is the same example with a spacer rest
+instead of a normal rest
@lilypond[relative=1]
-\new Staff << { a4 g2 f4~ f4 } \\
- { s4 g4 f2 f4 } >>
+ << { a4 g2 f4~ f4 } \\
+ { s4 g4 f2 f4 } >>
@end lilypond
Again, these expressions can be nested arbitrarily:
-@lilypond[fragment]
+@lilypond[fragment,relative=2]
<<
\new Staff
- \relative c''
<< { a4 g2 f4~ f4 } \\
- { s4 g4 f2 f4 } >>
+ { s4 g4 f2 f4 }
+ >>
\new Staff
- << { \clef bass <c g>1 ~ <c g>4 } \\
+ << \clef bass
+ { <c, g>1 ~ <c g>4 } \\
{ f4 d e2 ~ e4}
>>
>>
When all of the elements discussed earlier are combined to produce
larger files, the @code{\score} blocks get a lot bigger, because the
-music expressions are longer, and, in the case of polyphonic and/or
-orchestral pieces, more deeply nested. Such large expressions can
-become unwieldy.
+music expressions are longer, and, in the case of polyphonic pieces,
+more deeply nested. Such large expressions can become unwieldy.
By using variables, also known as identifiers, it is possible to break
up complex music expressions. An identifier is assigned as follows:
@lilypond[raggedright,verbatim]
seufzer = \notes {
- dis'8 e'8
+ e'4( dis'4)
}
\score { \notes {
\seufzer \seufzer
It is convenient to define the notes in a special file, for example,
suppose that the @file{horn-music.ly} contains the following part of a
-horn/bassoon duo.
+horn/bassoon duo,
@example
hornNotes = \notes \relative c @{
\time 2/4
@}
@end example
-Then, an individual part is made by putting the following in a file:
+Then, an individual part is made by putting the following in a file
+
@example
-\include "horn-music.lyinc"
+\include "horn-music.ly"
\header @{
instrument = "Horn in F"
@}
\notes \transpose f c' \hornNotes
@}
@end example
-The @code{\include} command substitutes the contents of the file at
-this position in the file, so that @code{hornNotes} is defined
-afterwards. The code @code{\transpose f c'} indicates that the
-argument, being @code{\hornNotes}, should be transposed by a fifth
-downwards: sounding @code{f} is denoted by notated @code{c'}, which
-corresponds with tuning of a normal French Horn in F. The
-transposition can be seen in the following output:
+
+The line
+
+@verbatim
+ \include "horn-music.ly"
+@end verbatim
+
+@noindent
+substitutes the contents of @file{horn-music.ly} at this position in
+the file, so @code{hornNotes} is defined afterwards. The command
+@code{\transpose f c'} indicates that the argument, being
+@code{\hornNotes}, should be transposed by a fifth downwards: sounding
+@code{f} is denoted by notated @code{c'}, which corresponds with
+tuning of a normal French Horn in F. The transposition can be seen in
+the following output:
@lilypond[raggedright]
\score {
In ensemble pieces, one of the voices often does not play for many
measures. This is denoted by a special rest, the multi-measure
-rest. It is entered with a capital R followed by a duration (1
+rest. It is entered with a capital @code{R} followed by a duration (1
for a whole note, 2 for a half note, etc.) By multiplying the
duration, longer rests can be constructed. For example, this rest
takes 3 measures in 2/4 time:
R2*3
@end example
-When printing the part, the following @code{skipBars} property must be
-set to true, to prevent the rest from being expanded to three one bar
-rests:
+When printing the part, multi-rests
+must be condensed. This is done by setting a run-time variable:
@example
\set Score.skipBars = ##t
@end example
-Prepending the rest and the property setting above, leads to the
-following result:
+
+
+This commands sets the property @code{skipBars} property in the
+@code{Score} context to true (@code{##t}). Prepending the rest and
+this option to the music above, leads to the following result:
@lilypond[raggedright]
\score {\notes { \transpose f c' \relative c { \time 2/4
r4 f8 a cis4 f e d } }}
@end lilypond
+
The score is made by combining all of the music in a @code{\score}
-block, assuming that the other voice is in @code{bassoonNotes}, in the
-file @file{bassoon-music.ly}:
+block. Assuming that the other voice is in @code{bassoonNotes} in the
+file @file{bassoon-music.ly}, a score is made with
+
@example
-\include "bassoon-music.lyinc"
-\include "horn-music.lyinc"
+\include "bassoon-music.ly"
+\include "horn-music.ly"
\score @{
\simultaneous @{
@} @}
@end example
-This would lead to the simple score depicted below:
+leading to
@lilypond[raggedright]
\score {
More in-depth information on preparing parts and scores is in the
notation manual, in @ref{Orchestral music}.
+Setting run-time variables (``properties'') is discussed in ref-TODO.
@node Integrating text and music
@section Integrating text and music
@cindex HTML, music in
@cindex Texinfo, music in
-Sometimes you might want to use music examples in a text that you are
-writing (for example, a musicological treatise, a songbook, or (like us)
-the LilyPond manual). You can make such texts by hand, simply by
-importing a PostScript figure into your word processor. However,
-there is an automated procedure to reduce the amount of work.
+Some texts include music examples. Examples are musicological
+treatises, songbooks or manuals like this. Such texts can be made by
+hand, simply by importing a PostScript figure into the word processor.
+However, there is an automated procedure to reduce the amount of work
+involved HTML, La@TeX{}, and Texinfo documents.
+
-If you use HTML, La@TeX{}, or Texinfo, you can mix text and LilyPond
-code. A script called @code{lilypond-book} will extract the music
-fragments, run LilyPond on them, and put back the resulting notation.
-This program is fully described in @ref{lilypond-book manual}. Here
-we show a small example. The example also contains explanatory text,
-so we will not comment on it further:
+A script called @code{lilypond-book} will extract the music fragments,
+run format them, and put back the resulting notation. This program is
+fully described in @ref{lilypond-book manual}. Here we show a small
+example. The example also contains explanatory text, so we will not
+comment on it further:
@example
\documentclass[a4paper]@{article@}
\begin@{document@}
-In a lilypond-book document, you can freely mix music and text. For
-example:
+Documents for lilypond-book may freely mix music and text. For
+example,
+
\begin@{lilypond@}
\score @{ \notes \relative c' @{
c2 g'2 \times 2/3 @{ f8 e d @} c'2 g4
@} @}
\end@{lilypond@}
-If you have no \verb+\score+ block in the fragment,
-\texttt@{lilypond-book@} will supply one:
+If there is no \verb+\score+ block in the fragment,
+\texttt@{lilypond-book@} will supply one
\begin@{lilypond@}
c'4
\end@{lilypond@}
-In the example you see here two things happened: a
+In this example two things happened: a
\verb+\score+ block was added, and the line width was set to natural
-length. You can specify options by putting them in brackets:
+length.
+
+Options are put in brackets.
\begin[staffsize=26,verbatim]@{lilypond@}
c'4 f16
\end@{lilypond@}
-If you want to include large examples in the text it is more
-convenient to put it in a separate file:
+
+Larger examples can be put in a separate file, and introduced with
+\verb+\lilypondfile+.
\lilypondfile@{screech-boink.ly@}
Reading `input/tutorial/lilybook.tex'
Reading `input/screech-boink.ly'
@var{lots of stuff deleted}
-Writing `out/lilybook.latex'
+Writing `out/lilybook.tex'
$ cd out
-$ latex lilybook.latex
+$ latex lilybook
@var{lots of stuff deleted}
$ xdvi lilybook
@end example
Running lilypond-book and running latex creates a lot of temporary
-files. You would not want those to clutter up your working
-directory. The @code{outdir} option to lilypond-book creates the
-temporary files in a separate subdirectory @file{out}.
+files, which would clutter up the working directory. To remedy this,
+use the @code{output} option. It will create the files in a separate
+subdirectory @file{out}.
-The result looks more or less like this:
+The result looks more or less like
@separate
-In a lilypond-book document, you can freely mix music and text. For
-example:
+Documents for lilypond-book may freely mix music and text. For
+example,
+
@lilypond
\score {
\notes \relative c' {
c'4
@end lilypond
-In the example you see here, two things happened: a
+In this example two things happened: a
@code{score} block was added, and the line width was set to natural
-length. You can specify options by putting them in brackets:
+length.
+
+Options are put in brackets.
@lilypond[staffsize=26,verbatim]
c'4 f16
@end lilypond
-If you want to include large examples in the text, it is more
-convenient to put it in a separate file:
+Larger examples can be put in a separate file, and introduced with
+@code{\lilypondfile}.
@lilypondfile{screech-boink.ly}
MAJOR_VERSION=2
MINOR_VERSION=1
PATCH_LEVEL=29
-MY_PATCH_LEVEL=
+MY_PATCH_LEVEL=hwn1
head_ape-> left_skyline_ = head_skyline;
head_ape->offset_ = 0.0;
- head_ape->offset_ -= robust_scm2double ( me->get_property ("right-padding"), 0);
-
-
Real padding = robust_scm2double (me->get_property ("padding"),0.2);
Array<Skyline_entry> left_skyline = head_ape->left_skyline_;
+ heighten_skyline (&left_skyline,
+ -robust_scm2double (me->get_property ("right-padding"), 0));
/*
Add accs entries right-to-left.
*/
class Horizontal_bracket_engraver : public Engraver
{
public:
- TRANSLATOR_DECLARATIONS(Horizontal_bracket_engraver);
+ TRANSLATOR_DECLARATIONS (Horizontal_bracket_engraver);
Link_array<Spanner> bracket_stack_;
Link_array<Music> events_;
int pop_count_;
int push_count_;
- virtual bool try_music(Music*);
+ virtual bool try_music (Music*);
virtual void stop_translation_timestep ();
virtual void process_music ();
virtual void acknowledge_grob (Grob_info);
};
-ENTER_DESCRIPTION(Horizontal_bracket_engraver,
+ENTER_DESCRIPTION (Horizontal_bracket_engraver,
"Create horizontal brackets over notes for musical analysis purposes.",
"HorizontalBracket",
"note-grouping-event",
"",
"");
-Horizontal_bracket_engraver::Horizontal_bracket_engraver()
+Horizontal_bracket_engraver::Horizontal_bracket_engraver ()
{
pop_count_ = 0;
push_count_ = 0;
if (d == STOP)
{
pop_count_ ++;
- if (pop_count_ > bracket_stack_.size())
- m->origin()->warning (_("Don't have that many brackets."));
+ if (pop_count_ > bracket_stack_.size ())
+ m->origin ()->warning (_("Don't have that many brackets."));
}
else
{
}
if (pop_count_ && push_count_)
- m->origin()->warning (_("Conflicting note group events."));
+ m->origin ()->warning (_("Conflicting note group events."));
return true;
}
{
if (Note_column::has_interface (gi.grob_))
{
- for (int i = 0; i < bracket_stack_.size(); i++)
+ for (int i = 0; i < bracket_stack_.size (); i++)
{
Side_position_interface::add_support (bracket_stack_[i], gi.grob_);
Pointer_group_interface::add_grob (bracket_stack_[i],
{
Spanner * sp = make_spanner ("HorizontalBracket");
- announce_grob (sp, events_[k]->self_scm());
- for (int i = 0; i < bracket_stack_.size(); i++)
+ announce_grob (sp, events_[k]->self_scm ());
+ for (int i = 0; i < bracket_stack_.size (); i++)
{
/*
sp is the smallest, it should be added to the bigger brackets.
{
for (int i = pop_count_; i--;)
{
- if (bracket_stack_.size())
- typeset_grob (bracket_stack_.pop());
+ if (bracket_stack_.size ())
+ typeset_grob (bracket_stack_.pop ());
}
pop_count_ = 0;
push_count_ = 0;
Spanner* hyphen_;
Spanner * finished_hyphen_;
public:
- TRANSLATOR_DECLARATIONS(Hyphen_engraver);
+ TRANSLATOR_DECLARATIONS (Hyphen_engraver);
protected:
virtual void acknowledge_grob (Grob_info);
if (ev_)
{
hyphen_ = make_spanner ("LyricHyphen");
- announce_grob (hyphen_, ev_->self_scm());
+ announce_grob (hyphen_, ev_->self_scm ());
}
}
-ENTER_DESCRIPTION(Hyphen_engraver,
+ENTER_DESCRIPTION (Hyphen_engraver,
/* descr */ "Create lyric hyphens",
/* creats*/ "LyricHyphen",
/* accepts */ "hyphen-event",
/* Print a textual represenation of the smob to a given port. */
static int
-print_box (SCM b, SCM port, scm_print_state *pstate)
+print_box (SCM b, SCM port, scm_print_state *)
{
SCM value = SCM_CELL_OBJECT_1 (b);
/* This defines the primitve `make-box', which returns a new smob of
type `box', initialized to `#f'. */
-LY_DEFINE(package_identifier, "ly:export", 1,0,0, (SCM arg),
+LY_DEFINE (package_identifier, "ly:export", 1,0,0, (SCM arg),
"Export a Scheme object to the parser, so it is treated as an identifier.")
{
/* This macro creates the new objects, stores the value `#f' into it
/* This is the primitive `box-ref' which returns the object stored in
the box. */
SCM
-unpack_identifier(SCM box)
+unpack_identifier (SCM box)
{
- if (SCM_IMP(box) || SCM_CELL_TYPE(box) != package_tag)
+ if (SCM_IMP (box) || SCM_CELL_TYPE (box) != package_tag)
return SCM_UNDEFINED;
return SCM_CELL_OBJECT_1 (box);
scm_set_smob_mark (package_tag, scm_markcdr);
scm_set_smob_print (package_tag, print_box);
}
-ADD_SCM_INIT_FUNC(package, init_box_type);
+ADD_SCM_INIT_FUNC (package, init_box_type);
/*
no ! suffix since it doesn't modify 1st argument.
*/
-LY_DEFINE(ly_set_point_and_click, "ly:set-point-and-click", 1, 0, 0,
+LY_DEFINE (ly_set_point_and_click, "ly:set-point-and-click", 1, 0, 0,
(SCM what),
"Set the options for Point-and-click source specials output. The\n"
"argument is a symbol. Possible options are @code{none} (no source specials),\n"
global_input_file =0;
- ly_clear_anonymous_modules();
+ ly_clear_anonymous_modules ();
}
"Print @var{msg} as a GNU compliant error message, pointing to the"
"location in @var{sip}.\n")
{
- Input *ip = unsmob_input(sip);
+ Input *ip = unsmob_input (sip);
SCM_ASSERT_TYPE (ip, sip, SCM_ARG1, __FUNCTION__, "input location");
SCM_ASSERT_TYPE (gh_string_p (msg), msg, SCM_ARG2, __FUNCTION__, "string");
{
public:
- TRANSLATOR_DECLARATIONS(Instrument_name_engraver);
+ TRANSLATOR_DECLARATIONS (Instrument_name_engraver);
protected:
Grob *text_;
{
if (Bar_line::has_interface (i.grob_))
{
- create_text();
+ create_text ();
}
if (dynamic_cast<Spanner*> (i.grob_)
a name to be attached to lyrics or chords.
*/
if (gh_string_p (get_property ("whichBar")))
- create_text();
+ create_text ();
}
-ENTER_DESCRIPTION(Instrument_name_engraver,
+ENTER_DESCRIPTION (Instrument_name_engraver,
/* descr */ " Prints the name of the instrument (specified by "
" @code{Staff.instrument} and @code{Staff.instr}) "
"at the left of the staff. ",
class Vocal_name_engraver : public Instrument_name_engraver
{
public:
- TRANSLATOR_DECLARATIONS(Vocal_name_engraver);
+ TRANSLATOR_DECLARATIONS (Vocal_name_engraver);
virtual void create_text ();
};
-ENTER_DESCRIPTION(Vocal_name_engraver,
+ENTER_DESCRIPTION (Vocal_name_engraver,
/* descr */ " Prints the name of the a lyric voice (specified by "
" @code{Staff.vocalName} and @code{Staff.vocNam}) "
"at the left of the staff. ",
-ADD_INTERFACE(Item,
+ADD_INTERFACE (Item,
"item-interface",
"\n"
"\n"
Item * item_;
public:
- TRANSLATOR_DECLARATIONS(Key_engraver);
+ TRANSLATOR_DECLARATIONS (Key_engraver);
protected:
virtual void initialize ();
item_->set_property ("old-accidentals", get_property ("lastKeySignature"));
item_->set_property ("new-accidentals", get_property ("keySignature"));
- announce_grob(item_, key_ev_ ? key_ev_->self_scm() : SCM_EOL);
+ announce_grob (item_, key_ev_ ? key_ev_->self_scm () : SCM_EOL);
}
if (!def)
daddy_context_->set_property ("keySignature", SCM_EOL);
daddy_context_->set_property ("lastKeySignature", SCM_EOL);
- Pitch p(0,0,0);
+ Pitch p (0,0,0);
daddy_context_->set_property ("tonic", p.smobbed_copy ());
}
-ENTER_DESCRIPTION(Key_engraver,
+ENTER_DESCRIPTION (Key_engraver,
/* descr */ "",
/* creats*/ "KeySignature",
/* accepts */ "key-change-event",
class Key_performer : public Performer
{
public:
- TRANSLATOR_DECLARATIONS(Key_performer);
+ TRANSLATOR_DECLARATIONS (Key_performer);
~Key_performer ();
protected:
return false;
}
-ENTER_DESCRIPTION(Key_performer,
+ENTER_DESCRIPTION (Key_performer,
"","",
"key-change-event",
"","","");
#if (KPATHSEA && HAVE_KPSE_FIND_FILE)
char * name_ptr = kpse_find_file (name, kpse_afm_format, true);
- if(!name_ptr)
+ if (!name_ptr)
{
/*
don't mutter about afms, since we try to find them first, and lots of
TFMs don't have AFMs.
*/
- // warning (_f("kpathsea couldn't find AFM file `%s'", name));
+ // warning (_f ("kpathsea couldn't find AFM file `%s'", name));
}
else
return name_ptr;
#if (KPATHSEA && HAVE_KPSE_FIND_FILE)
char * name_ptr = kpse_find_file (name, kpse_tfm_format, true);
- if(!name_ptr)
+ if (!name_ptr)
{
- warning (_f("Kpathsea couldn't find TFM file `%s'", name));
+ warning (_f ("Kpathsea couldn't find TFM file `%s'", name));
}
else
return name_ptr;
virtual void typeset_ligature (Spanner *ligature, Array<Grob_info>);
public:
- TRANSLATOR_DECLARATIONS(Ligature_bracket_engraver);
+ TRANSLATOR_DECLARATIONS (Ligature_bracket_engraver);
private:
void typeset_ligature_bracket ();
}
}
-ENTER_DESCRIPTION(Ligature_bracket_engraver,
+ENTER_DESCRIPTION (Ligature_bracket_engraver,
/* descr */ "Handles Ligature_events by engraving Ligature brackets.",
/* creats*/ "TupletBracket",
/* accepts */ "ligature-event",
ligature_start_mom_ = now_mom ();
- announce_grob(ligature_, reqs_drul_[START]->self_scm());
+ announce_grob (ligature_, reqs_drul_[START]->self_scm ());
override_stencil_callback ();
}
}
source-file.hh includes cmath which undefines isinf and isnan
*/
-inline int my_isinf(Real r) { return isinf(r); }
-inline int my_isnan(Real r) { return isnan(r); }
+inline int my_isinf (Real r) { return isinf (r); }
+inline int my_isnan (Real r) { return isnan (r); }
return result;
}
-LY_DEFINE(ly_gulp_file, "ly:gulp-file", 1,0, 0,
+LY_DEFINE (ly_gulp_file, "ly:gulp-file", 1,0, 0,
(SCM name),
"Read the file named @var{name}, and return its contents in a string. The "
" file is looked up using the lilypond search path.")
{
assert (gh_string_p (s));
- char *p = SCM_STRING_CHARS(s);
+ char *p = SCM_STRING_CHARS (s);
String r (p);
return r;
}
return s;
}
-LY_DEFINE(ly_warning,"ly:warn", 1, 0, 0,
+LY_DEFINE (ly_warning,"ly:warn", 1, 0, 0,
(SCM str),"Scheme callable function to issue the warning @code{msg}.")
{
SCM_ASSERT_TYPE (gh_string_p (str), str, SCM_ARG1, __FUNCTION__, "string");
return SCM_BOOL_T;
}
-LY_DEFINE(ly_dir_p, "ly:dir?", 1,0, 0, (SCM s),
+LY_DEFINE (ly_dir_p, "ly:dir?", 1,0, 0, (SCM s),
"type predicate. A direction is a -1, 0 or 1, where -1 represents "
"left or down and 1 represents right or up. ")
{
}
-LY_DEFINE(ly_number2string, "ly:number->string", 1, 0,0,
+LY_DEFINE (ly_number2string, "ly:number->string", 1, 0,0,
(SCM s),
" converts @var{num} to a string without generating many decimals. It "
"leaves a space at the end.")
#include "version.hh"
-LY_DEFINE(ly_version, "ly:version", 0, 0, 0, (),
+LY_DEFINE (ly_version, "ly:version", 0, 0, 0, (),
"Return the current lilypond version as a list, e.g. @code{(1 3 127 uu1)}. ")
{
char const* vs = "\'(" MAJOR_VERSION " " MINOR_VERSION " " PATCH_LEVEL " " MY_PATCH_LEVEL ")" ;
return gh_eval_str ((char*)vs);
}
-LY_DEFINE(ly_unit, "ly:unit", 0, 0, 0, (),
+LY_DEFINE (ly_unit, "ly:unit", 0, 0, 0, (),
"Return the unit used for lengths as a string.")
{
return scm_makfrom0str (INTERNAL_UNIT);
-LY_DEFINE(ly_dimension_p, "ly:dimension?", 1, 0, 0, (SCM d),
+LY_DEFINE (ly_dimension_p, "ly:dimension?", 1, 0, 0, (SCM d),
"Return @var{d} is a number. Used to distinguish length "
"variables from normal numbers.")
{
ly_assoc_cdr (SCM key, SCM alist)
{
if (gh_pair_p (alist)) {
- SCM trykey = ly_caar(alist);
- if(gh_pair_p(trykey) && to_boolean(scm_equal_p(key,ly_cdr(trykey))))
- return ly_car(alist);
+ SCM trykey = ly_caar (alist);
+ if (gh_pair_p (trykey) && to_boolean (scm_equal_p (key,ly_cdr (trykey))))
+ return ly_car (alist);
else
return ly_assoc_cdr (key, ly_cdr (alist));
}
SCM
display_list (SCM s)
{
- SCM p = scm_current_output_port();
+ SCM p = scm_current_output_port ();
scm_puts ("(", p);
- for (; gh_pair_p(s); s =gh_cdr(s))
+ for (; gh_pair_p (s); s =gh_cdr (s))
{
- scm_display (gh_car(s), p);
+ scm_display (gh_car (s), p);
scm_puts (" ", p);
}
scm_puts (")", p);
PRE: length (L) > 0
*/
SCM
-robust_list_ref(int i, SCM l)
+robust_list_ref (int i, SCM l)
{
- while (i-- > 0 && gh_pair_p (gh_cdr(l)))
+ while (i-- > 0 && gh_pair_p (gh_cdr (l)))
l = gh_cdr (l);
- return gh_car(l);
+ return gh_car (l);
}
/*
Debugging mem leaks:
*/
-LY_DEFINE(ly_protects, "ly:protects", 0, 0, 0, (),
+LY_DEFINE (ly_protects, "ly:protects", 0, 0, 0, (),
"Return hash of protected objects.")
{
return scm_protects;
}
}
-ADD_INTERFACE(Line_interface, "line-interface",
+ADD_INTERFACE (Line_interface, "line-interface",
"Generic line objects. Any object using lines supports this. Normally,"
"you get a straight line. If @code{dash-period} is defined, a dashed line is "
"produced; the length of the dashes is tuned with "
double w = robust_scm2double (me->get_property ("zigzag-width"), 1)*staff_space;
double l = robust_scm2double ( me->get_property ("zigzag-length"), 1)* w;
- double h = l>w/2 ? sqrt(l*l-w*w/4) : 0;
+ double h = l>w/2 ? sqrt (l*l-w*w/4) : 0;
SCM list = scm_list_n (ly_symbol2scm ("zigzag-line"),
gh_bool2scm (true),
return Stencil (b, list);
}
-MAKE_SCHEME_CALLBACK(Line_spanner, after_line_breaking, 1);
+MAKE_SCHEME_CALLBACK (Line_spanner, after_line_breaking, 1);
SCM
Line_spanner::after_line_breaking (SCM g)
{
--hwn.
*/
- if (sp->get_bound (LEFT)->break_status_dir()
- && !sp->get_bound (RIGHT)->break_status_dir())
+ if (sp->get_bound (LEFT)->break_status_dir ()
+ && !sp->get_bound (RIGHT)->break_status_dir ())
{
/*
Can't do suicide, since this mucks up finding the trend.
mol.translate (from);
return mol;
}
- return Stencil();
+ return Stencil ();
}
/*
Offset his_off;
- if (bound[RIGHT]->break_status_dir())
+ if (bound[RIGHT]->break_status_dir ())
{
if (bound[LEFT]->break_status_dir ())
{
programming_error ("line-spanner with two broken ends. Farewell sweet world.");
- me->suicide();
+ me->suicide ();
return SCM_EOL;
}
{
programming_error ("no note heads for the line spanner on next line?"
" Confused.");
- me->suicide();
+ me->suicide ();
return SCM_EOL;
}
dz = (dz.length () - 2*gap) *dir;
- Stencil l (line_stencil (me, Offset(0, 0), dz));
+ Stencil l (line_stencil (me, Offset (0, 0), dz));
l.translate (dir * gap + p1
- Offset (me->relative_coordinate (commonx, X_AXIS),
* | |
* | |
* |<-------------------------->|
- * Box extent(X_AXIS)
+ * Box extent (X_AXIS)
*/
Stencil
Lookup::round_filled_box (Box b, Real blotdiameter)
* touch each other will in general not work as expected for non-null
* blotdiameter.
*
- * (c) Given a polygon ((x0, y0), (x1, y1), ... , (x(n-1), y(n-1))),
+ * (c) Given a polygon ((x0, y0), (x1, y1), ... , (x (n-1), y (n-1))),
* if there is a natural number k such that blotdiameter is greater
- * than the maximum of { | (x(k mod n), y(k mod n)) - (x((k+1) mod n),
- * y((k+1) mod n)) |, | (x(k mod n), y(k mod n)) - (x((k+2) mod n),
- * y((k+2) mod n)) |, | (x((k+1) mod n), y((k+1) mod n)) - (x((k+2)
- * mod n), y((k+2) mod n)) | }, then the outline of the rounded
+ * than the maximum of { | (x (k mod n), y (k mod n)) - (x ((k+1) mod n),
+ * y ((k+1) mod n)) |, | (x (k mod n), y (k mod n)) - (x ((k+2) mod n),
+ * y ((k+2) mod n)) |, | (x ((k+1) mod n), y ((k+1) mod n)) - (x ((k+2)
+ * mod n), y ((k+2) mod n)) | }, then the outline of the rounded
* polygon will exceed the outline of the core polygon. In other
* words: Do not draw rounded polygons that have a leg smaller or
* thinner than blotdiameter (or set blotdiameter to a sufficiently
* to a core filled polygon. For details of these two different
* approaches, see the thread upon the ledger lines patch that started
* on March 25, 2002 on the devel mailing list. The below version of
- * round_filled_polygon() sticks to the moulding model, which the
+ * round_filled_polygon () sticks to the moulding model, which the
* majority of the list participants finally voted for. This,
* however, results in the above limitations and a much increased
* complexity of the algorithm, since it has to compute a shrinked
Offset p13n = 0.5 * (p10n + p12n);
Offset p14n = 0.5 * (p10n - p12n);
Offset p13;
- Real d = p13n.length () * p14n.length (); // distance p3n to line(p1..p0)
+ Real d = p13n.length () * p14n.length (); // distance p3n to line (p1..p0)
if (d < epsilon)
// special case: p0, p1, p2 are on a single line => build
// vector orthogonal to (p2-p0) of length 0.5 blotdiameter
ly_quote_scm (list),
gh_double2scm (linethick),
SCM_UNDEFINED));
- Box b(curve.extent (X_AXIS),
+ Box b (curve.extent (X_AXIS),
curve.extent (Y_AXIS));
b[X_AXIS].unite (back.extent (X_AXIS));
SCM slashnodot = scm_list_n (ly_symbol2scm ("repeat-slash"),
wid, sl, thick, SCM_UNDEFINED);
- Box b (Interval (0, w + sqrt (sqr(t/s) + sqr (t))),
+ Box b (Interval (0, w + sqrt (sqr (t/s) + sqr (t))),
Interval (0, w * s));
return Stencil (b, slashnodot); // http://slashnodot.org
Lookup::bracket (Axis a, Interval iv, Real thick, Real protude, Real blot)
{
Box b;
- Axis other = Axis((a+1)%2);
+ Axis other = Axis ((a+1)%2);
b[a] = iv;
- b[other] = Interval(-1, 1) * thick * 0.5;
+ b[other] = Interval (-1, 1) * thick * 0.5;
Stencil m = round_filled_box (b, blot);
SCM s = scm_list_n (ly_symbol2scm ("symmetric-x-triangle"),
gh_double2scm (thick),
- gh_double2scm (iv.length()),
+ gh_double2scm (iv.length ()),
gh_double2scm (protude), SCM_UNDEFINED);
return Stencil (b, s);
/*
TODO: use rounded boxes.
*/
-LY_DEFINE(ly_bracket ,"ly:bracket",
+LY_DEFINE (ly_bracket ,"ly:bracket",
4, 0, 0,
(SCM a, SCM iv, SCM t, SCM p),
"Make a bracket in direction @var{a}. The extent of the bracket is "
"given by @var{iv}. The wings protude by an amount of @var{p}, which "
"may be negative. The thickness is given by @var{t}.")
{
- SCM_ASSERT_TYPE(is_axis (a), a, SCM_ARG1, __FUNCTION__, "axis") ;
- SCM_ASSERT_TYPE(is_number_pair (iv), iv, SCM_ARG2, __FUNCTION__, "number pair") ;
- SCM_ASSERT_TYPE(gh_number_p (t), a, SCM_ARG3, __FUNCTION__, "number") ;
- SCM_ASSERT_TYPE(gh_number_p (p), a, SCM_ARG4, __FUNCTION__, "number") ;
+ SCM_ASSERT_TYPE (is_axis (a), a, SCM_ARG1, __FUNCTION__, "axis") ;
+ SCM_ASSERT_TYPE (is_number_pair (iv), iv, SCM_ARG2, __FUNCTION__, "number pair") ;
+ SCM_ASSERT_TYPE (gh_number_p (t), a, SCM_ARG3, __FUNCTION__, "number") ;
+ SCM_ASSERT_TYPE (gh_number_p (p), a, SCM_ARG4, __FUNCTION__, "number") ;
return Lookup::bracket ((Axis)gh_scm2int (a), ly_scm2interval (iv),
-LY_DEFINE(ly_filled_box ,"ly:round-filled-box",
+LY_DEFINE (ly_filled_box ,"ly:round-filled-box",
3, 0, 0,
(SCM xext, SCM yext, SCM blot),
"Make a @code{Stencil} "
"@var{yext} and roundness @var{blot}."
)
{
- SCM_ASSERT_TYPE(is_number_pair (xext), xext, SCM_ARG1, __FUNCTION__, "number pair") ;
- SCM_ASSERT_TYPE(is_number_pair (yext), yext, SCM_ARG2, __FUNCTION__, "number pair") ;
- SCM_ASSERT_TYPE(gh_number_p (blot), blot, SCM_ARG3, __FUNCTION__, "number") ;
+ SCM_ASSERT_TYPE (is_number_pair (xext), xext, SCM_ARG1, __FUNCTION__, "number pair") ;
+ SCM_ASSERT_TYPE (is_number_pair (yext), yext, SCM_ARG2, __FUNCTION__, "number pair") ;
+ SCM_ASSERT_TYPE (gh_number_p (blot), blot, SCM_ARG3, __FUNCTION__, "number") ;
return Lookup::round_filled_box (Box (ly_scm2interval (xext), ly_scm2interval (yext)),
gh_scm2double (blot)).smobbed_copy ();
UGH.
*/
- SCM_STRUCT_DATA(gh_car(s))[scm_module_index_obarray] = (long unsigned int) tab;
+ SCM_STRUCT_DATA (gh_car (s))[scm_module_index_obarray] = (long unsigned int) tab;
}
}
{
SCM_VALIDATE_MODULE (1, src);
- SCM obarr= SCM_MODULE_OBARRAY(src);
+ SCM obarr= SCM_MODULE_OBARRAY (src);
scm_internal_hash_fold ((Hash_cl_func) &define_one_var, (void*) dest, SCM_EOL, obarr);
}
{
SCM_VALIDATE_MODULE (1, mod);
- SCM obarr= SCM_MODULE_OBARRAY(mod);
+ SCM obarr= SCM_MODULE_OBARRAY (mod);
return scm_internal_hash_fold ((Hash_cl_func) &accumulate_symbol, NULL, SCM_EOL, obarr);
}
SCM_VALIDATE_MODULE (1, mod);
- SCM obarr= SCM_MODULE_OBARRAY(mod);
+ SCM obarr= SCM_MODULE_OBARRAY (mod);
return scm_internal_hash_fold ((Hash_cl_func) &entry_to_alist, NULL, SCM_EOL, obarr);
}
public:
Lyric_combine_music_iterator ();
Lyric_combine_music_iterator (Lyric_combine_music_iterator const&src);
- DECLARE_SCHEME_CALLBACK(constructor, ());
+ DECLARE_SCHEME_CALLBACK (constructor, ());
protected:
virtual void construct_children ();
virtual Moment pending_moment () const;
- virtual void do_quit();
+ virtual void do_quit ();
virtual void process (Moment);
virtual Music_iterator *try_music_in_children (Music *) const;
}
void
-Lyric_combine_music_iterator::derived_mark()const
+Lyric_combine_music_iterator::derived_mark ()const
{
if (music_iter_)
- scm_gc_mark (music_iter_->self_scm());
+ scm_gc_mark (music_iter_->self_scm ());
if (lyric_iter_)
- scm_gc_mark (lyric_iter_->self_scm());
+ scm_gc_mark (lyric_iter_->self_scm ());
}
void
Context * tr = music_iter_->get_outlet ();
SCM grobs = tr->get_property ("busyGrobs");
- Moment now = tr->now_mom();
+ Moment now = tr->now_mom ();
for (; gh_pair_p (grobs); grobs = gh_cdr (grobs))
{
SCM grob = gh_cdar (grobs);
Lyric_combine_music_iterator::do_quit ()
{
if (music_iter_)
- music_iter_->quit();
+ music_iter_->quit ();
if (lyric_iter_)
- lyric_iter_->quit();
+ lyric_iter_->quit ();
}
Music_iterator*
virtual void process_music ();
public:
- TRANSLATOR_DECLARATIONS(Lyric_engraver);
+ TRANSLATOR_DECLARATIONS (Lyric_engraver);
private:
Music * event_;
Item* text_;
text_= make_item ("LyricText");
text_->set_property ("text", event_->get_property ("text"));
- announce_grob (text_, event_->self_scm());
+ announce_grob (text_, event_->self_scm ());
}
}
}
-ENTER_DESCRIPTION(Lyric_engraver,
+ENTER_DESCRIPTION (Lyric_engraver,
/* descr */ "",
/* creats*/ "",
/* accepts */ "lyric-event",
Spanner *orig = dynamic_cast<Spanner*> (me->original_);
bool last_line = orig
- && (me->get_break_index () == orig->broken_intos_.size() - 2)
+ && (me->get_break_index () == orig->broken_intos_.size () - 2)
&& !Lyric_extender::is_visible (orig->broken_intos_.top ());
me->get_bound (RIGHT));
if (bounds[LEFT]->break_status_dir ()
- && Paper_column::when_mom (bounds[LEFT]) == Paper_column::when_mom (bounds[RIGHT]->get_column()))
+ && Paper_column::when_mom (bounds[LEFT]) == Paper_column::when_mom (bounds[RIGHT]->get_column ()))
return SCM_EOL;
Grob * common = bounds[LEFT]->common_refpoint (bounds[RIGHT], X_AXIS);
class Lyric_performer : public Performer {
public:
- TRANSLATOR_DECLARATIONS(Lyric_performer);
+ TRANSLATOR_DECLARATIONS (Lyric_performer);
protected:
virtual bool try_music (Music* req);
return false;
}
-ENTER_DESCRIPTION(Lyric_performer,"","","lyric-event","","","");
+ENTER_DESCRIPTION (Lyric_performer,"","","lyric-event","","","");
printf ("\n\n");
printf (_ ("Typeset music and/or produce MIDI from FILE.").to_str0 ());
printf ("\n\n");
- printf(_ ("LilyPond produces beautiful music notation.").to_str0 ());
+ printf (_ ("LilyPond produces beautiful music notation.").to_str0 ());
printf ("\n");
printf (_f ("For more information, see %s,", PROGRAM_URL).to_str0 ());
printf ("\n\n");
class Mark_engraver : public Engraver
{
public:
- TRANSLATOR_DECLARATIONS(Mark_engraver);
+ TRANSLATOR_DECLARATIONS (Mark_engraver);
protected:
Item* text_;
return;
text_ = make_item ("RehearsalMark");
- announce_grob(text_, ev->self_scm());
+ announce_grob (text_, ev->self_scm ());
}
}
}
-ENTER_DESCRIPTION(Mark_engraver,
+ENTER_DESCRIPTION (Mark_engraver,
/* descr */ "",
/* creats*/ "RehearsalMark",
/* accepts */ "mark-event",
class Measure_grouping_engraver : public Engraver
{
public:
- TRANSLATOR_DECLARATIONS(Measure_grouping_engraver);
+ TRANSLATOR_DECLARATIONS (Measure_grouping_engraver);
protected:
Spanner * grouping_;
};
void
-Measure_grouping_engraver::finalize()
+Measure_grouping_engraver::finalize ()
{
if (grouping_)
{
void
Measure_grouping_engraver::process_music ()
{
- Moment now = now_mom();
+ Moment now = now_mom ();
if (grouping_ && now.main_part_ >= stop_grouping_mom_ && !now.grace_part_)
{
grouping_->set_bound (RIGHT,
s = gh_cdr (s)
)
{
- int grouplen = gh_scm2int (gh_car(s));
+ int grouplen = gh_scm2int (gh_car (s));
if (where == mp)
{
if (grouping_)
announce_grob (grouping_, SCM_EOL);
- stop_grouping_mom_ = now.main_part_ + Rational(grouplen - 1) * bl ;
+ stop_grouping_mom_ = now.main_part_ + Rational (grouplen - 1) * bl ;
get_global_context ()->add_moment_to_process (Moment (stop_grouping_mom_));
if (grouplen == 3)
}
}
}
-Measure_grouping_engraver::Measure_grouping_engraver()
+Measure_grouping_engraver::Measure_grouping_engraver ()
{
grouping_ = 0;
}
-ENTER_DESCRIPTION(Measure_grouping_engraver,
+ENTER_DESCRIPTION (Measure_grouping_engraver,
/* descr */ "Creates Measure_grouping objects using beatGrouping property",
/* creats*/ "MeasureGrouping",
/* accepts */ "",
Real height = robust_scm2double (me->get_property ("height"), 1);
Real t = Staff_symbol_referencer::line_thickness (me) * robust_scm2double (me->get_property ("thickness"), 1);
- Grob *common = me->get_bound(LEFT)->common_refpoint (me->get_bound (RIGHT),
+ Grob *common = me->get_bound (LEFT)->common_refpoint (me->get_bound (RIGHT),
X_AXIS);
Interval rext = me->get_bound (RIGHT)->extent (common, X_AXIS);
}
m.align_to (Y_AXIS, DOWN);
- return m.smobbed_copy();
+ return m.smobbed_copy ();
}
ADD_INTERFACE (Measure_grouping,"measure-grouping-interface",
class Melisma_translator : public Translator
{
public:
- TRANSLATOR_DECLARATIONS(Melisma_translator);
+ TRANSLATOR_DECLARATIONS (Melisma_translator);
protected:
virtual bool try_music (Music *);
virtual void process_music ();
event_ = 0;
}
-Melisma_translator::Melisma_translator()
+Melisma_translator::Melisma_translator ()
{
event_ = 0;
}
-ENTER_DESCRIPTION(Melisma_translator,
+ENTER_DESCRIPTION (Melisma_translator,
/* descr */ "This translator collects melisma information about ties, beams, and user settings (@code{melismaBusy}, and signals it to the @code{\addlyrics} code. ",
/* creats*/ "",
/* accepts */ "melisma-playing-event melisma-span-event",
virtual void build_ligature (Spanner *ligature, Array<Grob_info> primitives);
public:
- TRANSLATOR_DECLARATIONS(Mensural_ligature_engraver);
+ TRANSLATOR_DECLARATIONS (Mensural_ligature_engraver);
private:
int apply_transition (Array<Grob_info> primitives,
* these properties via the concrete Ligature grob (like
* MensuralLigature) and then copy these properties as necessary to
* each of the NoteHead grobs. This is what
- * propagate_properties() does.
+ * propagate_properties () does.
*/
void
Mensural_ligature_engraver::propagate_properties (Spanner *ligature,
Real y_correction =
(cauda_direction == UP) ?
+0.5*height :
- -0.5*height - cauda_box_y.length();
+ -0.5*height - cauda_box_y.length ();
Box cauda_box (cauda_box_x, cauda_box_y);
Stencil cauda = Lookup::filled_box (cauda_box);
// Compensate optical illusion regarding vertical position of left
// and right endings due to slope.
- Real ypos_correction = -0.1*staff_space * sign(slope);
- Real slope_correction = 0.2*staff_space * sign(slope);
+ Real ypos_correction = -0.1*staff_space * sign (slope);
+ Real slope_correction = 0.2*staff_space * sign (slope);
Real corrected_slope = slope + slope_correction/width;
if (solid)
{
Stencil left_edge =
Lookup::beam (corrected_slope, thickness, height, 0.0);
- stencil.add_stencil(left_edge);
+ stencil.add_stencil (left_edge);
Stencil right_edge =
Lookup::beam (corrected_slope, thickness, height, 0.0);
right_edge.translate_axis (width-thickness, X_AXIS);
right_edge.translate_axis (corrected_slope * (width-thickness), Y_AXIS);
- stencil.add_stencil(right_edge);
+ stencil.add_stencil (right_edge);
Stencil bottom_edge =
Lookup::beam (corrected_slope, width, thickness, 0.0);
switch (primitive)
{
case MLP_NONE:
- return Stencil();
+ return Stencil ();
case MLP_BB:
out = brew_flexa (me, delta_pitch, false,
flexa_width, thickness, true, DOWN);
}
int pos = (int)rint (Staff_symbol_referencer::get_position (me));
- add_ledger_lines(me, &out, pos, 0, ledger_take_space);
+ add_ledger_lines (me, &out, pos, 0, ledger_take_space);
if (primitive & MLP_FLEXA)
{
pos += delta_pitch;
- add_ledger_lines(me, &out, pos, 0.5*delta_pitch, ledger_take_space);
+ add_ledger_lines (me, &out, pos, 0.5*delta_pitch, ledger_take_space);
}
return out;
class Metronome_mark_engraver : public Engraver
{
public:
- TRANSLATOR_DECLARATIONS(Metronome_mark_engraver);
+ TRANSLATOR_DECLARATIONS (Metronome_mark_engraver);
protected:
Item *text_;
Grob *bar_line_;
text_ = make_item ("MetronomeMark");
- announce_grob(text_, rq->self_scm());
+ announce_grob (text_, rq->self_scm ());
}
SCM proc = get_property ("metronomeMarkFormatter");
SCM result= scm_call_2 (proc, mark_ev_->self_scm (),
- daddy_context_->self_scm());
+ daddy_context_->self_scm ());
text_->set_property ("text", result);
}
}
-ENTER_DESCRIPTION(Metronome_mark_engraver,
+ENTER_DESCRIPTION (Metronome_mark_engraver,
/* descr */ "Engrave metro nome marking. This delegates the real work to the function in the metronomeMarkFormatter property",
/* creats*/ "MetronomeMark",
/* accepts */ "metronome-change-event",
SCM program = gh_call1 (proc, ly_symbol2scm (audio_->str_.to_str0 ()));
found = (program != SCM_BOOL_F);
if (found)
- program_byte = gh_scm2int(program);
+ program_byte = gh_scm2int (program);
else
warning (_f ("no such MIDI instrument: `%s'", audio_->str_.to_str0 ()));
Midi_note::get_fine_tuning () const
{
int ft = audio_->pitch_.quartertone_pitch ();
- ft -= 2 * audio_->pitch_.semitone_pitch();
+ ft -= 2 * audio_->pitch_.semitone_pitch ();
ft *= 50; // 1 quarter tone = 50 cents
return ft;
}
this is not correct, but at least it doesn't crash when you
start with graces
*/
- if (delta_t < Moment(0))
+ if (delta_t < Moment (0))
{
delta_t = Moment (0);
}
"notes, @var{g} is zero.\n"
)
{
- SCM_ASSERT_TYPE(SCM_INUMP (n), n, SCM_ARG1, __FUNCTION__, "integer");
- SCM_ASSERT_TYPE(SCM_INUMP (d), d, SCM_ARG2, __FUNCTION__, "integer");
+ SCM_ASSERT_TYPE (SCM_INUMP (n), n, SCM_ARG1, __FUNCTION__, "integer");
+ SCM_ASSERT_TYPE (SCM_INUMP (d), d, SCM_ARG2, __FUNCTION__, "integer");
- return Moment (Rational (gh_scm2int (n), gh_scm2int (d))).smobbed_copy();
+ return Moment (Rational (gh_scm2int (n), gh_scm2int (d))).smobbed_copy ();
}
LY_DEFINE (add_moment,"ly:add-moment", 2,0,0, (SCM a, SCM b),
SCM_ASSERT_TYPE (ma, a, SCM_ARG1, __FUNCTION__, "moment");
SCM_ASSERT_TYPE (mb, b, SCM_ARG2, __FUNCTION__, "moment");
- return (*ma + *mb).smobbed_copy();
+ return (*ma + *mb).smobbed_copy ();
}
SCM_ASSERT_TYPE (ma, a, SCM_ARG1, __FUNCTION__, "moment");
SCM_ASSERT_TYPE (mb, b, SCM_ARG2, __FUNCTION__, "moment");
- return (*ma * *mb).smobbed_copy();
+ return (*ma * *mb).smobbed_copy ();
}
SCM_ASSERT_TYPE (ma, a, SCM_ARG1, __FUNCTION__, "moment");
SCM_ASSERT_TYPE (mb, b, SCM_ARG2, __FUNCTION__, "moment");
- return (*ma / *mb).smobbed_copy();
+ return (*ma / *mb).smobbed_copy ();
}
LY_DEFINE (ly_moment_less_p,"ly:moment<?", 2,0,0, (SCM a, SCM b),
Moment::Moment (int m)
{
- main_part_ = Rational(m);
- grace_part_ = Rational( 0);
+ main_part_ = Rational (m);
+ grace_part_ = Rational ( 0);
}
Moment::Moment (Rational m, Rational g)
class Multi_measure_rest_engraver : public Engraver
{
public:
- TRANSLATOR_DECLARATIONS(Multi_measure_rest_engraver);
+ TRANSLATOR_DECLARATIONS (Multi_measure_rest_engraver);
protected:
virtual bool try_music (Music*);
{
mmrest_ = make_spanner ("MultiMeasureRest");
- if (text_events_.size())
+ if (text_events_.size ())
{
- for (int i = 0; i < text_events_.size(); i++)
+ for (int i = 0; i < text_events_.size (); i++)
{
Spanner *sp
= make_spanner ("MultiMeasureRestText");
sp->set_property ("direction",dir);
numbers_.push (sp);
- announce_grob (sp, e->self_scm());
+ announce_grob (sp, e->self_scm ());
}
/*
Direction d = DOWN;
do {
Grob *last =0;
- for (int i=0; i <numbers_.size(); i++)
+ for (int i=0; i <numbers_.size (); i++)
{
if (gh_int2scm (d) == numbers_[i]->get_property ("direction"))
{
Spanner *sp
= make_spanner ("MultiMeasureRestNumber");
numbers_.push (sp);
- announce_grob (sp, rest_ev_->self_scm());
+ announce_grob (sp, rest_ev_->self_scm ());
}
- for (int i =0 ; i < numbers_.size(); i++)
+ for (int i =0 ; i < numbers_.size (); i++)
{
Side_position_interface::add_support (numbers_[i], mmrest_);
numbers_[i]->set_parent (mmrest_, Y_AXIS);
}
- announce_grob (mmrest_, rest_ev_->self_scm());
+ announce_grob (mmrest_, rest_ev_->self_scm ());
start_measure_
= gh_scm2int (get_property ("currentBarNumber"));
}
if (bar_seen_)
{
- Grob *cmc = unsmob_grob (get_property("breakableSeparationItem"));
+ Grob *cmc = unsmob_grob (get_property ("breakableSeparationItem"));
if (!cmc)
cmc = unsmob_grob (get_property ("currentCommandColumn"));
if (mmrest_)
{
add_bound_item (mmrest_, it);
- for (int i = 0; i < numbers_.size(); i++)
+ for (int i = 0; i < numbers_.size (); i++)
add_bound_item (numbers_[i], it);
}
if (last_rest_)
{
add_bound_item (last_rest_,it);
- for (int i = 0; i < last_numbers_.size(); i++)
+ for (int i = 0; i < last_numbers_.size (); i++)
add_bound_item (last_numbers_[i], it);
}
}
&& mmrest_->get_bound (LEFT) && mmrest_->get_bound (RIGHT))
{
typeset_grob (mmrest_);
- for (int i = 0 ; i < numbers_.size(); i++)
+ for (int i = 0 ; i < numbers_.size (); i++)
{
typeset_grob (numbers_[i]);
}
}
}
last_rest_ = 0;
- last_numbers_.clear();
+ last_numbers_.clear ();
}
text_events_.clear ();
mmrest_ = 0;
numbers_.clear ();
- Grob * last = last_numbers_.size() ? last_numbers_[0] : 0;
+ Grob * last = last_numbers_.size () ? last_numbers_[0] : 0;
if (last && last->get_property ("text") == SCM_EOL)
{
SCM thres = get_property ("restNumberThreshold");
t = gh_scm2int (thres);
if (num <= t)
- last->suicide();
+ last->suicide ();
else
{
SCM text
}
-ENTER_DESCRIPTION(Multi_measure_rest_engraver,
+ENTER_DESCRIPTION (Multi_measure_rest_engraver,
/* descr */
"Engraves multi-measure rests that are produced with @code{R}. Reads "
"measurePosition and currentBarNumber to determine what number to print "
}
while ((flip (&d)) != LEFT);
- Real space = sp_iv.length();
+ Real space = sp_iv.length ();
Real rx = sp->get_bound (LEFT)->relative_coordinate (0, X_AXIS);
/*
measures = gh_scm2int (m);
}
if (measures <= 0)
- return Stencil();
+ return Stencil ();
SCM limit = me->get_property ("expand-limit");
Real slt = me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness"));
Real y = slt * thick_thick/2 * ss;
Real ythick = hair_thick * slt * ss;
- Box b(Interval (0, 0 >? (width - 2 * ythick)), Interval (-y, y));
+ Box b (Interval (0, 0 >? (width - 2 * ythick)), Interval (-y, y));
Real blot = width ? (.8 * (y <? ythick)) : 0.0;
}
Stencil mol;
- for (SCM s = mols; gh_pair_p (s); s = gh_cdr(s))
+ for (SCM s = mols; gh_pair_p (s); s = gh_cdr (s))
{
mol.add_at_edge (X_AXIS, LEFT, *unsmob_stencil (gh_car (s)), inner_padding, 0);
}
+ sym_width + 2.0; // 2.0 = magic!
Real minlen = robust_scm2double (me->get_property ("minimum-length"), 0.0);
- rod.distance_ = max(rod.distance_,
+ rod.distance_ = max (rod.distance_,
minlen);
rod.add_to_cols ();
}
else
p = new Simple_music_iterator;
- iter = p->self_scm();
+ iter = p->self_scm ();
scm_gc_unprotect_object (iter);
}
/****************************************************************/
IMPLEMENT_TYPE_P (Music_iterator, "ly:iterator?");
-IMPLEMENT_SMOBS(Music_iterator);
-IMPLEMENT_DEFAULT_EQUAL_P(Music_iterator);
+IMPLEMENT_SMOBS (Music_iterator);
+IMPLEMENT_DEFAULT_EQUAL_P (Music_iterator);
SCM
Music_iterator::mark_smob (SCM smob)
only, we _must_ mark them.
*/
if (mus->get_outlet ())
- scm_gc_mark (mus->get_outlet ()->self_scm());
+ scm_gc_mark (mus->get_outlet ()->self_scm ());
if (mus->music_)
- scm_gc_mark (mus->music_->self_scm());
+ scm_gc_mark (mus->music_->self_scm ());
return SCM_EOL;
}
void
-Music_iterator::derived_mark()const
+Music_iterator::derived_mark ()const
{
}
}
void
-Music_iterator::do_quit()
+Music_iterator::do_quit ()
{
}
}
void
-Music_wrapper_iterator::do_quit()
+Music_wrapper_iterator::do_quit ()
{
- child_iter_->quit();
+ child_iter_->quit ();
}
void
Music_wrapper_iterator::derived_mark () const
{
if (child_iter_)
- scm_gc_mark (child_iter_->self_scm());
+ scm_gc_mark (child_iter_->self_scm ());
}
void
void
Music_wrapper_iterator::construct_children ()
{
- Music * m = dynamic_cast<Music_wrapper const*> (get_music ())-> element();
+ Music * m = dynamic_cast<Music_wrapper const*> (get_music ())-> element ();
child_iter_ = unsmob_iterator (get_iterator (m));
}
scopes_ = SCM_EOL;
- add_scope(ly_make_anonymous_module());
+ add_scope (ly_make_anonymous_module ());
errorlevel_ =0;
main_input_b_ = false;
gh_car (s), SCM_UNDEFINED),
SCM_UNDEFINED);
- scm_primitive_eval(expr);
+ scm_primitive_eval (expr);
}
scopes_ = scm_cons (module, scopes_);
{
SCM var = ly_module_lookup (gh_car (s), sym);
if (var != SCM_BOOL_F)
- return scm_variable_ref(var);
+ return scm_variable_ref (var);
}
return SCM_UNDEFINED;
void
My_lily_lexer::prepare_for_next_token ()
{
- last_input_ = here_input();
+ last_input_ = here_input ();
}
{
delete lexer_;
if (default_header_)
- scm_gc_unprotect_object (default_header_->self_scm());
+ scm_gc_unprotect_object (default_header_->self_scm ());
}
/* Process one .ly file, or book. */
{
/*
Parsing looks ahead , so we really want the previous location of the
- lexer, not lexer_->here_input().
+ lexer, not lexer_->here_input ().
*/
/*
Actually, that gets very icky when there are white space, because
Grob *stem_;
public:
- TRANSLATOR_DECLARATIONS(New_fingering_engraver);
+ TRANSLATOR_DECLARATIONS (New_fingering_engraver);
protected:
virtual void stop_translation_timestep ();
virtual void acknowledge_grob (Grob_info);
void add_fingering (Grob*, Music*,Music*);
void add_script (Grob*, Music*,Music*);
- void position_scripts();
+ void position_scripts ();
};
void
Finger_tuple ft;
ft.script_ = make_item ("Fingering");
- announce_grob (ft.script_, event->self_scm());
+ announce_grob (ft.script_, event->self_scm ());
Side_position_interface::add_support (ft.script_, head);
/*
music for the softenon children?
*/
- event->origin()->warning (_("music for the martians."));
+ event->origin ()->warning (_("music for the martians."));
}
SCM sstr = scm_number_to_string (gh_int2scm (d), gh_int2scm (10)) ;
ft.script_->set_property ("text", sstr);
to the note head, and write a more flexible function for
positioning the fingerings, setting both X and Y coordinates.
*/
- for (int i = 0; i < fingerings_.size(); i++)
+ for (int i = 0; i < fingerings_.size (); i++)
{
- fingerings_[i].position_ = gh_scm2int (fingerings_[i].head_ -> get_property( "staff-position"));
+ fingerings_[i].position_ = gh_scm2int (fingerings_[i].head_ -> get_property ( "staff-position"));
}
- for (int i = fingerings_.size(); i--;)
- for (int j = heads_.size() ; j--;)
+ for (int i = fingerings_.size (); i--;)
+ for (int j = heads_.size () ; j--;)
Side_position_interface::add_support (fingerings_[i].script_, heads_[j]);
Array<Finger_tuple> up, down, horiz;
- for (int i = fingerings_.size(); i--;)
+ for (int i = fingerings_.size (); i--;)
{
SCM d = fingerings_[i].finger_event_->get_property ("direction");
if (to_dir (d))
if (left_p || right_p)
{
if (up_p && !up.size () && fingerings_.size ())
- up.push (fingerings_.pop());
+ up.push (fingerings_.pop ());
- if (down_p && !down.size () && fingerings_.size())
+ if (down_p && !down.size () && fingerings_.size ())
{
down.push (fingerings_[0]);
- fingerings_.del(0);
+ fingerings_.del (0);
}
horiz.concat (fingerings_);
}
else if (up_p && down_p)
{
- int center = fingerings_.size() / 2;
+ int center = fingerings_.size () / 2;
down.concat (fingerings_.slice (0,center));
- up.concat (fingerings_.slice (center, fingerings_.size()));
+ up.concat (fingerings_.slice (center, fingerings_.size ()));
}
else if (up_p)
{
else
{
if (!down_p)
- warning(_ ("Fingerings are also not down?! Putting them down anyway."));
+ warning (_ ("Fingerings are also not down?! Putting them down anyway."));
down.concat (fingerings_);
- fingerings_.clear();
+ fingerings_.clear ();
}
- for (int i = 0; i < horiz.size(); i++)
+ for (int i = 0; i < horiz.size (); i++)
{
Finger_tuple ft = horiz[i];
Grob* f = ft.script_;
}
int finger_prio = 200;
- for (int i = 0; i < up.size(); i++)
+ for (int i = 0; i < up.size (); i++)
{
Finger_tuple ft = up[i];
Grob* f = ft.script_;
typeset_grob (f);
}
- for (int i = 0; i < down.size(); i++)
+ for (int i = 0; i < down.size (); i++)
{
Finger_tuple ft = down[i];
Grob* f = ft.script_;
f->set_parent (ft.head_, X_AXIS);
f->set_property ("script-priority",
- gh_int2scm (finger_prio + down.size() - i));
+ gh_int2scm (finger_prio + down.size () - i));
f->add_offset_callback (Self_alignment_interface::centered_on_parent_proc, X_AXIS);
f->add_offset_callback (Self_alignment_interface::aligned_on_self_proc, X_AXIS);
{
if (fingerings_.size ())
{
- position_scripts();
+ position_scripts ();
fingerings_.clear ();
}
- for (int i = articulations_.size(); i--;)
+ for (int i = articulations_.size (); i--;)
{
Grob *sc = articulations_[i].script_;
- for (int j = heads_.size() ; j--;)
+ for (int j = heads_.size () ; j--;)
Side_position_interface::add_support (sc, heads_[j]);
if (stem_ && to_dir (sc->get_property ("side-relative-direction")))
stem_ = 0;
heads_.clear ();
- articulations_.clear();
+ articulations_.clear ();
}
-New_fingering_engraver::New_fingering_engraver()
+New_fingering_engraver::New_fingering_engraver ()
{
stem_ = 0;
}
-ENTER_DESCRIPTION(New_fingering_engraver,
+ENTER_DESCRIPTION (New_fingering_engraver,
/* descr */ "Create fingering-scripts for notes in a new chord. "
"This engraver is ill-named, since it "
"also takes care of articulations and harmonic note heads",
public:
New_lyric_combine_music_iterator ();
New_lyric_combine_music_iterator (New_lyric_combine_music_iterator const&src);
- DECLARE_SCHEME_CALLBACK(constructor, ());
+ DECLARE_SCHEME_CALLBACK (constructor, ());
protected:
virtual void construct_children ();
virtual Moment pending_moment () const;
- virtual void do_quit();
+ virtual void do_quit ();
virtual void process (Moment);
virtual Music_iterator *try_music_in_children (Music *) const;
virtual bool run_always ()const;
}
void
-New_lyric_combine_music_iterator::derived_mark()const
+New_lyric_combine_music_iterator::derived_mark ()const
{
if (lyric_iter_)
scm_gc_mark (lyric_iter_->self_scm ());
New_lyric_combine_music_iterator::do_quit ()
{
if (lyric_iter_)
- lyric_iter_->quit();
+ lyric_iter_->quit ();
}
Real wid = 0.0;
do
{
- if(cg[d].size())
+ if (cg[d].size ())
{
Grob *h = cg[d][0];
- wid = Note_column::first_head (h)->extent (h,X_AXIS).length() ;
+ wid = Note_column::first_head (h)->extent (h,X_AXIS).length () ;
}
}
while (flip (&d) != UP);
class Note_head_line_engraver : public Engraver
{
public:
- TRANSLATOR_DECLARATIONS(Note_head_line_engraver);
+ TRANSLATOR_DECLARATIONS (Note_head_line_engraver);
protected:
virtual void acknowledge_grob (Grob_info);
line_->set_bound (LEFT, last_head_);
line_->set_bound (RIGHT, head_);
- announce_grob(line_, head_->self_scm ());
+ announce_grob (line_, head_->self_scm ());
follow_ = false;
}
-ENTER_DESCRIPTION(Note_head_line_engraver,
+ENTER_DESCRIPTION (Note_head_line_engraver,
/* descr */ "Engrave a line between two note heads, for example a glissando. If "
" followVoice is set, staff switches also generate a line.",
/* creats*/ "Glissando VoiceFollower",
int line_count = (abs (pos) < interspaces)
? 0
: (abs (pos) - interspaces) / 2;
- Stencil stencil = Stencil();
+ Stencil stencil = Stencil ();
if (line_count)
ledger_size.widen ( ledger_size.length ()/4);
Real left_shorten =0.0;
- if (Grob * g = unsmob_grob(me->get_property ("accidental-grob")))
+ if (Grob * g = unsmob_grob (me->get_property ("accidental-grob")))
{
/*
make a little room for accidentals.
Grob *common = g->common_refpoint (me, X_AXIS);
Real d =
- (me->extent (common, X_AXIS)[LEFT]
- +g->extent (common, X_AXIS)[RIGHT]) /2;
+ linear_combination (Drul_array<Real> (me->extent (common, X_AXIS)[LEFT],
+ g->extent (common, X_AXIS)[RIGHT]),
+
+ 0.5);
left_shorten = (-ledger_size[LEFT] + d) >? 0 ;
/*
This is necessary to prevent a cyclic dependency: the appearance of
- the ledgers depends on positioning, so the Grob::get_stencil() can
+ the ledgers depends on positioning, so the Grob::get_stencil () can
not be used for determining the note head extent.
*/
Offset wxwy = fm->get_indexed_wxwy (k);
Interval v = b[a];
if (!v.is_empty ())
- return 2 * (wxwy[a] - v.center()) / v.length ();
+ return 2 * (wxwy[a] - v.center ()) / v.length ();
}
}
if (!gh_procedure_p (v))
return 0.0;
- SCM result = scm_call_2 (v, me->self_scm(), gh_int2scm (a));
+ SCM result = scm_call_2 (v, me->self_scm (), gh_int2scm (a));
if (!gh_pair_p (result))
return 0.0;
Link_array<Music> note_reqs_;
public:
- TRANSLATOR_DECLARATIONS(Note_heads_engraver);
+ TRANSLATOR_DECLARATIONS (Note_heads_engraver);
protected:
virtual bool try_music (Music *req) ;
virtual void stop_translation_timestep ();
};
-Note_heads_engraver::Note_heads_engraver()
+Note_heads_engraver::Note_heads_engraver ()
{
}
pos += gh_scm2int (c0);
note->set_property ("staff-position", gh_int2scm (pos));
- announce_grob (note,req->self_scm());
+ announce_grob (note,req->self_scm ());
notes_.push (note);
}
}
-ENTER_DESCRIPTION(Note_heads_engraver,
+ENTER_DESCRIPTION (Note_heads_engraver,
/* descr */ "Generate noteheads.",
/* creats*/ "NoteHead Dots",
/* accepts */ "note-event busy-playing-event",
class Note_name_engraver : public Engraver
{
public:
- TRANSLATOR_DECLARATIONS(Note_name_engraver);
+ TRANSLATOR_DECLARATIONS (Note_name_engraver);
Link_array<Music> events_;
Link_array<Item> texts_;
{
Item * t = make_item ("NoteName");
t->set_property ("text", scm_makfrom0str (s.to_str0 ()));
- announce_grob (t, events_[0]->self_scm());
+ announce_grob (t, events_[0]->self_scm ());
texts_.push (t);
}
}
}
-Note_name_engraver::Note_name_engraver()
+Note_name_engraver::Note_name_engraver ()
{
}
-ENTER_DESCRIPTION(Note_name_engraver,
+ENTER_DESCRIPTION (Note_name_engraver,
/* descr */ "",
/* creats*/ "NoteName",
/* accepts */ "note-event",
*/
class Note_performer : public Performer {
public:
- TRANSLATOR_DECLARATIONS(Note_performer);
+ TRANSLATOR_DECLARATIONS (Note_performer);
protected:
virtual bool try_music (Music *ev) ;
return false;
}
-ENTER_DESCRIPTION(Note_performer,"","",
+ENTER_DESCRIPTION (Note_performer,"","",
"note-event busy-playing-event","","","");
-Note_performer::Note_performer()
+Note_performer::Note_performer ()
{
}
Real base_space, Real increment, Real *space, Real *fixed)
{
- Drul_array<SCM> props(me->get_property ("left-items"),
+ Drul_array<SCM> props (me->get_property ("left-items"),
me->get_property ("right-items"));
Direction d = LEFT;
Direction col_dir = right_col->break_status_dir ();
{
for (SCM s = props[d]; gh_pair_p (s); s = gh_cdr (s))
{
- Item * it= dynamic_cast<Item*> (unsmob_grob (gh_car(s)));
+ Item * it= dynamic_cast<Item*> (unsmob_grob (gh_car (s)));
if (d == RIGHT && it->break_status_dir () != col_dir)
{
first note head will be.
*/
if (g)
- left_head_wid = g->extent(it_col, X_AXIS);
+ left_head_wid = g->extent (it_col, X_AXIS);
}
extents[d].unite (it->extent (it_col, X_AXIS));
Item *
Note_spacing::left_column (Grob *me)
{
- if (!me->live())
+ if (!me->live ())
return 0;
return dynamic_cast<Item*> (me)->get_column ();
Item *
Note_spacing::right_column (Grob*me)
{
- if (!me->live())
+ if (!me->live ())
return 0;
SCM right = me->get_property ("right-items");
{
/*
int r = Paper_column::get_rank (dynamic_cast<Item*>(me)->get_column ());
- programming_error (_f("Spacing wish column %d has no right item.", r));
+ programming_error (_f ("Spacing wish column %d has no right item.", r));
*/
return 0;
Real increment,
Real * space, Real *fixed)
{
- Drul_array<Direction> stem_dirs(CENTER,CENTER);
+ Drul_array<Direction> stem_dirs (CENTER,CENTER);
Drul_array<Interval> stem_posns;
Drul_array<Interval> head_posns;
- Drul_array<SCM> props(me->get_property ("left-items"),
+ Drul_array<SCM> props (me->get_property ("left-items"),
me->get_property ("right-items"));
- Drul_array<Grob*> beams_drul(0,0);
- Drul_array<Grob*> stems_drul(0,0);
+ Drul_array<Grob*> beams_drul (0,0);
+ Drul_array<Grob*> stems_drul (0,0);
stem_dirs[LEFT] = stem_dirs[RIGHT] = CENTER;
Interval intersect;
{
for (SCM s = props[d]; gh_pair_p (s); s = gh_cdr (s))
{
- Item * it= dynamic_cast<Item*> (unsmob_grob (gh_car(s)));
+ Item * it= dynamic_cast<Item*> (unsmob_grob (gh_car (s)));
if (d == RIGHT)
acc_right = acc_right || Note_column::accidentals (it);
return ;
}
- if(Stem::is_invisible (stem))
+ if (Stem::is_invisible (stem))
{
correct_stem_dirs = false;
continue;
Real chord_start = hp[sd];
Real stem_end = Stem::stem_end_position (stem);
- stem_posns[d] = Interval(chord_start<?stem_end, chord_start>? stem_end);
+ stem_posns[d] = Interval (chord_start<?stem_end, chord_start>? stem_end);
head_posns[d].unite (hp);
}
}
else
{
intersect = stem_posns[LEFT];
- intersect.intersect(stem_posns[RIGHT]);
+ intersect.intersect (stem_posns[RIGHT]);
correct_stem_dirs = correct_stem_dirs && !intersect.is_empty ();
if (correct_stem_dirs)
*space += correction;
- /* there used to be a correction for bar_xextent() here, but
+ /* there used to be a correction for bar_xextent () here, but
it's unclear what that was good for ?
*/
Interval span_points;
Grob *common = me->get_bound (LEFT)->common_refpoint (me->get_bound (RIGHT), X_AXIS);
- Paper_def * paper = me->get_paper();
+ Paper_def * paper = me->get_paper ();
Drul_array<bool> broken;
class Ottava_spanner_engraver : public Engraver
{
public:
- TRANSLATOR_DECLARATIONS(Ottava_spanner_engraver);
+ TRANSLATOR_DECLARATIONS (Ottava_spanner_engraver);
protected:
virtual void finalize ();
virtual void acknowledge_grob (Grob_info);
typeset_all ();
if (span_)
finished_ = span_;
- typeset_all();
+ typeset_all ();
last_ottavation_ = SCM_EOL;
}
-ENTER_DESCRIPTION(Ottava_spanner_engraver,
+ENTER_DESCRIPTION (Ottava_spanner_engraver,
/* descr */ "Create a text spanner when the ottavation property changes..",
/* creats*/ "OttavaBracket",
/* accepts */ "",
class Output_property_engraver : public Engraver
{
-TRANSLATOR_DECLARATIONS(Output_property_engraver);
+TRANSLATOR_DECLARATIONS (Output_property_engraver);
protected:
Link_array<Music> props_;
SCM proc = o->get_property ("procedure");
scm_call_3 (proc,
- inf.grob_->self_scm(),
- d->self_scm(),
- daddy_context_->self_scm());
+ inf.grob_->self_scm (),
+ d->self_scm (),
+ daddy_context_->self_scm ());
}
}
}
props_.clear ();
}
-Output_property_engraver::Output_property_engraver()
+Output_property_engraver::Output_property_engraver ()
{
}
-ENTER_DESCRIPTION(Output_property_engraver,
+ENTER_DESCRIPTION (Output_property_engraver,
/* descr */ "Interpret Music of Output_property type, and apply a function "
" to any Graphic objects that satisfies the predicate.",
/* creats*/ "",
class Output_property_music_iterator : public Simple_music_iterator
{
public:
- DECLARE_SCHEME_CALLBACK(constructor, ());
+ DECLARE_SCHEME_CALLBACK (constructor, ());
protected:
virtual void process (Moment);
};
Print a vertical line and the rank number, to aid debugging.
*/
-MAKE_SCHEME_CALLBACK(Paper_column,print,1);
+MAKE_SCHEME_CALLBACK (Paper_column,print,1);
SCM
Paper_column::print (SCM p)
{
THIS IS BROKEN KLUDGE. WE SHOULD INVENT SOMETHING BETTER.
*/
-MAKE_SCHEME_CALLBACK(Paper_column,before_line_breaking,1);
+MAKE_SCHEME_CALLBACK (Paper_column,before_line_breaking,1);
SCM
Paper_column::before_line_breaking (SCM grob)
{
main_smob_ = gh_cons (l->self_scm (), main_smob_);
l->pscore_ = this;
- scm_gc_unprotect_object (l->self_scm());
+ scm_gc_unprotect_object (l->self_scm ());
}
internal_ly_parse_scm (Parse_start * ps, bool safe)
{
Source_file* sf =ps->start_location_.source_file_;
- SCM port = sf->get_port();
+ SCM port = sf->get_port ();
int off = ps->start_location_.defined_str0_ - sf->to_str0();
ps->start_location_.error (_("GUILE signaled an error for the expression beginning here"));
if (scm_ilength (args) > 2)
- scm_display_error_message (gh_cadr (args), gh_caddr(args), scm_current_error_port());
+ scm_display_error_message (gh_cadr (args), gh_caddr (args), scm_current_error_port ());
/*
The following is a kludge; we should probably search for
Music*
set_property_music (SCM sym, SCM value)
{
- Music * p = MY_MAKE_MUSIC("PropertySet");
+ Music * p = MY_MAKE_MUSIC ("PropertySet");
p->set_property ("symbol", sym);
p->set_property ("value", value);
return p;
My_lily_lexer * lex = pars->lexer_;
lex->lexval = (void*) s;
- lex->prepare_for_next_token();
+ lex->prepare_for_next_token ();
return lex->yylex ();
}
SCM outname = scm_makfrom0str (p.to_string ().to_str0());
for (int i=0; i < sc->defs_.size (); i++)
- default_rendering (sc->music_, sc->defs_[i]->self_scm(), head, outname);
+ default_rendering (sc->music_, sc->defs_[i]->self_scm (), head, outname);
if (sc->defs_.is_empty ())
{
id = id ? id->clone () : new Paper_def;
- default_rendering (sc->music_, id->self_scm(), head, outname);
+ default_rendering (sc->music_, id->self_scm (), head, outname);
scm_gc_unprotect_object (id->self_scm ());
}
- scm_gc_unprotect_object (sc->self_scm());
+ scm_gc_unprotect_object (sc->self_scm ());
}
| output_def {
SCM id = SCM_EOL;
lilypond_header:
HEADER '{' lilypond_header_body '}' {
- $$ = THIS->lexer_-> remove_scope();
+ $$ = THIS->lexer_-> remove_scope ();
}
;
unsmob_context_def ($$)->set_spot (THIS->here_input ());
}
| context_def_spec_body GROBDESCRIPTIONS embedded_scm {
- Context_def*td = unsmob_context_def($$);
+ Context_def*td = unsmob_context_def ($$);
for (SCM p = $3; gh_pair_p (p); p = ly_cdr (p)) {
SCM tag = gh_caar (p);
tempo_event:
TEMPO steno_duration '=' bare_unsigned {
- $$ = MY_MAKE_MUSIC("MetronomeChangeEvent");
+ $$ = MY_MAKE_MUSIC ("MetronomeChangeEvent");
$$->set_property ("tempo-unit", $2);
$$->set_property ("metronome-count", gh_int2scm ( $4));
}
shift -= 1;
r->compress (Moment (Rational (1,list_len)));
}
- gh_call3 (func, r->self_scm (), gh_int2scm(shift),gh_int2scm(dots));
+ gh_call3 (func, r->self_scm (), gh_int2scm (shift),gh_int2scm (dots));
}
r->set_spot (*$4->origin ());
Sequential_music:
SEQUENTIAL '{' Music_list '}' {
- $$ = MY_MAKE_MUSIC("SequentialMusic");
+ $$ = MY_MAKE_MUSIC ("SequentialMusic");
$$->set_property ("elements", ly_car ($3));
- $$->set_spot(THIS->here_input());
+ $$->set_spot (THIS->here_input ());
}
| '{' Music_list '}' {
- $$ = MY_MAKE_MUSIC("SequentialMusic");
+ $$ = MY_MAKE_MUSIC ("SequentialMusic");
$$->set_property ("elements", ly_car ($2));
- $$->set_spot(THIS->here_input());
+ $$->set_spot (THIS->here_input ());
}
;
Simultaneous_music:
SIMULTANEOUS '{' Music_list '}'{
- $$ = MY_MAKE_MUSIC("SimultaneousMusic");
+ $$ = MY_MAKE_MUSIC ("SimultaneousMusic");
$$->set_property ("elements", ly_car ($3));
- $$->set_spot(THIS->here_input());
+ $$->set_spot (THIS->here_input ());
}
| simul_open Music_list simul_close {
- $$ = MY_MAKE_MUSIC("SimultaneousMusic");
+ $$ = MY_MAKE_MUSIC ("SimultaneousMusic");
$$->set_property ("elements", ly_car ($2));
- $$->set_spot(THIS->here_input());
+ $$->set_spot (THIS->here_input ());
}
;
THIS->parser_error (_ ("\\applycontext takes function argument"));
$$ = MY_MAKE_MUSIC ("ApplyOutputEvent");
$$->set_property ("procedure", $2);
- $$->set_spot (THIS->here_input());
+ $$->set_spot (THIS->here_input ());
}
| APPLYCONTEXT embedded_scm {
if (!ly_input_procedure_p ($2))
THIS->parser_error (_ ("\\applycontext takes function argument"));
$$ = MY_MAKE_MUSIC ("ApplyContext");
$$->set_property ("procedure", $2);
- $$->set_spot (THIS->here_input());
+ $$->set_spot (THIS->here_input ());
}
| MUSIC_IDENTIFIER {
$$ = unsmob_music ($1);
scm_gc_unprotect_object ($2->self_scm ());
$$ = unsmob_music (res);
scm_gc_protect_object (res);
- $$->set_spot (THIS->here_input());
+ $$->set_spot (THIS->here_input ());
}
| PARTCOMBINE Music Music {
static SCM proc;
scm_gc_unprotect_object ($2->self_scm ());
$$ = unsmob_music (res);
scm_gc_protect_object (res);
- $$->set_spot (THIS->here_input());
+ $$->set_spot (THIS->here_input ());
}
| grace_head Music {
#if 1
scm_gc_unprotect_object (stopm->self_scm ());
}
ms = scm_cons ($2->self_scm (), ms);
- scm_gc_unprotect_object ($2->self_scm());
+ scm_gc_unprotect_object ($2->self_scm ());
if (startm) {
startm = startm->clone ();
ms = scm_cons (startm->self_scm () , ms);
scm_gc_unprotect_object (startm->self_scm ());
}
- Music* seq = MY_MAKE_MUSIC("SequentialMusic");
+ Music* seq = MY_MAKE_MUSIC ("SequentialMusic");
seq->set_property ("elements", ms);
- $$ = MY_MAKE_MUSIC("GraceMusic");
+ $$ = MY_MAKE_MUSIC ("GraceMusic");
$$->set_property ("element", seq->self_scm ());
scm_gc_unprotect_object (seq->self_scm ());
#else
- $$ = MY_MAKE_MUSIC("GraceMusic");
+ $$ = MY_MAKE_MUSIC ("GraceMusic");
$$->set_property ("element", $2->self_scm ());
scm_gc_unprotect_object ($2->self_scm ());
#endif
int n = gh_scm2int (ly_car ($3)); int d = gh_scm2int (ly_cdr ($3));
Music *mp = $4;
- $$= MY_MAKE_MUSIC("TimeScaledMusic");
+ $$= MY_MAKE_MUSIC ("TimeScaledMusic");
$$->set_spot (THIS->pop_spot ());
$$->set_property ("element", mp->self_scm ());
| Simultaneous_music { $$ = $1; }
| Sequential_music { $$ = $1; }
| TRANSPOSE pitch_also_in_chords pitch_also_in_chords Music {
- $$ = MY_MAKE_MUSIC("TransposedMusic");
+ $$ = MY_MAKE_MUSIC ("TransposedMusic");
Music *p = $4;
Pitch from = *unsmob_pitch ($2);
Pitch to = *unsmob_pitch ($3);
Music *m = unsmob_music (ret);
if (!m) {
THIS->parser_error ("\\apply must return a Music");
- m = MY_MAKE_MUSIC("Music");
+ m = MY_MAKE_MUSIC ("Music");
}
$$ = m;
}
{ THIS->lexer_->push_figuredbass_state (); }
Music
{
- Music * chm = MY_MAKE_MUSIC("UntransposableMusic");
+ Music * chm = MY_MAKE_MUSIC ("UntransposableMusic");
chm->set_property ("element", $3->self_scm ());
$$ = chm;
- scm_gc_unprotect_object ($3->self_scm());
+ scm_gc_unprotect_object ($3->self_scm ());
THIS->lexer_->pop_state ();
}
THIS->lexer_->push_chord_state (alist_to_hashq (nn));
} Music {
- Music * chm = MY_MAKE_MUSIC("UnrelativableMusic");
+ Music * chm = MY_MAKE_MUSIC ("UnrelativableMusic");
chm->set_property ("element", $3->self_scm ());
- scm_gc_unprotect_object ($3->self_scm());
+ scm_gc_unprotect_object ($3->self_scm ());
$$ = chm;
THIS->lexer_->pop_state ();
RELATIVE absolute_pitch Music {
Music * p = $3;
Pitch pit = *unsmob_pitch ($2);
- $$ = MY_MAKE_MUSIC("RelativeOctaveMusic");
+ $$ = MY_MAKE_MUSIC ("RelativeOctaveMusic");
$$->set_property ("element", p->self_scm ());
scm_gc_unprotect_object (p->self_scm ());
re_rhythmed_music:
ADDLYRICS Music Music {
- Music*l =MY_MAKE_MUSIC("LyricCombineMusic");
+ Music*l =MY_MAKE_MUSIC ("LyricCombineMusic");
l->set_property ("elements", gh_list ($2->self_scm (), $3->self_scm (), SCM_UNDEFINED));
scm_gc_unprotect_object ($3->self_scm ());
scm_gc_unprotect_object ($2->self_scm ());
$$ = l;
}
| NEWADDLYRICS string Music {
- Music*l =MY_MAKE_MUSIC("NewLyricCombineMusic");
+ Music*l =MY_MAKE_MUSIC ("NewLyricCombineMusic");
l->set_property ("element", $3->self_scm ());
scm_gc_unprotect_object ($3->self_scm ());
$$ = l;
context_change:
CHANGE STRING '=' STRING {
- Music*t= MY_MAKE_MUSIC("ContextChange");
+ Music*t= MY_MAKE_MUSIC ("ContextChange");
t-> set_property ("change-to-type", scm_string_to_symbol ($2));
t-> set_property ("change-to-id", $4);
note_chord_element:
chord_body optional_notemode_duration post_events
{
- SCM dur = unsmob_duration ($2)->smobbed_copy();
+ SCM dur = unsmob_duration ($2)->smobbed_copy ();
SCM es = $1->get_property ("elements");
SCM postevs = scm_reverse_x ($3, SCM_EOL);
for (SCM s = es; gh_pair_p (s); s = gh_cdr (s))
- unsmob_music (gh_car(s))->set_property ("duration", dur);
+ unsmob_music (gh_car (s))->set_property ("duration", dur);
es = gh_append2 (es, postevs);
$1-> set_property ("elements", es);
chord_body:
chord_open chord_body_elements chord_close
{
- $$ = MY_MAKE_MUSIC("EventChord");
+ $$ = MY_MAKE_MUSIC ("EventChord");
$$->set_property ("elements",
scm_reverse_x ($2, SCM_EOL));
}
chord_body_elements:
/* empty */ { $$ = SCM_EOL; }
| chord_body_elements chord_body_element {
- $$ = gh_cons ($2->self_scm(), $1);
- scm_gc_unprotect_object ($2->self_scm());
+ $$ = gh_cons ($2->self_scm (), $1);
+ scm_gc_unprotect_object ($2->self_scm ());
}
;
chord_body_element:
pitch exclamations questions post_events
{
- Music * n = MY_MAKE_MUSIC("NoteEvent");
+ Music * n = MY_MAKE_MUSIC ("NoteEvent");
n->set_property ("pitch", $1);
if ($3 % 2)
n->set_property ("cautionary", SCM_BOOL_T);
$$ = n;
}
| DRUM_PITCH post_events {
- Music *n = MY_MAKE_MUSIC("NoteEvent");
+ Music *n = MY_MAKE_MUSIC ("NoteEvent");
n->set_property ("duration" ,$2);
n->set_property ("drum-type" , $1);
- n->set_spot (THIS->here_input());
+ n->set_spot (THIS->here_input ());
if (gh_pair_p ($2)) {
SCM arts = scm_reverse_x ($2, SCM_EOL);
command_element:
command_req {
- $$ = MY_MAKE_MUSIC("EventChord");
+ $$ = MY_MAKE_MUSIC ("EventChord");
$$->set_property ("elements", scm_cons ($1->self_scm (), SCM_EOL));
- scm_gc_unprotect_object ($1->self_scm());
+ scm_gc_unprotect_object ($1->self_scm ());
$$-> set_spot (THIS->here_input ());
$1-> set_spot (THIS->here_input ());
}
| SKIP duration_length {
- Music * skip = MY_MAKE_MUSIC("SkipMusic");
+ Music * skip = MY_MAKE_MUSIC ("SkipMusic");
skip->set_property ("duration", $2);
$$ = skip;
Music * quote = 0;
if (gh_vector_p (evs))
{
- quote = MY_MAKE_MUSIC("QuoteMusic");
+ quote = MY_MAKE_MUSIC ("QuoteMusic");
quote->set_property ("duration", $3);
quote->set_property ("quoted-events", evs);
} else {
}
| OCTAVE { THIS->push_spot (); }
pitch {
- Music *l = MY_MAKE_MUSIC("RelativeOctaveCheck");
+ Music *l = MY_MAKE_MUSIC ("RelativeOctaveCheck");
$$ = l;
$$->set_spot (THIS->pop_spot ());
$$->set_property ("pitch", $3);
}
| E_LEFTSQUARE {
- Music *l = MY_MAKE_MUSIC("LigatureEvent");
+ Music *l = MY_MAKE_MUSIC ("LigatureEvent");
l->set_property ("span-direction", gh_int2scm (START));
l->set_spot (THIS->here_input ());
- $$ = MY_MAKE_MUSIC("EventChord");
+ $$ = MY_MAKE_MUSIC ("EventChord");
$$->set_property ("elements", scm_cons (l->self_scm (), SCM_EOL));
- scm_gc_unprotect_object (l->self_scm());
+ scm_gc_unprotect_object (l->self_scm ());
$$->set_spot (THIS->here_input ());
}
| E_RIGHTSQUARE {
- Music *l = MY_MAKE_MUSIC("LigatureEvent");
+ Music *l = MY_MAKE_MUSIC ("LigatureEvent");
l->set_property ("span-direction", gh_int2scm (STOP));
l->set_spot (THIS->here_input ());
- $$ = MY_MAKE_MUSIC("EventChord");
+ $$ = MY_MAKE_MUSIC ("EventChord");
$$->set_property ("elements", scm_cons (l->self_scm (), SCM_EOL));
$$->set_spot (THIS->here_input ());
- scm_gc_unprotect_object (l->self_scm());
+ scm_gc_unprotect_object (l->self_scm ());
}
| E_BACKSLASH {
- $$ = MY_MAKE_MUSIC("VoiceSeparator");
+ $$ = MY_MAKE_MUSIC ("VoiceSeparator");
$$->set_spot (THIS->here_input ());
}
| '|' {
- $$ = MY_MAKE_MUSIC("BarCheck");
+ $$ = MY_MAKE_MUSIC ("BarCheck");
$$->set_spot (THIS->here_input ());
}
| TRANSPOSITION pitch {
command_req:
BREATHE {
- $$ = MY_MAKE_MUSIC("BreathingSignEvent");
+ $$ = MY_MAKE_MUSIC ("BreathingSignEvent");
}
| E_TILDE {
- $$ = MY_MAKE_MUSIC("PesOrFlexaEvent");
+ $$ = MY_MAKE_MUSIC ("PesOrFlexaEvent");
}
| MARK DEFAULT {
- Music * m = MY_MAKE_MUSIC("MarkEvent");
+ Music * m = MY_MAKE_MUSIC ("MarkEvent");
$$ = m;
}
| tempo_event {
$$ = $1;
}
| KEY DEFAULT {
- Music *key= MY_MAKE_MUSIC("KeyChangeEvent");
+ Music *key= MY_MAKE_MUSIC ("KeyChangeEvent");
$$ = key;
}
| KEY NOTENAME_PITCH SCM_IDENTIFIER {
- Music *key= MY_MAKE_MUSIC("KeyChangeEvent");
+ Music *key= MY_MAKE_MUSIC ("KeyChangeEvent");
if (scm_ilength ($3) > 0)
{
key->set_property ("pitch-alist", $3);
- key->set_property ("tonic", Pitch (0,0,0).smobbed_copy());
+ key->set_property ("tonic", Pitch (0,0,0).smobbed_copy ());
((Music*)key)->transpose (* unsmob_pitch ($2));
} else {
THIS->parser_error (_("Second argument must be pitch list."));
}
| post_events post_event {
$2->set_spot (THIS->here_input ());
- $$ = gh_cons ($2->self_scm(), $$);
- scm_gc_unprotect_object ($2->self_scm());
+ $$ = gh_cons ($2->self_scm (), $$);
+ scm_gc_unprotect_object ($2->self_scm ());
}
| post_events tagged_post_event {
$2 -> set_spot (THIS->here_input ());
- $$ = scm_cons ($2->self_scm(), $$);
- scm_gc_unprotect_object ($2->self_scm());
+ $$ = scm_cons ($2->self_scm (), $$);
+ scm_gc_unprotect_object ($2->self_scm ());
}
;
| HYPHEN {
if (!THIS->lexer_->is_lyric_state ())
THIS->parser_error (_ ("Have to be in Lyric mode for lyrics"));
- $$ = MY_MAKE_MUSIC("HyphenEvent");
+ $$ = MY_MAKE_MUSIC ("HyphenEvent");
}
| EXTENDER {
if (!THIS->lexer_->is_lyric_state ())
THIS->parser_error (_ ("Have to be in Lyric mode for lyrics"));
- $$ = MY_MAKE_MUSIC("ExtenderEvent");
+ $$ = MY_MAKE_MUSIC ("ExtenderEvent");
}
| script_dir direction_reqd_event {
if ($1)
string_number_event:
E_UNSIGNED {
- Music * s = MY_MAKE_MUSIC("StringNumberEvent");
- s->set_property ("string-number", gh_int2scm($1));
+ Music * s = MY_MAKE_MUSIC ("StringNumberEvent");
+ s->set_property ("string-number", gh_int2scm ($1));
s->set_spot (THIS->here_input ());
$$ = s;
}
*/
Music * m = MY_MAKE_MUSIC ("BeamEvent");
- m->set_spot (THIS->here_input());
+ m->set_spot (THIS->here_input ());
m->set_property ("span-direction" , gh_int2scm (START));
$$ = m;
}
| ']' {
Music * m = MY_MAKE_MUSIC ("BeamEvent");
- m->set_spot (THIS->here_input());
+ m->set_spot (THIS->here_input ());
m->set_property ("span-direction" , gh_int2scm (STOP));
$$ = m;
}
| '~' {
Music * m = MY_MAKE_MUSIC ("TieEvent");
- m->set_spot (THIS->here_input());
+ m->set_spot (THIS->here_input ());
$$ = m;
}
| close_event {
$$ = unsmob_music ($1);
}
| tremolo_type {
- Music * a = MY_MAKE_MUSIC("TremoloEvent");
+ Music * a = MY_MAKE_MUSIC ("TremoloEvent");
a->set_spot (THIS->here_input ());
a->set_property ("tremolo-type", gh_int2scm ($1));
$$ = a;
}
| script_abbreviation {
SCM s = THIS->lexer_->lookup_identifier ("dash" + ly_scm2string ($1));
- Music *a = MY_MAKE_MUSIC("ArticulationEvent");
+ Music *a = MY_MAKE_MUSIC ("ArticulationEvent");
if (gh_string_p (s))
a->set_property ("articulation-type", s);
else THIS->parser_error (_ ("Expecting string as script definition"));
close_event:
'(' {
- Music * s= MY_MAKE_MUSIC("SlurEvent");
+ Music * s= MY_MAKE_MUSIC ("SlurEvent");
$$ = s;
- s->set_spot (THIS->here_input());
+ s->set_spot (THIS->here_input ());
}
| E_OPEN {
- Music * s= MY_MAKE_MUSIC("PhrasingSlurEvent");
+ Music * s= MY_MAKE_MUSIC ("PhrasingSlurEvent");
$$ = s;
- s->set_spot (THIS->here_input());
+ s->set_spot (THIS->here_input ());
}
| E_SMALLER {
- Music *s =MY_MAKE_MUSIC("CrescendoEvent");
+ Music *s =MY_MAKE_MUSIC ("CrescendoEvent");
$$ = s;
- s->set_spot (THIS->here_input());
+ s->set_spot (THIS->here_input ());
}
| E_BIGGER {
- Music *s =MY_MAKE_MUSIC("DecrescendoEvent");
+ Music *s =MY_MAKE_MUSIC ("DecrescendoEvent");
$$ = s;
- s->set_spot (THIS->here_input());
+ s->set_spot (THIS->here_input ());
}
;
open_event:
E_EXCLAMATION {
- Music *s = MY_MAKE_MUSIC("CrescendoEvent");
- s->set_spot (THIS->here_input());
+ Music *s = MY_MAKE_MUSIC ("CrescendoEvent");
+ s->set_spot (THIS->here_input ());
$$ = s;
}
| ')' {
- Music * s= MY_MAKE_MUSIC("SlurEvent");
+ Music * s= MY_MAKE_MUSIC ("SlurEvent");
$$ = s;
- s->set_spot (THIS->here_input());
+ s->set_spot (THIS->here_input ());
}
| E_CLOSE {
- Music * s= MY_MAKE_MUSIC("PhrasingSlurEvent");
+ Music * s= MY_MAKE_MUSIC ("PhrasingSlurEvent");
$$ = s;
s->set_property ("span-type", scm_makfrom0str ( "phrasing-slur"));
- s->set_spot (THIS->here_input());
+ s->set_spot (THIS->here_input ());
}
;
gen_text_def:
full_markup {
- Music *t = MY_MAKE_MUSIC("TextScriptEvent");
+ Music *t = MY_MAKE_MUSIC ("TextScriptEvent");
t->set_property ("text", $1);
t->set_spot (THIS->here_input ());
$$ = t;
}
| string {
- Music *t = MY_MAKE_MUSIC("TextScriptEvent");
+ Music *t = MY_MAKE_MUSIC ("TextScriptEvent");
t->set_property ("text", make_simple_markup ($1));
t->set_spot (THIS->here_input ());
$$ = t;
}
| DIGIT {
- Music * t = MY_MAKE_MUSIC("FingerEvent");
+ Music * t = MY_MAKE_MUSIC ("FingerEvent");
t->set_property ("digit", gh_int2scm ($1));
t->set_spot (THIS->here_input ());
$$ = t;
bass_figure:
FIGURE_SPACE {
- Music *bfr = MY_MAKE_MUSIC("BassFigureEvent");
- $$ = bfr->self_scm();
+ Music *bfr = MY_MAKE_MUSIC ("BassFigureEvent");
+ $$ = bfr->self_scm ();
scm_gc_unprotect_object ($$);
}
| bass_number {
- Music *bfr = MY_MAKE_MUSIC("BassFigureEvent");
- $$ = bfr->self_scm();
+ Music *bfr = MY_MAKE_MUSIC ("BassFigureEvent");
+ $$ = bfr->self_scm ();
bfr->set_property ("figure", $1);
figure_spec:
FIGURE_OPEN figure_list FIGURE_CLOSE {
- Music * m = MY_MAKE_MUSIC("EventChord");
+ Music * m = MY_MAKE_MUSIC ("EventChord");
$2 = scm_reverse_x ($2, SCM_EOL);
m->set_property ("elements", $2);
$$ = m->self_scm ();
Music *n = 0;
if ($6)
- n = MY_MAKE_MUSIC("RestEvent");
+ n = MY_MAKE_MUSIC ("RestEvent");
else
- n = MY_MAKE_MUSIC("NoteEvent");
+ n = MY_MAKE_MUSIC ("NoteEvent");
n->set_property ("pitch", $1);
n->set_property ("duration", $5);
if ($2 % 2 || $3 % 2)
n->set_property ("force-accidental", SCM_BOOL_T);
- Music *v = MY_MAKE_MUSIC("EventChord");
+ Music *v = MY_MAKE_MUSIC ("EventChord");
v->set_property ("elements", scm_list_1 (n->self_scm ()));
- scm_gc_unprotect_object (n->self_scm());
+ scm_gc_unprotect_object (n->self_scm ());
v->set_spot (i);
n->set_spot (i);
| DRUM_PITCH optional_notemode_duration {
Input i = THIS->pop_spot ();
- Music *n = MY_MAKE_MUSIC("NoteEvent");
+ Music *n = MY_MAKE_MUSIC ("NoteEvent");
n->set_property ("duration" ,$2);
n->set_property ("drum-type" , $1);
- Music *v = MY_MAKE_MUSIC("EventChord");
+ Music *v = MY_MAKE_MUSIC ("EventChord");
v->set_property ("elements", scm_list_1 (n->self_scm ()));
- scm_gc_unprotect_object (n->self_scm());
+ scm_gc_unprotect_object (n->self_scm ());
v->set_spot (i);
n->set_spot (i);
$$ = v;
Music * ev = 0;
if (ly_scm2string ($1) =="s") {
/* Space */
- ev = MY_MAKE_MUSIC("SkipEvent");
+ ev = MY_MAKE_MUSIC ("SkipEvent");
}
else {
- ev = MY_MAKE_MUSIC("RestEvent");
+ ev = MY_MAKE_MUSIC ("RestEvent");
}
ev->set_property ("duration" ,$2);
ev->set_spot (i);
- Music * velt = MY_MAKE_MUSIC("EventChord");
+ Music * velt = MY_MAKE_MUSIC ("EventChord");
velt->set_property ("elements", scm_list_1 (ev->self_scm ()));
velt->set_spot (i);
- scm_gc_unprotect_object (ev->self_scm());
+ scm_gc_unprotect_object (ev->self_scm ());
$$ = velt;
}
proc = scm_c_eval_string ("make-multi-measure-rest");
SCM mus = scm_call_2 (proc, $2,
- make_input (THIS->here_input()));
+ make_input (THIS->here_input ()));
scm_gc_protect_object (mus);
$$ = unsmob_music (mus);
}
if (!THIS->lexer_->is_lyric_state ())
THIS->parser_error (_ ("Have to be in Lyric mode for lyrics"));
- Music * lreq = MY_MAKE_MUSIC("LyricEvent");
+ Music * lreq = MY_MAKE_MUSIC ("LyricEvent");
lreq->set_property ("text", $1);
lreq->set_property ("duration",$2);
lreq->set_spot (i);
- Music * velt = MY_MAKE_MUSIC("EventChord");
+ Music * velt = MY_MAKE_MUSIC ("EventChord");
velt->set_property ("elements", scm_list_1 (lreq->self_scm ()));
$$= velt;
*destination = sid;
return NUMBER_IDENTIFIER;
} else if (unsmob_context_def (sid)) {
- *destination = unsmob_context_def (sid)->clone_scm();
+ *destination = unsmob_context_def (sid)->clone_scm ();
return CONTEXT_DEF_IDENTIFIER;
} else if (unsmob_score (sid)) {
Score *sc = new Score (*unsmob_score (sid));
return SCORE_IDENTIFIER;
} else if (Music * mus =unsmob_music (sid)) {
mus = mus->clone ();
- *destination = mus->self_scm();
+ *destination = mus->self_scm ();
unsmob_music (*destination)->
set_property ("origin", make_input (last_input_));
return dynamic_cast<Event*> (mus)
? EVENT_IDENTIFIER : MUSIC_IDENTIFIER;
} else if (unsmob_duration (sid)) {
- *destination = unsmob_duration (sid)->smobbed_copy();
+ *destination = unsmob_duration (sid)->smobbed_copy ();
return DURATION_IDENTIFIER;
} else if (unsmob_music_output_def (sid)) {
Music_output_def *p = unsmob_music_output_def (sid);
p = p->clone ();
- *destination = p->self_scm();
+ *destination = p->self_scm ();
return MUSIC_OUTPUT_DEF_IDENTIFIER;
} else if (Text_item::markup_p (sid)) {
*destination = sid;
if (tag == ly_symbol2scm ("assign"))
{
- m = MY_MAKE_MUSIC("PropertySet");
+ m = MY_MAKE_MUSIC ("PropertySet");
val = gh_car (args);
}
else if (tag == ly_symbol2scm ("unset"))
- m = MY_MAKE_MUSIC("PropertyUnset");
+ m = MY_MAKE_MUSIC ("PropertyUnset");
else if (tag == ly_symbol2scm ("poppush")
|| tag == ly_symbol2scm ("push"))
{
- m = MY_MAKE_MUSIC("OverrideProperty");
+ m = MY_MAKE_MUSIC ("OverrideProperty");
grob_sym = gh_car (args);
grob_val = gh_cadr (args);
}
else if (tag == ly_symbol2scm ("pop")) {
- m = MY_MAKE_MUSIC("RevertProperty");
+ m = MY_MAKE_MUSIC ("RevertProperty");
grob_sym = gh_car (args);
}
Music*
context_spec_music (SCM type, SCM id, Music * m, SCM ops)
{
- Music * csm = MY_MAKE_MUSIC("ContextSpeccedMusic");
+ Music * csm = MY_MAKE_MUSIC ("ContextSpeccedMusic");
csm->set_property ("element", m->self_scm ());
scm_gc_unprotect_object (m->self_scm ());
class Part_combine_engraver : public Engraver
{
- TRANSLATOR_DECLARATIONS(Part_combine_engraver);
+ TRANSLATOR_DECLARATIONS (Part_combine_engraver);
protected:
virtual void acknowledge_grob (Grob_info);
event_ = 0;
}
-ENTER_DESCRIPTION(Part_combine_engraver,
+ENTER_DESCRIPTION (Part_combine_engraver,
/* descr */ "Part combine engraver for orchestral scores: "
"Print markings a2, Solo, Solo II, and unisono ",
/* creats*/ "CombineTextScript",
public:
Part_combine_iterator ();
- DECLARE_SCHEME_CALLBACK(constructor, ());
+ DECLARE_SCHEME_CALLBACK (constructor, ());
protected:
virtual void derived_substitute (Context *f, Context *t) ;
virtual void derived_mark () const;
virtual void construct_children ();
virtual Moment pending_moment () const;
- virtual void do_quit();
+ virtual void do_quit ();
virtual void process (Moment);
virtual Music_iterator *try_music_in_children (Music *) const;
Part_combine_iterator::derived_mark () const
{
if (first_iter_)
- scm_gc_mark (first_iter_->self_scm());
+ scm_gc_mark (first_iter_->self_scm ());
if (second_iter_)
- scm_gc_mark(second_iter_->self_scm());
+ scm_gc_mark (second_iter_->self_scm ());
}
void
Part_combine_iterator::do_quit ()
{
if (first_iter_)
- first_iter_->quit();
+ first_iter_->quit ();
if (second_iter_)
- second_iter_->quit();
+ second_iter_->quit ();
null_.set_translator (0);
one_ .set_translator (0);
playing_state_ = TOGETHER;
state_ = TOGETHER;
- substitute_both (shared_.get_outlet (), shared_.get_outlet());
+ substitute_both (shared_.get_outlet (), shared_.get_outlet ());
}
}
{
void typeset_perc ();
public:
- TRANSLATOR_DECLARATIONS(Percent_repeat_engraver);
+ TRANSLATOR_DECLARATIONS (Percent_repeat_engraver);
protected:
Repeated_music * repeat_;
perc_ = make_spanner ("PercentRepeat");
SCM col =get_property ("currentCommandColumn");
perc_->set_bound (LEFT, unsmob_grob (col));
- announce_grob(perc_, repeat_->self_scm());
+ announce_grob (perc_, repeat_->self_scm ());
}
else if (repeat_sign_type_ == DOUBLE_MEASURE)
{
double_percent_ = make_item ("DoublePercentRepeat");
- announce_grob(double_percent_, repeat_->self_scm());
+ announce_grob (double_percent_, repeat_->self_scm ());
/*
forbid breaks on a % line. Should forbid all breaks, really.
-ENTER_DESCRIPTION(Percent_repeat_engraver,
+ENTER_DESCRIPTION (Percent_repeat_engraver,
/* descr */ "Make whole bar and double bar repeats.",
/* creats*/ "PercentRepeat DoublePercentRepeat",
/* accepts */ "repeated-music",
return m;
}
-MAKE_SCHEME_CALLBACK(Percent_repeat_item_interface,double_percent,1);
+MAKE_SCHEME_CALLBACK (Percent_repeat_item_interface,double_percent,1);
SCM
Percent_repeat_item_interface::double_percent (SCM grob)
{
return m.smobbed_copy ();
}
-MAKE_SCHEME_CALLBACK(Percent_repeat_item_interface,beat_slash,1);
+MAKE_SCHEME_CALLBACK (Percent_repeat_item_interface,beat_slash,1);
SCM
Percent_repeat_item_interface::beat_slash (SCM grob)
{
}
void
-Percent_repeat_iterator::do_quit()
+Percent_repeat_iterator::do_quit ()
{
if (child_iter_)
- child_iter_->quit();
+ child_iter_->quit ();
}
bool
if (finish_mom_ <= m )
{
- child_iter_->quit();
+ child_iter_->quit ();
child_iter_ = 0;
}
}
}
void
-Percent_repeat_iterator::derived_mark()const
+Percent_repeat_iterator::derived_mark ()const
{
if (child_iter_)
- scm_gc_mark (child_iter_->self_scm());
+ scm_gc_mark (child_iter_->self_scm ());
}
void
-Percent_repeat_iterator::derived_substitute(Context *f,Context *t )
+Percent_repeat_iterator::derived_substitute (Context *f,Context *t )
{
if (child_iter_)
child_iter_->substitute_outlet (f,t);
#include "warn.hh"
-ENTER_DESCRIPTION(Performer_group_performer,
+ENTER_DESCRIPTION (Performer_group_performer,
/* descr */ "",
/* creats*/ "",
/* accepts */ "",
}
}
-Performer_group_performer::Performer_group_performer()
+Performer_group_performer::Performer_group_performer ()
{
}
virtual void process_acknowledged_grobs ();
public:
- TRANSLATOR_DECLARATIONS(Phrasing_slur_engraver);
+ TRANSLATOR_DECLARATIONS (Phrasing_slur_engraver);
};
start_phrasing_slurs.push (phrasing_slur);
eventses_.push (phrasing_slur_ev);
- announce_grob(phrasing_slur, phrasing_slur_ev->self_scm());
+ announce_grob (phrasing_slur, phrasing_slur_ev->self_scm ());
}
}
for (int i=0; i < start_phrasing_slurs.size (); i++)
-ENTER_DESCRIPTION(Phrasing_slur_engraver,
+ENTER_DESCRIPTION (Phrasing_slur_engraver,
/* descr */ "Print phrasing slurs. Similar to @ref{Slur_engraver}",
/* creats*/ "PhrasingSlur",
/* accepts */ "phrasing-slur-event",
struct Piano_pedal_bracket
{
- DECLARE_SCHEME_CALLBACK(print,(SCM));
+ DECLARE_SCHEME_CALLBACK (print,(SCM));
static bool has_interface (Grob*);
};
-MAKE_SCHEME_CALLBACK(Piano_pedal_bracket,print,1);
+MAKE_SCHEME_CALLBACK (Piano_pedal_bracket,print,1);
SCM
Piano_pedal_bracket::print (SCM smob)
{
Grob *common = me->get_bound (LEFT)
->common_refpoint (me->get_bound (RIGHT), X_AXIS);
- Grob *textbit = unsmob_grob (me->get_property("pedal-text"));
+ Grob *textbit = unsmob_grob (me->get_property ("pedal-text"));
if (textbit)
common = common->common_refpoint (textbit, X_AXIS);
String msg = _ ("Need 3 strings for piano pedals. No pedal made. ");
if (m)
- m->origin()->warning (msg);
+ m->origin ()->warning (msg);
else
warning (msg);
{
s = ly_caddr (strings);
if (previous_.size ())
- previous_.pop();
+ previous_.pop ();
}
p->start_ev_ = 0;
}
{
if (!p->event_drul_[START])
{
- if (previous_.size())
- previous_.pop();
+ if (previous_.size ())
+ previous_.pop ();
}
assert (!p->finished_bracket_);
// position new pedal spanner below the current one
*/
- if (previous_.size())
- Side_position_interface::add_support (p->line_spanner_, previous_.top());
+ if (previous_.size ())
+ Side_position_interface::add_support (p->line_spanner_, previous_.top ());
previous_.push (p->line_spanner_);
}
suicide?
*/
if (p->line_spanner_
- && !p->line_spanner_->live())
+ && !p->line_spanner_->live ())
p->line_spanner_ = 0;
if (p->line_spanner_)
typeset_all ();
}
if (p->bracket_
- && !p->bracket_->live())
+ && !p->bracket_->live ())
p->bracket_ = 0;
if (p->bracket_)
&& !p->finished_line_spanner_->live ())
p->finished_line_spanner_ = 0;
if (p->finished_bracket_
- && !p->finished_bracket_->live())
+ && !p->finished_bracket_->live ())
p->finished_bracket_ = 0;
};
public:
- TRANSLATOR_DECLARATIONS(Piano_pedal_performer);
+ TRANSLATOR_DECLARATIONS (Piano_pedal_performer);
~Piano_pedal_performer ();
protected:
class Pitch_squash_engraver : public Engraver {
public:
- TRANSLATOR_DECLARATIONS(Pitch_squash_engraver);
+ TRANSLATOR_DECLARATIONS (Pitch_squash_engraver);
virtual void acknowledge_grob (Grob_info);
};
-Pitch_squash_engraver::Pitch_squash_engraver()
+Pitch_squash_engraver::Pitch_squash_engraver ()
{
}
-ENTER_DESCRIPTION(Pitch_squash_engraver,
+ENTER_DESCRIPTION (Pitch_squash_engraver,
/* descr */
"Set the vertical position of noteheads to "
"@code{squashedPosition}, if that "
#include "context-def.hh"
#include "global-context.hh"
-bool check_grob(Music *mus, SCM sym);
+bool check_grob (Music *mus, SCM sym);
/**
There is no real processing to a property: just lookup the
Simple_music_iterator::process (m);
}
-MAKE_SCHEME_CALLBACK(Property_iterator,once_finalization, 2);
+MAKE_SCHEME_CALLBACK (Property_iterator,once_finalization, 2);
SCM
-Property_iterator::once_finalization(SCM translator, SCM music )
+Property_iterator::once_finalization (SCM translator, SCM music )
{
Music * m = unsmob_music (music);
Context * tg
{
if (to_boolean (get_music ()->get_property ("once")))
{
- SCM trans = get_outlet ()->self_scm();
- SCM music = get_music()->self_scm();
+ SCM trans = get_outlet ()->self_scm ();
+ SCM music = get_music ()->self_scm ();
Global_context * tg = get_outlet ()->get_global_context ();
tg->add_finalization (scm_list_n (once_finalization_proc,
property is a list.
*/
bool
-check_grob(Music *mus, SCM sym)
+check_grob (Music *mus, SCM sym)
{
if (!list_p)
{
if (!ok)
{
- mus->origin()->warning (_f("Not a grob name, `%s'." , ly_symbol2string (sym)));
+ mus->origin ()->warning (_f ("Not a grob name, `%s'." , ly_symbol2string (sym)));
}
return ok;
}
Simple_music_iterator::process (m);
}
-MAKE_SCHEME_CALLBACK(Push_property_iterator,once_finalization, 2);
+MAKE_SCHEME_CALLBACK (Push_property_iterator,once_finalization, 2);
SCM
Push_property_iterator::once_finalization (SCM trans, SCM music)
{
{
if (to_boolean (get_music ()->get_property ("once")))
{
- SCM trans = get_outlet ()->self_scm();
- SCM music = get_music ()->self_scm();
+ SCM trans = get_outlet ()->self_scm ();
+ SCM music = get_music ()->self_scm ();
Global_context * tg= get_outlet ()->get_global_context ();
tg->add_finalization (scm_list_n (once_finalization_proc,
SCM transposed_musics_;
- DECLARE_SCHEME_CALLBACK(constructor, ());
+ DECLARE_SCHEME_CALLBACK (constructor, ());
protected:
virtual void derived_mark ();
{
int cmp = (lo + hi) / 2;
- SCM when = gh_caar (SCM_VECTOR_REF(vec, cmp));
+ SCM when = gh_caar (SCM_VECTOR_REF (vec, cmp));
bool result = (*is_less) (key, when);
if (result)
hi = cmp;
bool b = get_outlet ()->try_music (mus);
if (!b)
- mus->origin ()->warning (_f ("In quotation: junking event %s", mus->name()));
+ mus->origin ()->warning (_f ("In quotation: junking event %s", mus->name ()));
}
else
programming_error ("need music in quote.");
{
void start ();
public:
- TRANSLATOR_DECLARATIONS(Recording_group_engraver);
+ TRANSLATOR_DECLARATIONS (Recording_group_engraver);
virtual bool try_music (Music *m);
virtual void start_translation_timestep ();
virtual void stop_translation_timestep ();
start ();
}
-Recording_group_engraver::Recording_group_engraver()
+Recording_group_engraver::Recording_group_engraver ()
{
}
void
Recording_group_engraver::start_translation_timestep ()
{
- Engraver_group_engraver::start_translation_timestep();
+ Engraver_group_engraver::start_translation_timestep ();
/*
- We have to do this both in initialize() and
- start_translation_timestep(), since start_translation_timestep()
+ We have to do this both in initialize () and
+ start_translation_timestep (), since start_translation_timestep ()
isn't called on the first time-step.
*/
start () ;
void
Recording_group_engraver::stop_translation_timestep ()
{
- Engraver_group_engraver::stop_translation_timestep();
+ Engraver_group_engraver::stop_translation_timestep ();
scm_set_cdr_x (accumulator_, gh_cons (gh_car (accumulator_), gh_cdr (accumulator_)));
scm_set_car_x (accumulator_, SCM_EOL);
SCM proc = get_property ("recordEventSequence");
if (gh_procedure_p (proc))
- scm_call_2 (proc, daddy_context_->self_scm(), gh_cdr (accumulator_));
+ scm_call_2 (proc, daddy_context_->self_scm (), gh_cdr (accumulator_));
accumulator_ = SCM_EOL;
}
bool retval = Translator_group::try_music (m);
SCM seq = gh_cdar (accumulator_);
- seq = gh_cons (gh_cons (m->self_scm(), gh_bool2scm (retval)),
+ seq = gh_cons (gh_cons (m->self_scm (), gh_bool2scm (retval)),
seq);
scm_set_cdr_x (gh_car (accumulator_), seq);
}
-ENTER_DESCRIPTION(Recording_group_engraver,
+ENTER_DESCRIPTION (Recording_group_engraver,
"Engraver_group_engraver that records all music events "
"for this context. Calls the procedure "
"in @code{recordEventSequence} when finished.",
{
Pitch no_octave (-1,
check_p->get_notename (),
- check_p->get_alteration());
+ check_p->get_alteration ());
Pitch result = no_octave.to_relative_octave (p);
p.get_notename (), p.get_alteration ());
}
-ADD_MUSIC(Relative_octave_check);
+ADD_MUSIC (Relative_octave_check);
class Repeat_acknowledge_engraver : public Engraver
{
public:
- TRANSLATOR_DECLARATIONS(Repeat_acknowledge_engraver);
+ TRANSLATOR_DECLARATIONS (Repeat_acknowledge_engraver);
virtual void start_translation_timestep ();
virtual void process_music ();
}
}
-ENTER_DESCRIPTION(Repeat_acknowledge_engraver,
+ENTER_DESCRIPTION (Repeat_acknowledge_engraver,
/* descr */ "Acknowledge repeated music, and convert the contents of "
"repeatCommands ainto an appropriate setting for whichBar.",
/* creats*/ "",
Music * body = unsmob_music (me->get_property ("element"));
if (body)
- return body->start_mom ().smobbed_copy();
+ return body->start_mom ().smobbed_copy ();
else
{
- return Music_sequence::minimum_start (me->get_property ("elements")).smobbed_copy();
+ return Music_sequence::minimum_start (me->get_property ("elements")).smobbed_copy ();
}
}
virtual void process_acknowledged_grobs ();
virtual void stop_translation_timestep ();
public:
- TRANSLATOR_DECLARATIONS(Rest_collision_engraver);
+ TRANSLATOR_DECLARATIONS (Rest_collision_engraver);
};
Rest_collision_engraver::Rest_collision_engraver ()
rest_collision_ = make_item ("RestCollision");
- announce_grob(rest_collision_, SCM_EOL);
+ announce_grob (rest_collision_, SCM_EOL);
for (int i=0; i < note_columns_.size (); i++)
Rest_collision::add_column (rest_collision_,note_columns_[i]);
}
rest_count_ = 0;
}
-ENTER_DESCRIPTION(Rest_collision_engraver,
+ENTER_DESCRIPTION (Rest_collision_engraver,
/* descr */ "Handles collisions of rests.",
/* creats*/ "RestCollision",
/* accepts */ "",
virtual void process_music ();
public:
- TRANSLATOR_DECLARATIONS(Rest_engraver);
+ TRANSLATOR_DECLARATIONS (Rest_engraver);
};
rest_->set_property ("staff-position", gh_int2scm (pos));
}
- announce_grob(rest_, rest_req_->self_scm());
+ announce_grob (rest_, rest_req_->self_scm ());
}
}
return false;
}
-ENTER_DESCRIPTION(Rest_engraver,
+ENTER_DESCRIPTION (Rest_engraver,
/* descr */ "",
/* creats*/ "Rest Dots",
/* accepts */ "rest-event",
int bt = gh_scm2int (me->get_property ("duration-log"));
int lc = Staff_symbol_referencer::line_count (me);
Real ss = Staff_symbol_referencer::staff_space (me);
- if(lc % 2)
+ if (lc % 2)
{
if (bt == 0 && lc > 1)
{
me->warning (_f ("rest `%s' not found, ", font_char.to_str0 ()));
}
- return out.smobbed_copy();
+ return out.smobbed_copy ();
}
SCM
Direction d = get_grob_direction (me);
Real off = 2* d ;
- if(off)
+ if (off)
off *= Staff_symbol_referencer::staff_space (me);
return gh_double2scm (off);
}
Grob * last_spacing_;
Grob * spacing_;
- TRANSLATOR_DECLARATIONS(Rhythmic_column_engraver);
+ TRANSLATOR_DECLARATIONS (Rhythmic_column_engraver);
protected:
virtual void acknowledge_grob (Grob_info);
if (!note_column_)
{
note_column_ = make_item ("NoteColumn");
- announce_grob(note_column_, rheads_[0]->self_scm ());
+ announce_grob (note_column_, rheads_[0]->self_scm ());
spacing_ = make_item ("NoteSpacing");
spacing_->set_property ("left-items", gh_cons (note_column_->self_scm (), SCM_EOL));
-ENTER_DESCRIPTION(Rhythmic_column_engraver,
+ENTER_DESCRIPTION (Rhythmic_column_engraver,
/* descr */ "Generates NoteColumn, an objects that groups stems, noteheads and rests.",
/* creats*/ "NoteColumn NoteSpacing",
/* accepts */ "",
{
int k = 0;
for (int i = SCM_VECTOR_LENGTH (src); i--;)
- for (SCM s = scm_vector_ref (src, SCM_MAKINUM (i)); ly_pair_p(s); s = ly_cdr (s))
+ for (SCM s = scm_vector_ref (src, SCM_MAKINUM (i)); ly_pair_p (s); s = ly_cdr (s))
{
scm_hashq_set_x (dest, ly_caar (s), ly_cdar (s));
k++;
{
assert (unsmob (s));
char str[1000];
- sprintf (str, "#<Scheme_hash_table 0x%0lx ", SCM_UNPACK(s));
+ sprintf (str, "#<Scheme_hash_table 0x%0lx ", SCM_UNPACK (s));
Scheme_hash_table *me = (Scheme_hash_table*) SCM_CELL_WORD_1 (s);
scm_display (me->hash_tab_, p);
scm_puts ("> ",p);
/*
42 will stick out like a sore thumb, hopefully.
*/
- return scm_hashq_ref (hash_tab_, k, SCM_MAKINUM(42));
+ return scm_hashq_ref (hash_tab_, k, SCM_MAKINUM (42));
}
void
{
SCM l = SCM_EOL;
for (int i = SCM_VECTOR_LENGTH (hash_tab_); i--;)
- for (SCM s = scm_vector_ref (hash_tab_, gh_int2scm (i)); ly_pair_p(s); s = ly_cdr (s))
+ for (SCM s = scm_vector_ref (hash_tab_, gh_int2scm (i)); ly_pair_p (s); s = ly_cdr (s))
{
l = scm_acons (ly_caar (s), ly_cdar (s), l);
}
}
else if (var == ly_symbol2scm ("parse-protect" ))
{
- parse_protect_global = to_boolean(val);
+ parse_protect_global = to_boolean (val);
}
else if (var == ly_symbol2scm ("internal-type-checking"))
{
{
Translator* t = unsmob_translator (implementation_);
Score_translator * s = dynamic_cast<Score_translator *> (t);
- s->one_time_step();
+ s->one_time_step ();
}
void
Score_engraver::initialize ()
{
- Font_metric *fm = all_fonts_global->find_afm("feta20");
+ Font_metric *fm = all_fonts_global->find_afm ("feta20");
if (!fm)
error (_f ("can't find `%s'", "feta20.afm")
+ "\n" +_ ("Fonts have not been installed properly. Aborting"));
/* don't warn for empty/suicided spanners,
it makes real warningsinvisible.
maybe should be junked earlier? */
- if (!elem->live())
+ if (!elem->live ())
; // gdb hook
else
elem->warning (_f ("unbound spanner `%s'", s->name ().to_str0 ()));
-ENTER_DESCRIPTION(Score_engraver,
+ENTER_DESCRIPTION (Score_engraver,
/* descr */ "Top level engraver. Takes care of generating columns and the complete system (ie. System) "
"\n\n "
"This engraver decides whether a column is breakable. The default is "
-ENTER_DESCRIPTION(Score_performer,
+ENTER_DESCRIPTION (Score_performer,
/* descr */ "",
/* creats*/ "",
/* accepts */ "",
-LY_DEFINE(ly_run_translator, "ly:run-translator",
+LY_DEFINE (ly_run_translator, "ly:run-translator",
2, 0, 0,
(SCM mus, SCM output_def),
"Process @var{mus} according to @var{output_def}. A interpretation "
}
trans->run_iterator_on_me (iter);
- iter->quit();
+ iter->quit ();
scm_remember_upto_here_1 (protected_iter);
trans->finish ();
}
-LY_DEFINE(ly_render_output, "ly:render-output",
+LY_DEFINE (ly_render_output, "ly:render-output",
3,0,0,
(SCM context, SCM header, SCM out_filename),
"Given a Score context in its final state, calculate the output, "
{
Global_context * gt = dynamic_cast<Global_context *> (unsmob_context (context));
- SCM_ASSERT_TYPE(gt, context, SCM_ARG1, __FUNCTION__,
+ SCM_ASSERT_TYPE (gt, context, SCM_ARG1, __FUNCTION__,
"Global context");
- SCM_ASSERT_TYPE(ly_module_p(header), header, SCM_ARG2, __FUNCTION__,
+ SCM_ASSERT_TYPE (ly_module_p (header), header, SCM_ARG2, __FUNCTION__,
"module");
- SCM_ASSERT_TYPE(gh_string_p (out_filename), out_filename, SCM_ARG3, __FUNCTION__,
+ SCM_ASSERT_TYPE (gh_string_p (out_filename), out_filename, SCM_ARG3, __FUNCTION__,
"output filename");
Music_output * output = gt->get_output ();
Link_array<Item> scripts_;
public:
- TRANSLATOR_DECLARATIONS(Script_column_engraver);
+ TRANSLATOR_DECLARATIONS (Script_column_engraver);
protected:
virtual void acknowledge_grob (Grob_info);
virtual void process_acknowledged_grobs ();
if (!scol_ && scripts_.size () > 1)
{
scol_ = make_item ("ScriptColumn");
- announce_grob(scol_, SCM_EOL);
+ announce_grob (scol_, SCM_EOL);
}
if (scol_)
}
-ENTER_DESCRIPTION(Script_column_engraver,
+ENTER_DESCRIPTION (Script_column_engraver,
/* descr */ "",
/* creats*/ "ScriptColumn",
/* accepts */ "",
{
Array<Script_tuple> scripts_;
public:
- TRANSLATOR_DECLARATIONS(Script_engraver);
+ TRANSLATOR_DECLARATIONS (Script_engraver);
protected:
virtual bool try_music (Music*);
virtual void stop_translation_timestep ();
p->set_property ("direction", force_dir);
if (p)
- announce_grob (p, l->self_scm());
+ announce_grob (p, l->self_scm ());
}
}
-Script_engraver::Script_engraver(){}
+Script_engraver::Script_engraver (){}
-ENTER_DESCRIPTION(Script_engraver,
+ENTER_DESCRIPTION (Script_engraver,
/* descr */ "Handles note scripted articulations.",
/* creats*/ "Script",
/* accepts */ "script-event articulation-event",
return;
- for(; gh_pair_p (next); next = ly_cdr (next))
+ for (; gh_pair_p (next); next = ly_cdr (next))
{
- Item *l = dynamic_cast<Item*> (unsmob_grob (ly_car( next)));
+ Item *l = dynamic_cast<Item*> (unsmob_grob (ly_car ( next)));
Item *lb = l->find_prebroken_piece (RIGHT);
if (lb)
}
void clear () {
staff_spacing_ = 0;
- note_spacings_.clear();
+ note_spacings_.clear ();
}
};
virtual void stop_translation_timestep ();
virtual void start_translation_timestep ();
public:
- TRANSLATOR_DECLARATIONS(Separating_line_group_engraver);
+ TRANSLATOR_DECLARATIONS (Separating_line_group_engraver);
};
Separating_line_group_engraver::Separating_line_group_engraver ()
{
sep_span_ = make_spanner ("SeparatingGroupSpanner");
- announce_grob(sep_span_, SCM_EOL);
+ announce_grob (sep_span_, SCM_EOL);
sep_span_->set_bound (LEFT, unsmob_grob (get_property ("currentCommandColumn")));
}
}
typeset_grob (sep_span_);
sep_span_ =0;
- for (int i= 0 ; i < last_spacings_.note_spacings_.size(); i++)
+ for (int i= 0 ; i < last_spacings_.note_spacings_.size (); i++)
{
Pointer_group_interface::add_grob (last_spacings_.note_spacings_[i],
ly_symbol2scm ("right-items" ),
column);
}
- if(last_spacings_.staff_spacing_
+ if (last_spacings_.staff_spacing_
&& last_spacings_.staff_spacing_->get_column () == column)
{
last_spacings_.staff_spacing_->suicide ();
return;
if (it->get_parent (X_AXIS)
&& it->get_parent (X_AXIS)
- ->has_extent_callback(Axis_group_interface::group_extent_callback_proc, X_AXIS))
+ ->has_extent_callback (Axis_group_interface::group_extent_callback_proc, X_AXIS))
return;
p_ref_->set_property ("breakable", SCM_BOOL_T);
daddy_context_->set_property ("breakableSeparationItem", p_ref_->self_scm ());
}
- announce_grob(p_ref_, SCM_EOL);
+ announce_grob (p_ref_, SCM_EOL);
if (p_ref_ == break_item_)
{
current_spacings_.staff_spacing_ = it;
it->set_property ("left-items", gh_cons (break_item_->self_scm (), SCM_EOL));
- announce_grob(it, SCM_EOL);
+ announce_grob (it, SCM_EOL);
if (int i = last_spacings_.note_spacings_.size ())
{
{
last_spacings_.staff_spacing_->set_property ("right-items",
- gh_cons (break_item_->self_scm(), SCM_EOL));
+ gh_cons (break_item_->self_scm (), SCM_EOL));
}
}
}
}
-ENTER_DESCRIPTION(Separating_line_group_engraver,
+ENTER_DESCRIPTION (Separating_line_group_engraver,
/* descr */ "Generates objects for computing spacing parameters.",
/* creats*/ "SeparationItem SeparatingGroupSpanner",
/* accepts */ "",
Sequential_iterator::do_quit ()
{
if (iter_)
- iter_->quit();
+ iter_->quit ();
}
Sequential_iterator::derived_mark ()const
{
if (iter_)
- scm_gc_mark (iter_->self_scm());
+ scm_gc_mark (iter_->self_scm ());
scm_gc_mark (list_);
scm_gc_mark (cursor_);
}
here.grace_part_ = s.grace_part_;
}
- if (l.to_bool())
+ if (l.to_bool ())
{
last = here;
here += l;
cursor_ = ly_cdr (cursor_);
- iter_->quit();
+ iter_->quit ();
if (gh_pair_p (cursor_))
iter_ = unsmob_iterator (get_iterator (unsmob_music (ly_car (cursor_))));
else
IMPLEMENT_CTOR_CALLBACK (Sequential_music_iterator);
SCM
-Sequential_music_iterator::get_music_list()const
+Sequential_music_iterator::get_music_list ()const
{
return dynamic_cast<Music_sequence const*> (get_music ())->music_list ();
}
void
Simple_spacer::add_columns (Link_array<Grob> const &icols)
{
- Link_array<Grob> cols(icols);
+ Link_array<Grob> cols (icols);
for (int i = cols.size (); i--;)
if (gh_pair_p (cols[i]->get_property ("between-cols")))
}
else
{
- programming_error (_f("No spring between column %d and next one",
+ programming_error (_f ("No spring between column %d and next one",
Paper_column::get_rank (cols[i])
));
desc.hooke_ = 1.0;
int sz = positions->cols_.size ();
for (int i = sz; i--; )
{
- SCM p = positions->cols_[i]->get_property( "penalty");
+ SCM p = positions->cols_[i]->get_property ( "penalty");
if (gh_number_p (p))
{
if (gh_scm2double (p) < -9999)
void
Simultaneous_music_iterator::derived_substitute (Context *f,Context *t)
{
- for (SCM s = children_list_; gh_pair_p (s); s = gh_cdr(s))
+ for (SCM s = children_list_; gh_pair_p (s); s = gh_cdr (s))
unsmob_iterator (gh_car (s))-> substitute_outlet (f,t);
}
}
else
{
- proc = SCM_CDRLOC(*proc);
+ proc = SCM_CDRLOC (*proc);
}
}
}
Moment next;
next.set_infinite (1);
- for (SCM s = children_list_; gh_pair_p (s); s = gh_cdr(s))
+ for (SCM s = children_list_; gh_pair_p (s); s = gh_cdr (s))
{
Music_iterator * it = unsmob_iterator (gh_car (s));
next = next <? it->pending_moment ();
Simultaneous_music_iterator::ok () const
{
bool run_always_ok = false;
- for (SCM s = children_list_; gh_pair_p (s); s = gh_cdr(s))
+ for (SCM s = children_list_; gh_pair_p (s); s = gh_cdr (s))
{
Music_iterator * it = unsmob_iterator (gh_car (s));
if (!it->run_always ())
bool
Simultaneous_music_iterator::run_always () const
{
- for (SCM s = children_list_; gh_pair_p (s); s = gh_cdr(s))
+ for (SCM s = children_list_; gh_pair_p (s); s = gh_cdr (s))
{
Music_iterator * it = unsmob_iterator (gh_car (s));
if (it->run_always ())
Simultaneous_music_iterator::try_music_in_children (Music *m) const
{
Music_iterator * b=0;
- for (SCM s = children_list_; !b && gh_pair_p (s); s = gh_cdr(s))
+ for (SCM s = children_list_; !b && gh_pair_p (s); s = gh_cdr (s))
b =unsmob_iterator (gh_car (s))->try_music (m);
return b;
}
void
Simultaneous_music_iterator::do_quit ()
{
- for (SCM s = children_list_; gh_pair_p (s); s = gh_cdr(s))
- unsmob_iterator (gh_car (s))->quit();
+ for (SCM s = children_list_; gh_pair_p (s); s = gh_cdr (s))
+ unsmob_iterator (gh_car (s))->quit ();
}
IMPLEMENT_CTOR_CALLBACK (Simultaneous_music_iterator);
return Music_sequence::minimum_start (get_property ("elements"));
}
-Simultaneous_music::Simultaneous_music()
+Simultaneous_music::Simultaneous_music ()
{
}
if (lily_1_8_relative)
lily_1_8_compatibility_used = true;
- return music_list_to_relative (music_list(), p, lily_1_8_relative);
+ return music_list_to_relative (music_list (), p, lily_1_8_relative);
}
ADD_MUSIC (Simultaneous_music);
return music_list_to_relative (music_list (), p, true);
}
-ADD_MUSIC(Event_chord);
+ADD_MUSIC (Event_chord);
skyline[...].width_ forms a partition of the real interval, where
the segments are adjacent, and ascending. Hence we have
- skyline.top().width_[RIGHT] = inf
+ skyline.top ().width_[RIGHT] = inf
skyline[0].width_[LEFT] = -inf
*/
/*
TODO: avoid unnecessary fragmentation.
- This is O(n^2), searching and insertion. Could be O(n log n) with
+ This is O (n^2), searching and insertion. Could be O (n log n) with
binsearch.
*/
void
/*
Intersect each segment of LINE with EXTENT, and if non-empty, insert relevant segments.
*/
- for (int i = line->size(); i--;)
+ for (int i = line->size (); i--;)
{
- Interval w = line->elem(i).width_;
+ Interval w = line->elem (i).width_;
w.intersect (extent);
if (extent[LEFT] >= w[RIGHT])
break;
- Real my_height = line->elem(i).height_;
+ Real my_height = line->elem (i).height_;
if (!w.is_empty () &&
- w.length() > EPS
+ w.length () > EPS
&& d* (my_height - stick_out) < 0)
{
- Interval e1 (line->elem(i).width_[LEFT], extent[LEFT]);
- Interval e3 (extent[RIGHT], line->elem(i).width_[RIGHT]);
+ Interval e1 (line->elem (i).width_[LEFT], extent[LEFT]);
+ Interval e3 (extent[RIGHT], line->elem (i).width_[RIGHT]);
- if (!e3.is_empty () && e3.length() > EPS)
+ if (!e3.is_empty () && e3.length () > EPS)
line->insert (Skyline_entry (e3, my_height), i+1);
- line->elem_ref(i).height_ = stick_out;
- line->elem_ref(i).width_ = w;
- if (!e1.is_empty () && e1.length() > EPS)
+ line->elem_ref (i).height_ = stick_out;
+ line->elem_ref (i).width_ = w;
+ if (!e1.is_empty () && e1.length () > EPS)
line->insert (Skyline_entry (e1, my_height), i );
}
Array<Skyline_entry> const & a2,
Direction dir)
{
- for (int i = 0; i < a2.size(); i++)
+ for (int i = 0; i < a2.size (); i++)
{
Box b;
b[X_AXIS] = a2[i].width_;
Array<Skyline_entry> skyline;
Interval i;
- i.set_empty();
- i.swap();
+ i.set_empty ();
+ i.swap ();
Skyline_entry e;
e.width_ = i;
e.height_ = -d * infinity_f;
extents_to_skyline (Array<Box> const &extents, Axis a, Direction d)
{
- Array<Skyline_entry> skyline = empty_skyline(d);
+ Array<Skyline_entry> skyline = empty_skyline (d);
/*
- This makes a cubic algorithm (array insertion is O(n),
- searching the array dumbly is O(n), and for n items, we get O(n^3).)
+ This makes a cubic algorithm (array insertion is O (n),
+ searching the array dumbly is O (n), and for n items, we get O (n^3).)
We could do a lot better (n log (n), using a balanced tree) but
that seems overkill for now.
*/
- for (int j = extents.size(); j--; )
+ for (int j = extents.size (); j--; )
insert_extent_into_skyline (&skyline, extents[j], a, d);
return skyline;
minimum distance that can be achieved between baselines. "Clouds" is
a skyline pointing down.
- This is an O(n) algorithm.
+ This is an O (n) algorithm.
*/
Real
skyline_meshing_distance (Array<Skyline_entry> const &buildings,
Array<Skyline_entry> const &clouds)
{
int i = buildings.size () -1;
- int j = clouds.size() -1;
+ int j = clouds.size () -1;
Real distance = - infinity_f;
while (i > 0 || j > 0)
{
Interval w = buildings[i].width_;
- w.intersect(clouds[j].width_);
+ w.intersect (clouds[j].width_);
if (!w.is_empty ())
distance = distance >? (buildings[i].height_ - clouds[j].height_);
return distance;
}
-Skyline_entry::Skyline_entry()
+Skyline_entry::Skyline_entry ()
{
height_ = 0.0;
}
class Slash_repeat_engraver : public Engraver
{
public:
- TRANSLATOR_DECLARATIONS(Slash_repeat_engraver);
+ TRANSLATOR_DECLARATIONS (Slash_repeat_engraver);
protected:
Repeated_music * repeat_;
if (repeat_ && now_mom () == next_moment_)
{
beat_slash_ = make_item ("RepeatSlash");
- announce_grob(beat_slash_, repeat_->self_scm());
+ announce_grob (beat_slash_, repeat_->self_scm ());
next_moment_ = next_moment_ + body_length_;
get_global_context ()->add_moment_to_process (next_moment_);
-ENTER_DESCRIPTION(Slash_repeat_engraver,
+ENTER_DESCRIPTION (Slash_repeat_engraver,
/* descr */ "Make beat repeats.",
/* creats*/ "RepeatSlash",
/* accepts */ "repeated-music",
/*
Swallow other events.
*/
- for (int j = new_slur_evs_.size(); j--;)
+ for (int j = new_slur_evs_.size (); j--;)
{
Direction nd = to_dir (new_slur_evs_[j]->get_property ("span-direction"));
class Slur_performer : public Performer {
public:
- TRANSLATOR_DECLARATIONS(Slur_performer);
+ TRANSLATOR_DECLARATIONS (Slur_performer);
protected:
virtual bool try_music (Music *ev) ;
return false;
}
-ENTER_DESCRIPTION(Slur_performer,"","",
+ENTER_DESCRIPTION (Slur_performer,"","",
"slur-event","","","");
-Slur_performer::Slur_performer()
+Slur_performer::Slur_performer ()
{
slur_ = false;
}
{
SCM cols = me->get_property ("note-columns");
- if(!gh_pair_p (cols))
+ if (!gh_pair_p (cols))
{
programming_error ("No note-columns in slur?");
me->suicide ();
}
if (dir == LEFT)
- cols = scm_reverse(cols);
+ cols = scm_reverse (cols);
Grob *col = unsmob_grob (ly_car (cols));
Grob *common[] =
SCM attach = me->get_property ("attachment");
if (!gh_pair_p (attach))
- attach = set_extremities(me);
+ attach = set_extremities (me);
if (!get_grob_direction (me)
name_ = filename;
istream_ = 0;
contents_str0_ = data.get_copy_str0();
- length_ = data.length();
+ length_ = data.length ();
pos_str0_ = to_str0 ();
- init_port();
+ init_port ();
}
Source_file::Source_file (String filename_string)
pos_str0_ = to_str0 ();
- init_port();
+ init_port ();
for (int i = 0; i < length_; i++)
if (contents_str0_[i] == '\n')
if (!contains (pos_str0))
return 0;
- if (!newline_locations_.size())
+ if (!newline_locations_.size ())
return 1;
int lo=0;
- int hi = newline_locations_.size();
+ int hi = newline_locations_.size ();
if (newline_locations_[lo] > pos_str0)
return 1;
Moment now_;
Spanner * spacing_;
- TRANSLATOR_DECLARATIONS(Spacing_engraver);
+ TRANSLATOR_DECLARATIONS (Spacing_engraver);
protected:
virtual void acknowledge_grob (Grob_info);
virtual void start_translation_timestep ();
{
spacing_ = make_spanner ("SpacingSpanner");
spacing_->set_bound (LEFT, unsmob_grob (get_property ("currentCommandColumn")));
- announce_grob(spacing_, SCM_EOL);
+ announce_grob (spacing_, SCM_EOL);
}
}
-ENTER_DESCRIPTION(Spacing_engraver,
+ENTER_DESCRIPTION (Spacing_engraver,
/* descr */ "make a SpacingSpanner and do bookkeeping of shortest starting and playing notes ",
/* creats*/ "SpacingSpanner",
/* accepts */ "",
some cases (two isolated, consecutive clef changes) won't be
nicely folded, but hey, then don't do that.
*/
- if(! ((Paper_column::is_musical (l_neighbor) || Item::is_breakable (l_neighbor))
+ if (! ((Paper_column::is_musical (l_neighbor) || Item::is_breakable (l_neighbor))
&& (Paper_column::is_musical (r_neighbor) || Item::is_breakable (r_neighbor))) )
{
return false;
Real increment = robust_scm2double (me->get_property ("spacing-increment"), 1.2);
for (int i=0; i < cols->size (); i++)
{
- if (Item::is_breakable (cols->elem(i)) || Paper_column::is_musical (cols->elem (i)))
+ if (Item::is_breakable (cols->elem (i)) || Paper_column::is_musical (cols->elem (i)))
{
- newcols.push (cols->elem(i));
+ newcols.push (cols->elem (i));
continue;
}
- Grob *c = cols->elem(i);
+ Grob *c = cols->elem (i);
if (loose_column (cols->elem (i-1), c, cols->elem (i+1)))
{
SCM lns = c->get_property ("left-neighbors");
next_door[LEFT] =cols->elem (i - 1);
next_door[RIGHT] =cols->elem (i + 1);
Direction d = LEFT;
- Drul_array<Real> dists(0,0);
+ Drul_array<Real> dists (0,0);
do
{
Rod r;
r.distance_ = dists[LEFT] + dists[RIGHT];
- r.item_l_drul_[LEFT] = dynamic_cast<Item*> (cols->elem(i-1));
+ r.item_l_drul_[LEFT] = dynamic_cast<Item*> (cols->elem (i-1));
r.item_l_drul_[RIGHT] = dynamic_cast<Item*> (cols->elem (i+1));
r.add_to_cols ();
void
Spacing_spanner::set_explicit_neighbor_columns (Link_array<Grob> cols)
{
- for (int i=0; i < cols.size(); i++)
+ for (int i=0; i < cols.size (); i++)
{
SCM right_neighbors = SCM_EOL;
int min_rank = 100000; // inf.
SCM ln = cols[i] ->get_property ("left-neighbors");
if (!gh_pair_p (ln) && i )
{
- cols[i]->set_property ("left-neighbors", gh_cons (cols[i-1]->self_scm(), SCM_EOL));
+ cols[i]->set_property ("left-neighbors", gh_cons (cols[i-1]->self_scm (), SCM_EOL));
}
SCM rn = cols[i] ->get_property ("right-neighbors");
if (!gh_pair_p (rn) && i < cols.size () - 1)
{
- cols[i]->set_property ("right-neighbors", gh_cons (cols[i + 1]->self_scm(), SCM_EOL));
+ cols[i]->set_property ("right-neighbors", gh_cons (cols[i + 1]->self_scm (), SCM_EOL));
}
}
}
global_shortest = find_shortest (me, all);
if (verbose_global_b)
{
- progress_indication (_f("Global shortest duration is %s\n", global_shortest.to_string ()));
+ progress_indication (_f ("Global shortest duration is %s\n", global_shortest.to_string ()));
}
}
prune_loose_columns (me, &all, global_shortest);
SCM st = cols[i]->get_property ("shortest-starter-duration");
Moment this_shortest = *unsmob_moment (st);
- assert (this_shortest.to_bool());
+ assert (this_shortest.to_bool ());
shortest_in_measure = shortest_in_measure <? this_shortest.main_part_;
}
else if (!shortest_in_measure.is_infinity ()
&& Item::is_breakable (cols[i]))
{
int j = 0;
- for (; j < durations.size(); j++)
+ for (; j < durations.size (); j++)
{
if (durations[j] > shortest_in_measure)
{
}
}
- if (durations.size() == j)
+ if (durations.size () == j)
{
durations.push (shortest_in_measure);
counts.push (1);
}
- shortest_in_measure.set_infinite(1);
+ shortest_in_measure.set_infinite (1);
}
}
int max_idx = -1;
int max_count = 0;
- for (int i =durations.size(); i--;)
+ for (int i =durations.size (); i--;)
{
if (counts[i] >= max_count)
{
{
*fixed = 0.0;
Direction d = LEFT;
- Drul_array<Item*> cols(l,r);
+ Drul_array<Item*> cols (l,r);
do
{
class Span_arpeggio_engraver : public Engraver
{
public:
- TRANSLATOR_DECLARATIONS(Span_arpeggio_engraver);
+ TRANSLATOR_DECLARATIONS (Span_arpeggio_engraver);
protected:
virtual void acknowledge_grob (Grob_info);
&& to_boolean (get_property ("connectArpeggios")))
{
span_arpeggio_ = make_item ("Arpeggio");
- announce_grob(span_arpeggio_, SCM_EOL);
+ announce_grob (span_arpeggio_, SCM_EOL);
}
}
-ENTER_DESCRIPTION(Span_arpeggio_engraver,
+ENTER_DESCRIPTION (Span_arpeggio_engraver,
/* descr */ "",
/* creats*/ "Arpeggio",
/* accepts */ "",
Link_array<Item> bars_;
public:
- TRANSLATOR_DECLARATIONS(Span_bar_engraver);
+ TRANSLATOR_DECLARATIONS (Span_bar_engraver);
protected:
virtual void acknowledge_grob (Grob_info);
virtual void stop_translation_timestep ();
-ENTER_DESCRIPTION(Span_bar_engraver,
+ENTER_DESCRIPTION (Span_bar_engraver,
/* descr */ "This engraver makes cross-staff barlines: It catches all normal "
"bar lines, and draws a single span-bar across them.",
/* creats*/ "SpanBar",
class Span_dynamic_performer : public Performer
{
public:
- TRANSLATOR_DECLARATIONS(Span_dynamic_performer);
+ TRANSLATOR_DECLARATIONS (Span_dynamic_performer);
protected:
virtual bool try_music (Music*);
}
}
broken_intos_.sort (Spanner::compare);
- for (int i= broken_intos_.size();i--;)
+ for (int i= broken_intos_.size ();i--;)
broken_intos_[i]->break_index_ = i;
}
return dynamic_cast<Spanner*> (unsmob_grob (s));
}
-ADD_INTERFACE(Spanner,
+ADD_INTERFACE (Spanner,
"spanner-interface",
"Some objects are horizontally spanned between objects. For\n"
"example, slur, beam, tie, etc. These grobs form a subtype called\n"
#include "warn.hh"
#include "ly-smobs.icc"
-Spring_smob::Spring_smob()
+Spring_smob::Spring_smob ()
{
distance_ =0.;
strength_ =1.0;
}
-IMPLEMENT_SIMPLE_SMOBS(Spring_smob);
+IMPLEMENT_SIMPLE_SMOBS (Spring_smob);
SCM
Spring_smob::mark_smob (SCM) { return SCM_UNSPECIFIED; }
Spring_smob::print_smob (SCM s, SCM p, scm_print_state *)
{
Spring_smob *ss = unsmob_spring (s);
- scm_puts (_f("#<spring smob d= %f>", ss->distance_).to_str0 (), p);
+ scm_puts (_f ("#<spring smob d= %f>", ss->distance_).to_str0 (), p);
return 1;
}
class Staff_collecting_engraver : public Engraver
{
public:
- TRANSLATOR_DECLARATIONS(Staff_collecting_engraver);
+ TRANSLATOR_DECLARATIONS (Staff_collecting_engraver);
virtual void acknowledge_grob (Grob_info);
};
}
-ENTER_DESCRIPTION(Staff_collecting_engraver,
+ENTER_DESCRIPTION (Staff_collecting_engraver,
/* descr */ "Maintain the stavesFound variable",
/* creats*/ "",
class Staff_performer : public Performer_group_performer
{
public:
- TRANSLATOR_DECLARATIONS(Staff_performer);
+ TRANSLATOR_DECLARATIONS (Staff_performer);
~Staff_performer ();
String new_instrument_string ();
Interval v;
if (Accidental_placement::has_interface (a))
{
- v = Accidental_placement::get_relevant_accidental_extent(a, col, me);
+ v = Accidental_placement::get_relevant_accidental_extent (a, col, me);
}
else
v = a->extent (col, X_AXIS);
Staff_spacing::bar_y_positions (Grob *bar_grob)
{
Interval bar_size;
- bar_size.set_empty();
+ bar_size.set_empty ();
if (Bar_line::has_interface (bar_grob))
{
SCM glyph = bar_grob->get_property ("glyph");
String glyph_string = gh_string_p (glyph) ? ly_scm2string (glyph) : "";
if (glyph_string.left_string (1) == "|" || glyph_string.left_string (1) == ".")
{
- SCM sz = Bar_line::get_staff_bar_size (bar_grob->self_scm());
+ SCM sz = Bar_line::get_staff_bar_size (bar_grob->self_scm ());
bar_size = Interval (-1,1);
bar_size *= robust_scm2double (sz, 1)
/ Staff_symbol_referencer::staff_space (bar_grob);
Item * me_item = dynamic_cast<Item*> (me);
for (SCM s = me->get_property ("left-items");
- gh_pair_p (s); s = gh_cdr(s))
+ gh_pair_p (s); s = gh_cdr (s))
{
- Grob * cand = unsmob_grob(gh_car (s));
+ Grob * cand = unsmob_grob (gh_car (s));
if (cand && Separation_item::has_interface (cand))
separation_item = cand ;
}
*fixed += distance / 2;
*space = *fixed + distance/2;
}
- else if (type == ly_symbol2scm("minimum-space"))
+ else if (type == ly_symbol2scm ("minimum-space"))
{
*space = last_ext[LEFT] + (last_ext.length () >? distance);
}
- else if (type == ly_symbol2scm("minimum-fixed-space"))
+ else if (type == ly_symbol2scm ("minimum-fixed-space"))
{
*space = last_ext[LEFT] + (last_ext.length () >? distance);
*fixed = *space;
*/
class Staff_symbol_engraver : public Engraver {
public:
- TRANSLATOR_DECLARATIONS(Staff_symbol_engraver);
+ TRANSLATOR_DECLARATIONS (Staff_symbol_engraver);
protected:
Spanner *span_;
span_->set_bound (LEFT, unsmob_grob (get_property ("currentCommandColumn")));
- announce_grob(span_, SCM_EOL);
+ announce_grob (span_, SCM_EOL);
}
}
-ENTER_DESCRIPTION(Staff_symbol_engraver,
+ENTER_DESCRIPTION (Staff_symbol_engraver,
/* descr */ "Create the constellation of five (default) "
"staff lines.",
/* creats*/ "StaffSymbol",
class Tab_staff_symbol_engraver : public Staff_symbol_engraver
{
public:
- TRANSLATOR_DECLARATIONS(Tab_staff_symbol_engraver);
+ TRANSLATOR_DECLARATIONS (Tab_staff_symbol_engraver);
protected:
virtual void process_music ();
};
Tab_staff_symbol_engraver::process_music ()
{
bool init = !span_;
- Staff_symbol_engraver::process_music();
+ Staff_symbol_engraver::process_music ();
if (init)
{
int k = scm_ilength (get_property ("stringTunings"));
}
}
-Tab_staff_symbol_engraver::Tab_staff_symbol_engraver()
+Tab_staff_symbol_engraver::Tab_staff_symbol_engraver ()
{
}
-ENTER_DESCRIPTION(Tab_staff_symbol_engraver,
+ENTER_DESCRIPTION (Tab_staff_symbol_engraver,
/* descr */ "Create a staff-symbol, but look at stringTunings for the number of lines."
"staff lines.",
/* creats*/ "StaffSymbol",
}
Real t = me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness"));
- t *= robust_scm2double ( me->get_property("thickness"), 1.0);
+ t *= robust_scm2double ( me->get_property ("thickness"), 1.0);
int l = Staff_symbol::line_count (me);
SCM lt_pair = me->get_property ("ledger-line-thickness");
Offset z = robust_scm2offset (lt_pair, Offset (1.0, 0.1));
- return z[X_AXIS] * get_line_thickness(me) + z[Y_AXIS]* staff_space (me);
+ return z[X_AXIS] * get_line_thickness (me) + z[Y_AXIS]* staff_space (me);
}
class Stanza_number_align_engraver : public Engraver
{
public:
- TRANSLATOR_DECLARATIONS(Stanza_number_align_engraver);
+ TRANSLATOR_DECLARATIONS (Stanza_number_align_engraver);
protected:
Link_array<Grob> lyrics_;
void
Stanza_number_align_engraver::stop_translation_timestep ()
{
- for (int i= lyrics_.size(); i--;)
+ for (int i= lyrics_.size (); i--;)
for (int j = stanza_numbers_.size (); j--;)
Side_position_interface::add_support (stanza_numbers_[j], lyrics_[i]);
}
-ENTER_DESCRIPTION(Stanza_number_align_engraver,
+ENTER_DESCRIPTION (Stanza_number_align_engraver,
"This engraver ensures that stanza numbers are neatly aligned. ",
"",
"",
*/
SCM last_stanza_;
public:
- TRANSLATOR_DECLARATIONS(Stanza_number_engraver);
+ TRANSLATOR_DECLARATIONS (Stanza_number_engraver);
virtual void process_music ();
virtual void stop_translation_timestep ();
virtual void acknowledge_grob (Grob_info);
}
-ENTER_DESCRIPTION(Stanza_number_engraver,
+ENTER_DESCRIPTION (Stanza_number_engraver,
/* descr */ "",
/* creats*/ "StanzaNumber",
/* accepts */ "",
*/
class Stem_engraver : public Engraver
{
- TRANSLATOR_DECLARATIONS(Stem_engraver);
+ TRANSLATOR_DECLARATIONS (Stem_engraver);
protected:
virtual void acknowledge_grob (Grob_info);
virtual void stop_translation_timestep ();
- (duration_log > 2 ? duration_log - 2 : 0);
if (tremolo_flags <= 0)
{
- tremolo_ev_->origin()->warning (_("tremolo duration is too long"));
+ tremolo_ev_->origin ()->warning (_("tremolo duration is too long"));
tremolo_flags = 0;
}
if (tremolo_flags)
{
tremolo_ = make_item ("StemTremolo");
- announce_grob(tremolo_, tremolo_ev_->self_scm());
+ announce_grob (tremolo_, tremolo_ev_->self_scm ());
/*
The number of tremolo flags is the number of flags of
/*
We announce the cause of the head as cause of the stem.
The stem needs a rhythmic structure to fit it into a beam. */
- announce_grob(stem_, i.music_cause ()->self_scm());
+ announce_grob (stem_, i.music_cause ()->self_scm ());
}
if (Stem::duration_log (stem_) != duration_log)
return false;
}
-ENTER_DESCRIPTION(Stem_engraver,
+ENTER_DESCRIPTION (Stem_engraver,
/* descr */ "Create stems and single-stem tremolos. It also works together with "
"the beam engraver for overriding beaming.",
/* creats*/ "Stem StemTremolo",
if (Stencil *m = unsmob_stencil (mol))
return ly_interval2scm (m->extent (a));
else
- return ly_interval2scm (Interval());
+ return ly_interval2scm (Interval ());
}
{
programming_error ("No tremolo flags?");
- me->suicide();
+ me->suicide ();
return Stencil ();
}
}
SCM l = index_get_cell (pair, d);
- for( int i = 0; i< beam_count; i++)
+ for (int i = 0; i< beam_count; i++)
{
l = gh_cons (gh_int2scm (i), l);
}
Crude hack: add extra space if tremolo flag is there.
We can't do this for the beam, since we get into a loop
- (Stem_tremolo::raw_stencil() looks at the beam.)
+ (Stem_tremolo::raw_stencil () looks at the beam.)
--hwn
*/
Real reverse_overlap =0.5;
heads[i]->translate_axis ((l-thick*reverse_overlap) * d, X_AXIS);
- if (is_invisible(me))
+ if (is_invisible (me))
heads[i]->translate_axis (-thick*(2 - reverse_overlap) * d , X_AXIS);
{
/* Urrgh! We have to detect wether this stem ends on a staff
line or between two staff lines. But we can not call
- stem_end_position(me) or get_default_stem_end_position(me),
+ stem_end_position (me) or get_default_stem_end_position (me),
since this encounters the flag and hence results in an
infinite recursion. However, in pure mensural notation,
there are no multiple note heads attached to a single stem,
if (Grob * f = first_head (me))
{
- Interval head_wid = Note_head::head_extent(f, X_AXIS);
+ Interval head_wid = Note_head::head_extent (f, X_AXIS);
Real attach =0.0;
attach = 0.0;
}
else
- attach = Note_head::stem_attachment_coordinate(f, X_AXIS);
+ attach = Note_head::stem_attachment_coordinate (f, X_AXIS);
Direction d = get_direction (me);
/****************************************************************/
-Stem_info::Stem_info()
+Stem_info::Stem_info ()
{
ideal_y_ = shortest_y_ =0;
dir_ = CENTER;
Stencil q (*s);
q.translate_axis (gh_scm2double (amount), Axis (gh_scm2int (axis)));
- return q.smobbed_copy();
+ return q.smobbed_copy ();
}
LY_DEFINE (ly_translate_stencil,"ly:stencil-translate",
Stencil q (*s);
q.translate (o);
- return q.smobbed_copy();
+ return q.smobbed_copy ();
}
LY_DEFINE (ly_stencil_get_expr, "ly:stencil-get-expr",
Real p = 0.0;
if (padding != SCM_UNDEFINED)
{
- SCM_ASSERT_TYPE(gh_number_p (padding), padding, SCM_ARG5, __FUNCTION__, "number");
+ SCM_ASSERT_TYPE (gh_number_p (padding), padding, SCM_ARG5, __FUNCTION__, "number");
p = gh_scm2double (padding);
}
Real m = 0.0;
if (minimum != SCM_UNDEFINED)
{
- SCM_ASSERT_TYPE(gh_number_p (minimum), minimum, SCM_ARG6, __FUNCTION__, "number");
+ SCM_ASSERT_TYPE (gh_number_p (minimum), minimum, SCM_ARG6, __FUNCTION__, "number");
m = gh_scm2double (minimum);
}
SCM_ASSERT_TYPE (is_number_pair (xext), xext, SCM_ARG2, __FUNCTION__, "number pair");
SCM_ASSERT_TYPE (is_number_pair (yext), yext, SCM_ARG3, __FUNCTION__, "number pair");
- Box b (ly_scm2interval (xext), ly_scm2interval(yext));
+ Box b (ly_scm2interval (xext), ly_scm2interval (yext));
Stencil s (b, expr);
return s.smobbed_copy ();
}
"Add a font selection command for the font metric @var{met} "
"to @var{f}.")
{
- SCM_ASSERT_TYPE(unsmob_metrics (met), met, SCM_ARG1, __FUNCTION__, "font metric");
+ SCM_ASSERT_TYPE (unsmob_metrics (met), met, SCM_ARG1, __FUNCTION__, "font metric");
return fontify_atom (unsmob_metrics (met), f);
}
class String_number_engraver : public Engraver
{
public:
- TRANSLATOR_DECLARATIONS(String_number_engraver);
+ TRANSLATOR_DECLARATIONS (String_number_engraver);
protected:
virtual bool try_music (Music* m);
};
*/
-ENTER_DESCRIPTION(String_number_engraver,
+ENTER_DESCRIPTION (String_number_engraver,
/* descr */ "Swallow string-number-events - the purpose of this engraver is to"
" process tab for normal notation. To provent warnings for unprocessed "
" string-number-event to obscure real error messages, this engraver "
class Swallow_engraver : public Engraver
{
public:
- TRANSLATOR_DECLARATIONS(Swallow_engraver);
+ TRANSLATOR_DECLARATIONS (Swallow_engraver);
protected:
bool try_music (Music*) ;
};
{
}
-ENTER_DESCRIPTION(Swallow_engraver,
+ENTER_DESCRIPTION (Swallow_engraver,
/* descr */ "This engraver swallows everything given to it silently. The purpose of "
"this is to prevent spurious \"event junked\" warnings.",
/* creats*/ "",
class Swallow_performer : public Performer
{
public:
- TRANSLATOR_DECLARATIONS(Swallow_performer);
+ TRANSLATOR_DECLARATIONS (Swallow_performer);
protected:
virtual bool try_music (Music*);
};
return true;
}
-Swallow_performer::Swallow_performer()
+Swallow_performer::Swallow_performer ()
{}
-ENTER_DESCRIPTION(Swallow_performer,
+ENTER_DESCRIPTION (Swallow_performer,
/* descr */ "",
/* creats*/ "",
/* accepts */ "general-music",
class System_start_delimiter_engraver : public Engraver
{
public:
- TRANSLATOR_DECLARATIONS(System_start_delimiter_engraver);
+ TRANSLATOR_DECLARATIONS (System_start_delimiter_engraver);
protected:
Spanner * delim_;
{
inf.grob_->translate_axis ( -0.8, X_AXIS); // ugh
inf.grob_->set_property ("arch-height",
- gh_double2scm (gh_scm2double(inf.grob_->get_property
+ gh_double2scm (gh_scm2double (inf.grob_->get_property
("arch-height"))+0.5));
}
}
}
}
-ENTER_DESCRIPTION(System_start_delimiter_engraver,
+ENTER_DESCRIPTION (System_start_delimiter_engraver,
/* descr */ "Creates a system start delimiter (ie. SystemStart@{Bar,Brace,Bracket@} spanner",
/* creats*/ "SystemStartBar SystemStartBrace SystemStartBracket",
/* accepts */ "",
while (hi - lo > 1);
Stencil m (fm->get_indexed_char_stencil (lo)); // ugh. ascii?
- b=m.extent_box();
+ b=m.extent_box ();
b[X_AXIS] = Interval (0,0);
- return Stencil (b, m.get_expr());
+ return Stencil (b, m.get_expr ());
}
for (SCM s = get_property ("all-elements");
gh_pair_p (s); s = ly_cdr (s))
{
- if (dynamic_cast<Spanner*> (unsmob_grob (gh_car(s))))
+ if (dynamic_cast<Spanner*> (unsmob_grob (gh_car (s))))
k++;
}
int len = scm_ilength (l);
SCM * arr = new SCM[len];
int k = 0;
- for (SCM s =l ; SCM_NNULLP (s); s = SCM_CDR(s))
- arr[k++] = SCM_CAR(s);
+ for (SCM s =l ; SCM_NNULLP (s); s = SCM_CDR (s))
+ arr[k++] = SCM_CAR (s);
assert (k == len);
qsort (arr, len, sizeof (SCM), &scm_default_compare);
if (i && arr[i] == arr[i-1])
continue;
- SCM_SETCAR(s, arr[i]);
+ SCM_SETCAR (s, arr[i]);
if (i < len - 1)
- s = SCM_CDR(s);
+ s = SCM_CDR (s);
}
- SCM_SETCDR(s, SCM_EOL);
+ SCM_SETCDR (s, SCM_EOL);
delete[] arr;
return l;
Item * it = dynamic_cast<Item*> (g);
if (it && Item::is_breakable (it))
{
- it->find_prebroken_piece (LEFT)->suicide();
- it->find_prebroken_piece (RIGHT)->suicide();
+ it->find_prebroken_piece (LEFT)->suicide ();
+ it->find_prebroken_piece (RIGHT)->suicide ();
}
g->suicide ();
}
Because the this->get_property (all-elements) contains items
in 3 versions, handle_broken_dependencies () will leave duplicated
items in all-elements. Strictly speaking this is harmless, but it
- leads to duplicated symbols in the output. uniquify_list() makes
+ leads to duplicated symbols in the output. uniquify_list () makes
sure that no duplicates are in the list.
*/
for (int i=0; i < broken_intos_.size (); i++)
*/
Grob * common = right->common_refpoint (left, X_AXIS);
- Real rx = right->extent(common, X_AXIS)[LEFT];
- Real lx = left->extent(common, X_AXIS)[RIGHT];
+ Real rx = right->extent (common, X_AXIS)[LEFT];
+ Real lx = left->extent (common, X_AXIS)[RIGHT];
Real total_dx = rx - lx;
Interval cval =col->extent (col, X_AXIS);
This might seem inefficient, but Stencils are cached per grob
anyway.
*/
- this->get_stencil();
+ this->get_stencil ();
for (SCM s = all; gh_pair_p (s); s = ly_cdr (s))
{
Grob * g = unsmob_grob (ly_car (s));
/* Output elements in three layers, 0, 1, 2.
The default layer is 1. */
{
- Stencil *m = this->get_stencil();
+ Stencil *m = this->get_stencil ();
if (m)
- output_stencil (m->get_expr (), Offset(0,0));
+ output_stencil (m->get_expr (), Offset (0,0));
}
for (int i = 0; i < 3; i++)
Link_array<Music> note_events_;
Link_array<Music> tabstring_events_;
public:
- TRANSLATOR_DECLARATIONS(Tab_note_heads_engraver);
+ TRANSLATOR_DECLARATIONS (Tab_note_heads_engraver);
protected:
virtual bool try_music (Music *event) ;
};
-Tab_note_heads_engraver::Tab_note_heads_engraver()
+Tab_note_heads_engraver::Tab_note_heads_engraver ()
{
}
for (int i=0; i < note_events_.size (); i++)
{
SCM stringTunings = get_property ("stringTunings");
- int number_of_strings = ((int) gh_length(stringTunings));
- bool high_string_one = to_boolean(get_property ("highStringOne"));
+ int number_of_strings = ((int) gh_length (stringTunings));
+ bool high_string_one = to_boolean (get_property ("highStringOne"));
Item * note = make_item ("TabNoteHead");
if (!tabstring_event && j < tabstring_events_.size ())
{
tabstring_event = tabstring_events_[j];
- if (j +1 < tabstring_events_.size())
+ if (j +1 < tabstring_events_.size ())
j++;
}
bool string_found;
if (tabstring_event)
{
- tab_string = gh_scm2int(tabstring_event->get_property ("string-number"));
+ tab_string = gh_scm2int (tabstring_event->get_property ("string-number"));
string_found = true;
}
else
SCM scm_pitch = event->get_property ("pitch");
SCM proc = get_property ("tablatureFormat");
SCM min_fret_scm = get_property ("minimumFret");
- int min_fret = gh_number_p(min_fret_scm) ? gh_scm2int(min_fret_scm) : 0;
+ int min_fret = gh_number_p (min_fret_scm) ? gh_scm2int (min_fret_scm) : 0;
- while(!string_found)
+ while (!string_found)
{
- int fret = unsmob_pitch(scm_pitch)->semitone_pitch()
- - gh_scm2int(gh_list_ref(stringTunings,gh_int2scm(tab_string-1)));
- if(fret<min_fret)
+ int fret = unsmob_pitch (scm_pitch)->semitone_pitch ()
+ - gh_scm2int (gh_list_ref (stringTunings,gh_int2scm (tab_string-1)));
+ if (fret<min_fret)
tab_string += high_string_one ? 1 : -1;
else
string_found = true;
SCM text = gh_call3 (proc, gh_int2scm (tab_string), stringTunings, scm_pitch);
int pos = 2 * tab_string - number_of_strings - 1; // No tab-note between the string !!!
- if(to_boolean(get_property("stringOneTopmost")))
+ if (to_boolean (get_property ("stringOneTopmost")))
pos = -pos;
note->set_property ("text", text);
note->set_property ("staff-position", gh_int2scm (pos));
- announce_grob (note, event->self_scm());
+ announce_grob (note, event->self_scm ());
notes_.push (note);
}
}
}
-ENTER_DESCRIPTION(Tab_note_heads_engraver,
+ENTER_DESCRIPTION (Tab_note_heads_engraver,
/* descr */ "Generate one or more tablature noteheads from Music of type NoteEvent.",
/* creats*/ "TabNoteHead Dots",
/* accepts */ "note-event string-number-event busy-playing-event",
class Tempo_performer : public Performer
{
public:
- TRANSLATOR_DECLARATIONS(Tempo_performer);
+ TRANSLATOR_DECLARATIONS (Tempo_performer);
~Tempo_performer ();
protected:
Link_array<Music> reqs_;
Link_array<Item> texts_;
public:
- TRANSLATOR_DECLARATIONS(Text_engraver);
+ TRANSLATOR_DECLARATIONS (Text_engraver);
protected:
virtual bool try_music (Music* m);
virtual void stop_translation_timestep ();
{
}
-ENTER_DESCRIPTION(Text_engraver,
+ENTER_DESCRIPTION (Text_engraver,
/* descr */ "Create text-scripts",
/* creats*/ "TextScript",
/* accepts */ "text-script-event",
return SCM_EOL;
}
-MAKE_SCHEME_CALLBACK(Text_item,print,1);
+MAKE_SCHEME_CALLBACK (Text_item,print,1);
SCM
Text_item::print (SCM grob)
{
class Text_spanner_engraver : public Engraver
{
public:
- TRANSLATOR_DECLARATIONS(Text_spanner_engraver);
+ TRANSLATOR_DECLARATIONS (Text_spanner_engraver);
protected:
virtual void finalize ();
virtual void acknowledge_grob (Grob_info);
{
if (current_req_)
{
- req_drul_[START]->origin ()->warning(_ ("already have a text spanner"));
+ req_drul_[START]->origin ()->warning (_ ("already have a text spanner"));
}
else
{
Side_position_interface::set_axis (span_, Y_AXIS);
- announce_grob (span_, req_drul_[START]->self_scm());
+ announce_grob (span_, req_drul_[START]->self_scm ());
req_drul_[START] = 0;
}
}
}
}
-ENTER_DESCRIPTION(Text_spanner_engraver,
+ENTER_DESCRIPTION (Text_spanner_engraver,
/* descr */ "Create text spanner from a Music.",
/* creats*/ "TextSpanner",
/* accepts */ "text-span-event",
/* Ugh, must be same as Hairpin::print. */
Grob *common = spanner->get_bound (LEFT)->common_refpoint (spanner->get_bound (RIGHT), X_AXIS);
- Paper_def * paper = me->get_paper();
+ Paper_def * paper = me->get_paper ();
SCM flare = me->get_property ("bracket-flare");
SCM shorten = me->get_property ("shorten-pair");
Real dy = - dir * edge_height[d] ;
if (dy)
- edge_line[d] = Line_spanner::line_stencil (me, Offset(0,0), Offset (dx, dy));
+ edge_line[d] = Line_spanner::line_stencil (me, Offset (0,0), Offset (dx, dy));
}
while (flip (&d) != LEFT);
}
while (flip (&d) != LEFT);
do
{
- if (d* span_points[d] > d * edge[-d].extent(X_AXIS)[d])
+ if (d* span_points[d] > d * edge[-d].extent (X_AXIS)[d])
{
edge_line[d].translate_axis (span_points[d], X_AXIS);
m.add_stencil (edge_line[d]);
virtual void process_music ();
void typeset_tie (Grob*);
public:
- TRANSLATOR_DECLARATIONS(Tie_engraver);
+ TRANSLATOR_DECLARATIONS (Tie_engraver);
};
Tie::set_head (p, RIGHT, h);
ties_.push (p);
- announce_grob(p, last_event_->self_scm());
+ announce_grob (p, last_event_->self_scm ());
}
}
if (ties_.size () && ! tie_column_)
{
tie_column_ = make_spanner ("TieColumn");
- announce_grob(tie_column_, SCM_EOL);
+ announce_grob (tie_column_, SCM_EOL);
}
if (tie_column_)
typeset_tie (ties_[i]);
}
- ties_.clear();
+ ties_.clear ();
last_event_ = 0;
if (tie_column_)
{
}
-ENTER_DESCRIPTION(Tie_engraver,
+ENTER_DESCRIPTION (Tie_engraver,
/* descr */ "Generate ties between noteheads of equal pitch.",
/* creats*/ "Tie TieColumn",
/* accepts */ "tie-event",
virtual bool try_music (Music*);
virtual void process_music ();
public:
- TRANSLATOR_DECLARATIONS(Tie_performer);
+ TRANSLATOR_DECLARATIONS (Tie_performer);
};
now_heads_.clear ();
}
-ENTER_DESCRIPTION(Tie_performer,
+ENTER_DESCRIPTION (Tie_performer,
/* descr */ "Generate ties between noteheads of equal pitch.",
/* creats*/ "",
/* accepts */ "tie-event",
if (Note_head::has_interface (l) && Rhythmic_head::get_dots (l))
{
Grob* dots = Rhythmic_head::get_dots (l);
- if(fabs (staff_space * Staff_symbol_referencer::get_position (dots) /2
+ if (fabs (staff_space * Staff_symbol_referencer::get_position (dots) /2
- ypos) < 0.5)
{
ypos += 0.5 * dir ;
virtual void stop_translation_timestep ();
virtual void process_music ();
public:
- TRANSLATOR_DECLARATIONS(Time_signature_engraver);
+ TRANSLATOR_DECLARATIONS (Time_signature_engraver);
};
OTOH, Tristan Keuris writes 8/20 in his Intermezzi.
*/
- warning (_f("Found strange time signature %d/%d.",
+ warning (_f ("Found strange time signature %d/%d.",
den,
gh_scm2int (gh_car (fr))
));
time_signature_->set_property ("fraction",fr);
if (time_signature_)
- announce_grob(time_signature_, SCM_EOL);
+ announce_grob (time_signature_, SCM_EOL);
}
}
}
-ENTER_DESCRIPTION(Time_signature_engraver,
+ENTER_DESCRIPTION (Time_signature_engraver,
/* descr */ "Create a TimeSignature whenever @code{timeSignatureFraction} changes",
/* creats*/ "TimeSignature",
/* accepts */ "",
class Time_signature_performer : public Performer
{
public:
- TRANSLATOR_DECLARATIONS(Time_signature_performer);
+ TRANSLATOR_DECLARATIONS (Time_signature_performer);
~Time_signature_performer ();
protected:
}
}
-ENTER_DESCRIPTION(Time_signature_performer,"","","","","","");
+ENTER_DESCRIPTION (Time_signature_performer,"","","","","","");
me->set_property ("font-family", ly_symbol2scm ("number"));
SCM sn =
- Text_item::interpret_markup (me->get_paper ()->self_scm(), chain,
+ Text_item::interpret_markup (me->get_paper ()->self_scm (), chain,
scm_makfrom0str (to_string (num).to_str0 ()));
SCM sd =
- Text_item::interpret_markup (me->get_paper ()->self_scm(), chain,
+ Text_item::interpret_markup (me->get_paper ()->self_scm (), chain,
scm_makfrom0str (to_string (den).to_str0 ()));
Stencil n = *unsmob_stencil (sn);
daddy_context_->set_property ("measurePosition", measposp.smobbed_copy ());
}
-ENTER_DESCRIPTION(Timing_translator,"","","","","","");
+ENTER_DESCRIPTION (Timing_translator,"","","","","","");
Scheme_hash_table *global_translator_dict=0;
-LY_DEFINE(get_all_translators,"ly:get-all-translators", 0, 0, 0, (),
+LY_DEFINE (get_all_translators,"ly:get-all-translators", 0, 0, 0, (),
"Return an list of a all translator objects that may be instantiated "
" during a lilypond run.")
{
translator_accepts_any_of (Translator*tr, SCM ifaces)
{
SCM ack_ifs = scm_assoc (ly_symbol2scm ("events-accepted"),
- tr->translator_description());
+ tr->translator_description ());
ack_ifs = gh_cdr (ack_ifs);
for (SCM s = ifaces; ly_pair_p (s); s = ly_cdr (s))
if (scm_memq (ly_car (s), ack_ifs) != SCM_BOOL_F)
/*
this function has 2 properties
- - It is called before try_music()
+ - It is called before try_music ()
- It is called before any user information enters the translators.
(i.e. any \property or event is not processed yet.)
IMPLEMENT_SMOBS (Translator);
IMPLEMENT_DEFAULT_EQUAL_P (Translator);
-IMPLEMENT_TYPE_P(Translator,"ly:translator?");
+IMPLEMENT_TYPE_P (Translator,"ly:translator?");
ugh: code dup.
*/
Grob *s1 = Note_column::get_stem (cols[0]);
- Grob *s2 = Note_column::get_stem (cols.top());
+ Grob *s2 = Note_column::get_stem (cols.top ());
Grob*b1 = s1 ? Stem::get_beam (s1) : 0;
Grob*b2 = s2 ? Stem::get_beam (s2) : 0;
Link_array<Grob> beam_stems = Pointer_group_interface__extract_grobs
(b1, (Grob*)0, "stems");
- if (beam_stems.size() == 0)
+ if (beam_stems.size () == 0)
{
programming_error ("Beam under tuplet bracket has no stems!");
*equally_long = 0;
return 0;
}
- *equally_long = (beam_stems[0] == s1 && beam_stems.top() == s2);
+ *equally_long = (beam_stems[0] == s1 && beam_stems.top () == s2);
return b1;
}
Tuplet brackets are normally not broken, but we shouldn't crash if
they are.
*/
- commonx = commonx->common_refpoint (sp->get_bound(LEFT), X_AXIS);
- commonx = commonx->common_refpoint (sp->get_bound(RIGHT), X_AXIS);
+ commonx = commonx->common_refpoint (sp->get_bound (LEFT), X_AXIS);
+ commonx = commonx->common_refpoint (sp->get_bound (RIGHT), X_AXIS);
Direction dir = get_grob_direction (me);
Grob * lgr = get_x_bound_grob (columns[0], dir);
- Grob * rgr = get_x_bound_grob (columns.top(), dir);
+ Grob * rgr = get_x_bound_grob (columns.top (), dir);
Real x0 = lgr->extent (commonx,X_AXIS)[LEFT];
Real x1 = rgr->extent (commonx,X_AXIS)[RIGHT];
Drul_array<Real> flare,
Drul_array<Real> shorten)
{
- Drul_array<Offset> corners (Offset(0,0), dz);
+ Drul_array<Offset> corners (Offset (0,0), dz);
Real length = dz.length ();
Drul_array<Offset> gap_corners;
Grob * lgr = get_x_bound_grob (columns[0], dir);
- Grob * rgr = get_x_bound_grob (columns.top(), dir);
+ Grob * rgr = get_x_bound_grob (columns.top (), dir);
Real x0 = lgr->extent (commonx,X_AXIS)[LEFT];
Real x1 = rgr->extent (commonx,X_AXIS)[RIGHT];
Pointer_group_interface__extract_grobs (me, (Grob*)0, "note-columns");
- for (int i = columns.size(); i--;)
+ for (int i = columns.size (); i--;)
{
Grob * s =Note_column::get_stem (columns[i]);
Grob * b = s ? Stem::get_beam (s): 0;
if (dynamic_cast<Spanner*> (me)->is_broken ())
{
me->warning (_("Killing tuplet bracket across linebreak."));
- me->suicide();
+ me->suicide ();
return SCM_UNSPECIFIED;
}
Direction
Tuplet_bracket::get_default_dir (Grob*me)
{
- Drul_array<int> dirs(0,0);
+ Drul_array<int> dirs (0,0);
for (SCM s = me->get_property ("note-columns"); gh_pair_p (s); s = ly_cdr (s))
{
Grob * nc = unsmob_grob (ly_car (s));
class Tuplet_engraver : public Engraver
{
public:
- TRANSLATOR_DECLARATIONS(Tuplet_engraver);
+ TRANSLATOR_DECLARATIONS (Tuplet_engraver);
protected:
Link_array<Music> time_scaled_musics_;
glep->set_property ("text", t);
}
- announce_grob(glep, time_scaled_musics_ [i]->self_scm());
+ announce_grob (glep, time_scaled_musics_ [i]->self_scm ());
}
}
-Tuplet_engraver::Tuplet_engraver(){}
+Tuplet_engraver::Tuplet_engraver (){}
-ENTER_DESCRIPTION(Tuplet_engraver,
+ENTER_DESCRIPTION (Tuplet_engraver,
/* descr */ "Catch Time_scaled_music and generate appropriate bracket ",
/* creats*/ "TupletBracket",
/* accepts */ "time-scaled-music",
virtual bool try_music (Music*) { return true; }
public:
- TRANSLATOR_DECLARATIONS(Skip_event_swallow_translator);
+ TRANSLATOR_DECLARATIONS (Skip_event_swallow_translator);
};
virtual bool try_music (Music*) { return true; }
public:
- TRANSLATOR_DECLARATIONS(Rest_swallow_translator);
+ TRANSLATOR_DECLARATIONS (Rest_swallow_translator);
};
-Skip_event_swallow_translator::Skip_event_swallow_translator(){}
+Skip_event_swallow_translator::Skip_event_swallow_translator (){}
-ENTER_DESCRIPTION(Skip_event_swallow_translator,
+ENTER_DESCRIPTION (Skip_event_swallow_translator,
"Swallow \\skip.",
"",
"skip-event",
"");
-Rest_swallow_translator::Rest_swallow_translator(){}
+Rest_swallow_translator::Rest_swallow_translator (){}
-ENTER_DESCRIPTION(Rest_swallow_translator,
+ENTER_DESCRIPTION (Rest_swallow_translator,
"Swallow rest",
"",
"rest-event",
virtual bool try_music (Music*) { return true; }
public:
- TRANSLATOR_DECLARATIONS(Note_swallow_translator);
+ TRANSLATOR_DECLARATIONS (Note_swallow_translator);
};
-Note_swallow_translator::Note_swallow_translator(){}
+Note_swallow_translator::Note_swallow_translator (){}
-ENTER_DESCRIPTION(Note_swallow_translator,
+ENTER_DESCRIPTION (Note_swallow_translator,
"Swallow notes",
"",
"note-event",
return p;
}
-ADD_MUSIC(Un_relativable_music);
+ADD_MUSIC (Un_relativable_music);
class Unfolded_repeat_iterator : public Sequential_iterator
{
public:
- DECLARE_SCHEME_CALLBACK(constructor, ());
+ DECLARE_SCHEME_CALLBACK (constructor, ());
protected:
virtual SCM get_music_list () const;
};
class Volta_repeat_iterator : public Sequential_iterator
{
public:
- DECLARE_SCHEME_CALLBACK(constructor, ());
- Volta_repeat_iterator();
+ DECLARE_SCHEME_CALLBACK (constructor, ());
+ Volta_repeat_iterator ();
void add_repeat_command (SCM);
protected:
virtual SCM get_music_list () const;
virtual void next_element (bool);
- virtual void construct_children();
+ virtual void construct_children ();
virtual void process (Moment);
bool first_time_;
};
-Volta_repeat_iterator::Volta_repeat_iterator()
+Volta_repeat_iterator::Volta_repeat_iterator ()
{
done_count_ = alt_count_ = rep_count_= 0;
first_time_ = true;
}
SCM
-Volta_repeat_iterator::get_music_list()const
+Volta_repeat_iterator::get_music_list ()const
{
return gh_cons (get_music ()->get_property ("element"),
get_music ()->get_property ("elements"));
void
Volta_repeat_iterator::construct_children ()
{
- Sequential_iterator::construct_children();
+ Sequential_iterator::construct_children ();
SCM alts = get_music ()->get_property ("elements");
add_repeat_command (ly_symbol2scm ("start-repeat"));
first_time_ = false;
}
- Sequential_iterator::process(m);
+ Sequential_iterator::process (m);
}
-IMPLEMENT_CTOR_CALLBACK(Volta_repeat_iterator);
-IMPLEMENT_CTOR_CALLBACK(Unfolded_repeat_iterator);
+IMPLEMENT_CTOR_CALLBACK (Volta_repeat_iterator);
+IMPLEMENT_CTOR_CALLBACK (Unfolded_repeat_iterator);
return p;
}
-ADD_MUSIC(Untransposable_music);
+ADD_MUSIC (Untransposable_music);
-Untransposable_music::Untransposable_music()
+Untransposable_music::Untransposable_music ()
{
}
Real thickness);
public:
- TRANSLATOR_DECLARATIONS(Vaticana_ligature_engraver);
+ TRANSLATOR_DECLARATIONS (Vaticana_ligature_engraver);
protected:
virtual Spanner *create_ligature_spanner ();
else
{
prev_primitive->set_property ("add-join",
- gh_bool2scm(true));
+ gh_bool2scm (true));
/*
* Create a small overlap of adjacent heads so that the join
if (prefix_set & ~PES_OR_FLEXA)
{
String prefs = Gregorian_ligature::prefixes_to_str (primitive);
- primitive->warning (_f ("ignored prefix(es) `%s' of this head according "
+ primitive->warning (_f ("ignored prefix (es) `%s' of this head according "
"to restrictions of the selected ligature style",
prefs.to_str0 ()));
}
int prev_context_info = 0;
int prev_delta_pitch = 0;
String prev_glyph_name = "";
- for (int i = 0; i < primitives.size(); i++) {
+ for (int i = 0; i < primitives.size (); i++) {
Item *primitive = dynamic_cast<Item*> (primitives[i].grob_);
int delta_pitch;
if (prefix_set & VIRGA)
{
glyph_name = "vaticana_punctum";
- primitive->set_property ("add-stem", gh_bool2scm(true));
+ primitive->set_property ("add-stem", gh_bool2scm (true));
}
else if (prefix_set & QUILISMA)
glyph_name = "vaticana_quilisma";
* placed somewhere else.
*/
prev_primitive->set_property ("add-cauda",
- gh_bool2scm(false));
+ gh_bool2scm (false));
}
glyph_name = "vaticana_reverse_plica";
}
*/
if ((context_info & FLEXA_LEFT) && !(context_info & PES_UPPER))
if (!String::compare (glyph_name, "vaticana_punctum"))
- primitive->set_property ("add-cauda", gh_bool2scm(true));
+ primitive->set_property ("add-cauda", gh_bool2scm (true));
/*
* Execptional rule for porrectus:
align_heads (primitives, flexa_width, thickness);
#if 0 // experimental code to collapse spacing after ligature
- /* TODO: set to max(old/new spacing-increment), since other
+ /* TODO: set to max (old/new spacing-increment), since other
voices/staves also may want to set this property. */
Item *first_primitive = dynamic_cast<Item*> (primitives[0].grob_);
- Paper_column *paper_column = first_primitive->get_column();
+ Paper_column *paper_column = first_primitive->get_column ();
paper_column->warning (_f ("Vaticana_ligature_engraver: "
"setting `spacing-increment = %f': ptr=%ul",
ligature_width, paper_column));
paper_column->
- set_property("forced-spacing", gh_double2scm (ligature_width));
+ set_property ("forced-spacing", gh_double2scm (ligature_width));
#endif
}
*/
Real left_height =
right_height +
- min (0.12 * abs(interval), 0.3) * staff_space;
+ min (0.12 * abs (interval), 0.3) * staff_space;
/*
* Compensate optical illusion regarding vertical position of left
* and right endings due to curved shape.
*/
- Real ypos_correction = -0.1*staff_space * sign(interval);
- Real interval_correction = 0.2*staff_space * sign(interval);
+ Real ypos_correction = -0.1*staff_space * sign (interval);
+ Real interval_correction = 0.2*staff_space * sign (interval);
Real corrected_interval = interval*staff_space + interval_correction;
/*
inner_top_curve.translate (Offset (0.0, -line_thickness));
Stencil top_edge =
Lookup::bezier_sandwich (top_curve, inner_top_curve);
- stencil.add_stencil(top_edge);
+ stencil.add_stencil (top_edge);
Bezier inner_bottom_curve = bottom_curve;
inner_bottom_curve.translate (Offset (0.0, +line_thickness));
Stencil bottom_edge =
Lookup::bezier_sandwich (bottom_curve, inner_bottom_curve);
- stencil.add_stencil(bottom_edge);
+ stencil.add_stencil (bottom_edge);
/*
* TODO: Use horizontal slope with proper slope value rather
Box left_edge_box (Interval (0, line_thickness),
Interval (-0.5*left_height, +0.5*left_height));
Stencil left_edge = Lookup::filled_box (left_edge_box);
- stencil.add_stencil(left_edge);
+ stencil.add_stencil (left_edge);
Box right_edge_box (Interval (-line_thickness, 0),
Interval (-0.5*right_height, +0.5*right_height));
Stencil right_edge = Lookup::filled_box (right_edge_box);
right_edge.translate_axis (width, X_AXIS);
right_edge.translate_axis (corrected_interval / 2.0, Y_AXIS);
- stencil.add_stencil(right_edge);
+ stencil.add_stencil (right_edge);
}
stencil.translate_axis (ypos_correction, Y_AXIS);
return stencil;
out.add_stencil (join);
}
- vaticana_add_ledger_lines(me, &out, pos, 0, ledger_take_space);
+ vaticana_add_ledger_lines (me, &out, pos, 0, ledger_take_space);
if (!String::compare (glyph_name, "flexa"))
{
pos += flexa_height;
- vaticana_add_ledger_lines(me, &out, pos, 0.5*flexa_height,
+ vaticana_add_ledger_lines (me, &out, pos, 0.5*flexa_height,
ledger_take_space);
}
Spanner * valign_;
bool qualifies (Grob_info) const;
public:
- TRANSLATOR_DECLARATIONS(Vertical_align_engraver);
+ TRANSLATOR_DECLARATIONS (Vertical_align_engraver);
protected:
virtual void acknowledge_grob (Grob_info);
virtual void process_music ();
}
-ENTER_DESCRIPTION(Vertical_align_engraver,
+ENTER_DESCRIPTION (Vertical_align_engraver,
/* descr */ "Catch Vertical axis groups and stack them.",
/* creats*/ "VerticalAlignment",
/* accepts */ "",
SCM nm = gh_car (s);
Font_metric *fm = def->find_font (nm, mag);
- *tail = scm_cons (fm->self_scm(),SCM_EOL);
+ *tail = scm_cons (fm->self_scm (),SCM_EOL);
tail = SCM_CDRLOC (*tail);
}
}
void
-Virtual_font_metric::derived_mark()const
+Virtual_font_metric::derived_mark ()const
{
scm_gc_mark (font_list_);
}
Virtual_font_metric::get_ascii_char (int) const
{
programming_error ("Virtual font metric cannot be indexed by ASCII.");
- return Box();
+ return Box ();
}
Stencil
Virtual_font_metric::get_ascii_char_stencil (int ) const
{
programming_error ("Virtual font metric cannot be indexed by ASCII.");
- return Stencil();
+ return Stencil ();
}
}
- return Box();
+ return Box ();
}
for (SCM s = font_list_; gh_pair_p (s); s = gh_cdr (s))
{
Font_metric* fm = unsmob_metrics (gh_car (s));
- if (code < total + fm->count())
+ if (code < total + fm->count ())
{
m = fm->get_indexed_char_stencil (code - total); // ugh.
break;
bool no_vertical_end = orig_span && !broken_last_bracket;
SCM s = me->get_property ("bars");
Grob * endbar = unsmob_grob (ly_car (s));
- SCM glyph = endbar->get_property("glyph");
+ SCM glyph = endbar->get_property ("glyph");
String str;
if (gh_string_p (glyph))
- str = ly_scm2string(glyph);
+ str = ly_scm2string (glyph);
else
return SCM_EOL;
const char* cs = str.to_str0 ();
no_vertical_end |=
- (strcmp(cs,":|")!=0 && strcmp(cs,"|:")!=0 && strcmp(cs,"|.")!=0
- && strcmp(cs,":|:")!=0 && strcmp(cs,".|")!=0);
+ (strcmp (cs,":|")!=0 && strcmp (cs,"|:")!=0 && strcmp (cs,"|.")!=0
+ && strcmp (cs,":|:")!=0 && strcmp (cs,".|")!=0);
Paper_def * paper =me->get_paper ();
Real half_space = 0.5;
class Volta_engraver : public Engraver
{
public:
- TRANSLATOR_DECLARATIONS(Volta_engraver);
+ TRANSLATOR_DECLARATIONS (Volta_engraver);
protected:
virtual void acknowledge_grob (Grob_info);
staff_ = SCM_UNDEFINED;
if (staff_ != SCM_UNDEFINED)
- staff_ = i.grob_->self_scm();
+ staff_ = i.grob_->self_scm ();
}
}
THIS IS A KLUDGE.
we need to do this here, because STAFF_ is not initialized yet
- in the 1st call of process_music()
+ in the 1st call of process_music ()
*/
- volta_span_->suicide( );
+ volta_span_->suicide ( );
volta_span_ = 0;
}
TODO: should attach volta to paper-column if no bar is found.
*/
-ENTER_DESCRIPTION(Volta_engraver,
+ENTER_DESCRIPTION (Volta_engraver,
/* descr */ "Make volta brackets",
/* creats*/ "VoltaBracket",
/* accepts */ "",
(AccidentalPlacement
. (
(X-extent-callback . ,Axis_group_interface::group_extent_callback)
- (left-padding . 0.3)
+ (left-padding . 0.2)
;; this is quite small, but it is very ugly to have
;; accs closer to the previous note than to the next one.
- (right-padding . 0.25)
+ (right-padding . 0.15)
(meta . ((interfaces . (item-interface accidental-placement-interface))))
))