本文整理匯總了Python中solfege.mpd.track.Track.notelen_time方法的典型用法代碼示例。如果您正苦於以下問題:Python Track.notelen_time方法的具體用法?Python Track.notelen_time怎麽用?Python Track.notelen_time使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類solfege.mpd.track.Track
的用法示例。
在下文中一共展示了Track.notelen_time方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_melodic_interval_2_tracks
# 需要導入模塊: from solfege.mpd.track import Track [as 別名]
# 或者: from solfege.mpd.track.Track import notelen_time [as 別名]
def test_melodic_interval_2_tracks(self):
"""
In this test, only MIDI channel 0 will be allocated, even though
two different patches and volumes are used. This because the tones
from the two tracks does not sound at the same time.
"""
t1 = Track()
t1.set_patch(1)
t1.set_volume(101)
t1.note(4, 64)
t2 = Track()
t2.set_patch(2)
t2.set_volume(102)
t2.notelen_time(4)
t2.note(4, 66)
self.assertEquals(t1.str_repr(), "p1 v101 n64 d1/4 o64")
self.assertEquals(t2.str_repr(), "p2 v102 d1/4 n66 d1/4 o66")
m = MidiEventStream(t1, t2)
self.assertEquals(m.str_repr(1),
"p0:1 v0:101 n0:64 d1/4 o64 p0:2 v0:102 n0:66 d1/4 o66")