Beispiel #1
0
 def test_set_bpm(self):
     t = Track()
     t.set_bpm(120)
     t.note(4, 50)
     self.assertEqual(
         MidiEventStream(t).str_repr(1),
         "t120/4 p0:0 v0:100 n0:50 d1/4 o50")
Beispiel #2
0
 def test_set_bpm(self):
     t = Track()
     t.set_bpm(120)
     t.note(4, 50)
     self.assertEquals(
         MidiEventStream(t).str_repr(1),
         "t120/4 p0:0 v0:100 n0:50 d1/4 o50")
Beispiel #3
0
 def test_set_bpm2(self):
     """
     Two set_bpm in a row should only generate MIDI events for the
     last one.
     """
     t = Track()
     t.set_bpm(120)
     t.set_bpm(121)
     t.note(4, 50)
     self.assertEquals(MidiEventStream(t).str_repr(1),
         "t121/4 p0:0 v0:100 n0:50 d1/4 o50")
Beispiel #4
0
 def test_set_bpm2(self):
     """
     Two set_bpm in a row should only generate MIDI events for the
     last one.
     """
     t = Track()
     t.set_bpm(120)
     t.set_bpm(121)
     t.note(4, 50)
     self.assertEquals(
         MidiEventStream(t).str_repr(1),
         "t121/4 p0:0 v0:100 n0:50 d1/4 o50")
Beispiel #5
0
 def test_set_bpm3(self):
     """
     When two tracks set a different tempo, the tempo from the
     last track is used. There is not issues two MIDI events.
     """
     t1 = Track()
     t1.set_bpm(120)
     t1.note(4, 50)
     t2 = Track()
     t2.set_bpm(121)
     t2.note(4, 55)
     self.assertEquals(MidiEventStream(t1, t2).str_repr(1),
         "t121/4 p0:0 v0:100 n0:50 n0:55 d1/4 o50 o55")
Beispiel #6
0
 def test_set_bpm3(self):
     """
     When two tracks set a different tempo, the tempo from the
     last track is used. There is not issues two MIDI events.
     """
     t1 = Track()
     t1.set_bpm(120)
     t1.note(4, 50)
     t2 = Track()
     t2.set_bpm(121)
     t2.note(4, 55)
     self.assertEquals(
         MidiEventStream(t1, t2).str_repr(1),
         "t121/4 p0:0 v0:100 n0:50 n0:55 d1/4 o50 o55")