@end ignore
+@item
+Tablature staves show fret numbers only by default. To get the
+former style, @code{\tabFullNotation} is provided.
+
@item
Funk-style and Walker-style shape notes have been added.
FretBoards now have a chordChanges property to keep repeated FretBoard objects
from being typeset.
+@item
+The vertical spacing engine has been drastically changed, making
+it more flexible and easier to control.
+
@end itemize
@item
@code{@@code@{@dots{}@}}, @code{@@samp@{@dots{}@}} ---
-Use the @code{@@code@{@dots{}@}} command for individual
-language-specific tokens (keywords, commands, engravers, scheme
-symbols, etc.). Ideally, a single @code{@@code@{@dots{}@}} block
-should fit within one line in the PDF output. Use the
-@code{@@samp@{@dots{}@}} command when you have a short example of
-user input, unless it constitutes an entire @code{@@item} by
-itself, in which case @code{@@code@{@dots{}@}} is preferable.
-Otherwise, both should only be used when part of a larger sentence
-within a paragraph or @code{@@item}. Never use a
-@code{@@code@{@dots{}@}} or @code{@@samp@{@dots{}@}} block as a
-free-standing paragraph; use @code{@@example} instead.
+Use the @code{@@code@{@dots{}@}} command when referring to
+individual language-specific tokens (keywords, commands,
+engravers, scheme symbols, etc.) in the text. Ideally, a single
+@code{@@code@{@dots{}@}} block should fit within one line in the
+PDF output.
+
+Use the @code{@@samp@{@dots{}@}} command when you have a short
+example of user input, unless it constitutes an entire
+@code{@@item} by itself, in which case @code{@@code@{@dots{}@}} is
+preferable. Otherwise, both should only be used when part of a
+larger sentence within a paragraph or @code{@@item}. Do not use
+@code{@@code@{@dots{}@}} or @code{@@samp@{@dots{}@}} inside an
+@code{@@example} block, and do not use either as a free-standing
+paragraph; use @code{@@example} instead.
A single unindented line in the PDF has space for about 79
fixed-width characters (76 if indented). Within an @code{@@item}
@q{@code{@@q@{@@w@{@@code@{@@bs@{@}relative c''@}@}@}}}.
@item
-@code{@@command@{@dots{}@}} --- Use for command-line commands (eg.
-@samp{@@command@{lilypond-book@}}).
+@code{@@command@{@dots{}@}} --- Use when referring to command-line
+commands within the text (eg. @samp{@@command@{convert-ly@}}). Do
+not use inside an @code{@@example} block.
@item
@code{@@example} --- Use for examples of program code. Do not add
@code{@@smallexample} line by about 5 columns.
@item
-@code{@@file@{@dots{}@}} --- Use for filenames and directories.
+@code{@@file@{@dots{}@}} --- Use when referring to filenames and
+directories in the text. Do not use inside an @code{@@example}
+block.
@item
-@code{@@option@{@dots{}@}} --- Use for options to command-line
-commands (eg. @samp{@@option@{--format@}}).
+@code{@@option@{@dots{}@}} --- Use when referring to command-line
+options in the text (eg. @samp{@@option@{--format@}}). Do not use
+inside an @code{@@example} block.
@item
@code{@@verbatim} --- Prints the block exactly as it appears in
backslash (\), you must use @samp{@@bs@{@}}.
@item
-@code{@@var@{@dots{}@}} --- Use for variables.
+@code{@@var@{@dots{}@}} --- Use for metasyntactic variables (such
+as @code{@var{foo}}, @code{@var{bar}}, @code{@var{arg1}}, etc.).
+In most cases, when the @code{@@var@{@dots{}@}} command appears in
+the text (and not in an @code{@@example} block) it should be
+wrapped with an appropriate texinfo code-highlighting command
+(such as @code{@@code}, @code{@@samp}, @code{@@file},
+@code{@@command}, etc.). For example:
+@samp{@@code@{@@var@{foo@}@}},
+@samp{@@file@{@@var@{myfile.ly@}@}},
+@w{@samp{@@samp@{git checkout @@var@{branch@}@}}}, etc. This
+improves readability in the PDF and HTML output.
@item
@code{@@version@{@}} --- Return the current LilyPond version
@file{Documentation/@/web/@/ly-examples/} directories are
@strong{not} compiled. You need to upload them, and if they ever
change, a user in the @code{lilypond} group must upload them to
-@file{~graham/@/media} on the host.
+@file{~graham/@/lilypond@/media} on the host.
Upload latest pictures/ and ly-examples/ (local script):
EXAMPLES=$BUILD_DIR/Documentation/web/ly-examples/out-www/
cd $BUILD_DIR
-rsync -a $PICS graham@lilypond.org:media/pictures
-rsync -a $EXAMPLES graham@lilypond.org:ly-examples
+rsync -a $PICS graham@lilypond.org:lilypond/media/pictures
+rsync -a $EXAMPLES graham@lilypond.org:lilypond/media/ly-examples
@end verbatim
and LilyPond code in the music expression to be returned.
Some @code{\override} commands require an argument consisting of
-a pair of numbers (called a @code{cons cell} in Scheme).
+a pair of numbers (called a @emph{cons cell} in Scheme).
The pair can be directly passed into the music function,
using a @code{pair?} variable:
The arguments are
-@table @var
-@item command-name
+@table @code
+@item @var{command-name}
the markup command name
@item layout
the @q{layout} definition.
@item props
a list of associative lists, containing all active properties.
-@item argi
+@item @var{argi}
@var{i}th command argument
-@item argi-type?
+@item @var{argi-type?}
a type predicate for the i@var{th} argument
@end table
-If the command uses properties from the @var{props} arguments, the
-@code{#:properties} keyword can be used to specify which properties are
-used along with their default values.
+If the command uses properties from the @code{props} arguments,
+the @code{#:properties} keyword can be used to specify which
+properties are used along with their default values.
Arguments are distinguished according to their type:
@itemize
@code{list?}, @code{number?}, @code{boolean?}, etc.
@end itemize
-There is no limitation on the order of arguments (after the standard
-@var{layout} and @var{props} arguments). However, markup functions
-taking a markup as their last argument are somewhat special as you can
-apply them to a markup list, and the result is a markup list where the
-markup function (with the specified leading arguments) has been applied
-to every element of the original markup list.
+There is no limitation on the order of arguments (after the
+standard @code{layout} and @code{props} arguments). However,
+markup functions taking a markup as their last argument are
+somewhat special as you can apply them to a markup list, and the
+result is a markup list where the markup function (with the
+specified leading arguments) has been applied to every element of
+the original markup list.
-Since replicating the leading arguments for applying a markup function
-to a markup list is cheap mostly for Scheme arguments, you avoid
-performance pitfalls by just using Scheme arguments for the leading
-arguments of markup functions that take a markup as their last argument.
+Since replicating the leading arguments for applying a markup
+function to a markup list is cheap mostly for Scheme arguments,
+you avoid performance pitfalls by just using Scheme arguments for
+the leading arguments of markup functions that take a markup as
+their last argument.
@node On properties
@unnumberedsubsubsec On properties
\applyContext @var{function}
@end example
-@var{function} should be a Scheme function that takes a single
-argument: the context in which the @code{\applyContext} command is
-being called. The following code will print the current bar
-number on the standard output during the compile:
+@code{@var{function}} should be a Scheme function that takes a
+single argument: the context in which the @code{\applyContext}
+command is being called. The following code will print the
+current bar number on the standard output during the compile:
@example
\applyContext
@funindex \applyOutput
-The most versatile way of tuning an object is @code{\applyOutput}. Its
-syntax is
+The most versatile way of tuning an object is @code{\applyOutput} which
+works by inserting an event into the specified context
+(@rinternals{ApplyOutputEvent}). Its syntax is
@example
\applyOutput @var{context} @var{proc}
@end example
@noindent
-where @var{proc} is a Scheme function, taking three arguments.
+where @code{@var{proc}} is a Scheme function, taking three arguments.
-When interpreted, the function @var{proc} is called for every layout
-object found in the context @var{context}, with the following
-arguments:
+When interpreted, the function @code{@var{proc}} is called for
+every layout object found in the context @code{@var{context}} at
+the current time step, with the following arguments:
@itemize
@item the layout object itself,
@item the context where the layout object was created, and
In addition, the cause of the layout object, i.e., the music
expression or object that was responsible for creating it, is in the
object property @code{cause}. For example, for a note head, this is a
-@rinternals{NoteHead} event, and for a @rinternals{Stem} object,
-this is a @rinternals{NoteHead} object.
+@rinternals{NoteHead} event, and for a stem object,
+this is a @rinternals{Stem} object.
Here is a function to use for @code{\applyOutput}; it blanks
-note-heads on the center-line:
+note-heads on the center-line and next to it:
@lilypond[quote,verbatim,ragged-right]
#(define (blanker grob grob-origin context)
(if (and (memq 'note-head-interface (ly:grob-interfaces grob))
- (eq? (ly:grob-property grob 'staff-position) 0))
+ (< (abs (ly:grob-property grob 'staff-position)) 2))
(set! (ly:grob-property grob 'transparent) #t)))
\relative c' {
- e4 g8 \applyOutput #'Voice #blanker b d2
+ a'4 e8 <<\applyOutput #'Voice #blanker a c d>> b2
}
@end lilypond
@c -*- coding: utf-8; mode: texinfo; documentlanguage : fr -*-
@ignore
- Translation of GIT committish: 0ab366a101ef8c3439dd8d6ff6c634f70fa5f63b
+ Translation of GIT committish: 87a9977bbd54e3822338e290716845d8e2e304e3
When revising a translation, copy the HEAD committish of the
version that you are working on. For details, see the Contributors'
@warning{Il s'agit des versions @emph{instables et de développement}.
Si vous avez le moindre doute quant à l'utilisation ou l'installation de
-LilyPond, nous vous enjoignons à utiliser le @ref{Téléchargement} et la
-lecture des @ref{Manuels} pour la version stable.}
+LilyPond, nous vous enjoignons à utiliser le
+@ref{Téléchargement,téléchargement de la version stable} et la
+lecture des @ref{Manuels,manuels pour la version stable}.}
@divEnd
@c -*- coding: utf-8; mode: texinfo; documentlanguage: fr -*-
@c This file is part of web.texi
@ignore
- Translation of GIT committish: 0ab366a101ef8c3439dd8d6ff6c634f70fa5f63b
+ Translation of GIT committish: 87a9977bbd54e3822338e290716845d8e2e304e3
When revising a translation, copy the HEAD committish of the
version that you are working on. For details, see the Contributors'
@divClass{column-center-top}
-@subheading Autres programmes qui exportent du code LilyPond
+@subheading Programmes qui exportent du code LilyPond
@subsubheading Éditeurs de partition, tablature et MIDI
@uref{http://www.volny.cz/smilauer/rumor/rumor.html,Rumor}, un
convertisseur monophonique temps-réel MIDI vers LilyPond.
+@item
+@uref{http://www.holmessoft.co.uk/homepage/software/NWC2LY/index.htm,NW2LY},
+programme en C#, permet de convertir une chanson écrite avec
+@uref{http://www.noteworthysoftware.com/, NoteWorthy} au format LilyPond.
+
+
@end itemize
@subsubheading Générateurs de code
@itemize
@item
-@uref{http://strasheela.sourceforge.net, Strasheela} est un système de
-composition musicale @qq{highly expressive constraint-based}.
+@uref{http://www.projectabjad.org/,Abjad}, API de contrôle
+formaliste de partition pour @uref{http://www.python.org/,Python},
+permet aux compositeurs de gérer du code LilyPond complexe.
+
+@item
+@uref{http://strasheela.sourceforge.net,Strasheela} est un système de
+composition musicale basé sur le projet
+@uref{http://www.mozart-oz.org/,Mozart/Oz}.
@item
@uref{http://common-lisp.net/project/fomus/,FOMUS}, bibliothèque LISP
g1
c1
}
- \new Score \chordmode {
+ \chordmode {
c1
r1
g1
@code{Voice} contexts as explained in @rlearning{Contexts and engravers} and
@rlearning{Explicitly instantiating voices}.
+@strong{@i{Voice order}}
+
+When entering multiple voices in the input file, use the following
+order:
+
+@example
+Voice 1: highest
+Voice 2: lowest
+Voice 3: second highest
+Voice 4: second lowest
+Voice 5: third highest
+Voice 6: third lowest
+etc.
+@end example
+
+Though this may seem counterintuitive, it simplifies the automatic
+layout process. Note that the odd-numbered voices are given
+upstems, and the even-numbered voices are given downstems:
+
+@lilypond[quote,verbatim]
+\new Staff <<
+ \time 2/4
+ { f''2 } % 1: highest
+ \\
+ { c'2 } % 2: lowest
+ \\
+ { d''2 } % 3: second-highest
+ \\
+ { e'2 } % 4: second-lowest
+ \\
+ { b'2 } % 5: third-highest
+ \\
+ { g'2 } % 6: third-lowest
+>>
+@end lilypond
+
@strong{@i{Identical rhythms}}
In the special case that we want to typeset parallel pieces of music
>>
@end lilypond
-The @code{\shiftOn}, @code{\shiftOnn}, and @code{\shiftOnnn}
-commands specify the degree to which chords of the current voice
-should be shifted. The outer voices (normally: voices one and
-two) have @code{\shiftOff}, while the inner voices (three and
-four) have @code{\shiftOn}. @code{\shiftOnn} and
-@code{\shiftOnnn} define further shift levels.
+The @code{\shiftOn} command allows (but does not force) the notes
+in a voice to be shifted. When @code{\shiftOn} is applied to a
+voice, a note or chord in that voice is shifted only if its stem
+would otherwise collide with a stem from another voice, and only
+if the colliding stems point in the same direction. The
+@code{\shiftOff} command prevents this type of shifting from
+occuring.
+
+By default, the outer voices (normally voices one and two) have
+@code{\shiftOff} specified, while the inner voices (three and
+above) have @code{\shiftOn} specified. When a shift is applied,
+voices with upstems (odd-numbered voices) are shifted to the
+right, and voices with downstems (even-numbered voices) are
+shifted to the left.
+
+Here is an example to help you visualize how an abbreviated
+polyphonic expression would be expanded internally.
+
+@warning{Note that with three or more voices, the vertical order
+of voices in your input file should not be the same as the
+vertical order of voices on the staff!}
+
+@lilypond[quote,verbatim]
+\new Staff \relative c'' {
+ %% abbreviated entry
+ <<
+ { f2 } % 1: highest
+ \\
+ { g,2 } % 2: lowest
+ \\
+ { d'2 } % 3: upper middle
+ \\
+ { b2 } % 4: lower middle
+ >>
+ %% internal expansion of the above
+ <<
+ \new Voice = "1" { \voiceOne \shiftOff f'2 }
+ \new Voice = "2" { \voiceTwo \shiftOff g,2 }
+ \new Voice = "3" { \voiceThree \shiftOn d'2 } % shifts right
+ \new Voice = "4" { \voiceFour \shiftOn b2 } % shifts left
+ >>
+}
+@end lilypond
+
+Two additional commands, @code{\shiftOnn} and @code{\shiftOnnn}
+provide further shift levels which may be specified temporarily to
+resolve collisions in complex situations -- see
+@rlearning{Real music example}.
Notes are only merged if they have opposing stem directions (as
they have, for example, in voices one and two by default or when
specific font is used for this purpose.
@lilypond[quote,verbatim,relative=1]
-\override TextScript #'font-family = #'typewriter
-\override TextScript #'font-size = #2
\clef "G_8"
-c4^\markup Kaspar
+c4^\markup \fontsize #1 \smallCaps Kaspar
c c c
\clef "bass"
-a4^\markup Melchior
+a4^\markup \fontsize #1 \smallCaps Melchior
a a a
+\clef "G_8"
+c4^\markup \fontsize #1 \smallCaps Kaspar
+c c c
+@end lilypond
+
+Alternatively, if there are many character changes, it may be
+easier to set up @qq{instrument} definitions for each character at
+the top level so that @code{\instrumentSwitch} can be used to
+indicate each change.
+
+@lilypond[quote,verbatim]
+\addInstrumentDefinition #"kaspar"
+ #`((instrumentTransposition . ,(ly:make-pitch -1 0 0))
+ (shortInstrumentName . "Kas.")
+ (clefGlyph . "clefs.G")
+ (clefOctavation . -7)
+ (middleCPosition . 1)
+ (clefPosition . -2)
+ (instrumentCueName . ,(markup #:fontsize 1 #:smallCaps "Kaspar"))
+ (midiInstrument . "voice oohs"))
+
+\addInstrumentDefinition #"melchior"
+ #`((instrumentTransposition . ,(ly:make-pitch 0 0 0))
+ (shortInstrumentName . "Mel.")
+ (clefGlyph . "clefs.F")
+ (clefOctavation . 0)
+ (middleCPosition . 6)
+ (clefPosition . 2)
+ (instrumentCueName . ,(markup #:fontsize 1 #:smallCaps "Melchior"))
+ (midiInstrument . "voice aahs"))
+
+\relative c' {
+ \instrumentSwitch "kaspar"
+ c4 c c c
+ \instrumentSwitch "melchior"
+ a4 a a a
+ \instrumentSwitch "kaspar"
+ c4 c c c
+}
@end lilypond
@seealso
Notation Reference:
@ref{Instrument names},
-@ref{Selecting font and font size},
-@ref{Text}.
+@ref{Scheme functions},
+@ref{Text},
+@ref{Text markup commands}.
+
+Extending LilyPond:
+@rextend{Markup construction in Scheme}.
@node Musical cues
@unnumberedsubsubsec Musical cues
@end ifset
+@c we normally don't allow named references, but in this case
+@c it's good to emphasize the "stable" part. -gp
@warning{These are @emph{unstable development} versions. If you
have the slightest doubt about how to use or install LilyPond, we
-urge you to use the stable @ref{Download}, and read the stable
-@ref{Manuals}.}
+urge you to use the @ref{Download, stable Download}, and read the
+@ref{Manuals, stable Manuals}.}
@divEnd
@uref{http://www.volny.cz/smilauer/rumor/rumor.html,Rumor}, a
realtime monophonic MIDI to LilyPond converter.
+@item
+@uref{http://www.holmessoft.co.uk/homepage/software/NWC2LY/index.htm,
+NW2LY} is a C# program which converts a
+@uref{http://www.noteworthysoftware.com/, NoteWorthy} song into
+LilyPond.
+
@end itemize
@subsubheading Algorithmic code generators
environments.
@item
-@uref{http://strasheela.sourceforge.net,Strasheela}, @qq{a
-highly expressive constraint-based music composition system.}
+@uref{http://strasheela.sourceforge.net,Strasheela}, an
+environment built on top of the
+@uref{http://www.mozart-oz.org/, Mozart/Oz} constraint programming
+language.
@end itemize
@divEnd
@ref{Development}.
One known regression against 2.12.3 still exist:
-@uref{http://code.google.com/p/lilypond/issues/detail?id=1263,
+@uref{http://code.google.com/p/lilypond/issues/detail?id=1173,
Issue 1173 MetronomeMarks cannot be aligned on a note if a
multi-measure rest exists in another voice}, but we expect to find
more. If you decide to test 2.13.34, do not be surprised to
# htaccess for root dir of lilypond.org
+# ----------------------------------------------------
+# The file comes from git master:
+# Documentation/web/server/lilypond.org.htaccess
+#
+# Please do not edit it directly (unless something
+# is critically broken); instead, change it in git
+# and then do the:
+# update-git.sh
+# check-git.sh
+# copy-git.sh
+# make-website.sh
+# as discussed in:
+# Contributor 5.2 Uploading and security
+# ----------------------------------------------------
RewriteEngine On
RewriteRule ^.*/source/.*$ /please-respect-robots.txt.html [L]
# Permanent top level entry points -- ./doc
-RedirectMatch ^/music-glossary /doc/Documentation/user/music-glossary/index
-RedirectMatch ^/tutorial /doc/Documentation/user/lilypond-learning/Tutorial
+RedirectMatch ^/music-glossary /glossary
+RedirectMatch ^/tutorial /learning
RedirectMatch ^/documentation/$ /doc
# Possibly resurrect this with new web site
# This breaks the documentation index with old site
# RedirectMatch ^/documentation$ /doc
-RedirectMatch ^/bugs http://code.google.com/p/lilypond/issues/list
+#
+RedirectMatch ^/bugs /bug-reports
+#RedirectMatch ^/bugs http://code.google.com/p/lilypond/issues/list
RedirectMatch ^/wiki http://wiki.lilynet.net
-RedirectMatch ^/authors /doc/Documentation/topdocs/AUTHORS
-RedirectMatch ^/news /doc/Documentation/topdocs/NEWS
+# the new website already has an /authors
+#RedirectMatch ^/authors /doc/Documentation/topdocs/AUTHORS
+# the new website has news on the main page
+RedirectMatch ^/news /
RedirectMatch ^/stable /doc/stable
RedirectMatch ^/development /doc/development
RewriteEngine on
RewriteBase /
-SetEnvIf REQUEST_URI .* WEB=/web
-## To switch over to the new site, we do not even need to put it in /web
-## we could do
-# SetEnvIf REQUEST_URI .* WEB=/doc/v2.13/Documentation
+SetEnvIf REQUEST_URI .* WEB=/website
# Rewrite empty to /web
RewriteCond %{REQUEST_URI} ^/*$
RewriteCond %{DOCUMENT_ROOT}%{ENV:WEB}%{REQUEST_URI} -d
# ...and does not start with /web
RewriteCond %{REQUEST_URI} !^%{ENV:WEB}
-RewriteCond %{REQUEST_URI} !^/web
+RewriteCond %{REQUEST_URI} !^/website
# ...and does not start with /doc$
RewriteCond %{REQUEST_URI} !^/doc$
# ...add trailing slash for [menu] and to avoid /web/ in browser url
RewriteRule ^(.+)$ http://%{HTTP_HOST}/$1/ [R,QSA,L]
# Request that does not start with /web
-RewriteCond %{REQUEST_URI} !^/web
+RewriteCond %{REQUEST_URI} !^/website
RewriteCond %{REQUEST_URI} !^%{ENV:WEB}
# ...and does not start with /doc/
RewriteCond %{REQUEST_URI} !^/doc/
PACKAGE_NAME=LilyPond
MAJOR_VERSION=2
MINOR_VERSION=13
-PATCH_LEVEL=34
+PATCH_LEVEL=35
MY_PATCH_LEVEL=
VERSION_STABLE=2.12.3
-VERSION_DEVEL=2.13.33
+VERSION_DEVEL=2.13.34
--- /dev/null
+\version "2.13.35"
+
+\header {
+ texidoc = "Grace notes at the start of a partial measure do not
+break autobeaming."
+}
+
+\relative c' {
+ \partial 4
+ \grace e16
+ d8 d
+ c8 c c c c c c c
+}
%% \partial
\test "" ##[ \partial 2 #]
\test "" ##[ \partial 8. #]
-\test #"TODO? exotic durations in \\partial" ##[ \partial 4*2/3 #]
+\test "" ##[ \partial 4*2/3 #]
%% \partcombine
\test "" ##[ \partcombine { c e }
void
Fingering_engraver::stop_translation_timestep ()
{
- if (!fingerings_.size ())
- return;
-
fingerings_.clear ();
events_.clear ();
}
--- /dev/null
+/*
+ This file is part of LilyPond, the GNU music typesetter.
+
+ Copyright (C) 2010 Neil Puttock <n.puttock@gmail.com>
+
+ LilyPond is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ LilyPond is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "context.hh"
+#include "input.hh"
+#include "international.hh"
+#include "moment.hh"
+#include "music.hh"
+#include "simple-music-iterator.hh"
+
+class Partial_iterator : public Simple_music_iterator
+{
+public:
+ DECLARE_SCHEME_CALLBACK (constructor, ());
+ protected:
+ virtual void process (Moment);
+};
+
+void
+Partial_iterator::process (Moment m)
+{
+ if (Duration *dur
+ = unsmob_duration (get_music ()->get_property ("partial-duration")))
+ {
+ Context *ctx = get_outlet ();
+ Moment now = ctx->now_mom ();
+ if (now.main_part_ > Rational (0))
+ get_music ()->origin ()->
+ warning (_ ("trying to use \\partial after the start of a piece"));
+ Moment length = Moment (dur->get_length ());
+ now = Moment (0, now.grace_part_);
+ ctx->set_property ("measurePosition", (now - length).smobbed_copy ());
+ }
+ else
+ programming_error ("invalid duration in \\partial");
+
+ Simple_music_iterator::process (m);
+}
+
+IMPLEMENT_CTOR_CALLBACK (Partial_iterator);
top-htaccess=$(trusted-dir)/lilypond.org.htaccess
dir-htaccess=$(trusted-dir)/website-dir.htaccess
TEXI2HTML_PROGRAM=$(HOME)/usr/bin/texi2html
- EXAMPLES=$(HOME)/media/ly-examples/
- PICTURES=$(HOME)/media/pictures
+ EXAMPLES=$(HOME)/lilypond/media/ly-examples/
+ PICTURES=$(HOME)/lilypond/media/pictures
else
### for normal git
script-dir=$(top-src-dir)/scripts/build/
;;; using `chain-assoc-get' (more on that below)
;;;
;;; args...
-;;; the command arguments. There are restrictions on the
-;;; possible arguments for a markup command.
-;;; First, arguments are distinguished according to their type:
-;;; 1) a markup (or a string), corresponding to type predicate `markup?'
-;;; 2) a list of markups, corresponding to type predicate `markup-list?'
-;;; 3) any scheme object, corresponding to type predicates such as
-;;; `list?', 'number?', 'boolean?', etc.
-;;; The supported arrangements of arguments, according to their type, are:
-;;; - no argument
-;;; - markup
-;;; - scheme
-;;; - markup, markup
-;;; - markup-list
-;;; - scheme, scheme
-;;; - scheme, markup
-;;; - scheme, scheme, markup
-;;; - scheme, scheme, markup, markup
-;;; - scheme, markup, markup
-;;; - scheme, scheme, scheme
-;;; This combinations are hard-coded in the lexer and in the parser
-;;; (lily/lexer.ll and lily/parser.yy)
+;;; the command arguments.
+;;; There is no limitation on the order of command arguments.
+;;; However, markup functions taking a markup as their last
+;;; argument are somewhat special as you can apply them to a
+;;; markup list, and the result is a markup list where the
+;;; markup function (with the specified leading arguments) has
+;;; been applied to every element of the original markup list.
+;;;
+;;; Since replicating the leading arguments for applying a
+;;; markup function to a markup list is cheap mostly for
+;;; Scheme arguments, you avoid performance pitfalls by just
+;;; using Scheme arguments for the leading arguments of markup
+;;; functions that take a markup as their last argument.
;;;
;;; args-signature
;;; the arguments signature, i.e. a list of type predicates which
(format #f "\\bar \"~a\"~a" ?bar-type (new-line->lily-string))))
;;; \partial
-(define (duration->moment ly-duration)
- (let ((log2 (ly:duration-log ly-duration))
- (dots (ly:duration-dot-count ly-duration))
- (num+den (ly:duration-factor ly-duration)))
- (let* ((m (expt 2 (- log2)))
- (factor (/ (car num+den) (cdr num+den))))
- (/ (do ((i 0 (1+ i))
- (delta (/ m 2) (/ delta 2)))
- ((= i dots) m)
- (set! m (+ m delta)))
- factor))))
-
-(define moment-duration-alist (map (lambda (duration)
- (cons (duration->moment duration)
- duration))
- (append-map (lambda (log2)
- (map (lambda (dots)
- (ly:make-duration log2 dots 1 1))
- (list 0 1 2 3)))
- (list 0 1 2 3 4))))
-
-(define (moment->duration moment)
- (assoc-get (- moment) moment-duration-alist))
(define-extra-display-method ContextSpeccedMusic (expr parser)
"If `expr' is a partial measure, return \"\\partial ...\".
'ContextSpeccedMusic
context-type 'Timing
element (music
- 'PropertySet
- value ?moment
- symbol 'measurePosition))))
- (let ((duration (moment->duration (/ (ly:moment-main-numerator ?moment)
- (ly:moment-main-denominator ?moment)))))
- (and duration (format #f "\\partial ~a" (duration->lily-string duration
- #:force-duration #t))))))
+ 'PartialSet
+ partial-duration ?duration))))
+
+ (and ?duration
+ (format #f "\\partial ~a"
+ (duration->lily-string ?duration #:force-duration #t)))))
;;;
;;;
(page-turn-permission ,symbol? "When the music is at top-level,
whether to allow, forbid or force a page turn.")
(parenthesize ,boolean? "Enclose resulting objects in parentheses?")
+ (partial-duration ,ly:duration? "The length of a partial measure as a
+duration.")
(part-combine-status ,symbol? "Change to what kind of state?
Options are @code{solo1}, @code{solo2} and @code{unisono}.")
(pitch ,ly:pitch? "The pitch of this note.")
(types . (general-music break-event page-turn-event event))
))
+ (PartialSet
+ . ((description . "Create an anacrusis or upbeat (partial measure).")
+ (iterator-ctor . ,ly:partial-iterator::constructor)
+ (types . (general-music partial-set))
+ ))
+
(PartCombineMusic
. ((description . "Combine two parts on a staff, either merged or
as separate voices.")
(set! (ly:music-property ev 'label) label)
ch))))
-(define-ly-syntax-simple (partial dur)
+(define-ly-syntax (partial parser location dur)
"Make a partial measure."
- (let ((mom (ly:moment-sub ZERO-MOMENT (ly:duration-length dur))))
- ;; We use `descend-to-context' here instead of `context-spec-music' to
- ;; ensure \partial still works if the Timing_translator is moved
+ ;; We use `descend-to-context' here instead of `context-spec-music' to
+ ;; ensure \partial still works if the Timing_translator is moved
(descend-to-context
- (context-spec-music (make-property-set 'measurePosition mom) 'Timing)
- 'Score)))
+ (context-spec-music (make-music 'PartialSet
+ 'origin location
+ 'partial-duration dur)
+ 'Timing)
+ 'Score))
((and (not (string? arg)) (markup? arg)) ;; a markup
(inner-markup->make-markup arg))
(else ;; scheme arg
- arg)))
+ (music->make-music arg))))
(define (inner-markup->make-markup mrkup)
(if (string? mrkup)
`(#:simple ,mrkup)