Extend tests to cover V2 models

This commit is contained in:
hirsch 2016-07-31 17:50:47 -04:00
parent 5c5d24cdd0
commit 32b6bdde02

262
test.py
View file

@ -24,6 +24,9 @@ mido.set_backend('mido.backends.rtmidi')
pc = mido.Message('program_change') pc = mido.Message('program_change')
cc = mido.Message('control_change') cc = mido.Message('control_change')
# 1 == v1, 2 == v2
type = 0
def analog_send( outport, sleeptime=0.25 ): def analog_send( outport, sleeptime=0.25 ):
for value in [ 0, 32, 64, 96, 127, 96, 64, 32, 0 ]: for value in [ 0, 32, 64, 96, 127, 96, 64, 32, 0 ]:
cc.value = value cc.value = value
@ -43,29 +46,34 @@ def amp_screen1( outport ):
analog_send( outport ) analog_send( outport )
# Some variation in screen 2 across models # Some variation in screen 2 across models
def amp_screen2( outport, bias_sag, extra ): def amp_screen2( outport, template ):
if bias_sag: limit = len(template)
cc.control = 74
discrete_send( outport, 2 )
cc.control = 75
analog_send( outport )
cc.control = 76 i = 74
discrete_send( outport, 4 ) j = 5
while j < limit:
cc.control = 77 cc.control = i
discrete_send( outport, 12 ) i += 1
if template[j] == "A":
if extra: analog_send( outport )
cc.control = 78 elif template[j] == "D":
analog_send( outport ) j += 1
cc.control = 79 count = int( template[j:j+2] )
analog_send( outport ) j += 1
discrete_send( outport, count )
elif template[j] == "-":
pass
j += 1
# Step through all amp models # Step through all amp models
def amp_select( outport ): def amp_select( outport ):
if type == 2:
max = 18
else:
max = 13
cc.control = 68 cc.control = 68
for i in range( 0, 13 ): for i in range( 0, max ):
cc.value = i cc.value = i
outport.send( cc ) outport.send( cc )
sleep( 0.5 ) sleep( 0.5 )
@ -75,18 +83,20 @@ def run_amp_test( struct, outport ):
amp_select( outport ) amp_select( outport )
for i in range( 0, len(struct) ): for i in range( 0, len(struct) ):
amp_rec = struct[i] control_rec = struct[i]
if control_rec[3] and type != 2:
continue
raw_input( "Hit ENTER to run parm edit check for %s\n" % amp_rec[0] ) raw_input( "Hit ENTER to run parm edit check for %s\n" % control_rec[0] )
cc.control = 68 cc.control = 68
cc.value = amp_rec[1] cc.value = control_rec[1]
outport.send( cc ) outport.send( cc )
raw_input( "Enter amp edit mode on Mustang and hit ENTER to proceed...\n" ) raw_input( "Enter amp edit mode on Mustang and hit ENTER to proceed...\n" )
amp_screen1( outport ) amp_screen1( outport )
raw_input( "Step to amp edit screen 2 and hit ENTER...\n" ) raw_input( "Step to amp edit screen 2 and hit ENTER...\n" )
amp_screen2( outport, amp_rec[2], amp_rec[3] ) amp_screen2( outport, control_rec[2] )
# Step through all reverb models # Step through all reverb models
def reverb_select( outport ): def reverb_select( outport ):
@ -119,29 +129,43 @@ def run_delay_test( struct, outport ):
delay_select( outport ) delay_select( outport )
for i in range( 0, len(struct) ): for i in range( 0, len(struct) ):
delay_rec = struct[i] control_rec = struct[i]
if control_rec[3] and type != 2:
continue
raw_input( "Hit ENTER to run parm edit check for %s\n" % delay_rec[0] ) raw_input( "Hit ENTER to run parm edit check for %s\n" % control_rec[0] )
cc.control = 48 cc.control = 48
cc.value = delay_rec[1] cc.value = control_rec[1]
outport.send( cc ) outport.send( cc )
raw_input( "Enter delay edit mode on Mustang and hit ENTER to proceed...\n" ) raw_input( "Enter delay edit mode on Mustang and hit ENTER to proceed...\n" )
for i in range( 49, 54 ): limit = len(control_rec[2])
cc.control = i template = control_rec[2]
# Multitap Delay has a single discrete control
if i==53 and delay_rec[2]: i = 49
discrete_send( outport, 3 ) j = 0
else: while j < limit:
analog_send( outport ) cc.control = i
i += 1
if template[j] == "A":
analog_send( outport )
elif template[j] == "D":
j += 1
count = int( template[j:j+2] )
j += 1
discrete_send( outport, count )
j += 1
if delay_rec[3]:
analog_send( outport )
# Step through all mod models # Step through all mod models
def mod_select( outport ): def mod_select( outport ):
if type == 2:
max = 15
else:
max = 12
cc.control = 38 cc.control = 38
for i in range( 0, 12 ): for i in range( 0, max ):
cc.value = i cc.value = i
outport.send( cc ) outport.send( cc )
sleep( 0.5 ) sleep( 0.5 )
@ -151,25 +175,42 @@ def run_mod_test( struct, outport ):
mod_select( outport ) mod_select( outport )
for i in range( 0, len(struct) ): for i in range( 0, len(struct) ):
mod_rec = struct[i] control_rec = struct[i]
if control_rec[3] and type != 2:
continue
raw_input( "Hit ENTER to run parm edit check for %s\n" % mod_rec[0] ) raw_input( "Hit ENTER to run parm edit check for %s\n" % control_rec[0] )
cc.control = 38 cc.control = 38
cc.value = mod_rec[1] cc.value = control_rec[1]
outport.send( cc ) outport.send( cc )
raw_input( "Enter mod edit mode on Mustang and hit ENTER to proceed...\n" ) raw_input( "Enter mod edit mode on Mustang and hit ENTER to proceed...\n" )
for i in range( 39, 44 ): limit = len(control_rec[2])
template = control_rec[2]
i = 39
j = 0
while j < limit:
cc.control = i cc.control = i
if (i==42 and mod_rec[2]) or (i==43 and mod_rec[3]): i += 1
discrete_send( outport, 1 ) if template[j] == "A":
else:
analog_send( outport ) analog_send( outport )
elif template[j] == "D":
j += 1
count = int( template[j:j+2] )
j += 1
discrete_send( outport, count )
j += 1
# Step through all stomp models # Step through all stomp models
def stomp_select( outport ): def stomp_select( outport ):
if type == 2:
max = 13
else:
max = 8
cc.control = 28 cc.control = 28
for i in range( 0, 8 ): for i in range( 0, max ):
cc.value = i cc.value = i
outport.send( cc ) outport.send( cc )
sleep( 0.5 ) sleep( 0.5 )
@ -179,23 +220,32 @@ def run_stomp_test( struct, outport ):
stomp_select( outport ) stomp_select( outport )
for i in range( 0, len(struct) ): for i in range( 0, len(struct) ):
stomp_rec = struct[i] control_rec = struct[i]
if control_rec[3] and type != 2:
continue
raw_input( "Hit ENTER to run parm edit check for %s\n" % stomp_rec[0] ) raw_input( "Hit ENTER to run parm edit check for %s\n" % control_rec[0] )
cc.control = 28 cc.control = 28
cc.value = stomp_rec[1] cc.value = control_rec[1]
outport.send( cc ) outport.send( cc )
raw_input( "Enter stomp edit mode on Mustang and hit ENTER to proceed...\n" ) raw_input( "Enter stomp edit mode on Mustang and hit ENTER to proceed...\n" )
for i in range( 29, 34 ): limit = len(control_rec[2])
template = control_rec[2]
i = 29
j = 0
while j < limit:
cc.control = i cc.control = i
if i==33 and stomp_rec[2]: i += 1
discrete_send( outport, 1 ) if template[j] == "A":
elif i==29 and stomp_rec[3]:
discrete_send( outport, 3 )
break
else:
analog_send( outport ) analog_send( outport )
elif template[j] == "D":
j += 1
count = int( template[j:j+2] )
j += 1
discrete_send( outport, count )
j += 1
# Step through program changes # Step through program changes
def program_change_test( outport ): def program_change_test( outport ):
@ -207,8 +257,10 @@ def program_change_test( outport ):
args = sys.argv args = sys.argv
if not len(args) == 3: if len(args) < 4:
print "Usage: test.py <virtual_port_name> <midi_channel>\n" print "Usage: test.py <virtual_port_name> <midi_channel> <v1|v2> [test_name]\n"
print " Pass test name in {pc, stomp, mod, reverb, delay, amp} for single test\n"
print " Default is to run all of them if no arg 4 passed\n"
sys.exit( 1 ) sys.exit( 1 )
try: try:
@ -217,51 +269,77 @@ except ValueError:
print "Arg2 must be numeric!\n" print "Arg2 must be numeric!\n"
sys.exit( 1 ) sys.exit( 1 )
if args[3] == "v1":
type = 1
elif args[3] == "v2":
type = 2
else:
print "Arg 3 must be 'v1' or 'v2'"
sys.exit( 1 )
single = "all"
if len(args) == 5:
single = args[4]
outport = mido.open_output( args[1] ) outport = mido.open_output( args[1] )
program_change_test( outport ) if single == "all" or single == "pc":
program_change_test( outport )
# Model # 33 Dig? if single == "all" or single == "stomp":
stomp_test = ( # Model # Ctrl v2only
( "Overdrive", 1, False, False ), stomp_test = (
( "Wah", 2, True, False ), ( "Ranger Boost", 8, "AAAA", True ),
( "Simple Comp", 6, False, True ), ( "Green Box", 9, "AAAA", True ),
( "Comp", 7, False, False ) ( "Orange Box", 10, "AAA", True ),
) ( "Black Box", 11, "AAA", True ),
( "Big Fuzz", 12, "AAA", True ),
run_stomp_test( stomp_test, outport ) ( "Overdrive", 1, "AAAAA", False ),
( "Wah", 2, "AAAAD01", False ),
( "Simple Comp", 6, "D03", False ),
( "Comp", 7, "AAAAA", False )
)
run_stomp_test( stomp_test, outport )
# Model # 42 Dig? 43 Dig? if single == "all" or single == "mod":
mod_test = ( # Model # Ctrl v2only
( "Sine Chorus", 1, False, False ), mod_test = (
( "Vibratone", 5, False, False ), ( "Wah", 12, "AAAAD02", True ),
( "Vintage Trem", 6, False, False ), ( "Touch Wah", 13, "AAAAD02", True ),
( "Ring Mod", 8, True, False ), ( "Dia Shift", 14, "AD22D12D09A", True ),
( "Phaser", 10, False, True ),
( "Pitch Shift", 11, False, False )
)
run_mod_test( mod_test, outport ) ( "Sine Chorus", 1, "AAAAA", False ),
( "Vibratone", 5, "AAAAA", False ),
( "Vintage Trem", 6, "AAAAA", False ),
( "Ring Mod", 8, "AAAD01A", False ),
( "Phaser", 10, "AAAAD01", False ),
( "Pitch Shift", 11, "AAAAA", False )
)
run_mod_test( mod_test, outport )
run_reverb_test( outport ) if single == "all" or single == "reverb":
run_reverb_test( outport )
# Model # 53 Dig?, Has 54? if single == "all" or single == "delay":
delay_test = ( # Model # Ctrl v2only
( "Mono Delay", 1, False, False ), delay_test = (
( "Multitap", 4, True, False ), ( "Mono Delay", 1, "AAAAA", False ),
( "Tape Delay", 8, False, False ) ( "Multitap", 4, "AAAAD03", False ),
) ( "Tape Delay", 8, "AAAAA", False )
)
run_delay_test( delay_test, outport )
run_delay_test( delay_test, outport ) if single == "all" or single == "amp":
# Model, #, Bias/Sag? Has 78+79?
amp_test = (
( "Studio Preamp", 13, "AAAAA--D04D12", True ),
# Model, #, Bias/Sag?, Extra? ( "Fender 65 Twin", 6, "AAAAAD02AD04D12", False ),
amp_test = ( ( "Fender SuperSonic", 7, "AAAAAD02AD04D12AA", False ),
( "Fender 65 Twin", 6, True, False ), ( "British 60s", 8, "AAAAAD02AD04D12AA", False ),
( "Fender SuperSonic", 7, True, True ), ( "British 70s", 9, "AAAAAD02AD04D12AA", False ),
( "British 60s", 8, True, True ), ( "British 80s", 10, "AAAAAD02AD04D12AA", False )
( "British 70s", 9, True, True ), )
( "British 80s", 10, True, True ) run_amp_test( amp_test, outport )
)
run_amp_test( amp_test, outport )