gcstat*.scm
lily-[0-9a-f][0-9a-f][0-9a-f]*
nohup.out
+out
out-cov
out-scons
out-test
pages_dict = {}
def build_pages_dict (filelist):
- """Build dictionnary of available translations of each page"""
+ """Build dictionary of available translations of each page"""
global pages_dict
for f in filelist:
m = html_re.match (f)
+++ /dev/null
-#!/usr/bin/env python
-
-notes = "CDEFGAB"
-alterations = [-1, 0, 1]
-
-def print_note (octave, note, alteration):
- print " <note>\n <pitch>\n <step>%s</step>" % notes[note]
- if alteration <> 0:
- print " <alter>%s</alter>" % alteration
- print " <octave>%s</octave>\n </pitch>\n <duration>1</duration>\n <voice>1</voice>\n <type>quarter</type>\n </note>" % octave
-
-
-print """<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE score-partwise PUBLIC "-//Recordare//DTD MusicXML 1.0 Partwise//EN"
- "http://www.musicxml.org/dtds/partwise.dtd">
-<score-partwise>
- <movement-title>Various piches and interval sizes</movement-title>
- <part-list>
- <score-part id="P1">
- <part-name>MusicXML Part</part-name>
- </score-part>
- </part-list>
- <!--=========================================================-->
- <part id="P1">
- <measure number="1">
- <attributes>
- <divisions>1</divisions>
- <key>
- <fifths>0</fifths>
- <mode>major</mode>
- </key>
- <time symbol="common">
- <beats>2</beats>
- <beat-type>4</beat-type>
- </time>
- <clef>
- <sign>G</sign>
- <line>2</line>
- </clef>
- </attributes>
-"""
-
-start_octave = 5
-
-for octave in (start_octave, start_octave+1):
- for note in (0,1,2,3,4,5,6):
- for alteration in alterations:
- if octave == start_octave and note == 0 and alteration == -1:
- continue
- print_note (octave, note, alteration)
-# if octave == start_octave and note == 0 and alteration == 0:
-# continue
- print_note (start_octave-(octave-start_octave)-(1-(7-note)/7), (7-note)%7, -alteration)
-
-print """ </measure>
- </part>
-</score-partwise>
-"""
\ No newline at end of file
+++ /dev/null
-#!/usr/bin/env python
-
-notes = "CDEFGAB"
-alterations = [-1, 0, 1]
-
-def print_measure (nr, fifth, mode, atts = "", final = ""):
- print """ <measure number="%s">
- <attributes>
-%s <key>
- <fifths>%s</fifths>
- <mode>%s</mode>
- </key>
- </attributes>
- <note>
- <pitch>
- <step>C</step>
- <octave>4</octave>
- </pitch>
- <duration>2</duration>
- <voice>1</voice>
- <type>half</type>
- </note>
-%s </measure>""" % (nr, atts, fifth, mode, final)
-
-first_atts = """ <divisions>1</divisions>
- <time symbol="common">
- <beats>2</beats>
- <beat-type>4</beat-type>
- </time>
- <clef>
- <sign>G</sign>
- <line>2</line>
- </clef>
-"""
-
-final_barline = """ <barline location="right">
- <bar-style>light-heavy</bar-style>
- </barline>
-"""
-
-print """<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE score-partwise PUBLIC "-//Recordare//DTD MusicXML 1.0 Partwise//EN"
- "http://www.musicxml.org/dtds/partwise.dtd">
-<score-partwise>
- <movement-title>Different Key signatures</movement-title>
- <part-list>
- <score-part id="P1">
- <part-name>MusicXML Part</part-name>
- </score-part>
- </part-list>
- <!--=========================================================-->
- <part id="P1">
-"""
-
-max_range = 11
-measure = 0
-for fifth in range(-max_range, max_range+1):
- measure += 1
- if fifth == -max_range:
- print_measure (measure, fifth, "major", first_atts)
- else:
- print_measure (measure, fifth, "major")
- measure += 1
- if fifth == max_range:
- print_measure (measure, fifth, "minor", "", final_barline)
- else:
- print_measure (measure, fifth, "minor")
-
-
-print """ </part>
-</score-partwise>
-"""
\ No newline at end of file
+++ /dev/null
-#!/usr/bin/env python
-
-notes = "CDEFGAB"
-alterations = [-1, 0, 1]
-
-def print_measure (nr, beats, type, params = "", attr = "", barline = ""):
- print """ <measure number="%s">
- <attributes>
-%s <time %s>
- <beats>%s</beats>
- <beat-type>%s</beat-type>
- </time>
- </attributes>
- <note>
- <pitch>
- <step>C</step>
- <octave>5</octave>
- </pitch>
- <duration>1</duration>
- <voice>1</voice>
- <type>quarter</type>
- </note>
-%s </measure>""" % (nr, attr, params, beats, type, barline)
-
-first_atts = """ <divisions>1</divisions>
- <key>
- <fifths>0</fifths>
- <mode>major</mode>
- </key>
- <time symbol="common">
- <beats>2</beats>
- <beat-type>4</beat-type>
- </time>
- <clef>
- <sign>G</sign>
- <line>2</line>
- </clef>
-"""
-
-final_barline = """ <barline location="right">
- <bar-style>light-heavy</bar-style>
- </barline>
-"""
-
-print """<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE score-partwise PUBLIC "-//Recordare//DTD MusicXML 1.0 Partwise//EN"
- "http://www.musicxml.org/dtds/partwise.dtd">
-<score-partwise>
- <movement-title>Different time signatures</movement-title>
- <part-list>
- <score-part id="P1">
- <part-name>MusicXML Part</part-name>
- </score-part>
- </part-list>
- <!--=========================================================-->
- <part id="P1">
-"""
-
-measure = 1
-
-print_measure (measure, 2, 2, " symbol=\"common\"", first_atts)
-measure += 1
-
-print_measure (measure, 4, 4, " symbol=\"common\"")
-measure += 1
-
-print_measure (measure, 2, 2)
-measure += 1
-
-print_measure (measure, 3, 2)
-measure += 1
-
-print_measure (measure, 2, 4)
-measure += 1
-
-print_measure (measure, 3, 4)
-measure += 1
-
-print_measure (measure, 4, 4)
-measure += 1
-
-print_measure (measure, 5, 4)
-measure += 1
-
-print_measure (measure, 3, 8)
-measure += 1
-
-print_measure (measure, 6, 8)
-measure += 1
-
-print_measure (measure, 12, 8, "", "", final_barline)
-measure += 1
-
-print """ </part>
-</score-partwise>
-"""
\ No newline at end of file
--- /dev/null
+#!/usr/bin/env python
+
+notes = "CDEFGAB"
+alterations = [-1, 0, 1]
+
+def print_note (octave, note, alteration):
+ print " <note>\n <pitch>\n <step>%s</step>" % notes[note]
+ if alteration <> 0:
+ print " <alter>%s</alter>" % alteration
+ print " <octave>%s</octave>\n </pitch>\n <duration>1</duration>\n <voice>1</voice>\n <type>quarter</type>\n </note>" % octave
+
+
+print """<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE score-partwise PUBLIC "-//Recordare//DTD MusicXML 1.0 Partwise//EN"
+ "http://www.musicxml.org/dtds/partwise.dtd">
+<score-partwise>
+ <movement-title>Various piches and interval sizes</movement-title>
+ <part-list>
+ <score-part id="P1">
+ <part-name>MusicXML Part</part-name>
+ </score-part>
+ </part-list>
+ <!--=========================================================-->
+ <part id="P1">
+ <measure number="1">
+ <attributes>
+ <divisions>1</divisions>
+ <key>
+ <fifths>0</fifths>
+ <mode>major</mode>
+ </key>
+ <time symbol="common">
+ <beats>2</beats>
+ <beat-type>4</beat-type>
+ </time>
+ <clef>
+ <sign>G</sign>
+ <line>2</line>
+ </clef>
+ </attributes>
+"""
+
+start_octave = 5
+
+for octave in (start_octave, start_octave+1):
+ for note in (0,1,2,3,4,5,6):
+ for alteration in alterations:
+ if octave == start_octave and note == 0 and alteration == -1:
+ continue
+ print_note (octave, note, alteration)
+# if octave == start_octave and note == 0 and alteration == 0:
+# continue
+ print_note (start_octave-(octave-start_octave)-(1-(7-note)/7), (7-note)%7, -alteration)
+
+print """ </measure>
+ </part>
+</score-partwise>
+"""
\ No newline at end of file
--- /dev/null
+#!/usr/bin/env python
+
+notes = "CDEFGAB"
+alterations = [-1, 0, 1]
+
+def print_measure (nr, fifth, mode, atts = "", final = ""):
+ print """ <measure number="%s">
+ <attributes>
+%s <key>
+ <fifths>%s</fifths>
+ <mode>%s</mode>
+ </key>
+ </attributes>
+ <note>
+ <pitch>
+ <step>C</step>
+ <octave>4</octave>
+ </pitch>
+ <duration>2</duration>
+ <voice>1</voice>
+ <type>half</type>
+ </note>
+%s </measure>""" % (nr, atts, fifth, mode, final)
+
+first_atts = """ <divisions>1</divisions>
+ <time symbol="common">
+ <beats>2</beats>
+ <beat-type>4</beat-type>
+ </time>
+ <clef>
+ <sign>G</sign>
+ <line>2</line>
+ </clef>
+"""
+
+final_barline = """ <barline location="right">
+ <bar-style>light-heavy</bar-style>
+ </barline>
+"""
+
+print """<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE score-partwise PUBLIC "-//Recordare//DTD MusicXML 1.0 Partwise//EN"
+ "http://www.musicxml.org/dtds/partwise.dtd">
+<score-partwise>
+ <movement-title>Different Key signatures</movement-title>
+ <part-list>
+ <score-part id="P1">
+ <part-name>MusicXML Part</part-name>
+ </score-part>
+ </part-list>
+ <!--=========================================================-->
+ <part id="P1">
+"""
+
+max_range = 11
+measure = 0
+for fifth in range(-max_range, max_range+1):
+ measure += 1
+ if fifth == -max_range:
+ print_measure (measure, fifth, "major", first_atts)
+ else:
+ print_measure (measure, fifth, "major")
+ measure += 1
+ if fifth == max_range:
+ print_measure (measure, fifth, "minor", "", final_barline)
+ else:
+ print_measure (measure, fifth, "minor")
+
+
+print """ </part>
+</score-partwise>
+"""
\ No newline at end of file
--- /dev/null
+#!/usr/bin/env python
+
+notes = "CDEFGAB"
+alterations = [-1, 0, 1]
+
+def print_measure (nr, beats, type, params = "", attr = "", barline = ""):
+ print """ <measure number="%s">
+ <attributes>
+%s <time %s>
+ <beats>%s</beats>
+ <beat-type>%s</beat-type>
+ </time>
+ </attributes>
+ <note>
+ <pitch>
+ <step>C</step>
+ <octave>5</octave>
+ </pitch>
+ <duration>1</duration>
+ <voice>1</voice>
+ <type>quarter</type>
+ </note>
+%s </measure>""" % (nr, attr, params, beats, type, barline)
+
+first_atts = """ <divisions>1</divisions>
+ <key>
+ <fifths>0</fifths>
+ <mode>major</mode>
+ </key>
+ <time symbol="common">
+ <beats>2</beats>
+ <beat-type>4</beat-type>
+ </time>
+ <clef>
+ <sign>G</sign>
+ <line>2</line>
+ </clef>
+"""
+
+final_barline = """ <barline location="right">
+ <bar-style>light-heavy</bar-style>
+ </barline>
+"""
+
+print """<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE score-partwise PUBLIC "-//Recordare//DTD MusicXML 1.0 Partwise//EN"
+ "http://www.musicxml.org/dtds/partwise.dtd">
+<score-partwise>
+ <movement-title>Different time signatures</movement-title>
+ <part-list>
+ <score-part id="P1">
+ <part-name>MusicXML Part</part-name>
+ </score-part>
+ </part-list>
+ <!--=========================================================-->
+ <part id="P1">
+"""
+
+measure = 1
+
+print_measure (measure, 2, 2, " symbol=\"common\"", first_atts)
+measure += 1
+
+print_measure (measure, 4, 4, " symbol=\"common\"")
+measure += 1
+
+print_measure (measure, 2, 2)
+measure += 1
+
+print_measure (measure, 3, 2)
+measure += 1
+
+print_measure (measure, 2, 4)
+measure += 1
+
+print_measure (measure, 3, 4)
+measure += 1
+
+print_measure (measure, 4, 4)
+measure += 1
+
+print_measure (measure, 5, 4)
+measure += 1
+
+print_measure (measure, 3, 8)
+measure += 1
+
+print_measure (measure, 6, 8)
+measure += 1
+
+print_measure (measure, 12, 8, "", "", final_barline)
+measure += 1
+
+print """ </part>
+</score-partwise>
+"""
\ No newline at end of file
ifeq ($(out),)
LILYPOND_BOOK_PROCESS = true
+LILYPOND_BOOK_FLAGS += --no-lily-run
else
LILYPOND_BOOK_PROCESS = $(LILYPOND_BINARY)
endif
+ifeq ($(out),test)
+LILYPOND_BOOK_FLAGS += --skip-png-check
+endif
TEXINPUTS=$(top-src-dir)/tex/::
export TEXINPUTS
1:'\\stopTextSpan'}.get (self.span_direction, '')
class BracketSpannerEvent (SpanEvent):
+ # Ligature brackets use prefix-notation!!!
+ def print_before_note (self, printer):
+ if self.span_direction == -1:
+ printer.dump ('\[')
+ # the the bracket after the last note
+ def print_after_note (self, printer):
+ if self.span_direction == 1:
+ printer.dump ('\]')
+ # we're printing everything in print_(before|after)_note...
def ly_expression (self):
- return {-1: '\\startGroup',
- 1:'\\stopGroup'}.get (self.span_direction, '')
+ return '';
class OctaveShiftEvent (SpanEvent):
action='store', dest='output_dir',
default='')
+ p.add_option ('--skip-lily-check',
+ help=_ ("do not fail if no lilypond output is found."),
+ metavar=_ ("DIR"),
+ action='store_true', dest='skip_lilypond_run',
+ default=False)
+
+ p.add_option ('--skip-png-check',
+ help=_ ("do not fail if no PNG images are found for EPS files"),
+ metavar=_ ("DIR"),
+ action='store_true', dest='skip_png_check',
+ default=False)
+
p.add_option ('--lily-output-dir',
help=_ ("write lily-XXX files to DIR, link into --output dir."),
metavar=_ ("DIR"),
return re.sub (r'\\(version|sourcefileline|sourcefilename)[^\n]*\n', '', ly)
def link_all_output_files (self, output_dir, output_dir_files, destination):
- existing = self.all_output_files (output_dir, output_dir_files)
+ existing, missing = self.all_output_files (output_dir, output_dir_files)
+ if missing:
+ print '\nMissing', missing
+ raise CompileError(self.basename())
for name in existing:
try:
os.unlink (os.path.join (destination, name))
output_dir_files is the list of files in the output directory.
"""
- class Missing(Exception):
- pass
-
- result = set()
+ result = set ()
+ missing = set ()
base = self.basename()
full = os.path.join (output_dir, base)
def consider_file (name):
if name in output_dir_files:
result.add (name)
-
+
def require_file (name):
- if name not in output_dir_files:
- raise Missing
- result.add (name)
-
- try:
- for required in [base + '.ly',
- base + '.txt',
- base + '-systems.count']:
- require_file (required)
-
- map (consider_file, [base + '.tex',
- base + '.eps',
- base + '.texidoc',
- base + '-systems.texi',
- base + '-systems.tex',
- base + '-systems.pdftexi'])
-
- if base + '.eps' in result and self.format in (HTML, TEXINFO):
- page_count = ps_page_count (full + '.eps')
- if page_count <= 1:
- require_file (base + '.png')
- else:
- for page in range (1, page_count + 1):
- require_file (base + '-page%d.png' % page)
+ if name in output_dir_files:
+ result.add (name)
+ else:
+ missing.add (name)
+
+ # UGH - junk global_options
+ skip_lily = global_options.skip_lilypond_run
+ for required in [base + '.ly',
+ base + '.txt']:
+ require_file (required)
+ if not skip_lily:
+ require_file (base + '-systems.count')
+
+ map (consider_file, [base + '.tex',
+ base + '.eps',
+ base + '.texidoc',
+ base + '-systems.texi',
+ base + '-systems.tex',
+ base + '-systems.pdftexi'])
+
+ # UGH - junk global_options
+ if (base + '.eps' in result and self.format in (HTML, TEXINFO)
+ and not global_options.skip_png_check):
+ page_count = ps_page_count (full + '.eps')
+ if page_count <= 1:
+ require_file (base + '.png')
+ else:
+ for page in range (1, page_count + 1):
+ require_file (base + '-page%d.png' % page)
+ system_count = 0
+ if not skip_lily and not missing:
system_count = int(file (full + '-systems.count').read())
- for number in range(1, system_count + 1):
- systemfile = '%s-%d' % (base, number)
- require_file (systemfile + '.eps')
- consider_file (systemfile + '.pdf')
- except Missing:
- return None
+ for number in range(1, system_count + 1):
+ systemfile = '%s-%d' % (base, number)
+ require_file (systemfile + '.eps')
+ consider_file (systemfile + '.pdf')
- return result
+ return (result, missing)
def is_outdated (self, output_dir, current_files):
- return self.all_output_files (output_dir, current_files) is None
+ found, missing = self.all_output_files (output_dir, current_files)
+ return missing
def filter_text (self):
"""Run snippet bodies through a command (say: convert-ly).
This functionality is rarely used, and this code must have bitrot.
"""
-
code = self.substring ('code')
s = filter_pipe (code, global_options.filter_cmd)
d = {
def find_toplevel_snippets (input_string, format, types):
res = {}
for t in types:
- res[t] = ly.re.compile (snippet_res[format][t])
+ res[t] = re.compile (snippet_res[format][t])
snippets = []
index = 0
output_name = ''
LINE_BELL = 60
-scale_steps = [0,2,4,5,7,9,11]
+scale_steps = [0, 2, 4, 5, 7, 9, 11]
global_options = None
-
clocks_per_1 = 1536
clocks_per_4 = 0
return p + e
-
class Duration:
allowed_durs = (1, 2, 4, 8, 16, 32, 64, 128)
def __init__ (self, clocks):
return retval.values ()
-# Brackets need a special engraver added the Staff context!
-def musicxml_bracket_to_ly ():
- layout_information.set_context_item ('Staff', '\consists "Horizontal_bracket_engraver" % for \\startGroup and \\stopGroup brackets')
- return musicexp.BracketSpannerEvent ()
-
spanner_event_dict = {
'beam' : musicexp.BeamEvent,
'dashes' : musicexp.TextSpannerEvent,
- 'bracket' : musicxml_bracket_to_ly,
+ 'bracket' : musicexp.BracketSpannerEvent,
'glissando' : musicexp.GlissandoEvent,
'octave-shift' : musicexp.OctaveShiftEvent,
'pedal' : musicexp.PedalEvent,
ev = musicxml_spanner_to_lily_event (a)
if ev:
ev_chord.append (ev)
-
+
+ # accidental-marks are direct children of <notation>!
+ for a in notations.get_named_children ('accidental-mark'):
+ ev = musicxml_articulation_to_lily_event (a)
+ if ev:
+ ev_chord.append (ev)
+
# Articulations can contain the following child elements:
# accent | strong-accent | staccato | tenuto |
# detached-legato | staccatissimo | spiccato |