示例#1
0
    def test_1(self):
        midi = Midi(60)
        expected = '''<pitch>
  <step>C</step>
  <octave>4</octave>
</pitch>
'''
        self.assertEqual(expected, midi.get_pitch_rest().to_string())
示例#2
0
    def test_4(self):
        midi = Midi(59, accidental=Accidental(mode='enharmonic_2'))
        expected = '''<pitch>
  <step>A</step>
  <alter>2</alter>
  <octave>3</octave>
</pitch>
'''
        self.assertEqual(expected, midi.get_pitch_rest().to_string())
示例#3
0
    def test_5(self):
        midi = Midi(58, accidental=Accidental(mode='sharp'))
        expected = '''<pitch>
  <step>A</step>
  <alter>1</alter>
  <octave>3</octave>
</pitch>
'''
        self.assertEqual(expected, midi.get_pitch_rest().to_string())
示例#4
0
    def test_2(self):
        midi = Midi(0)
        expected = '''<rest/>
'''
        self.assertEqual(expected, midi.get_pitch_rest().to_string())