lily-[0-9a-f][0-9a-f][0-9a-f]*
out-scons
out-cov
+out-test
tags
test-output-distance
config-*.hh
\alternative { {d2 d} {f f,} }
@end lilypond
-In the following example, the first ending is not a complete
-bar (it only had 3 beats). The beginning of the second ending
-contains the 4th beat from the first ending. This @q{extra} beat
-in the second ending is due to the first time ending,
-and has nothing to do with the @code{\partial} at the
-beginning of the example.
+Repeats with upbeats may be created.
@lilypond[quote,ragged-right,fragment,verbatim,relative=2]
\new Staff {
- \partial 4
- \repeat volta 4 { e | c2 d2 | e2 f2 | }
- \alternative { { g4 g g } { a | a a a a | b2. } }
+ \partial 4 e |
+ \repeat volta 4 { c2 d2 | e2 f2 | }
+ \alternative { { g4 g g e } { a a a a | b2. } }
}
@end lilypond
cd $(tree-share-prefix)/tex && \
ln -s $(top-src-dir)/tex source && \
ln -s ../../../../../tex/$(outconfbase) tex-out && \
- ln -s ../../../../../mf/$(outconfbase) mf-out
-
+ true
cd $(tree-share-prefix)/fonts && \
ln -s $(top-src-dir)/mf source && \
true
fi > input/regression/out-test/tree.gittxt
$(MAKE) -C input/regression/ out=$(OUT_TEST) LILYPOND_BOOK_LILYPOND_FLAGS="-dbackend=eps --formats=ps $(LILYPOND_JOBS) -dseparate-log-files -dinclude-eps-fonts -dgs-load-fonts --header=texidoc -I $(top-src-dir)/input/manual -ddump-profile -dcheck-internal-types -ddump-signatures -danti-alias-factor=1" LILYPOND_BOOK_VERBOSE= out-$(OUT_TEST)/collated-files.html
@find input ly -name '*.ly' -print |grep -v 'out.*/' | xargs grep '\\version' -L | grep -v "standard input" |sed 's/^/**** Missing version: /g'
-
+ rsync -L -a --exclude 'out-*' --exclude 'out' --exclude mf --exclude source --exclude mf $(outdir)/share input/regression/out-test/
test-baseline:
@if test -d .git ; then \
PACKAGE_NAME=LilyPond
MAJOR_VERSION=2
MINOR_VERSION=11
-PATCH_LEVEL=25
+PATCH_LEVEL=26
MY_PATCH_LEVEL=
import os.path
import shutil
-dirs = ['ancient','chords','connecting','contemporary','expressive','education','guitar','parts','pitches','repeats','scheme','spacing','staff','text','vocal','other']
+dirs = ['ancient','chords','connecting','contemporary','expressive','education','guitar','parts','pitch','repeats','scheme','spacing','staff','text','vocal','other']
notsafe=[]
try:
#!@PYTHON@
-# mf-to-table.py -- convert spacing info in MF logs . and .tex
+# mf-to-table.py -- convert spacing info in MF logs .
#
# source file of the GNU LilyPond music typesetter
#
-def write_tex_defs (file, global_info, charmetrics):
- nm = font_family
- for m in charmetrics:
-
- texname = re.sub ('[_.]', 'X', m['name'])
- def digit_to_letter (match):
- return chr (ord (match.group(1)) - ord ('0') + ord ('A'))
- texname = re.sub ('([0-9])', digit_to_letter, texname)
- file.write (r'''\gdef\%s%s{\char%d}%%%s''' % \
- (nm, texname, m['code'],'\n'))
- file.write ('\\endinput\n')
def write_character_lisp_table (file, global_info, charmetrics):
-l, --ly=FILE name output table
-o, --outdir=DIR prefix for dependency info
-p, --package=DIR specify package
- -t, --tex=FILE name output tex chardefs
""")
sys.exit (0)
'a:d:ho:p:t:',
['enc=', 'outdir=', 'dep=', 'lisp=',
'global-lisp=',
- 'tex=', 'debug', 'help', 'package='])
+ 'debug', 'help', 'package='])
global_lisp_nm = ''
char_lisp_nm = ''
enc_nm = ''
-texfile_nm = ''
depfile_nm = ''
lyfile_nm = ''
outdir_prefix = '.'
depfile_nm = a
elif o == '--outdir' or o == '-o':
outdir_prefix = a
- elif o == '--tex' or o == '-t':
- texfile_nm = a
elif o == '--lisp':
char_lisp_nm = a
elif o == '--global-lisp':
print o
raise getopt.error
-base = re.sub ('.tex$', '', texfile_nm)
+base = os.path.splitext (lyfile_nm)[0]
for filenm in files:
(g, m, deps) = parse_logfile (filenm)
- write_tex_defs (open (texfile_nm, 'w'), g, m)
enc_name = 'FetaEncoding'
if re.search ('parmesan', filenm):
enc_name = 'ParmesanEncoding'
write_deps (open (depfile_nm, 'wb'), deps,
[base + '.log', base + '.dvi', base + '.pfa',
depfile_nm,
- base + '.pfb', texfile_nm])
+ base + '.pfb'])
return d + orphan_distance
-
-
def add_file_compare (self, f1, f2):
system_index = []
for f in glob.glob (pat):
infile = f
outfile = (dest_dir + '/' + f).replace ('.eps', '.png')
-
+ data_option = ''
+ if options.local_data_dir:
+ data_option = ('-slilypond-datadir=%s/share/lilypond/current '
+ % os.path.split(infile)[0])
+
mkdir (os.path.split (outfile)[0])
cmd = ('gs -sDEVICE=png16m -dGraphicsAlphaBits=4 -dTextAlphaBits=4 '
+ ' %(data_option)s '
' -r101 '
' -sOutputFile=%(outfile)s -dNOSAFER -dEPSCrop -q -dNOPAUSE '
- ' %(infile)s -c quit ' % locals ())
+ ' %(infile)s -c quit ') % locals ()
files_created[oldnew].append (outfile)
system (cmd)
action="store_true",
help="Create PNGs from EPSes")
+
+ p.add_option ('--local-datadir',
+ dest="local_data_dir",
+ default=False,
+ action="store_true",
+ help='whether to use the share/lilypond/ directory in the test directory')
+
p.add_option ('-o', '--output-dir',
dest="output_dir",
default=None,
return (dir_.length () && dir_[0] == DIRSEP) || root_.length ();
}
+
+
+File_name
+File_name::canonicalized () const
+{
+ File_name c = *this;
+
+ replace_all (c.dir_, string ("//"), string ("/"));
+
+ vector<string> components = string_split (c.dir_, '/');
+ vector<string> new_components;
+
+ for (vsize i = 0; i < components.size (); i++)
+ {
+ if (components[i] == "..")
+ new_components.pop_back ();
+ else
+ new_components.push_back (components[i]);
+ }
+
+ c.dir_ = string_join (new_components, "/");
+ return c;
+}
bool is_absolute () const;
string to_string () const;
-
+ File_name canonicalized () const;
string dir_part () const;
string file_part () const;
};
#endif /* HAVE_BOOST_LAMBDA */
vector<string> string_split (string str, char c);
+string string_join (vector<string> const &strs, string infix);
#define iterof(i,s) typeof((s).begin()) i((s).begin())
return str;
}
+/*
+ TODO: this O(n^2) in #occurences of find, due to repeated copying.
+ */
string &
replace_all (string &str, string find, string replace)
{
{
string s = str.substr (0, i);
a.push_back (s);
- while (str[++i] == c)
- ;
+ i ++;
str = str.substr (i);
i = str.find (c);
}
a.push_back (str);
return a;
}
+
+string
+string_join (vector<string> const &strs, string infix)
+{
+ string result;
+ for (vsize i = 0; i < strs.size (); i ++)
+ {
+ if (i)
+ result += infix;
+ result += strs[i];
+ }
+
+ return result;
+}
string s = slashify (to_string ());
EQUAL ("/tmp/x.ly", s);
}
+
+TEST_STRING (File_name, Canonicalize, "foo//bar/..//bla//z.ly")
+{
+ string s = canonicalized ().to_string ();
+ EQUAL ("foo/bla/z.ly", s);
+}
+
--- /dev/null
+%% Do not edit this file; it is auto-generated from LSR!
+\version "2.11.23"
+
+\header { texidoc = "
+Here is demonstrated a preliminary support of Gregorian Scripts:
+
+ictus, circulus, semicirculus, accentus, episem.
+" }
+
+\include "gregorian-init.ly"
+
+\score {
+ \context VaticanaVoice {
+ \override Script #'padding = #-0.5
+ {
+ a\ictus
+ a\circulus
+ a\semicirculus
+ a\accentus
+ \[ a \episemInitium \pes b \flexa a \episemFinis \]
+ }
+ }
+ \layout {
+ line-width = 70.0
+ width = 60.0
+ indent = 0.0
+ ragged-right = ##t
+ }
+}
--- /dev/null
+%% Do not edit this file; it is auto-generated from LSR!
+\version "2.11.23"
+
+\header { texidoc = "
+Volta brackets can be placed over chord names. Just set the
+voltaOnThisStaff property to \"true\" for the ChordNames context and to
+\"false\" for the topmost ordinary Staff context.
+" }
+
+\score { <<
+ \new ChordNames \with {
+ voltaOnThisStaff = ##t
+ } \chordmode {
+ c1 c
+ }
+ \new Staff \with {
+ voltaOnThisStaff = ##f
+ }
+ {
+ \repeat volta 2 { c'1 } \alternative { c' }
+ }
+>> }
--- /dev/null
+%% Do not edit this file; it is auto-generated from LSR!
+\version "2.11.23"
+
+\header { texidoc = "
+Lilypond can subdivide beams automatically. Set the property
+subdivideBeams, and beams are subdivided at beat positions (as
+specified in beat length)
+" }
+
+\relative{ b'32^"default"[ a g f c' b a g f e d' c b a g f ]
+ \set subdivideBeams = ##t
+ b32^"subdivision enabled"[ a g f c' b a g f e d' c b a g f ]
+ \set Score.beatLength = #(ly:make-moment 1 8)
+ b32^"beatLength 1 8"[ a g f c' b a g f e d' c b a g f ]
+ \set Score.beatLength = #(ly:make-moment 1 16)
+ b32^"beatLength 1 16"[ a g f c' b a g f e d' c b a g f ]
+ }
+
--- /dev/null
+%% Do not edit this file; it is auto-generated from LSR!
+\version "2.11.23"
+
+\header { texidoc = "
+Groups of beamed notes can be made by setting the subdivideBeams
+property. However, if you have \"\time\"-statements inside your score,
+you'll need to set the beatLength again after each \time-statement
+(that has a denominator that is not 8).
+
+This happens because the \"\time\"-statements reset the
+beatLength-value to the denominator of the time signature. So, if
+you have many meter-changes, you can use the following function named
+\"\timenb #X #Y\" instead of \"\time X/Y\".
+" }
+
+% timenb sets TIMEesignature and measure length, but Not Beatlength
+timenb = #(define-music-function (parser location x y ) (integer? integer?) #{
+ \set Staff.timeSignatureFraction = #(cons $x $y)
+ \set Score.measureLength = #(ly:make-moment $x $y)
+#})
+
+\new Staff {
+ \relative c''
+ {
+ \set Score.beatLength = #(ly:make-moment 1 8)
+ \set subdivideBeams = ##t
+
+ \timenb #3 #8 c16.[ c32 c16. c32 c16. c32] |
+ \timenb #5 #8 d8[ d] d16.[ d32 d16. d32 d8] |
+ \timenb #3 #4 e8[ e16. e32] e16.[ e32 e16. e32] e16.[ f32 f8] |
+ \timenb #2 #4
+ g16.[ g32 g16. g32] g16.[ g32 g16. g32] |
+
+ }
+}
+
--- /dev/null
+%% Do not edit this file; it is auto-generated from LSR!
+\version "2.11.23"
+
+\header { texidoc = "
+in XXth century music, where time signatures tend to change a lot, it
+is sometimes recommended to put the time signatures on top of the score
+(or above each StaffGroup in case of an orchestral score). This can be
+achieved by creating a dummy staff which only contains the
+Time-signature-engraver). In this specific example, I've used a
+separate identifier to define every time signature change, which allows
+me to not bother entering them again when typing the actual music
+(careful though: it makes getting lost easier!).
+" }
+
+\layout{
+ \context {
+ \type "Engraver_group"
+ \consists "Time_signature_engraver"
+ \consists "Axis_group_engraver"
+ \name "TimeSig"
+ \override TimeSignature #'extra-offset = #'(-2.2 . 0.0 )
+ \override TimeSignature #'font-size = #3
+ }
+ \context {
+ \Score \accepts TimeSig
+ }
+
+ \context { \Staff
+ \override TimeSignature #'transparent = ##t
+ }
+}
+
+timeSignatures = { \time 2/4 s2 \time 3/4 s2. \time 4/4 s1 }
+\score {
+
+<< \new TimeSig \timeSignatures
+ \new Staff \relative { c'2 c2. c1 }
+ \new Staff { a2 a2. a1}
+ >>
+}
--- /dev/null
+%% Do not edit this file; it is auto-generated from LSR!
+\version "2.11.23"
+
+\header { texidoc = "
+For pedagogical purposes, you may want to make one staff line thicker
+(e.g. the middle line, to emphasize the line of the G clef). This can
+be achieved by adding extra lines very close to the line you want to
+make thicker, using the #'line-positions property in the StaffSymbol
+context.
+" }
+
+\score {
+ \new Staff{
+ \override Staff.StaffSymbol #'line-positions =#'(-4 -2 -0.2 0 0.2 2 4 )
+ d'4 e' f' g'
+ }
+}
--- /dev/null
+%% Do not edit this file; it is auto-generated from LSR!
+\version "2.11.23"
+
+\header { texidoc = "
+As children do not always have hands large enough, say, to plays
+octavas when studying piano, or anything else, it can be useful to add
+parentheses around a low note for example. In this snippet, the
+\"parenthesized\" note is made a bit smaller using the \tweak command
+on the #'font-size property.
+" }
+
+{ \clef bass
+< f \parenthesize \tweak #'font-size #-1 f, >2
+}
--- /dev/null
+%% Do not edit this file; it is auto-generated from LSR!
+\version "2.11.23"
+
+\header { texidoc = "
+If you want to print some white text on black background, here's the
+trick:
+" }
+
+{
+ g1^\markup { \combine \filled-box #'(-.3 . 6.8) #'(-.3 . 1.8) #0 \with-color #white White}
+}
--- /dev/null
+%% Do not edit this file; it is auto-generated from LSR!
+\version "2.11.23"
+
+\header { texidoc = "
+A hammer in tablature can be faked with slurs.
+" }
+
+\score{
+\context TabStaff
+ <<
+ \relative c''{
+ c(d)
+ d(d)
+ d(c)
+ }
+ >>
+}
+
+%%some weird letters are displayed in the Staff; can't reproduce it at home... --vv
--- /dev/null
+%% Do not edit this file; it is auto-generated from LSR!
+\version "2.11.23"
+
+\header { texidoc = "
+A demonstration of all headers.
+" }
+
+\header {
+copyright = "copyright"
+title = "title"
+subtitle = "subtitle"
+composer = "composer"
+arranger = "arranger"
+instrument = "instrument"
+metre = "metre"
+opus = "opus"
+piece = "piece"
+poet = "poet"
+texidoc = "All header fields with special meanings."
+ copyright = "public domain"
+ enteredby = "jcn"
+ source = "urtext"
+
+}
+
+
+\score {
+ \relative c'' { c1 c1 c1 c1 }
+}
+
+\score {
+ \relative c'' { c1 c1 c1 c1 }
+
+ \header {
+
+ title = "localtitle"
+ subtitle = "localsubtitle"
+ composer = "localcomposer"
+ arranger = "localarranger"
+ instrument = "localinstrument"
+ metre = "localmetre"
+ opus = "localopus"
+ piece = "localpiece"
+ poet = "localpoet"
+ copyright = "localcopyright"
+ }
+}
+
--- /dev/null
+%% Do not edit this file; it is auto-generated from LSR!
+\version "2.11.23"
+
+\header { texidoc = "
+The notation problem, creating a certain symbol, is handled by plugins.
+Each plugin is called an Engraver. In this example, engravers are
+switched on one by one, in the following order:
+
+- note heads
+
+
+- staff symbol,
+
+
+- clef,
+
+
+- stem,
+
+
+- beams, slurs, accents,
+
+
+- accidentals, bar lines, time signature, and key signature.
+
+
+
+Engravers are grouped. For example, note heads, slurs, beams etc. form
+a Voice context. Engravers for key, accidental, bar, etc. form a Staff
+context.
+
+
+You may only see the first example in this document; please download
+this snippet and run it from your own computer.
+" }
+
+%% sample music
+topVoice = \relative c' {
+ \key d\major
+ es8([ g] a[ fis])
+ b4
+ b16[-. b-. b-. cis-.]
+ d4->
+}
+
+botVoice = \relative c' {
+ \key d\major
+ c8[( f] b[ a)]
+ es4
+ es16[-. es-. es-. fis-.]
+ b4->
+}
+
+hoom = \relative c {
+ \key d \major
+ \clef bass
+ g8-. r
+ r4
+ fis8-.
+ r8
+ r4
+ b'4->
+}
+
+pah = \relative c' {
+ r8 b-.
+ r4
+ r8 g8-.
+ r16 g-. r8
+ \clef treble
+ fis'4->
+}
+
+%
+% setup for Request->Element conversion. Guru-only
+%
+
+MyStaff =\context {
+ \type "Engraver_group"
+ \name Staff
+
+ \description "Handles clefs, bar lines, keys, accidentals. It can contain
+@code{Voice} contexts."
+
+
+ \consists "Output_property_engraver"
+
+ \consists "Font_size_engraver"
+
+ \consists "Volta_engraver"
+ \consists "Separating_line_group_engraver"
+ \consists "Dot_column_engraver"
+
+ \consists "Ottava_spanner_engraver"
+ \consists "Rest_collision_engraver"
+ \consists "Piano_pedal_engraver"
+ \consists "Piano_pedal_align_engraver"
+ \consists "Instrument_name_engraver"
+ \consists "Grob_pq_engraver"
+ \consists "Forbid_line_break_engraver"
+ \consists "Axis_group_engraver"
+
+ \consists "Pitch_squash_engraver"
+
+ \override VerticalAxisGroup #'minimum-Y-extent = #'(-6 . 6)
+ extraVerticalExtent = ##f
+ verticalExtent = ##f
+ localKeySignature = #'()
+
+ % explicitly set instrument, so we don't get
+ % weird effects when doing instrument names for
+ % piano staves
+
+ instrumentName = #'()
+ shortInstrumentName = #'()
+
+ \accepts "Voice"
+}
+
+
+MyVoice = \context {
+ \type "Engraver_group"
+ \name Voice
+
+ \description "
+ Corresponds to a voice on a staff. This context handles the
+ conversion of dynamic signs, stems, beams, super- and subscripts,
+ slurs, ties, and rests.
+
+ You have to instantiate this explicitly if you want to have
+ multiple voices on the same staff."
+
+ localKeySignature = #'()
+ \consists "Font_size_engraver"
+
+ % must come before all
+ \consists "Output_property_engraver"
+ \consists "Arpeggio_engraver"
+ \consists "Multi_measure_rest_engraver"
+ \consists "Text_spanner_engraver"
+ \consists "Grob_pq_engraver"
+ \consists "Note_head_line_engraver"
+ \consists "Glissando_engraver"
+ \consists "Ligature_bracket_engraver"
+ \consists "Breathing_sign_engraver"
+ % \consists "Rest_engraver"
+ \consists "Grace_beam_engraver"
+ \consists "New_fingering_engraver"
+ \consists "Chord_tremolo_engraver"
+ \consists "Percent_repeat_engraver"
+ \consists "Slash_repeat_engraver"
+
+%{
+ Must come before text_engraver, but after note_column engraver.
+
+%}
+ \consists "Text_engraver"
+ \consists "Dynamic_engraver"
+ \consists "Fingering_engraver"
+
+ \consists "Script_column_engraver"
+ \consists "Rhythmic_column_engraver"
+ \consists "Cluster_spanner_engraver"
+ \consists "Tie_engraver"
+ \consists "Tie_engraver"
+ \consists "Tuplet_engraver"
+ \consists "Note_heads_engraver"
+ \consists "Rest_engraver"
+
+ \consists "Skip_event_swallow_translator"
+}
+
+
+\score {
+ \topVoice
+ \layout {
+ \context { \MyStaff }
+ \context { \MyVoice }
+ }
+}
+
+
+MyStaff = \context {
+ \MyStaff
+ \consists "Staff_symbol_engraver"
+}
+
+\score {
+ \topVoice
+ \layout {
+ \context { \MyStaff }
+ \context { \MyVoice }
+ }
+}
+
+MyStaff = \context {
+ \MyStaff
+ \consists "Clef_engraver"
+ \remove "Pitch_squash_engraver"
+}
+
+\score {
+ \topVoice
+ \layout {
+ \context { \MyStaff }
+ \context { \MyVoice }
+ }
+}
+
+MyVoice = \context {
+ \MyVoice
+ \consists "Stem_engraver"
+}
+
+\score {
+ \topVoice
+ \layout {
+ \context { \MyStaff }
+ \context { \MyVoice }
+ }
+}
+
+MyVoice = \context {
+ \MyVoice
+ \consists "Beam_engraver"
+}
+
+\score {
+ \topVoice
+ \layout {
+ \context { \MyStaff }
+ \context { \MyVoice }
+ }
+}
+
+MyVoice= \context {
+ \MyVoice
+ \consists "Phrasing_slur_engraver"
+ \consists "Slur_engraver"
+ \consists "Script_engraver"
+}
+
+
+\score {
+ \topVoice
+ \layout {
+ \context { \MyStaff }
+ \context { \MyVoice }
+ }
+}
+
+MyStaff = \context {
+ \MyStaff
+ \consists "Bar_engraver"
+ \consists "Time_signature_engraver"
+}
+
+\score {
+ \topVoice
+ \layout {
+ \context { \MyStaff }
+ \context { \MyVoice }
+ }
+}
+
+MyStaff = \context {
+ \MyStaff
+ \consists "Accidental_engraver"
+ \consists "Key_engraver"
+}
+\score {
+ \topVoice
+ \layout {
+ \context { \MyStaff }
+ \context { \MyVoice }
+ }
+}
+
--- /dev/null
+%% Do not edit this file; it is auto-generated from LSR!
+\version "2.11.23"
+
+\header { texidoc = "
+Setting the @code{transparent} property will cause an object to be
+printed in `invisible ink': the object is not printed, but all its
+other behavior is retained. The object still takes up space, it takes
+part in collisions, and slurs, and ties and beams can be attached to it.
+
+
+The snippet demonstrates how to connect different voices using ties.
+Normally, ties only connect two notes in the same voice. By
+introducing a tie in a different voice, and blanking the first up-stem
+in that voice, the tie appears to cross voices.
+" }
+
+\relative c'' {
+<< {
+ \once \override Stem #'transparent = ##t
+ b8~ b8\noBeam
+} \\ {
+ b[ g8]
+} >>
+}
--- /dev/null
+%% Do not edit this file; it is auto-generated from LSR!
+\version "2.11.23"
+
+\header { texidoc = "
+By putting the output of
+ @code{lilypond-version} into a lyric, it is possible to print the
+ version number of LilyPond in a score, or in a document generated
+ with @code{lilypond-book}. Another possibility is to append the
+ version number to the doc-string, in this manner:
+" }
+
+\score { \context Lyrics {
+ \override Score.RehearsalMark #'self-alignment-X = #LEFT
+ \mark #(ly:export (string-append "Processed with LilyPond version " (lilypond-version)))
+ s2
+ }
+}
+
+
+
--- /dev/null
+%% Do not edit this file; it is auto-generated from LSR!
+\version "2.11.23"
+
+\header { texidoc = "
+Engravers can be removed one by one. Here, the time signature and bar
+lines have been removed.
+
+
+" }
+
+\score {
+ \relative c'' {
+ a b c d
+ d c b a
+ }
+ \layout {
+ raggedright = ##t
+ \context {
+ \Staff
+ whichBar = #""
+ \remove "Time_signature_engraver"
+ }
+ }
+}
+
+
+
\version "2.11.23"
\header { texidoc = "
-With the \tweak command, you can tune every grob directly. Here are
-some examples of available tweaks.
+With the @code{\tweak} command, you can tune every grob directly. Here
+are some examples of available tweaks.
" }
\paper {
--- /dev/null
+%% Do not edit this file; it is auto-generated from LSR!
+\version "2.11.23"
+
+\header { texidoc = "
+The part combiner tool ( \partcombine command ) allows you to combine
+different parts on a same Staff. You can choose whether you want or
+don't want to add texts such as \"solo\" or \"a2\", by defining the
+printPartCombineTexts property.
+
+For vocal scores (hymns), there is no need to add solo/a2 texts, so
+they should be switched off. However, you'd better not use it if there
+are any solos, as they won't be indicated. In such cases, you may
+simply wan't to use standard LilyPond polyphony.
+
+This snippet presents the three ways two parts can be printed on a same
+staff : standard polyphony, \partcombine whitout texts, and
+\partcombine with texts.
+
+
+" }
+
+musicUp = { \time 4/4
+ \relative c'' {
+ a4 c4.(g8) a4 |
+ g4 e' g,( a8 b) |
+ c b a2.
+ }
+}
+
+musicDown = {
+ \relative c'' {
+ g4 e4.(d8) c4 |
+ r2 g'4( f8 e) |
+ d2 a
+ }
+}
+\score{
+ \new Staff {
+ \set Staff.instrumentName = "Standard polyphony "
+ << \musicUp \\ \musicDown >>
+ }
+ \layout{
+ indent = 6.0\cm
+ }
+}
+
+\score{
+ \context Staff {
+ \set Staff.instrumentName = "PartCombine without texts "
+ \partcombine \musicUp \musicDown
+ }
+ \layout{
+ indent = 6.0\cm
+ \context {
+ \Voice
+ printPartCombineTexts = ##f
+ }
+ }
+}
+
+\score{
+ \context Staff {
+ \set Staff.instrumentName = "PartCombine with texts "
+ \partcombine \musicUp \musicDown
+ }
+ \layout{
+ indent = 6.0\cm
+ \context {
+ \Voice
+ printPartCombineTexts = ##t
+ }
+ }
+}
+
+%% Do not edit this file; it is auto-generated from LSR!
\header {
texidoc = "Makam is Turkish type of melody that uses 1/9 tone
}
-\version "2.11.6"
+\version "2.11.23"
%{
--- /dev/null
+%% Do not edit this file; it is auto-generated from LSR!
+\version "2.11.23"
+
+\header { texidoc = "
+Extending stems to the center line may be prevented using
+@code{no-stem-extend}.
+
+
+" }
+
+\score {
+ \context Voice \relative c {
+ \context Staff <<
+ \new Voice {
+ f2 f8 g a b
+ \override Stem #'no-stem-extend = ##t
+ f2 f8 g a b
+ }
+ \new Voice {
+ c''2 c8 b a g
+ \override Stem #'no-stem-extend = ##t
+ c2 c8 b a g
+ }
+ >>
+
+ }
+
+}
+
+
--- /dev/null
+%% Do not edit this file; it is auto-generated from LSR!
+\version "2.11.23"
+
+\header { texidoc = "
+Rests may be used in various styles.
+
+
+
+" }
+
+\layout {
+ indent = 0.0
+ raggedright = ##t
+}
+
+\context Staff \relative c {
+ \set Score.timing = ##f
+ \override Staff.Rest #'style = #'mensural
+ r\maxima^\markup \typewriter { mensural }
+ r\longa r\breve r1 r2 r4 r8 r16 r32 r64 r128 r128
+ \bar ""
+
+ \override Staff.Rest #'style = #'neomensural
+ r\maxima^\markup \typewriter { neomensural }
+ r\longa r\breve r1 r2 r4 r8 r16 r32 r64 r128 r128
+ \bar ""
+
+ \override Staff.Rest #'style = #'classical
+ r\maxima^\markup \typewriter { classical }
+ r\longa r\breve r1 r2 r4 r8 r16 r32 r64 r128 r128
+ \bar ""
+
+ \override Staff.Rest #'style = #'default
+ r\maxima^\markup \typewriter { default }
+ r\longa r\breve r1 r2 r4 r8 r16 r32 r64 r128 r128
+
+}
+
+
--- /dev/null
+%% Do not edit this file; it is auto-generated from LSR!
+\version "2.11.23"
+
+\header { texidoc = "
+This Scheme-based snippet allows you to generate 256 random notes based
+on the current time (or any randomish number you might wish to specify
+instead, so you can obtain the same random notes each time): i.e. to
+get different random notes patterns, just change this number.
+" }
+
+\score {
+{ #(let ((random-state (seed->random-state (current-time))))
+ (ly:export
+ (make-music 'SequentialMusic 'elements
+ (map (lambda x
+ (let ((idx (random 12 random-state)))
+ (make-music 'EventChord
+ 'elements (list (make-music 'NoteEvent
+ 'duration (ly:make-duration 2 0 1 1)
+ 'pitch (ly:make-pitch (quotient idx 7)
+ (remainder idx 7)
+ 0))))))
+ (make-list 256)))))
+ }
+}
--- /dev/null
+%% Do not edit this file; it is auto-generated from LSR!
+\version "2.11.23"
+
+\header { texidoc = "
+There is a way to enforce enharmonic modifications for notes in order
+to have the minimum number of accidentals. In that case, ``Double
+accidentals should be removed, as well as E-sharp (-> F), bC (-> B), bF
+(-> E), B-sharp (-> C).'', as proposed by a request for a new feature.
+In this manner, the most natural enharmonic notes are chosen in this
+example.
+" }
+
+#(define (naturalise-pitch p)
+ (let* ((o (ly:pitch-octave p))
+ (a (ly:pitch-alteration p))
+ (n (ly:pitch-notename p)))
+
+ (cond
+ ((and (> a 1) (or (eq? n 6) (eq? n 2)))
+ (set! a (- a 2))
+ (set! n (+ n 1)))
+ ((and (< a -1) (or (eq? n 0) (eq? n 3)))
+ (set! a (+ a 2))
+ (set! n (- n 1))))
+
+ (cond
+ ((> a 2) (set! a (- a 4)) (set! n (+ n 1)))
+ ((< a -2) (set! a (+ a 4)) (set! n (- n 1))))
+
+ (if (< n 0) (begin (set! o (- o 1)) (set! n (+ n 7))))
+ (if (> n 6) (begin (set! o (+ o 1)) (set! n (- n 7))))
+
+ (ly:make-pitch o n a)))
+
+#(define (naturalise music)
+ (let* ((es (ly:music-property music 'elements))
+ (e (ly:music-property music 'element))
+ (p (ly:music-property music 'pitch)))
+
+ (if (pair? es)
+ (ly:music-set-property!
+ music 'elements
+ (map (lambda (x) (naturalise x)) es)))
+
+ (if (ly:music? e)
+ (ly:music-set-property!
+ music 'element
+ (naturalise e)))
+
+ (if (ly:pitch? p)
+ (begin
+ (set! p (naturalise-pitch p))
+ (ly:music-set-property! music 'pitch p)))
+
+ music))
+
+music = \relative c' { c4 d e f g a b c }
+
+naturaliseMusic =
+#(define-music-function (parser location m)
+ (ly:music?)
+ (naturalise m))
+
+\score {
+ \context Staff {
+ \transpose c ais \music
+ \naturaliseMusic \transpose c ais \music
+ \transpose c deses \music
+ \naturaliseMusic \transpose c deses \music
+ }
+ \layout { ragged-right = ##t}
+}
+
+
as ossias.
" }
-% ****************************************************************
-% ly snippet:
-% ****************************************************************
-
\paper {
ragged-right = ##t
}
}
>> }
>>
-
-
-
-% ****************************************************************
-% end ly snippet
-% ****************************************************************
-
\version "2.11.23"
\header { texidoc = "
-By setting the Scheme property 'debug-skylines, you can make a nice
-funky artwork out of you score :-)
-
-More seriously, drawing your skyline can be helpful to debug spacing
-and collision issues. (Still, it does make your score pretty; so just
-try it, no matter how you really need to...)
+By setting the Scheme property 'debug-skylines, you can turn your score
+into a nice funky artwork :-) More seriously, drawing this skyline can
+be helpful to debug spacing and collision issues. (Still, it does make
+your score pretty; so just try it, no matter how much you really need
+to...)
" }
#(ly:set-option 'debug-skylines #t)
--- /dev/null
+%% Do not edit this file; it is auto-generated from LSR!
+\version "2.11.23"
+
+\header { texidoc = "
+The object may be extended to larger sized by overriding their
+properties. The lyrics in this example have an extent of
+@code{(-10,10)}, which is why they are spaced so widely.
+
+
+
+" }
+
+\score {
+ \context Lyrics \lyricmode {
+ foo --
+
+ \override LyricText #'X-extent = #'(-10.0 . 10.0)
+ bar baz
+ }
+ \layout { raggedright = ##t}
+}
+
+
+
--- /dev/null
+%% Do not edit this file; it is auto-generated from LSR!
+\version "2.11.23"
+
+\header { texidoc = "
+Instrument names can be displayed using a \markup command; in this case
+the name is placed inside a padded box, which can help vertical
+alignment.
+" }
+
+\new StaffGroup \relative
+<<
+ \new Staff {
+ \set Staff.instrumentName = \markup { \hcenter-in #10 "blabla" }
+ c1 c1
+ }
+ \new Staff {
+ \set Staff.instrumentName = \markup { \hcenter-in #10 "blo" }
+ c1 c1
+ }
+
+>>
--- /dev/null
+%% Do not edit this file; it is auto-generated from LSR!
+\version "2.11.23"
+
+\header { texidoc = "
+In order to change staff sizes, both @code{staff-space} and
+@code{fontSize} must be scaled.
+" }
+
+\relative c' <<
+% \new Staff \relative c'' { \dynamicDown c4 \ff c c c }
+ \new Staff \with {
+ fontSize = #-3
+ \override StaffSymbol #'staff-space = #(magstep -3)
+ } {
+ \clef bass
+ c8 c c c c c c c
+ }
+>>
+
+
+
--- /dev/null
+%% Do not edit this file; it is auto-generated from LSR!
+\version "2.11.23"
+
+\header { texidoc = "
+In this preliminary test of a modern score, the staff lines are washed
+out temporarily. This is done by making a tuned @code{StaffContainer},
+which @code{\skip}s some notes without printing lines either and
+creates a @code{\new Staff} then in order to create the lines again.
+(Be careful if you use this; it has been done by splitting the grouping
+@code{Axis_group_engraver} and creating functionality into separate
+contexts, but the clefs and time signatures may not do what you would
+expect.)
+
+
+
+" }
+
+\score {
+ \relative c'' <<
+ \new StaffContainer {
+
+ %% need << >>, otherwise we descend to the voice inside SA
+ << \new Staff { c4 c4 } >>
+ \skip 4 % s4 would create staff.
+
+ << \new Staff { b4 b4 } >>
+ }
+ \new StaffContainer {
+ \skip 4
+ << \context Staff { e d f \bar ":|" } >>
+ \skip 4
+ }
+ >>
+
+ \layout {
+ \context {
+ \Score
+ \accepts StaffContainer
+ \denies Staff
+ }
+ \context {
+ \type Engraver_group
+ \consists Clef_engraver
+ \consists Time_signature_engraver
+ \consists Separating_line_group_engraver
+ \consists "Axis_group_engraver"
+ \accepts "Staff"
+
+ \name StaffContainer
+ }
+ \context {
+ \Staff
+ \remove Axis_group_engraver
+ \remove Separating_line_group_engraver
+ \remove Clef_engraver
+ \remove Time_signature_engraver
+ }
+ raggedright=##t
+ }
+}
+
+
+
--- /dev/null
+%% Do not edit this file; it is auto-generated from LSR!
+\version "2.11.23"
+
+\header { texidoc = "
+The \startTextSpan and \stopTextSpan commands give you the ability to
+create text spanners as easily as pedals indications or octavations.
+Override some properties of the TextSpanner object to modify its
+output.
+" }
+
+\relative c''{
+ \override TextSpanner #'edge-text = #'("bla" . "blu")
+ a \startTextSpan
+ b c
+ a \stopTextSpan
+
+ \override TextSpanner #'dash-period = #2
+ \override TextSpanner #'dash-fraction = #0.0
+ a \startTextSpan
+ b c
+ a \stopTextSpan
+
+ \revert TextSpanner #'style
+ \override TextSpanner #'style = #'dashed-line \override TextSpanner #'bound-details #'left #'text = \markup { \draw-line #'(0 . 1) }
+ \override TextSpanner #'bound-details #'right #'text = \markup { \draw-line #'(0 . -2) }
+
+ a \startTextSpan
+ b c
+ a \stopTextSpan
+
+
+ \set Staff.middleCPosition = #-13
+
+ \override TextSpanner #'dash-period = #10
+ \override TextSpanner #'dash-fraction = #.5
+ \override TextSpanner #'thickness = #10
+ a \startTextSpan
+ b c
+ a \stopTextSpan
+ \set Staff.middleCPosition = #-6
+}
+
--- /dev/null
+%% Do not edit this file; it is auto-generated from LSR!
+\version "2.11.23"
+
+\header { texidoc = "
+Some letters imply smaller vertical extents than the others; if you
+have, below your staff, two markups with different vertical extents
+(e.g. one text with letters \"t,h,l and/or UPPER CASE\" and one text
+with \"a, c, e, n or m\"), LilyPond will align them to the top by
+default, thus making it look a bit messy. Therefore, you need to add
+invisible ascender letters using the \transparent command to make it
+right.
+" }
+
+\new Staff {
+ \override TextScript #'staff-padding = #4
+ \override TextScript #'self-alignment-X = #center
+ \time 2/4
+ c'4_\markup { \transparent "A" "WRONG" \transparent "A" }
+ c'4_\markup { "case" }
+ c'4_\markup { \transparent "A" "RIGHT" \transparent "A" }
+ c'4_\markup { \transparent "A" "case" \transparent "A" }
+}
--- /dev/null
+%% Do not edit this file; it is auto-generated from LSR!
+\version "2.11.23"
+
+\header { texidoc = "
+LilyPond gives you the ability to rotate any object you want,
+particularly markups as showed here. Alternatively, you can use the
+\column function to display your text vertically without rotating the
+letters.
+" }
+
+\score {
+ \relative c' {
+ c4^\markup {\rotate #45.0 {"hello"}}
+ c4^\markup {\rotate #90.0 {"hello"}}
+ c4^\markup {\column {"h" "e" "l" "l" "o"}}
+ }
+ }
--- /dev/null
+%% Do not edit this file; it is auto-generated from LSR!
+\version "2.11.23"
+
+\header { texidoc = "
+You can specify different horizontal alignment for your lyrics, by
+overriding the #'self-alignment-X property of the LyricText object. #-1
+is left, #0 is center and #1 is right; however, you can use #LEFT,
+#CENTER and #RIGHT as well.
+" }
+
+\relative c'' {
+c1 c c}
+\addlyrics {\once \override LyricText #'self-alignment-X = #LEFT "This is left-aligned"
+\once \override LyricText #'self-alignment-X = #CENTER "This is centered"
+\once \override LyricText #'self-alignment-X = #1 "this is right-aligned" }
--- /dev/null
+%% Do not edit this file; it is auto-generated from LSR!
+\version "2.11.23"
+
+\header { texidoc = "
+This example shows a trick to insert a vertical brace when going from
+several stanzas into a common ending in the lyrics. (An alternative is
+of course to just skip the brace, especially if you add a line break
+instead).
+" }
+
+% Replace brace150 by whatever between brace0 and brace575 that is of a
+% suitable size.
+leftbrace = \markup {\override #'(font-encoding . fetaBraces) \lookup #"brace200" }
+
+% In some versions earlier than 20.10.20, the argument to \rotate was
+% erroneously treated as radians instead of degrees, i.e. #3.14 was
+% needed instead of #180
+rightbrace = \markup {\rotate #180 \leftbrace }
+
+
+lyricsbeforebrace = \lyricmode {Here is some ly -- rics }
+
+lyricsfrombrace = \lyricmode { \markup{\rightbrace Here} comes some more }
+
+
+melody = \relative c'{ c d e f g f e d c e d f g }
+
+
+\score{
+<<
+ \new Voice = m \melody
+ \new Lyrics \lyricsto m \lyricsbeforebrace
+ \new Lyrics \lyricsto m { \lyricsbeforebrace \lyricsfrombrace }
+ \new Lyrics \lyricsto m \lyricsbeforebrace
+>>
+}
+
--- /dev/null
+\header {
+ texidoc = "Ambituses use actual pitch not lexicographic ordering."
+ }
+
+\version "2.10.25"
+
+\paper {
+ ragged-right=##t
+}
+
+\new Voice \with { \consists "Ambitus_engraver" } {
+ \clef F c eis fes
+}
--- /dev/null
+\header {
+ texidoc = "Dot columns do not trigger beam slanting too early."
+}
+
+\version "2.11.26"
+\paper{ ragged-right=##t }
+<<
+ { e''8 e''8 g'' g''} \\
+ { e8 r4. }
+>>
--- /dev/null
+\header {
+
+ texidoc = "@code{\laissezVibrer} ties on beamed notes don't trigger
+premature beam slope calculation. "
+
+}
+
+\version "2.11.26"
+
+\paper{
+ ragged-right=##t
+}
+
+{
+ c'8 e' g' c''\laissezVibrer r2 |
+ c'8 e' g' c'' r2
+}
+++ /dev/null
-\version "2.10.0"
-\header {
-
-texidoc ="In polyphonic notation, many voices can share a staff: In
-this situation, the accidentals and staff are shared, but the stems,
-slurs, beams, etc. are private to each voice. Hence, engravers should
-be grouped. The engravers for note head, stems, slurs, etc. go into a
-group called ``Voice context'', while the engravers for key,
-accidental, bar, etc. go into a group called ``Staff context''. In the
-case of polyphony, a single Staff context contains more than one Voice
-context. Similarly, more Staff contexts can be put into a single Score
-context. "
-
-}
-
-\include "engraver-example.ily"
-
-\score {
-\context Staff << \topVoice \\ \botVoice >>
-}
-
-
-\score {
-<< \new Staff << \topVoice \\ \botVoice >>
-\new Staff << \pah \\ \hoom >>
- >>
-}
-
-
-
+++ /dev/null
-
-\version "2.10.0"
-\header {
-
- texidoc = "The notation problem, creating a certain symbol,
- is handled by plugins. Each plugin is called Engraver. In this example,
-engravers are switched on one by one, in the following order:
-
-@itemize
-@item note heads,
-@item staff symbol,
-@item clef,
-@item stem,
-@item beams, slurs, accents,
-@item accidentals, bar lines, time signature, and key signature.
-@end itemize
-
-Engravers are grouped. For example, note heads, slurs, beams etc. form
-a Voice context. Engravers for key, accidental, bar, etc. form a
-Staff context.
-
-"
-
-}
-\layout { ragged-right = ##t }
-
-\include "engraver-example.ily"
-
-
-%
-% setup for Request->Element conversion. Guru-only
-%
-
-MyStaff =\context {
- \type "Engraver_group"
- \name Staff
-
- \description "Handles clefs, bar lines, keys, accidentals. It can contain
-@code{Voice} contexts."
-
-
- \consists "Output_property_engraver"
-
- \consists "Font_size_engraver"
-
- \consists "Volta_engraver"
- \consists "Separating_line_group_engraver"
- \consists "Dot_column_engraver"
-
- \consists "Ottava_spanner_engraver"
- \consists "Rest_collision_engraver"
- \consists "Piano_pedal_engraver"
- \consists "Piano_pedal_align_engraver"
- \consists "Instrument_name_engraver"
- \consists "Grob_pq_engraver"
- \consists "Forbid_line_break_engraver"
- \consists "Axis_group_engraver"
-
- \consists "Pitch_squash_engraver"
-
- \override VerticalAxisGroup #'minimum-Y-extent = #'(-6 . 6)
- extraVerticalExtent = ##f
- verticalExtent = ##f
- localKeySignature = #'()
-
- % explicitly set instrument, so we don't get
- % weird effects when doing instrument names for
- % piano staves
-
- instrumentName = #'()
- shortInstrumentName = #'()
-
- \accepts "Voice"
-}
-
-
-MyVoice = \context {
- \type "Engraver_group"
- \name Voice
-
- \description "
- Corresponds to a voice on a staff. This context handles the
- conversion of dynamic signs, stems, beams, super- and subscripts,
- slurs, ties, and rests.
-
- You have to instantiate this explicitly if you want to have
- multiple voices on the same staff."
-
- localKeySignature = #'()
- \consists "Font_size_engraver"
-
- % must come before all
- \consists "Output_property_engraver"
- \consists "Arpeggio_engraver"
- \consists "Multi_measure_rest_engraver"
- \consists "Text_spanner_engraver"
- \consists "Grob_pq_engraver"
- \consists "Note_head_line_engraver"
- \consists "Glissando_engraver"
- \consists "Ligature_bracket_engraver"
- \consists "Breathing_sign_engraver"
- % \consists "Rest_engraver"
- \consists "Grace_beam_engraver"
- \consists "New_fingering_engraver"
- \consists "Chord_tremolo_engraver"
- \consists "Percent_repeat_engraver"
- \consists "Slash_repeat_engraver"
-
-%{
- Must come before text_engraver, but after note_column engraver.
-
-%}
- \consists "Text_engraver"
- \consists "Dynamic_engraver"
- \consists "Fingering_engraver"
-
- \consists "Script_column_engraver"
- \consists "Rhythmic_column_engraver"
- \consists "Cluster_spanner_engraver"
- \consists "Tie_engraver"
- \consists "Tie_engraver"
- \consists "Tuplet_engraver"
- \consists "Note_heads_engraver"
- \consists "Rest_engraver"
-
- \consists "Skip_event_swallow_translator"
-}
-
-
-\score {
- \topVoice
- \layout {
- \context { \MyStaff }
- \context { \MyVoice }
- }
-}
-
-
-MyStaff = \context {
- \MyStaff
- \consists "Staff_symbol_engraver"
-}
-
-\score {
- \topVoice
- \layout {
- \context { \MyStaff }
- \context { \MyVoice }
- }
-}
-
-MyStaff = \context {
- \MyStaff
- \consists "Clef_engraver"
- \remove "Pitch_squash_engraver"
-}
-
-\score {
- \topVoice
- \layout {
- \context { \MyStaff }
- \context { \MyVoice }
- }
-}
-
-MyVoice = \context {
- \MyVoice
- \consists "Stem_engraver"
-}
-
-\score {
- \topVoice
- \layout {
- \context { \MyStaff }
- \context { \MyVoice }
- }
-}
-
-MyVoice = \context {
- \MyVoice
- \consists "Beam_engraver"
-}
-
-\score {
- \topVoice
- \layout {
- \context { \MyStaff }
- \context { \MyVoice }
- }
-}
-
-MyVoice= \context {
- \MyVoice
- \consists "Phrasing_slur_engraver"
- \consists "Slur_engraver"
- \consists "Script_engraver"
-}
-
-
-\score {
- \topVoice
- \layout {
- \context { \MyStaff }
- \context { \MyVoice }
- }
-}
-
-MyStaff = \context {
- \MyStaff
- \consists "Bar_engraver"
- \consists "Time_signature_engraver"
-}
-
-\score {
- \topVoice
- \layout {
- \context { \MyStaff }
- \context { \MyVoice }
- }
-}
-
-MyStaff = \context {
- \MyStaff
- \consists "Accidental_engraver"
- \consists "Key_engraver"
-}
-\score {
- \topVoice
- \layout {
- \context { \MyStaff }
- \context { \MyVoice }
- }
-}
+++ /dev/null
-\version "2.10.0"
-\header {
- texidoc = "@cindex Gregorian Scripts
-
-Here is demonstrated a preliminary support of Gregorian Scripts:
-
-ictus, circulus, semicirculus, accentus, episem.
-
-"}
-
-%{
-
-FIXME: horizontal spacing (ragged right mode).
-
-FIXME: padding/minimum-distance is fragile.
-
-FIXME: episem stops one notehead too early.
-
-%}
-
-\include "gregorian-init.ly"
-
-\paper {
- line-thickness = \staff-space / 5.0
-}
-
-\score {
- \context VaticanaVoice {
- \override Script #'padding = #-0.5
- {
- a\ictus
- a\circulus
- a\semicirculus
- a\accentus
- \[ a \episemInitium \pes b \flexa a \episemFinis \]
- }
- }
- \layout {
- line-width = 70.0
- width = 60.0
- indent = 0.0
- ragged-right = ##t
- }
-}
+++ /dev/null
-
-\version "2.10.0"
-
-\header { texidoc = "
-
-You can combine two parts on the same staff using the part
-combiner. For vocal scores (hymns), there is no need to add solo/a2
-texts, so they should be switched off.
-
-" }
-
-\score{
- \context Staff <<
- \time 4/4
- \partcombine
- \relative c'' {
- a4 c4.(g8) a4 |
- g4 e' g(f) |
- b, a c2
- }
- \relative c'' {
- g4 e4.(d8) c4 |
- g'4 c, e(f) |
- d2 a
- }
- >>
- \layout{
- line-width=140.\mm
- \context {
- \Voice
- printPartCombineTexts = ##f
- }
- }
-}
-
-
+++ /dev/null
-
-\header {
-
-
- texidoc = "instrument names may be aligned manually by putting the
-names in padded boxes with @code{\markup}."
-
-
-}
-
-\version "2.10.0"
-
-\paper {
- line-width = 15\cm
-}
-
-
-\new StaffGroup \relative
-<<
- \new Staff {
- \set Staff.instrumentName = \markup { \hcenter-in #10 "blabla" }
- c1 c1
- }
- \new Staff {
- \set Staff.instrumentName = \markup { \hcenter-in #10 "blo" }
- c1 c1
- }
-
->>
+++ /dev/null
-
-\version "2.10.0"
-% MERGE with title.ly -gp
-
-%{
- Test lilypond features.
-%}
-
-\header {
-copyright = "copyright"
-title = "title"
-subtitle = "subtitle"
-composer = "composer"
-arranger = "arranger"
-instrument = "instrument"
-metre = "metre"
-opus = "opus"
-piece = "piece"
-poet = "poet"
-texidoc = "All header fields with special meanings."
- copyright = "public domain"
- enteredby = "jcn"
- source = "urtext"
-
-}
-
-
-\score {
- \relative c'' { c1 c1 c1 c1 }
-}
-
-\score {
- \relative c'' { c1 c1 c1 c1 }
-
- \header {
-
- title = "localtitle"
- subtitle = "localsubtitle"
- composer = "localcomposer"
- arranger = "localarranger"
- instrument = "localinstrument"
- metre = "localmetre"
- opus = "localopus"
- piece = "localpiece"
- poet = "localpoet"
- copyright = "localcopyright"
- }
-}
-
+++ /dev/null
-\version "2.10.0"
-
-% possible rename to scheme- something. -gp
-\header { texidoc = "@cindex Scheme Music Creation
-You can engrave music using just Scheme expressions. Although those
-expressions reflect the inner mechanism of LilyPond, they are rather
-clumsy to use, so avoid them, if possible. "
-}
-
-#(define (make-note-req p d)
- (make-music 'NoteEvent
- 'duration d
- 'pitch p))
-
-#(define (make-note elts)
- (make-music 'EventChord
- 'elements elts))
-
-#(define (seq-music-list elts)
- (make-music 'SequentialMusic
- 'elements elts))
-
-fooMusic = #(seq-music-list
- (list (make-note (list (make-note-req (ly:make-pitch 1 0 0) (ly:make-duration 2 0))))
- (make-note (list (make-note-req (ly:make-pitch 1 1 0) (ly:make-duration 2 0))))))
-
-\score { \fooMusic
-\layout { ragged-right = ##t }
-}
-
+++ /dev/null
-
-\version "2.10.0"
-% possible rename to bar-lines-foo. -gp
-
-\header{ texidoc = "@cindex Bar Lines Remove
-Engravers can be removed one by one. Here, the time signature and bar lines
-have been removed.
-"
-}
-
-\score {
- \relative c'' {
- a b c d
- d c b a
- }
- \layout {
- ragged-right = ##t
- \context {
- \Staff
- whichBar = #""
- \remove "Time_signature_engraver"
- }
- }
-}
-
-
+++ /dev/null
-
-\version "2.10.0"
-% check with invisible-notes or blank-notes. possible rename. -gp
-\header{ texidoc = "@cindex Partial Blank
-When entering partially typeset music (i.e. for students to be
-completed by hand), you may need the spacing that correspond to the
-timing of notes: all measures have same length, etc. It can be
-implemented by adding an invisible staff with a lot of fast notes. "
-}
-
-quickmeasure = {
- \repeat unfold 16 c''16
-}
-
-mel = \relative c' {c16 d16 e8 a4 g2 e8 d c2. g'1 e4 d c2}
-
-\score {
-\context PianoStaff <<
- \new Staff <<
- \clef G
- \new Voice {\mel}
- \new Voice {
- \override NoteHead #'transparent = ##t
- \override Stem #'transparent = ##t
- \override Beam #'transparent = ##t
- \repeat unfold 4 \quickmeasure
- }
- >>
- \new Staff {\clef F s1*4}
->>
-\layout {}
-}
-
+++ /dev/null
-\version "2.10.0"
-\header { texidoc = "
-
-@cindex Preset Extent
-
-The object may be extended to larger sized by overriding their properties.
-The lyrics in this example have an extent of @code{(-10,10)}, which is why
-they are spaced so widely.
-
-"
-
-}
-
-\score {
- \context Lyrics \lyricmode {
- foo --
-
- \override LyricText #'X-extent = #'(-10.0 . 10.0)
- bar baz
- }
- \layout { ragged-right = ##t}
-}
-
-
+++ /dev/null
-
-\version "2.10.0"
-\header {
- texidoc = "@cindex Rests
-
-Rests may be used in various styles.
-
-"
-}
-
-\layout {
- indent = 0.0
- ragged-right = ##t
-}
-
-\context Staff \relative c {
- \set Score.timing = ##f
- \override Staff.Rest #'style = #'mensural
- r\maxima^\markup \typewriter { mensural }
- r\longa r\breve r1 r2 r4 r8 r16 r32 r64 r128 r128
- \bar ""
-
- \override Staff.Rest #'style = #'neomensural
- r\maxima^\markup \typewriter { neomensural }
- r\longa r\breve r1 r2 r4 r8 r16 r32 r64 r128 r128
- \bar ""
-
- \override Staff.Rest #'style = #'classical
- r\maxima^\markup \typewriter { classical }
- r\longa r\breve r1 r2 r4 r8 r16 r32 r64 r128 r128
- \bar ""
-
- \override Staff.Rest #'style = #'default
- r\maxima^\markup \typewriter { default }
- r\longa r\breve r1 r2 r4 r8 r16 r32 r64 r128 r128
-
-}
-
+++ /dev/null
-\version "2.10.0"
-
-\header {
-
- texidoc = "
-
-In this preliminary test of a modern score, the staff lines are washed
-out temporarily. This is done by making a tuned @code{StaffContainer},
-which @code{\skip}s some notes without printing lines either and
-creates a @code{\\new Staff} then in order to create the lines again.
-(Be careful if you use this; it has been done by splitting the
-grouping @code{Axis_group_engraver} and creating functionality into
-separate contexts, but the clefs and time signatures may not do
-what you would expect.)
-
- "
-
- }
-
-
-
-\score {
- \relative c'' <<
- \new StaffContainer {
-
- %% need << >>, otherwise we descend to the voice inside SA
- << \new Staff { c4 c4 } >>
- \skip 4 % s4 would create staff.
-
- << \new Staff { b4 b4 } >>
- }
- \new StaffContainer {
- \skip 4
- << \context Staff { e d f \bar ":|" } >>
- \skip 4
- }
- >>
-
- \layout {
- \context {
- \Score
- \accepts StaffContainer
- \denies Staff
- }
- \context {
- \type Engraver_group
- \consists Clef_engraver
- \consists Time_signature_engraver
- \consists Separating_line_group_engraver
- \consists "Axis_group_engraver"
- \accepts "Staff"
-
- \name StaffContainer
- }
- \context {
- \Staff
- \remove Axis_group_engraver
- \remove Separating_line_group_engraver
- \remove Clef_engraver
- \remove Time_signature_engraver
- }
- ragged-right=##t
- }
-}
-
-
+++ /dev/null
-\version "2.10.0"
-
-\header { texidoc = "@cindex Staff Size
-
-In order to change staff sizes, both @code{staff-space} and @code{fontSize}
-must be scaled."
-
-}
-
-\layout { ragged-right = ##t}
-
-\relative c' <<
-% \new Staff \relative c'' { \dynamicDown c4 \ff c c c }
- \new Staff \with {
- fontSize = #-3
- \override StaffSymbol #'staff-space = #(magstep -3)
- } {
- \clef bass
- c8 c c c c c c c
- }
->>
-
-
+++ /dev/null
-\version "2.10.0"
-
-\header { texidoc = "@cindex Stem Extend
-Extending stems to the center line may be prevented using @code{no-stem-extend}.
-"
-}
-
-\score {
- \context Voice \relative c {
- \context Staff <<
- \new Voice {
- f2 f8 g a b
- \override Stem #'no-stem-extend = ##t
- f2 f8 g a b
- }
- \new Voice {
- c''2 c8 b a g
- \override Stem #'no-stem-extend = ##t
- c2 c8 b a g
- }
- >>
-
- }
- \layout { ragged-right = ##t}
-}
-
+++ /dev/null
-
-\version "2.10.0"
-\header {texidoc = "@cindex Tablature hammer
-A hammer in tablature can be faked with slurs. "
-}
-
-\score{
- %BROKEN \context TabStaff
- <<
- \relative c''{
- c(d)
- d(d)
- d(c)
- }
- >>
- \layout{ ragged-right = ##t}
-}
-
+++ /dev/null
-
-\version "2.10.0"
-
-\header { texidoc = "@cindex text spanner
-Text spanners can be used in the similar manner than markings for pedals
-or octavation.
-"
- }
-\layout{ ragged-right = ##t}
-
-\relative c''{
- \override TextSpanner #'edge-text = #'("bla" . "blu")
- a \startTextSpan
- b c
- a \stopTextSpan
-
- \override TextSpanner #'dash-period = #2
- \override TextSpanner #'dash-fraction = #0.0
- a \startTextSpan
- b c
- a \stopTextSpan
-
- \revert TextSpanner #'style
- \override TextSpanner #'style = #'dashed-line
- \override TextSpanner #'edge-height = #'(1 . -2)
- a \startTextSpan
- b c
- a \stopTextSpan
-
-
- \set Staff.middleCPosition = #-13
-
- \override TextSpanner #'dash-period = #10
- \override TextSpanner #'dash-fraction = #.5
- \override TextSpanner #'thickness = #10
- a \startTextSpan
- b c
- a \stopTextSpan
- \set Staff.middleCPosition = #-6
-}
-
+++ /dev/null
-%% todo: move into advanced notation section of the manual.
-
-\header {
-
- texidoc = "Time signatures may be put on a separate staff. This is
- used contemporary pieces with many time signature changes. "
-
-}
-\version "2.10.0"
-\layout {
- ragged-right = ##T
-}
-
-\layout{
- \context {
- \type "Engraver_group"
- \consists "Time_signature_engraver"
- \consists "Axis_group_engraver"
- \name "TimeSig"
- \override TimeSignature #'font-size = #4
- }
- \context {
- \Score \accepts TimeSig
- }
-
- \context { \Staff
- \override TimeSignature #'transparent = ##t
- }
-}
-
-
-\relative
-<< \new Staff { \time 2/4 c2 \time 3/4 c2. \time 4/4 c1 }
- \new TimeSig {
- \skip 4 * 9
- }
- \new Staff { r4 r r
- r4 r r
- r4 r r }
-
- >>
+++ /dev/null
-\version "2.10.0"
-
-\header {
-
-
- texidoc = #(string-append "By putting the output of
- @code{lilypond-version} into a lyric, it is possible to print the
- version number of LilyPond in a score, or in a document generated
- with @code{lilypond-book}. Another possibility is to append the
- version number to the doc-string, in this manner: "
-
- (lilypond-version)
- )
-
-}
-
-\score { \context Lyrics {
- \override Score.RehearsalMark #'self-alignment-X = #LEFT
- \mark #(ly:export (string-append "Processed with LilyPond version " (lilypond-version)))
- s2
- }
-}
-
-
+++ /dev/null
-\version "2.10.0"
-% TODO: huh? what's this file about? -gp
-% This file shows that Staff grobs can get very deep or high; there is a lot
-% of room between the staves.
-
-\header { texidoc = "
-Vertical extents may increased by setting @code{\override VerticalAxisGroup #'minimum-Y-extent},
-@code{extra-Y-extent}, and @code{Y-extent}. In this example,
-@code{Y-extent} is increased.
-" }
-
-\score {
- <<
- \new Staff {
- \override Staff.VerticalAxisGroup #'Y-extent = #'(-15.0 . 0.0)
- \clef alto
- a1^"15-deep staff"
- }
- \new Staff {
- \clef alto
- b1
- }
- \new Staff {
- \clef alto
- c1
- }
- \new Staff {
- \clef alto
- \override Staff.VerticalAxisGroup #'Y-extent = #'(-0.0 . 10.0)
- d1^"10-high staff"
- }
- >>
- \layout{
- ragged-right = ##t
- }
-}
-
+++ /dev/null
-\header {
- texidoc = "Volta brackets can be placed over chord names. Just set
-the @code{voltaOnThisStaff} property to true for the @code{ChordNames} context and to false for the topmost ordinary @code{Staff} context."
-}
-
-\version "2.10.0"
-\score { <<
- \new ChordNames \with {
- voltaOnThisStaff = ##t
- } \chordmode {
- c1 c
- }
- \new Staff \with {
- voltaOnThisStaff = ##f
- }
- {
- \repeat volta 2 { c'1 } \alternative { c' }
- }
->> }
stem_xposns.push_back (s->relative_coordinate (common[X_AXIS], X_AXIS));
}
- bool xstaff = false;
- if (lvs && fvs)
- {
- Grob *commony = fvs->common_refpoint (lvs, Y_AXIS);
- xstaff = Align_interface::has_interface (commony);
- }
+ bool xstaff = Align_interface::has_interface (common[Y_AXIS]);
Direction ldir = Direction (stem_infos[0].dir_);
Direction rdir = Direction (stem_infos.back ().dir_);
Direction d = DOWN;
do
score[d] /= max (count[d], 1);
- while (flip (&d) != DOWN)
- ;
+ while (flip (&d) != DOWN);
return score[LEFT] + score[RIGHT];
}
&& me->get_bound (event_dir)->break_status_dir ())
{
current.horizontal_[event_dir]
- = (robust_relative_extent (me->get_bound (event_dir), commonx, X_AXIS)[RIGHT]
+ = (robust_relative_extent (me->get_bound (event_dir),
+ commonx, X_AXIS)[RIGHT]
+ event_dir * break_overshoot[event_dir]);
}
else
if (inside_stem)
{
Grob *neighbor_stem = stems[segs[j].stem_index_ + event_dir];
- Real neighbor_stem_x = neighbor_stem->relative_coordinate (commonx, X_AXIS);
+ Real neighbor_stem_x
+ = neighbor_stem->relative_coordinate (commonx, X_AXIS);
notehead_width = min (notehead_width,
fabs (neighbor_stem_x - segs[j].stem_x_)/2);
current.horizontal_[event_dir]
= event_dir * min (event_dir * current.horizontal_[event_dir],
- gap_length/2
- + event_dir * heads[k]->extent (commonx, X_AXIS)[-event_dir]);
+ + event_dir
+ * heads[k]->extent (commonx,
+ X_AXIS)[-event_dir]);
}
}
}
int precision = 8;
if (spec == '$')
- precision = '2';
+ precision = 2;
else if (isdigit (spec))
{
precision = spec - '0';
spec = format.at (tilde ++);
}
- if (spec == 'a' || spec == 'f')
+ if (spec == 'a' || spec == 'A' || spec == 'f' || spec == '$')
results.push_back (format_single_argument (arg, precision));
else if (spec == 'l')
{
static Grob *accidentals (Grob *me);
static Grob *arpeggio (Grob *me);
static Slice head_positions_interval (Grob *me);
- static Direction static_dir (Grob *);
static void translate_rests (Grob *me, int dy);
static Grob *first_head (Grob *me);
static Grob *get_rest (Grob *me);
bool is_empty () const;
};
+class Pitch_lexicographic_interval : public Drul_array<Pitch>
+{
+public:
+ Pitch_lexicographic_interval ();
+ Pitch_lexicographic_interval (Pitch, Pitch);
+ void add_point (Pitch);
+ bool is_empty () const;
+};
+
#endif /* PITCH_INTERVAL_HH */
set<int> dot_positions_;
Interval dot_x_;
vector<Tie_specification> specifications_;
+ bool use_horizontal_spacing_;
Tie_configuration_map possibilities_;
string s = symbols;
replace_all (s, '\n', ' ');
replace_all (s, '\t', ' ');
+ replace_all (s, " ", " ");
return ly_string_array_to_scm (string_split (s, ' '));
}
void
Pitch_interval::add_point (Pitch p)
+{
+ if (at (LEFT).tone_pitch () > p.tone_pitch ())
+ at (LEFT) = p;
+ if (at (RIGHT).tone_pitch () < p.tone_pitch ())
+ at (RIGHT) = p;
+}
+
+
+Pitch_lexicographic_interval::Pitch_lexicographic_interval (Pitch p1, Pitch p2)
+{
+ at (LEFT) = p1;
+ at (RIGHT) = p2;
+}
+
+Pitch_lexicographic_interval::Pitch_lexicographic_interval ()
+{
+ at (LEFT) = Pitch (100, 0, 0);
+ at (RIGHT) = Pitch (-100, 0, 0);
+}
+
+bool
+Pitch_lexicographic_interval::is_empty () const
+{
+ return at (LEFT) > at (RIGHT);
+}
+
+void
+Pitch_lexicographic_interval::add_point (Pitch p)
{
if (at (LEFT) > p)
at (LEFT) = p;
o--;
}
+ /*
+ we're effictively hardcoding the octave to 6 whole-tones,
+ which is as arbitrary as coding it to 1200 cents
+ */
Rational tones ((o + n / scale_->step_tones_.size ()) * 6, 1);
tones += scale_->step_tones_[n % scale_->step_tones_.size ()];
void internal_set_option (SCM var, SCM val)
{
- scm_hashq_set_x (option_hash, var, val);
-
if (0)
;
else if (var == ly_symbol2scm ("profile-property-accesses"))
debug_page_breaking_scoring = to_boolean (val);
val = scm_from_bool (to_boolean (val));
}
+ else if (var == ly_symbol2scm ("datadir"))
+ {
+ /* ignore input value. */
+ val = ly_string2scm (lilypond_datadir);
+ }
+
+
+ scm_hashq_set_x (option_hash, var, val);
+
+
}
if (char const *env = getenv ("LILYPOND_DATADIR"))
{
-#ifdef __MINGW32__
/* Normalize file name. */
lilypond_datadir = File_name (env).to_string ();
-#else
- lilypond_datadir = env;
-#endif
}
/* When running from build dir, a full LILYPOND_DATADIR is set-up at
if (!is_dir (lilypond_datadir.c_str ())
&& is_dir (build_datadir_current.c_str ()))
lilypond_datadir = build_datadir_current;
+
+
+ lilypond_datadir = File_name (lilypond_datadir).canonicalized().to_string();
global_path.append ("");
Interval notedim;
for (vsize i = 0; i < notes.size (); i++)
- notedim.unite (notes[i]->extent (common, Y_AXIS));
-
+ {
+ if (Note_column::dir (notes[i]) == -dir)
+ {
+ /* try not to look at the stem, as looking at a beamed
+ note may trigger beam positioning prematurely.
+
+ This happens with dotted rests, which need Y
+ positioning to compute X-positioning.
+ */
+ Grob *head = Note_column::first_head (notes[i]);
+ if (head)
+ notedim.unite (head->extent (common, Y_AXIS));
+ else
+ programming_error ("Note_column without first_head()");
+ }
+ else
+ notedim.unite (notes[i]->extent (common, Y_AXIS));
+ }
Real y = dir * max (0.0,
-dir * restdim[-dir] + dir * notedim[dir] + minimum_dist);
SCM scm_pitch = event->get_property ("pitch");
int min_fret = robust_scm2int (get_property ("minimumFret"), 0);
int start = (high_string_one) ? 1 : string_count;
- int end = (high_string_one) ? string_count : 1;
+ int end = (high_string_one) ? string_count+1 : 0;
int i = start;
do
Tie_formatting_problem::Tie_formatting_problem ()
{
x_refpoint_ = 0;
+ use_horizontal_spacing_ = true;
}
Tie_formatting_problem::~Tie_formatting_problem ()
{
if (Stem::is_normal_stem (stem))
{
-
Interval x;
x.add_point (stem->relative_coordinate (x_refpoint_, X_AXIS));
x.widen (staff_space / 20); // ugh.
Interval y;
- Real stem_end_position =
- Stem::is_cross_staff (stem)
- ? get_grob_direction (stem) * infinity_f
- : Stem::stem_end_position (stem) * staff_space * .5;
+ Real stem_end_position = 0.0;
+ if (Stem::is_cross_staff (stem))
+ stem_end_position = get_grob_direction (stem) * infinity_f;
+ else
+ {
+ if (use_horizontal_spacing_ || !Stem::get_beam (stem))
+ stem_end_position = Stem::stem_end_position (stem) * staff_space * .5;
+ else
+ stem_end_position = Stem::note_head_positions (stem)[get_grob_direction (stem)]
+ * staff_space * .5;
+ }
+
y.add_point (stem_end_position);
Direction stemdir = get_grob_direction (stem);
{
if (semi_ties.empty ())
return;
-
+
+ use_horizontal_spacing_ = false;
details_.from_grob (semi_ties[0]);
vector<Item*> heads;
##
## todo: this also depends on .tfm, FIXME.
-$(outdir)/%.lisp $(outdir)/%.otf-gtable $(outdir)/%.enc $(outdir)/%.tex $(outdir)/%.dep: $(outdir)/%.log
- $(PYTHON) $(buildscript-dir)/mf-to-table.py --global-lisp=$(outdir)/$(<F:.log=.otf-gtable) --lisp=$(outdir)/$(<F:.log=.lisp) --outdir=$(outdir) --dep $(outdir)/$(<F:.log=.dep) --enc $(outdir)/$(<F:.log=.enc) --tex $(outdir)/$(<F:.log=.tex) $<
+$(outdir)/%.lisp $(outdir)/%.otf-gtable $(outdir)/%.enc $(outdir)/%.dep: $(outdir)/%.log
+ $(PYTHON) $(buildscript-dir)/mf-to-table.py --global-lisp=$(outdir)/$(<F:.log=.otf-gtable) --lisp=$(outdir)/$(<F:.log=.lisp) --outdir=$(outdir) --dep $(outdir)/$(<F:.log=.dep) --enc $(outdir)/$(<F:.log=.enc) $<
local-clean:
rm -f mfplain.mem mfplain.log
('right', m.group (4))]:
if h and float (h):
+ once = m.group(1)
+ if not once:
+ once = ''
+
s += (r"%s \override %s #'bound-details #'%s #'text = \markup { \draw-line #'(0 . %s) }"
- % (m.group(1), m.group (2), var, h))
+ % (once, m.group (2), var, h))
s += '\n'
(is-eps (string-match "\\.eps$" name))
(paper-size-string (if is-eps
" -dEPSCrop "
- (format "-dDEVICEWIDTHPOINTS=~,2f \
--dDEVICEHEIGHTPOINTS=~,2f "
+ (ly:format "-dDEVICEWIDTHPOINTS=~$ \
+-dDEVICEHEIGHTPOINTS=~$ "
paper-width paper-height )))
- (cmd (format #f
+ (cmd (simple-format #f
"~a\
~a\
~a\
(define-public (rhythmic-location->file-string a)
- (format "~a.~a.~a"
+ (ly:format "~a.~a.~a"
(car a)
(ly:moment-main-numerator (cdr a))
(ly:moment-main-denominator (cdr a))))
(define-public (rhythmic-location->string a)
- (format "bar ~a ~a"
+ (ly:format "bar ~a ~a"
(car a)
(ly:moment->string (cdr a))))
(use-modules (lily)
(ice-9 rdelim)
(ice-9 regex)
- (ice-9 format))
+ (ice-9 format) ;; needed for ~8@
+ )
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(let*
((th (chain-assoc-get 'thickness props 0.1))
(x (car dest))
- (y (cdr dest)))
+ (y (cdr dest))
+ (s (ly:make-stencil
+ `(draw-line
+ ,th
+ 0 0
+ ,x ,y)
- (ly:make-stencil
- `(draw-line
- ,th
- 0 0
- ,x ,y)
+ (cons (min x 0) (max x 0))
+ (cons (min y 0) (max y 0)))))
- (cons (min x 0) (min y 0))
- (cons (max x 0) (max y 0)))))
+ s))
(define-builtin-markup-command (draw-circle layout props radius thickness fill)
(number? number? boolean?)
(use-modules (ice-9 regex)
(ice-9 string-fun)
- (ice-9 format)
(guile)
(scm framework-ps)
(scm paper-system)
(srfi srfi-13)
(lily))
+(define format ergonomic-simple-format)
+
(define framework-eps-module (current-module))
(use-modules (ice-9 regex)
(ice-9 string-fun)
- (ice-9 format)
(guile)
(srfi srfi-1)
(ice-9 pretty-print)
(srfi srfi-13)
(lily))
-(define-public (output-framework channel book scopes fields )
+(define-public (output-framework channel book scopes fields)
#t)
(scm clip-region)
(lily))
-(define (format dest . rest)
- (if (string? dest)
- (apply simple-format (cons #f (cons dest rest)))
- (apply simple-format (cons dest rest))))
+(define format ergonomic-simple-format)
(define framework-ps-module (current-module))
(define (write-preamble paper load-fonts? port)
(define (load-font-via-GS font-name-filename)
- (define (ps-load-file name)
- (format
- (if (string? name)
- "(~a) (r) file .loadfont\n"
- "% cannot find font file: ~a\n")
- name))
+ (define (ps-load-file file-name)
+ (if (string? file-name)
+ (if (string-contains file-name (ly:get-option 'datadir))
+ (begin
+ (set! file-name (ly:string-substitute (ly:get-option 'datadir) "" file-name))
+ (format "lilypond-datadir (~a) concatstrings (r) file .loadfont" file-name))
+ (format "(~a) (r) file .loadfont\n" file-name))
+ (format "% cannot find font file: ~a\n" file-name)))
(let* ((font (car font-name-filename))
(name (cadr font-name-filename))
pfas))
(display "%%BeginProlog\n" port)
+
+ (format port
+ "/lilypond-datadir where {pop} {userdict /lilypond-datadir (~a) put } ifelse"
+ (ly:get-option 'datadir))
+
(if load-fonts?
(for-each
(lambda (f)
(use-modules (ice-9 regex)
(ice-9 string-fun)
- (ice-9 format)
(guile)
(srfi srfi-1)
(ice-9 pretty-print)
(define-public (output-framework basename book scopes fields )
(let*
- ((file (open-output-file (format "~a.scm" basename))))
+ ((file (open-output-file (format #f "~a.scm" basename))))
(display ";;Creator: LilyPond\n" file)
(display ";; raw SCM output\n" file)
(srfi srfi-13)
(ice-9 regex))
+(define format ergonomic-simple-format)
+
(define-public (output-framework basename book scopes fields)
(let* ((filename (format "~a.svg" basename))
(outputter (ly:make-paper-outputter (open-file filename "wb")
'(version . "1.2")
;; Argggghhhh: SVG takes the px <-> mm mapping from the windowing system
- `(width . ,(format #f "~s" page-width))
- `(height . ,(format #f "~s" page-height))))
+ `(width . ,(format "~s" page-width))
+ `(height . ,(format "~s" page-height))))
(dump (dump-fonts outputter paper))
(dump
(define (dump-page outputter page page-number page-count landscape? page-set?)
(define (dump str) (display str (ly:outputter-port outputter)))
- (dump (comment (format #f "Page: ~S/~S" page-number page-count)))
+ (dump (comment (format "Page: ~S/~S" page-number page-count)))
(if (or landscape? page-set?)
(dump
(if landscape?
(use-modules (ice-9 regex)
(ice-9 string-fun)
- (ice-9 format)
(scm page)
(scm paper-system)
(guile)
(scm kpathsea)
(lily))
+(define format ergonomic-simple-format)
+
(define (output-formats)
(define formats (ly:output-formats))
(set! formats (completize-formats formats))
(apply string-append
(map
(lambda (sub-name)
- (format #f "\\font\\~a=~a scaled ~a%\n"
+ (format "\\font\\~a=~a scaled ~a%\n"
(tex-font-command-raw
sub-name (ly:font-magnification font))
sub-name
(use-modules (ice-9 regex)
(scm paper-system)
(ice-9 string-fun)
- (ice-9 format)
(guile)
(srfi srfi-1)
(srfi srfi-13)
(lily))
+(define format ergonomic-simple-format)
+
(define (header filename)
(format "% header
\\input{lilypond-tex-metrics}
")
(define-public (output-classic-framework basename book scopes fields)
- (let* ((filename (format "~a.texstr" basename))
+ (let* ((filename (format #f "~a.texstr" basename))
(outputter (ly:make-paper-outputter
(open-file filename "wb")
(ly:get-option 'backend)))
(ly:outputter-dump-string outputter (footer))))
(define-public (output-framework basename book scopes fields )
- (let* ((filename (format "~a.texstr" basename))
+ (let* ((filename (format #f "~a.texstr" basename))
(outputter
(ly:make-paper-outputter
(open-file filename "wb")
(fret-count (+ (- (cadr fret-range) (car fret-range)) 1))
(label-text
(cond
- ((equal? number-type 'roman-lower) (format #f "~(~:@r~)" base-fret))
- ((equal? number-type 'roman-upper) (format #f "~:@r" base-fret))
- ((equal? 'arabic number-type) (format #f "~d" base-fret))
- (else (format #f "~(~:@r~)" base-fret)))))
+ ((equal? number-type 'roman-lower) (fancy-format #f "~(~:@r~)" base-fret))
+ ((equal? number-type 'roman-upper) (fancy-format #f "~:@r" base-fret))
+ ((equal? 'arabic number-type) (fancy-format #f "~d" base-fret))
+ (else (fancy-format #f "~(~:@r~)" base-fret)))))
(if (eq? orientation 'normal)
(ly:stencil-translate-axis
(sans-serif-stencil layout props (* size label-font-mag) label-text)
(read-enable 'positions)
(debug-enable 'debug)
-
-
(define scheme-options-definitions
`(
(backend ps "which backend to use by default; Options: eps, ps [default], scm, svg, tex, texstr)")
(check-internal-types #f "check every property assignment for types")
(clip-systems #f "Generate cut-out snippets of a score")
+ (datadir #f "LilyPond prefix for data files (Readonly).")
(debug-gc #f "dump memory debugging statistics")
(debug-gc-assert-parsed-dead #f "for memory debugging:
ensure that all refs to parsed objects are dead. This is an internal option, and is switched on automatically for -ddebug-gc.")
(use-modules (ice-9 regex)
(ice-9 safe)
+ (ice-9 format)
(ice-9 rdelim)
(ice-9 optargs)
(oop goops)
(scm memory-trace)
(scm coverage)
)
+(define-public fancy-format format)
+(define-public (ergonomic-simple-format dest . rest)
+ "Like ice-9 format, but without the memory consumption."
+
+ (if (string? dest)
+ (apply simple-format (cons #f (cons dest rest)))
+ (apply simple-format (cons dest rest))))
+
+(define format ergonomic-simple-format)
;; my display
(define-public (myd k v) (display k) (display ": ") (display v) (display ", ")
outfile)
(format outfile "\nprotected symbols: ~a\n"
- (length (filter symbol? (map car protects))))
-
-
+ (apply + (map (lambda (obj-count) (if (symbol? (car obj-count))
+ (cdr obj-count)
+ 0))
+ protects)))
;; (display (ly:smob-protects))
(newline outfile)
(use-modules
(guile)
(ice-9 regex)
+ (ice-9 format)
(lily)
(srfi srfi-1)
(srfi srfi-13))
+(define fancy-format format)
+(define format ergonomic-simple-format)
(define lily-unit-length 1.75)
;; Helper functions
(define-public (attributes attributes-alist)
(apply string-append
- (map (lambda (x) (format #f " ~s=\"~a\"" (car x) (cdr x)))
+ (map (lambda (x) (format " ~s=\"~a\"" (car x) (cdr x)))
attributes-alist)))
(define-public (eo entity . attributes-alist)
"o = open"
- (format #f "<~S~a>\n" entity (attributes attributes-alist)))
+ (format "<~S~a>\n" entity (attributes attributes-alist)))
(define-public (eoc entity . attributes-alist)
" oc = open/close"
- (format #f "<~S~a/>\n" entity (attributes attributes-alist)))
+ (format "<~S~a/>\n" entity (attributes attributes-alist)))
(define-public (ec entity)
"c = close"
- (format #f "</~S>\n" entity))
+ (format "</~S>\n" entity))
(apply eo (cons entity attributes-alist)) string (ec entity))))
(define (offset->point o)
- (format #f " ~S,~S" (car o) (- (cdr o))))
+ (format " ~S,~S" (car o) (- (cdr o))))
(define (number-list->point lst)
(define (helper lst)
(* x x))
(define (integer->entity integer)
- (format #f "&#x~x;" integer))
+ (fancy-format "&#x~x;" integer))
(define (char->entity char)
(integer->entity (char->integer char)))
(size (modified-font-metric-font-scaling font))
(anchor "west"))
- (format #f "font-family:~a;font-style:~a;font-size:~a;text-anchor:~a;"
+ (format "font-family:~a;font-style:~a;font-size:~a;text-anchor:~a;"
(car name-style) (cadr name-style)
size anchor))))
expr
;; FIXME: Not using GNU coding standards [translate ()] here
;; to work around a bug in Microsoft Internet Explorer 6.0
- `(transform . ,(format #f "translate(~f, ~f)"
+ `(transform . ,(ly:format "translate(~f, ~f)"
x (- y)))))
(define (polygon coords blot-diameter is-filled)
(use-modules (ice-9 regex)
(ice-9 string-fun)
- (ice-9 format)
(guile)
(srfi srfi-13)
(scm framework-tex)
(embedded-ps (list 'round-filled-box x y width height blotdiam)))
(define (text font s)
- (format
+ (format #f
"\\hbox{\\~a{}~a}" (tex-font-command font)
(sanitize-tex-string s)))
(page-width 100)
(page-height 100)
(rename-page-1 #f)
- (be-verbose #f)
+ (be-verbose (ly:get-option 'verbose))
(pixmap-format 'png16m)
(anti-alias-factor 1))
~a\
-dGraphicsAlphaBits=4\
-dTextAlphaBits=4\
- -q\
-dNOPAUSE\
-sDEVICE=~a\
-sOutputFile=~S\
(if (not (interval-sane? extent))
(set! annotation (interpret-markup
layout text-props
- (make-simple-markup (format "~a: NaN/inf" name))))
+ (make-simple-markup (simple-format #f "~a: NaN/inf" name))))
(let ((text-stencil (interpret-markup
layout text-props
(markup #:whiteout #:simple name)))
((interval-empty? extent)
(format "empty"))
(is-length
- (format "~$" (interval-length extent)))
+ (ly:format "~$" (interval-length extent)))
(else
- (format "(~$,~$)"
+ (ly:format "(~$,~$)"
(car extent) (cdr extent)))))))
(arrows (ly:stencil-translate-axis
(dimension-arrows (cons 0 (interval-length extent)))
(factor (exact->inexact (/ size bbox-size)))
(scaled-bbox
(map (lambda (x) (* factor x)) bbox))
- (clip-rect-string (format
+ (clip-rect-string (ly:format
"~a ~a ~a ~a rectclip"
(list-ref bbox 0)
(list-ref bbox 1)
(list
'embedded-ps
(string-append
- (format
+ (ly:format
"
gsave
currentpoint translate
(if (pair? paper-systems)
(begin
(let*
- ((outname (format "~a-~a.signature" basename count)) )
+ ((outname (simple-format #f "~a-~a.signature" basename count)) )
(ly:message "Writing ~a" outname)
(write-system-signature outname (car paper-systems))
(write-system-signatures basename (cdr paper-systems) (1+ count))))))
-
(use-modules (scm paper-system))
(define-public (write-system-signature filename paper-system)
(define (float? x)
(paper-system-system-grob paper-system))
(define output (open-output-file filename))
-
+
+ ;; todo: optionally use a command line flag? Or just junk this?
+ (define compare-expressions #f)
(define (strip-floats expr)
"Replace floats by #f"
(cond
rest))
expr))
-
- (define (pythonic-string expr)
- "escape quotes and slashes for python consumption"
- (regexp-substitute/global #f "([\n\\\\'\"])" (format "~a" expr) 'pre "\\" 1 'post))
-
- (define (pythonic-pair expr)
- (format "(~a,~a)"
- (car expr) (cdr expr)))
-
-
(define (raw-string expr)
"escape quotes and slashes for python consumption"
- (regexp-substitute/global #f "[@\n]" (format "~a" expr) 'pre " " 'post))
+ (regexp-substitute/global #f "[@\n]" (simple-format #f "~a" expr) 'pre " " 'post))
(define (raw-pair expr)
- (format "~a ~a"
+ (simple-format #f "~a ~a"
(car expr) (cdr expr)))
(define (found-grob expr)
;; todo: use stencil extent if available.
(x-ext (ly:grob-extent grob system-grob X))
(y-ext (ly:grob-extent grob system-grob Y))
- )
-
- (interpret-for-signature #f (lambda (e)
- (set! collected (cons e collected)))
- rest)
-
- (format output
+ (expression-skeleton
+ (if compare-expressions
+ (interpret-for-signature
+ #f (lambda (e)
+ (set! collected (cons e collected)))
+ rest)
+ "")))
+
+ (simple-format output
"~a@~a@~a@~a@~a\n"
(cdr (assq 'name (ly:grob-property grob 'meta) ))
(raw-string location)
(if (ly:grob? system-grob)
(begin
- (display (format "# Output signature\n# Generated by LilyPond ~a\n" (lilypond-version))
+ (display (simple-format #f "# Output signature\n# Generated by LilyPond ~a\n" (lilypond-version))
output)
(interpret-for-signature found-grob (lambda (x) #f)
(ly:stencil-expr