Exemplo n.º 1
0
 def setUp(self):
     self.commonbar = Bar()
     self.ebar = Bar('E', (4, 4))
     self.fbar = Bar('F', (6, 8))
     self.tbar = Bar('C', (4, 4))
     self.mbar = Bar('C', (4, 4))
     for y in [self.commonbar, self.ebar, self.fbar]:
         map(lambda x: y + x, ['C', 'E', 'G', 'B'])
     map(lambda x: self.tbar.place_notes(NoteContainer(x), 6), [
         'C',
         'E',
         'G',
         'B',
         'C',
         'E',
     ])
     map(lambda x: self.mbar.place_notes(NoteContainer(x), 4), ['C', 'E'])
     map(lambda x: self.mbar.place_notes(NoteContainer(x), 6),
         ['G', 'B', 'C'])
     self.track1 = Track()
     self.track1 + self.commonbar
     self.track2 = Track()
     self.track2 + self.commonbar
     self.track2 + self.ebar
     self.composition1 = Composition()
     self.composition1.add_track(self.track1)
     self.composition2 = Composition()
     self.composition2.add_track(self.track1)
     self.composition2.add_track(self.track2)
Exemplo n.º 2
0
def from_Bar(bar):
    c = Composition()
    t = Track()
    t.add_bar(bar)
    c.add_track(t)
    return _composition2musicxml(c).toprettyxml()
Exemplo n.º 3
0
def from_Track(track):
    c = Composition()
    c.add_track(track)
    return _composition2musicxml(c).toprettyxml()
Exemplo n.º 4
0
def from_Note(note):
    c = Composition()
    c.add_note(note)
    return _composition2musicxml(c).toprettyxml()