4 alterations = [-1, 0, 1]
6 def print_measure (nr, beats, type, params = "", attr = "", barline = ""):
7 print """ <measure number="%s">
11 <beat-type>%s</beat-type>
19 <duration>1</duration>
23 %s </measure>""" % (nr, attr, params, beats, type, barline)
25 first_atts = """ <divisions>1</divisions>
30 <time symbol="common">
32 <beat-type>4</beat-type>
40 final_barline = """ <barline location="right">
41 <bar-style>light-heavy</bar-style>
45 print """<?xml version="1.0" encoding="UTF-8"?>
46 <!DOCTYPE score-partwise PUBLIC "-//Recordare//DTD MusicXML 1.0 Partwise//EN"
47 "http://www.musicxml.org/dtds/partwise.dtd">
49 <movement-title>Different time signatures</movement-title>
52 <part-name>MusicXML Part</part-name>
55 <!--=========================================================-->
61 print_measure (measure, 2, 2, " symbol=\"common\"", first_atts)
64 print_measure (measure, 4, 4, " symbol=\"common\"")
67 print_measure (measure, 2, 2)
70 print_measure (measure, 3, 2)
73 print_measure (measure, 2, 4)
76 print_measure (measure, 3, 4)
79 print_measure (measure, 4, 4)
82 print_measure (measure, 5, 4)
85 print_measure (measure, 3, 8)
88 print_measure (measure, 6, 8)
91 print_measure (measure, 12, 8, "", "", final_barline)