Open ZhaoJY1 opened 3 years ago
Hi Jianye,
Yeah, good catch. It looks like that line has a mistake in it. The check should be something like if unique_inst == 1:
. But if a band definition file (band_classes_def
) is provided that pretty much does the same thing, so that check can safely be removed in that case. What it'll do is it will just reject the case where there is only one of each type of track in it, as you pointed out.
Feel free to omit that check in your own code, or make a PR here.
Thanks again, Ethan
Hi Ethan,
I'm reading your code, and I found something confusing:
line 111 - 116
in the functioncheck_midi_file
inrender_by-instrument.py
:# Make sure there's more than one TYPE of instrument
unique_inst = len(set([utils.get_inst_class(inst_classes, i, pgm0_is_piano) for i in pm.instruments]))
if unique_inst == len(pm.instruments):
# There's only one type of source!
return False
Are these lines only allowing those midi files with some instruments included, those but of the same 'class', to pass?
For example, if we have a midi file with only two tracks and they are asigned with violin (program number 40) and piano (program number 0), respectively. And this midi file will simply not pass the check, does this make sense?
Maybe these lines were intended to be deleted but you forgot? Because in the function header, you did not even mention the TYPE criterion.
Regards! Jianye