#NEWLINE# def performance( ) : #NEWLINE# #INDENT# tracks = [ ] #NEWLINE# for track_num in range ( 8 ) : #NEWLINE# #INDENT# seq = OSequence ( [ ] ) #NEWLINE# for pattern in patterns : #NEWLINE# #INDENT# seq += ( parse ( pattern ) * random . randint ( 2 , 5 ) ) #NEWLINE# #UNINDENT# tracks . append ( ( seq | transpose ( random . choice ( [ ( - 12 ) , 0 , 12 ] ) ) ) ) #NEWLINE# #UNINDENT# f = open ( 'in_c_performance.mid' , 'w' ) #NEWLINE# s = SMF ( tracks ) #NEWLINE# s . write ( f ) #NEWLINE# f . close ( )