4 alterations = [-1, 0, 1]
6 def print_measure (nr, fifth, mode, atts = "", final = ""):
7 print """ <measure number="%s">
19 <duration>2</duration>
23 %s </measure>""" % (nr, fifth, mode, atts, final)
25 first_atts = """ <divisions>1</divisions>
26 <time symbol="common">
28 <beat-type>4</beat-type>
36 final_barline = """ <barline location="right">
37 <bar-style>light-heavy</bar-style>
41 print """<?xml version="1.0" encoding="UTF-8"?>
42 <!DOCTYPE score-partwise PUBLIC "-//Recordare//DTD MusicXML 1.0 Partwise//EN"
43 "http://www.musicxml.org/dtds/partwise.dtd">
45 <movement-title>Different Key signatures</movement-title>
48 <part-name>MusicXML Part</part-name>
51 <!--=========================================================-->
57 for fifth in range(-max_range, max_range+1):
59 if fifth == -max_range:
60 print_measure (measure, fifth, "major", first_atts)
62 print_measure (measure, fifth, "major")
64 if fifth == max_range:
65 print_measure (measure, fifth, "minor", "", final_barline)
67 print_measure (measure, fifth, "minor")