Beispiel #1
0
 def test_defaults_no_mixing_coeffs(self):
     mtrack = multitrack.MultiTrack('AHa_TakeOnMe')
     actual_filepaths, actual_weights = mix._build_mix_args(
         mtrack, None, None, None, None)
     expected_filepaths = [
         os.path.join(AUDIO_PATH, 'AHa_TakeOnMe', 'AHa_TakeOnMe_STEMS',
                      'AHa_TakeOnMe_STEM_{}.wav'.format(i))
         for i in ['01', '02', '03', '04', '05', '06']
     ]
     expected_weights = [1, 1, 1, 1, 1, 1]
     self.assertEqual(expected_filepaths, actual_filepaths)
     self.assertEqual(expected_weights, actual_weights)
Beispiel #2
0
 def test_one_stem_mix(self):
     actual_filepaths, actual_weights = mix._build_mix_args(
         self.mtrack, [2], None, None, None)
     expected_filepaths = [
         os.path.join(AUDIO_PATH, 'LizNelson_Rainfall',
                      'LizNelson_Rainfall_STEMS',
                      'LizNelson_Rainfall_STEM_{}.wav'.format(i))
         for i in ['02']
     ]
     expected_weights = [0.12610504621272442]
     self.assertEqual(expected_filepaths, actual_filepaths)
     self.assertEqual(expected_weights, actual_weights)
Beispiel #3
0
 def test_less_stems(self):
     actual_filepaths, actual_weights = mix._build_mix_args(
         self.mtrack, [2, 4], None, None, None)
     expected_filepaths = [
         os.path.join(AUDIO_PATH, 'LizNelson_Rainfall',
                      'LizNelson_Rainfall_STEMS',
                      'LizNelson_Rainfall_STEM_{}.wav'.format(i))
         for i in ['02', '04']
     ]
     expected_weights = [0.88655832334783, 0.9709353677932278]
     self.assertEqual(expected_filepaths, actual_filepaths)
     self.assertEqual(expected_weights, actual_weights)
Beispiel #4
0
 def test_defaults(self):
     actual_filepaths, actual_weights = mix._build_mix_args(
         self.mtrack, None, None, None, None)
     expected_filepaths = [
         os.path.join(AUDIO_PATH, 'LizNelson_Rainfall',
                      'LizNelson_Rainfall_STEMS',
                      'LizNelson_Rainfall_STEM_{}.wav'.format(i))
         for i in ['01', '02', '03', '04', '05']
     ]
     expected_weights = [
         0.6354871509502455, 0.12610504621272442, 0.0624147327727016,
         0.8433924607944484, 0.29222231756693756
     ]
     self.assertEqual(expected_filepaths, actual_filepaths)
     self.assertEqual(expected_weights, actual_weights)
Beispiel #5
0
 def test_defaults(self):
     actual_filepaths, actual_weights = mix._build_mix_args(
         self.mtrack, None, None, None, None)
     expected_filepaths = [
         os.path.join(AUDIO_PATH, 'LizNelson_Rainfall',
                      'LizNelson_Rainfall_STEMS',
                      'LizNelson_Rainfall_STEM_{}.wav'.format(i))
         for i in ['01', '02', '03', '04', '05']
     ]
     expected_weights = [
         0.9138225670999782, 0.88655832334783, 0.7820245646673145,
         0.9709353677932278, 0.7734022629465723
     ]
     self.assertEqual(expected_filepaths, actual_filepaths)
     self.assertEqual(expected_weights, actual_weights)
Beispiel #6
0
 def test_alt_weights(self):
     actual_filepaths, actual_weights = mix._build_mix_args(
         self.mtrack, None, {
             2: 2.0,
             4: 0.5
         }, None, None)
     expected_filepaths = [
         os.path.join(AUDIO_PATH, 'LizNelson_Rainfall',
                      'LizNelson_Rainfall_STEMS',
                      'LizNelson_Rainfall_STEM_{}.wav'.format(i))
         for i in ['01', '02', '03', '04', '05']
     ]
     expected_weights = [
         0.6354871509502455, 2.0, 0.0624147327727016, 0.5,
         0.29222231756693756
     ]
     self.assertEqual(expected_filepaths, actual_filepaths)
     self.assertEqual(expected_weights, actual_weights)