From 3aa8b584c737a697df0fadc38d9fa3de570a061c Mon Sep 17 00:00:00 2001 From: Reinhold Kainhofer Date: Wed, 21 Nov 2007 16:10:04 +0100 Subject: [PATCH] MusicXML: Cleanup of the unit test files... Renamed and cleaned up part of the basic unit test files. Also added unit tests for time and key signature changes as well as all different intervals (the python files to generate the .xml files are also commited into git). --- ...ches-Finale.xml => 00a-Basics-Pitches.xml} | 283 +----- .../musicxml/00b-Basics-Intervals.xml | 825 ++++++++++++++++++ ...ns-Finale.xml => 00c-Basics-Durations.xml} | 15 +- ...inale.xml => 00d-Basics-RestDurations.xml} | 0 ...JB.xml => 00e-Basics-PitchedRests-PJB.xml} | 0 ...-Clefs-Finale.xml => 00f-Basics-Clefs.xml} | 0 input/regression/musicxml/00g-Basics-Keys.xml | 810 +++++++++++++++++ .../musicxml/00h-Basics-TimeSignatures.xml | 219 +++++ ...egarden.xml => 00i-Basics-NoKeyOrClef.xml} | 0 ...Time-PJB.xml => 00j-Basics-NoTime-PJB.xml} | 0 .../{00d-Backup.xml => 00k-Basics-Backup.xml} | 0 ...00c-Tie-PJB.xml => 00l-Basics-Tie-PJB.xml} | 0 .../regression/musicxml/generate_intervals.py | 58 ++ input/regression/musicxml/generate_keys.py | 72 ++ .../musicxml/generate_timesignatures.py | 96 ++ 15 files changed, 2082 insertions(+), 296 deletions(-) rename input/regression/musicxml/{00a-Pitches-Finale.xml => 00a-Basics-Pitches.xml} (82%) create mode 100644 input/regression/musicxml/00b-Basics-Intervals.xml rename input/regression/musicxml/{00b-Durations-Finale.xml => 00c-Basics-Durations.xml} (93%) rename input/regression/musicxml/{11a-RestDurations-Finale.xml => 00d-Basics-RestDurations.xml} (100%) rename input/regression/musicxml/{11b-PitchedRests-PJB.xml => 00e-Basics-PitchedRests-PJB.xml} (100%) rename input/regression/musicxml/{07a-Clefs-Finale.xml => 00f-Basics-Clefs.xml} (100%) create mode 100644 input/regression/musicxml/00g-Basics-Keys.xml create mode 100644 input/regression/musicxml/00h-Basics-TimeSignatures.xml rename input/regression/musicxml/{07b-Nokeyclef-Rosegarden.xml => 00i-Basics-NoKeyOrClef.xml} (100%) rename input/regression/musicxml/{07c-NoTime-PJB.xml => 00j-Basics-NoTime-PJB.xml} (100%) rename input/regression/musicxml/{00d-Backup.xml => 00k-Basics-Backup.xml} (100%) rename input/regression/musicxml/{00c-Tie-PJB.xml => 00l-Basics-Tie-PJB.xml} (100%) create mode 100755 input/regression/musicxml/generate_intervals.py create mode 100755 input/regression/musicxml/generate_keys.py create mode 100755 input/regression/musicxml/generate_timesignatures.py diff --git a/input/regression/musicxml/00a-Pitches-Finale.xml b/input/regression/musicxml/00a-Basics-Pitches.xml similarity index 82% rename from input/regression/musicxml/00a-Pitches-Finale.xml rename to input/regression/musicxml/00a-Basics-Pitches.xml index e2790254ef..9edd9ab787 100644 --- a/input/regression/musicxml/00a-Pitches-Finale.xml +++ b/input/regression/musicxml/00a-Basics-Pitches.xml @@ -2,15 +2,9 @@ - Finale pitch test + Pitches and accidentals Reinhold Kainhofer - Public Domain - - Finale 2007 for Windows - Dolet Light for Finale 2007 - 2007-09-14 - @@ -1206,265 +1200,6 @@ - - - - C - 4 - - 1 - 1 - quarter - up - - - - D - 4 - - 1 - 1 - quarter - up - - - - E - 4 - - 1 - 1 - quarter - up - - - - F - 4 - - 1 - 1 - quarter - up - - - - - - - - G - 4 - - 1 - 1 - quarter - up - - - - A - 4 - - 1 - 1 - quarter - up - - - - B - 4 - - 1 - 1 - quarter - down - - - - C - 5 - - 1 - 1 - quarter - down - - - - - - - D - 5 - - 1 - 1 - quarter - down - - - - E - 5 - - 1 - 1 - quarter - down - - - - F - 5 - - 1 - 1 - quarter - down - - - - G - 5 - - 1 - 1 - quarter - down - - - - - - - C - 4 - - 1 - 1 - quarter - up - - - - D - 4 - - 1 - 1 - quarter - up - - - - E - 4 - - 1 - 1 - quarter - up - - - - F - 4 - - 1 - 1 - quarter - up - - - - - - - G - 4 - - 1 - 1 - quarter - up - - - - A - 4 - - 1 - 1 - quarter - up - - - - B - 4 - - 1 - 1 - quarter - down - - - - C - 5 - - 1 - 1 - quarter - down - - - - - - - D - 5 - - 1 - 1 - quarter - down - - - - E - 5 - - 1 - 1 - quarter - down - - - - F - 5 - - 1 - 1 - quarter - down - - - - G - 5 - - 1 - 1 - quarter - down - - - @@ -1542,22 +1277,6 @@ sharp down - - - - - - 4 - 1 - - - - - - - 4 - 1 - light-heavy diff --git a/input/regression/musicxml/00b-Basics-Intervals.xml b/input/regression/musicxml/00b-Basics-Intervals.xml new file mode 100644 index 0000000000..e5f9ef4852 --- /dev/null +++ b/input/regression/musicxml/00b-Basics-Intervals.xml @@ -0,0 +1,825 @@ + + + + Various piches and interval sizes + + + MusicXML Part + + + + + + + 1 + + 0 + major + + + + G + 2 + + + + + + C + 5 + + 1 + 1 + quarter + + + + C + 5 + + 1 + 1 + quarter + + + + C + 1 + 5 + + 1 + 1 + quarter + + + + C + -1 + 5 + + 1 + 1 + quarter + + + + D + -1 + 5 + + 1 + 1 + quarter + + + + B + 1 + 4 + + 1 + 1 + quarter + + + + D + 5 + + 1 + 1 + quarter + + + + B + 4 + + 1 + 1 + quarter + + + + D + 1 + 5 + + 1 + 1 + quarter + + + + B + -1 + 4 + + 1 + 1 + quarter + + + + E + -1 + 5 + + 1 + 1 + quarter + + + + A + 1 + 4 + + 1 + 1 + quarter + + + + E + 5 + + 1 + 1 + quarter + + + + A + 4 + + 1 + 1 + quarter + + + + E + 1 + 5 + + 1 + 1 + quarter + + + + A + -1 + 4 + + 1 + 1 + quarter + + + + F + -1 + 5 + + 1 + 1 + quarter + + + + G + 1 + 4 + + 1 + 1 + quarter + + + + F + 5 + + 1 + 1 + quarter + + + + G + 4 + + 1 + 1 + quarter + + + + F + 1 + 5 + + 1 + 1 + quarter + + + + G + -1 + 4 + + 1 + 1 + quarter + + + + G + -1 + 5 + + 1 + 1 + quarter + + + + F + 1 + 4 + + 1 + 1 + quarter + + + + G + 5 + + 1 + 1 + quarter + + + + F + 4 + + 1 + 1 + quarter + + + + G + 1 + 5 + + 1 + 1 + quarter + + + + F + -1 + 4 + + 1 + 1 + quarter + + + + A + -1 + 5 + + 1 + 1 + quarter + + + + E + 1 + 4 + + 1 + 1 + quarter + + + + A + 5 + + 1 + 1 + quarter + + + + E + 4 + + 1 + 1 + quarter + + + + A + 1 + 5 + + 1 + 1 + quarter + + + + E + -1 + 4 + + 1 + 1 + quarter + + + + B + -1 + 5 + + 1 + 1 + quarter + + + + D + 1 + 4 + + 1 + 1 + quarter + + + + B + 5 + + 1 + 1 + quarter + + + + D + 4 + + 1 + 1 + quarter + + + + B + 1 + 5 + + 1 + 1 + quarter + + + + D + -1 + 4 + + 1 + 1 + quarter + + + + C + -1 + 6 + + 1 + 1 + quarter + + + + C + 1 + 4 + + 1 + 1 + quarter + + + + C + 6 + + 1 + 1 + quarter + + + + C + 4 + + 1 + 1 + quarter + + + + C + 1 + 6 + + 1 + 1 + quarter + + + + C + -1 + 4 + + 1 + 1 + quarter + + + + D + -1 + 6 + + 1 + 1 + quarter + + + + B + 1 + 3 + + 1 + 1 + quarter + + + + D + 6 + + 1 + 1 + quarter + + + + B + 3 + + 1 + 1 + quarter + + + + D + 1 + 6 + + 1 + 1 + quarter + + + + B + -1 + 3 + + 1 + 1 + quarter + + + + E + -1 + 6 + + 1 + 1 + quarter + + + + A + 1 + 3 + + 1 + 1 + quarter + + + + E + 6 + + 1 + 1 + quarter + + + + A + 3 + + 1 + 1 + quarter + + + + E + 1 + 6 + + 1 + 1 + quarter + + + + A + -1 + 3 + + 1 + 1 + quarter + + + + F + -1 + 6 + + 1 + 1 + quarter + + + + G + 1 + 3 + + 1 + 1 + quarter + + + + F + 6 + + 1 + 1 + quarter + + + + G + 3 + + 1 + 1 + quarter + + + + F + 1 + 6 + + 1 + 1 + quarter + + + + G + -1 + 3 + + 1 + 1 + quarter + + + + G + -1 + 6 + + 1 + 1 + quarter + + + + F + 1 + 3 + + 1 + 1 + quarter + + + + G + 6 + + 1 + 1 + quarter + + + + F + 3 + + 1 + 1 + quarter + + + + G + 1 + 6 + + 1 + 1 + quarter + + + + F + -1 + 3 + + 1 + 1 + quarter + + + + A + -1 + 6 + + 1 + 1 + quarter + + + + E + 1 + 3 + + 1 + 1 + quarter + + + + A + 6 + + 1 + 1 + quarter + + + + E + 3 + + 1 + 1 + quarter + + + + A + 1 + 6 + + 1 + 1 + quarter + + + + E + -1 + 3 + + 1 + 1 + quarter + + + + B + -1 + 6 + + 1 + 1 + quarter + + + + D + 1 + 3 + + 1 + 1 + quarter + + + + B + 6 + + 1 + 1 + quarter + + + + D + 3 + + 1 + 1 + quarter + + + + B + 1 + 6 + + 1 + 1 + quarter + + + + D + -1 + 3 + + 1 + 1 + quarter + + + + + diff --git a/input/regression/musicxml/00b-Durations-Finale.xml b/input/regression/musicxml/00c-Basics-Durations.xml similarity index 93% rename from input/regression/musicxml/00b-Durations-Finale.xml rename to input/regression/musicxml/00c-Basics-Durations.xml index b4d0a5cefd..cbb8dc62ed 100644 --- a/input/regression/musicxml/00b-Durations-Finale.xml +++ b/input/regression/musicxml/00c-Basics-Durations.xml @@ -2,26 +2,13 @@ - Finale note duration unit test + Note durations Reinhold Kainhofer - Public Domain - - Finale 2007 for Windows - Dolet Light for Finale 2007 - 2007-09-14 - MusicXML Part - - Grand Piano - - - 1 - 1 - diff --git a/input/regression/musicxml/11a-RestDurations-Finale.xml b/input/regression/musicxml/00d-Basics-RestDurations.xml similarity index 100% rename from input/regression/musicxml/11a-RestDurations-Finale.xml rename to input/regression/musicxml/00d-Basics-RestDurations.xml diff --git a/input/regression/musicxml/11b-PitchedRests-PJB.xml b/input/regression/musicxml/00e-Basics-PitchedRests-PJB.xml similarity index 100% rename from input/regression/musicxml/11b-PitchedRests-PJB.xml rename to input/regression/musicxml/00e-Basics-PitchedRests-PJB.xml diff --git a/input/regression/musicxml/07a-Clefs-Finale.xml b/input/regression/musicxml/00f-Basics-Clefs.xml similarity index 100% rename from input/regression/musicxml/07a-Clefs-Finale.xml rename to input/regression/musicxml/00f-Basics-Clefs.xml diff --git a/input/regression/musicxml/00g-Basics-Keys.xml b/input/regression/musicxml/00g-Basics-Keys.xml new file mode 100644 index 0000000000..fd50181ec5 --- /dev/null +++ b/input/regression/musicxml/00g-Basics-Keys.xml @@ -0,0 +1,810 @@ + + + + Different Key signatures + + + MusicXML Part + + + + + + + + 1 + + + G + 2 + + + -11 + major + + + + + C + 4 + + 2 + 1 + half + + + + + + -11 + minor + + + + + C + 4 + + 2 + 1 + half + + + + + + -10 + major + + + + + C + 4 + + 2 + 1 + half + + + + + + -10 + minor + + + + + C + 4 + + 2 + 1 + half + + + + + + -9 + major + + + + + C + 4 + + 2 + 1 + half + + + + + + -9 + minor + + + + + C + 4 + + 2 + 1 + half + + + + + + -8 + major + + + + + C + 4 + + 2 + 1 + half + + + + + + -8 + minor + + + + + C + 4 + + 2 + 1 + half + + + + + + -7 + major + + + + + C + 4 + + 2 + 1 + half + + + + + + -7 + minor + + + + + C + 4 + + 2 + 1 + half + + + + + + -6 + major + + + + + C + 4 + + 2 + 1 + half + + + + + + -6 + minor + + + + + C + 4 + + 2 + 1 + half + + + + + + -5 + major + + + + + C + 4 + + 2 + 1 + half + + + + + + -5 + minor + + + + + C + 4 + + 2 + 1 + half + + + + + + -4 + major + + + + + C + 4 + + 2 + 1 + half + + + + + + -4 + minor + + + + + C + 4 + + 2 + 1 + half + + + + + + -3 + major + + + + + C + 4 + + 2 + 1 + half + + + + + + -3 + minor + + + + + C + 4 + + 2 + 1 + half + + + + + + -2 + major + + + + + C + 4 + + 2 + 1 + half + + + + + + -2 + minor + + + + + C + 4 + + 2 + 1 + half + + + + + + -1 + major + + + + + C + 4 + + 2 + 1 + half + + + + + + -1 + minor + + + + + C + 4 + + 2 + 1 + half + + + + + + 0 + major + + + + + C + 4 + + 2 + 1 + half + + + + + + 0 + minor + + + + + C + 4 + + 2 + 1 + half + + + + + + 1 + major + + + + + C + 4 + + 2 + 1 + half + + + + + + 1 + minor + + + + + C + 4 + + 2 + 1 + half + + + + + + 2 + major + + + + + C + 4 + + 2 + 1 + half + + + + + + 2 + minor + + + + + C + 4 + + 2 + 1 + half + + + + + + 3 + major + + + + + C + 4 + + 2 + 1 + half + + + + + + 3 + minor + + + + + C + 4 + + 2 + 1 + half + + + + + + 4 + major + + + + + C + 4 + + 2 + 1 + half + + + + + + 4 + minor + + + + + C + 4 + + 2 + 1 + half + + + + + + 5 + major + + + + + C + 4 + + 2 + 1 + half + + + + + + 5 + minor + + + + + C + 4 + + 2 + 1 + half + + + + + + 6 + major + + + + + C + 4 + + 2 + 1 + half + + + + + + 6 + minor + + + + + C + 4 + + 2 + 1 + half + + + + + + 7 + major + + + + + C + 4 + + 2 + 1 + half + + + + + + 7 + minor + + + + + C + 4 + + 2 + 1 + half + + + + + + 8 + major + + + + + C + 4 + + 2 + 1 + half + + + + + + 8 + minor + + + + + C + 4 + + 2 + 1 + half + + + + + + 9 + major + + + + + C + 4 + + 2 + 1 + half + + + + + + 9 + minor + + + + + C + 4 + + 2 + 1 + half + + + + + + 10 + major + + + + + C + 4 + + 2 + 1 + half + + + + + + 10 + minor + + + + + C + 4 + + 2 + 1 + half + + + + + + 11 + major + + + + + C + 4 + + 2 + 1 + half + + + + + + 11 + minor + + + + + C + 4 + + 2 + 1 + half + + + light-heavy + + + + + diff --git a/input/regression/musicxml/00h-Basics-TimeSignatures.xml b/input/regression/musicxml/00h-Basics-TimeSignatures.xml new file mode 100644 index 0000000000..547eba1281 --- /dev/null +++ b/input/regression/musicxml/00h-Basics-TimeSignatures.xml @@ -0,0 +1,219 @@ + + + + Different time signatures + + + MusicXML Part + + + + + + + + 1 + + 0 + major + + + + G + 2 + + + + + + C + 5 + + 1 + 1 + quarter + + + + + + + + + C + 5 + + 1 + 1 + quarter + + + + + + + + + C + 5 + + 1 + 1 + quarter + + + + + + + + + C + 5 + + 1 + 1 + quarter + + + + + + + + + C + 5 + + 1 + 1 + quarter + + + + + + + + + C + 5 + + 1 + 1 + quarter + + + + + + + + + C + 5 + + 1 + 1 + quarter + + + + + + + + + C + 5 + + 1 + 1 + quarter + + + + + + + + + C + 5 + + 1 + 1 + quarter + + + + + + + + + C + 5 + + 1 + 1 + quarter + + + + + + + + + C + 5 + + 1 + 1 + quarter + + + light-heavy + + + + + diff --git a/input/regression/musicxml/07b-Nokeyclef-Rosegarden.xml b/input/regression/musicxml/00i-Basics-NoKeyOrClef.xml similarity index 100% rename from input/regression/musicxml/07b-Nokeyclef-Rosegarden.xml rename to input/regression/musicxml/00i-Basics-NoKeyOrClef.xml diff --git a/input/regression/musicxml/07c-NoTime-PJB.xml b/input/regression/musicxml/00j-Basics-NoTime-PJB.xml similarity index 100% rename from input/regression/musicxml/07c-NoTime-PJB.xml rename to input/regression/musicxml/00j-Basics-NoTime-PJB.xml diff --git a/input/regression/musicxml/00d-Backup.xml b/input/regression/musicxml/00k-Basics-Backup.xml similarity index 100% rename from input/regression/musicxml/00d-Backup.xml rename to input/regression/musicxml/00k-Basics-Backup.xml diff --git a/input/regression/musicxml/00c-Tie-PJB.xml b/input/regression/musicxml/00l-Basics-Tie-PJB.xml similarity index 100% rename from input/regression/musicxml/00c-Tie-PJB.xml rename to input/regression/musicxml/00l-Basics-Tie-PJB.xml diff --git a/input/regression/musicxml/generate_intervals.py b/input/regression/musicxml/generate_intervals.py new file mode 100755 index 0000000000..dbde2bcee7 --- /dev/null +++ b/input/regression/musicxml/generate_intervals.py @@ -0,0 +1,58 @@ +#!/usr/bin/env python + +notes = "CDEFGAB" +alterations = [-1, 0, 1] + +def print_note (octave, note, alteration): + print " \n \n %s" % notes[note] + if alteration <> 0: + print " %s" % alteration + print " %s\n \n 1\n 1\n quarter\n " % octave + + +print """ + + + Various piches and interval sizes + + + MusicXML Part + + + + + + + 1 + + 0 + major + + + + G + 2 + + +""" + +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 """ + + +""" \ No newline at end of file diff --git a/input/regression/musicxml/generate_keys.py b/input/regression/musicxml/generate_keys.py new file mode 100755 index 0000000000..cd0f99529f --- /dev/null +++ b/input/regression/musicxml/generate_keys.py @@ -0,0 +1,72 @@ +#!/usr/bin/env python + +notes = "CDEFGAB" +alterations = [-1, 0, 1] + +def print_measure (nr, fifth, mode, atts = "", final = ""): + print """ + +%s + %s + %s + + + + + C + 4 + + 2 + 1 + half + +%s """ % (nr, atts, fifth, mode, final) + +first_atts = """ 1 + + + G + 2 + +""" + +final_barline = """ + light-heavy + +""" + +print """ + + + Different Key signatures + + + MusicXML Part + + + + +""" + +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 """ + +""" \ No newline at end of file diff --git a/input/regression/musicxml/generate_timesignatures.py b/input/regression/musicxml/generate_timesignatures.py new file mode 100755 index 0000000000..9844f3d0f6 --- /dev/null +++ b/input/regression/musicxml/generate_timesignatures.py @@ -0,0 +1,96 @@ +#!/usr/bin/env python + +notes = "CDEFGAB" +alterations = [-1, 0, 1] + +def print_measure (nr, beats, type, params = "", attr = "", barline = ""): + print """ + +%s + + + + C + 5 + + 1 + 1 + quarter + +%s """ % (nr, attr, params, beats, type, barline) + +first_atts = """ 1 + + 0 + major + + + + G + 2 + +""" + +final_barline = """ + light-heavy + +""" + +print """ + + + Different time signatures + + + MusicXML Part + + + + +""" + +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 """ + +""" \ No newline at end of file -- 2.39.5