'Verify properties of the St. Anne file.
The file contains 2 parts and 4 voices.'

def test_st_anne(self):

    ns = musicxml_reader.musicxml_file_to_sequence_proto(self.st_anne_filename)
    expected_ns = common_testing_lib.parse_test_proto(music_pb2.NoteSequence, '\n                                ticks_per_quarter:    220\n                                time_signatures    {\n                                        numerator:    1\n                                        denominator:    4\n                                }\n                                time_signatures    {\n                                        time:    0.5\n                                        numerator:    4\n                                        denominator:    4\n                                }\n                                time_signatures    {\n                                        time:    6.5\n                                        numerator:    3\n                                        denominator:    4\n                                }\n                                time_signatures    {\n                                        time:    8.0\n                                        numerator:    1\n                                        denominator:    4\n                                }\n                                time_signatures    {\n                                        time:    8.5\n                                        numerator:    4\n                                        denominator:    4\n                                }\n                                time_signatures    {\n                                        time:    14.5\n                                        numerator:    3\n                                        denominator:    4\n                                }\n                                tempos:    {\n                                        qpm:    120\n                                }\n                                key_signatures:    {\n                                        key:    C\n                                }\n                                source_info:    {\n                                        source_type:    SCORE_BASED\n                                        encoding_type:    MUSIC_XML\n                                        parser:    MAGENTA_MUSIC_XML\n                                }\n                                part_infos    {\n                                        part:    0\n                                        name:    "Harpsichord"\n                                }\n                                part_infos    {\n                                        part:    1\n                                        name:    "Piano"\n                                }\n                                total_time:    16.0\n                                ')
    pitches_0_1 = [(67, 0.5), (64, 0.5), (69, 0.5), (67, 0.5), (72, 0.5), (72, 0.5), (71, 0.5), (72, 0.5), (67, 0.5), (72, 0.5), (67, 0.5), (69, 0.5), (66, 0.5), (67, 1.5), (71, 0.5), (72, 0.5), (69, 0.5), (74, 0.5), (71, 0.5), (72, 0.5), (69, 0.5), (71, 0.5), (67, 0.5), (69, 0.5), (72, 0.5), (74, 0.5), (71, 0.5), (72, 1.5)]
    pitches_0_2 = [(60, 0.5), (60, 0.5), (60, 0.5), (60, 0.5), (64, 0.5), (62, 0.5), (62, 0.5), (64, 0.5), (64, 0.5), (64, 0.5), (64, 0.5), (64, 0.5), (62, 0.5), (62, 1.5), (62, 0.5), (64, 0.5), (60, 0.5), (65, 0.5), (62, 0.5), (64, 0.75), (62, 0.25), (59, 0.5), (60, 0.5), (65, 0.5), (64, 0.5), (62, 0.5), (62, 0.5), (64, 1.5)]
    pitches_1_1 = [(52, 0.5), (55, 0.5), (57, 0.5), (60, 0.5), (60, 0.5), (57, 0.5), (55, 0.5), (55, 0.5), (60, 0.5), (60, 0.5), (59, 0.5), (57, 0.5), (57, 0.5), (59, 1.5), (55, 0.5), (55, 0.5), (57, 0.5), (57, 0.5), (55, 0.5), (55, 0.5), (57, 0.5), (56, 0.5), (55, 0.5), (53, 0.5), (55, 0.5), (57, 0.5), (55, 0.5), (55, 1.5)]
    pitches_1_2 = [(48, 0.5), (48, 0.5), (53, 0.5), (52, 0.5), (57, 0.5), (53, 0.5), (55, 0.5), (48, 0.5), (48, 0.5), (45, 0.5), (52, 0.5), (48, 0.5), (50, 0.5), (43, 1.5), (55, 0.5), (48, 0.5), (53, 0.5), (50, 0.5), (55, 0.5), (48, 0.5), (53, 0.5), (52, 0.5), (52, 0.5), (50, 0.5), (48, 0.5), (53, 0.5), (55, 0.5), (48, 1.5)]
    part_voice_instrument_program_pitches = [(0, 1, 1, 7, pitches_0_1), (0, 2, 1, 7, pitches_0_2), (1, 1, 2, 1, pitches_1_1), (1, 2, 2, 1, pitches_1_2)]
    for (part, voice, instrument, program, pitches) in part_voice_instrument_program_pitches:
        time = 0
        for (pitch, duration) in pitches:
            note = expected_ns.notes.add()
            note.part = part
            note.voice = voice
            note.pitch = pitch
            note.start_time = time
            time += duration
            note.end_time = time
            note.velocity = 64
            note.instrument = instrument
            note.program = program
            if (duration == 0.5):
                note.numerator = 1
                note.denominator = 4
            if (duration == 0.25):
                note.numerator = 1
                note.denominator = 8
            if (duration == 0.75):
                note.numerator = 3
                note.denominator = 8
            if (duration == 1.5):
                note.numerator = 3
                note.denominator = 4
    expected_ns.notes.sort(key=(lambda note: (note.part, note.voice, note.start_time)))
    ns.notes.sort(key=(lambda note: (note.part, note.voice, note.start_time)))
    self.assertProtoEquals(expected_ns, ns)
