def test_apparatus(self): apparatus.parse("| c ) d ) ]] ]] ]] g ] |").decorate(loud=True) skoar = apparatus.parse("| mp c ) d ) %S% ]] | [1.] fff ]] fp ]] g p D.S. ] | [2.] <! 4/4 \sna !> <c,e,g> )) )) ) :|") skoar.decorate(loud=True) print(skoar.tree.draw_tree())
def test_meter(self): apparatus.parse("<!!>").decorate(loud=True) apparatus.parse("<! 130 => )) !>").decorate(loud=True) apparatus.parse("<! 90 => forte 100 => fforte 127 => fff 4=>ppp !>").decorate(loud=True) apparatus.parse("<! !>").decorate(loud=True) apparatus.parse("<!!>").decorate(loud=True)
def test_multiline(self): apparatus.parse(""" <! 120 => ) !> | <a,c,e> ). ). ]]] ]]] ]]] |: f# ) ) ooo/ ]]] ooo/ ]] ]] :| ) <? yay ?> ) """).decorate(loud=True)
def test_more(self): skoar = apparatus.parse( """|: mp c ) d ) %S% ]] :|: [1.] fff (+) ]] fp ]] g p D.S. al Coda ] | [2.] <! 4/4 \sna !> <c,e,g> )) )) ) :|""") skoar.decorate() for x, y in skoar.get_pattern_gen(): print("x: " + str(x) + ", " + str(y))
def test_notes(self): skoar = apparatus.parse( "| a ) b )) c ))) | d ] e ]] f ]]] g ] ] |") skoar.decorate() for x, y in skoar.get_pattern_gen(): print("x: " + str(x) + ", " + str(y))
def test_small(self): src = """ <! 4/4 120 => ) !> | mp c ) d ) %S% ]] piano |: f# ) ) ooo/ ]]] ooo/ ]] ]] fine :| | [1.] fff ]] fp ]] g ] | [2.] <! 3/4 !> <c,e,g> )) )) ) D.S. al fine | """ print("Skoarse Code") print("------------") print(src) skoar = apparatus.parse(src) print("\nParse Tree") print("----------") print(skoar.tree.draw_tree()) skoar.decorate() print(skoar.tree.draw_tree())
def test_big(self): src = """ | c ) d ) ]] ]] ]] g ] | | mp c ) d ) %S% ]] | [1.] fff ]] fp ]] g p D.S. ] | [2.] <! 4/4 \sna !> <c,e,g> )) )) ) :| <! 120 => ) !> | <a,c,e> ). ). ]]] ]]] ]]] |: f# ) ) ooo/ ]]] ooo/ ]] ]] :| | <a,c,e> ). ). ]]] ]]] ]]] |: f# ) ) ooo/ ]]] ooo/ ]] ]] :| | <a,c,e> ). ). ]]] ]]] ]]] |: f# ) ) ooo/ ]]] ooo/ ]] ]] :| | <a,c,e> ). ). ]]] ]]] ]]] |: f# ) ) ooo/ ]]] ooo/ ]] ]] :| | <a,c,e> ). ). ]]] ]]] ]]] |: f# ) ) ooo/ ]]] ooo/ ]] ]] :| | <a,c,e> ). ). ]]] ]]] ]]] |: f# ) ) ooo/ ]]] ooo/ ]] ]] :| | <a,c,e> ). ). ]]] ]]] ]]] |: f# ) ) ooo/ ]]] ooo/ ]] ]] :| | <a,c,e> ). ). ]]] ]]] ]]] |: f# ) ) ooo/ ]]] ooo/ ]] ]] :| | a ) b ) c ) | d ) e ) f ) g ) %S%_food | """ print("Skoarse Code") print("------------") print(src) skoar = apparatus.parse(src) print("\nParse Tree") print("----------") print(skoar.tree.draw_tree()) skoar.decorate() print(skoar.tree.draw_tree())
def test_time_signatures(self): apparatus.parse("<! 4/4 9/8 2/2 !>").decorate(loud=True)
def test_f(self): apparatus.parse("f ff fff ffff f# fp #f |").decorate(loud=True)
def test_misc(self): apparatus.parse("|ppp a ) b ) mp c ) | d mf ) // ) f $ ) g $ ) |").decorate(loud=True) apparatus.parse(" <3,4,5> 2 -3 +5 3.2 0.4").decorate(loud=True)
def test_syncopation(self): apparatus.parse("| c ) c 'stress this note:' .) ]] c!b,hh ]] ]] ] |")
def test_complex_time_sig(self): apparatus.parse("<! 3+4+5/4 !>")
def test_octave_shift(self): apparatus.parse("| ~~o) o~~) ~ooo) oo_o) :|")
def test_voicings(self): apparatus.parse( """ | 'root position' ooo) '1st inv' oo_o) '2nd_inv' o_oo) | """ )
def test_ties_and_stress(self): apparatus.parse("| b )__ c.) d) e .__) |") apparatus.parse("| b )__ c) d) e __.) |")
def test_ties(self): apparatus.parse("| b )__ c) d) e __) |") apparatus.parse("| b ))__ c] d) e __]. |") apparatus.parse("| b )__ c] d) e __]]. |") apparatus.parse("| b )__ c] d) e __]. |") apparatus.parse("| b )__ c] d) e __]. |")
def test_notes(self): apparatus.parse("| a ) b ) c ) | d ) e ) f ) g ) |").decorate(loud=True) apparatus.parse("| a ) a ) b ) | ++ ) e ) f ) ) g |").decorate(loud=True) apparatus.parse("| a c e ) bb ) c# ) | d## ) e ) ~f ) g~ ) |").decorate(loud=True)
def test_drums(self): apparatus.parse("| !b,hh ) !sn ) ]] c!b,hh ]] ]] ] |")