4 alterations = [-1, 0, 1]
6 def print_measure (nr, fifth, mode, atts1 = "", atts = "", final = ""):
7 print """ <measure number="%s">
19 <duration>2</duration>
23 %s </measure>""" % (nr, atts1, fifth, mode, atts, final)
25 first_div = """ <divisions>1</divisions>
27 first_atts = """ <time symbol="common">
29 <beat-type>4</beat-type>
37 final_barline = """ <barline location="right">
38 <bar-style>light-heavy</bar-style>
42 print """<?xml version="1.0" encoding="UTF-8"?>
43 <!DOCTYPE score-partwise PUBLIC "-//Recordare//DTD MusicXML 1.0 Partwise//EN"
44 "http://www.musicxml.org/dtds/partwise.dtd">
46 <movement-title>Different Key signatures</movement-title>
49 <miscellaneous-field name="description">Various key signature: from 11
50 flats to 11 sharps (each one first one measure in major, then one
51 measure in minor)</miscellaneous-field>
56 <part-name>MusicXML Part</part-name>
59 <!--=========================================================-->
64 for fifth in range(-max_range, max_range+1):
66 if fifth == -max_range:
67 print_measure (measure, fifth, "major", first_div, first_atts)
69 print_measure (measure, fifth, "major")
71 if fifth == max_range:
72 print_measure (measure, fifth, "minor", "", "", final_barline)
74 print_measure (measure, fifth, "minor")