def test_loading_tonenamedb(self): logging.debug("#@testing loading tonenamedb======================") profile_category = "synth" for profile_name in ["fluidsynth/Z00-FluidR3_GM", "fluidsynth/Z01-FluidR3_GM"]: prof = test_target.load(profile_category, profile_name) logging.debug("#@prof:%s: %s -------------"%(profile_name,prof)) l = prof["tonenamedb"].ls() # logging.debug("##@ prof.tonenamedb:%s"%l) self.assertTrue(len(l) > 0) self.assertTrue(prof["tonenamedb"].get_tname(0,0,0) == "Yamaha Grand Piano") self.assertTrue(l[0][0] == 0) self.assertTrue(l[0][1] == 0) self.assertTrue(l[0][2] == 0) if "tonenamecsv" in prof: self.assertTrue(l[0][3] == "Piano") else: self.assertTrue(l[0][3] == midisw.util.sfpath2sfname(prof["soundfont"])) self.assertTrue(l[0][4] == "Yamaha Grand Piano")
def test_expanding_command(self): profile_category = "process" profile_name = "Z00-init-PCH" prof = test_target.load(profile_category, profile_name) logging.debug(f"#builded profile:{prof}") self.assertTrue(type(prof['command']) is str)
def test_zynaddsubfx_default(self): profile_category = "process" profile_name = "Z23-zynaddsubfx-default" prof = test_target.load(profile_category, profile_name) logging.debug(f"#builded profile:{prof}") self.assertTrue(prof['require'][0]['type'] == 'jack/audio') self.assertTrue(prof['require'][0]['name'] == 'system:playback_1') self.assertTrue(prof['require'][1]['type'] == 'jack/audio') self.assertTrue(prof['require'][1]['name'] == 'system:playback_2') self.assertTrue(prof['portname_prefix'] in prof['command'])
def test_loading_fc50(self): logging.debug("#@testing loading synth/hard/fc-50======================") profile_category = "synth" profile_name = "hard/fc-50" prof = test_target.load(profile_category, profile_name) logging.debug("#@prof:%s: %s"%(profile_name,prof)) self.assertFalse( 'recive' in prof ) self.assertTrue( 7 in prof["send"]["cc"] ) self.assertFalse( 0x80 in prof["send"]["message"] ) self.assertTrue(0xc0 in prof["send"]["message"] ) self.assertTrue(0xb0 in prof["send"]["message"] )
def test_loading_tonenamedb_zynaddsubfx(self): logging.debug("#@testing loading zynaddsubfx======================") profile_category = "synth" profile_name = "zynaddsubfx/Z00-zynaddsubfx" prof = test_target.load(profile_category, profile_name) logging.debug("#@prof:%s: %s"%(profile_name,prof)) l = prof["tonenamedb"].ls() self.assertTrue(len(l) > 0) self.assertTrue(l[0][3] == "Arpeggios")
def test_loading_fluidsynth(self): logging.debug("#@testing loading synth/fluidsynth======================") profile_category = "synth" profile_name = "fluidsynth/Z00-FluidR3_GM" prof = test_target.load(profile_category, profile_name) logging.debug("#@prof:%s: %s"%(profile_name,prof)) self.assertIsNotNone(prof["name"]) self.assertFalse('send' in prof) self.assertTrue(type(prof["recive"]["message"][0x80]) is str) self.assertTrue(min(prof["recive"]["ch"]) == 0) self.assertTrue(max(prof["recive"]["ch"]) == 15) self.assertTrue(min(prof["recive"]["notes"]) == 0) self.assertTrue(max(prof["recive"]["notes"]) == 127)
def test_start_to_stop(self): loaded_profs = {} p_wrapper = {} for profname in self.target_profile_names: logging.debug(f"# loading profile:{profname}") loaded_profs[profname] = test_profile.load('process', profname) logging.debug(f"# done profile={loaded_profs[profname]}") for profname in self.target_profile_names: logging.debug( f"## starting:{profname} ############################################" ) p_wrapper[profname] = test_target.ProcessWrapper( loaded_profs[profname]) p_wrapper[profname].start() self.assertTrue(p_wrapper[profname].is_active()) logging.debug("### checking port:" + str(p_wrapper[profname].prof['provides'])) for port in p_wrapper[profname].prof['provides']: self.assertTrue( midisw.util.is_port_active(port['type'], port['name'])) logging.debug('# sleeping 10 sec ###################################') time.sleep(10) for profname in reversed(self.target_profile_names): logging.debug(f"## stopping:{profname} ......") p_wrapper[profname].stop() self.assertFalse(p_wrapper[profname].is_active()) for port in p_wrapper[profname].prof['provides']: self.assertFalse( midisw.util.is_port_active(port['type'], port['name']))
def test_loading(self): profile_category = "process" profile_name = "Z10-jack-PCH" prof = test_target.load(profile_category, profile_name) self.assertIsNotNone(prof['name'])