def as_score(self): return MoveStackScore(*[ calliope.Staff( self.as_row(index=i) # to consider adding in a smart range ) for i in range(self.row_count) ])
"R", 9,(-8,9), (-5,2,5),-8, 2, ) ).eps( 1,2,4, "note_head:0:cross")( 2, "note_head:1:cross" )() seg.append(c1) seg.append(c2) calliope.illustrate(calliope.Staff( seg, clef="percussion" )) # def test1(times=10000): # for i in range(times): # my_cell = ImaginaryCell(rhythm=(4,-4,2,2), pitches=(2,"R",0,-1)) # my_cell.events[0].tag("p") # return my_cell # def test2(times=10000): # def cell_test(lib): # return ImaginaryCell(rhythm=(4,)*4) # lib = library.Library() # lib.add(cell_test, namespace="testing")
def bass_flat2(lib): return lib("bass_line").flat2() def to_lib(lib): if not lib.is_loaded("bass"): lib.add(bass_line, bass_trunc, bass_short, bass_flat1, bass_flat2) lib.mark_loaded("bass") if __name__ == '__main__': lib = library.Library() to_lib(lib) calliope.illustrate(calliope.Staff(lib("bass_line"), clef="bass")) # l5_aflat = l5() # for e in l5_aflat.note_events: # if e.pitch % 12 == 9: # e.pitch += -1 # l5_dflat = l5_aflat() # for e in l5_dflat.note_events: # if e.pitch % 12 == 2: # e.pitch += -1 # s5 = calliope.Segment( # l5(), # l5(), # l5_aflat(),
pitches=( (-5, 9), (9, -8), (-5, 9, 2), (9, -8), (-5, 9), (9, 4, -8), 2, (-5, 9, 2), (9, -8), )) c.events[1, 3, 5, 8].tag("note_head:0:cross") c.events[0, 1, 2, 3, 4, 5, 7, 8].tag("note_head:-1:cross") return c def to_lib(lib): if not lib.is_loaded("drum"): lib.add(drum_off_short, drum_du_du, drum_on_off, drum_quick_off, drum_rock_out, drum_quick_off2, drum_dark, drum_hits) lib.mark_loaded("drum") if __name__ == '__main__': lib = library.Library() to_lib(lib) calliope.illustrate( calliope.Staff(lib("drum_hits") * 8, clef="percussion"), as_midi=True, open_midi=True, )
def to_staves(self): return calliope.StaffGroup(*[calliope.Staff(c()) for c in self])