diff --git a/generate_oly_score.py b/generate_oly_score.py index 047fb410398d1d221386ff9ee221dbd62eb789c4..c614b03fda3064fbf013c137ced993df9c1776d6 100755 --- a/generate_oly_score.py +++ b/generate_oly_score.py @@ -478,14 +478,19 @@ def generate_tex_files (settings, lily_files): #this_settings["scorenamebase"] = "Name"; tex_files.append (write_texscore_file (settings, this_settings, "TeX_Score.tex", score)) - this_settings = copy.deepcopy (tex_settings); - this_settings["scoretype"] = "InstrumentalParts"; - tmpopts = this_settings.get ("tex_options", []) - tmpopts.append (tex_options_map.get (this_settings["scoretype"], "")) - this_settings["tex_options"] = tmpopts - if "createCriticalComments" not in tex_settings: - this_settings["createCriticalComments"] = score not in no_criticalcomments_scores; - tex_files.append (write_texscore_file (settings, this_settings, "TeX_Instruments.tex", "Instruments")) + + # Create the tex instruments file only if we have instruments! + if set(this_settings["instruments"]) != set(this_settings["noscore_instruments"]): + this_settings = copy.deepcopy (tex_settings); + this_settings["scoretype"] = "InstrumentalParts"; + tmpopts = this_settings.get ("tex_options", []) + tmpopts.append (tex_options_map.get (this_settings["scoretype"], "")) + this_settings["tex_options"] = tmpopts + if "createCriticalComments" not in tex_settings: + this_settings["createCriticalComments"] = score not in no_criticalcomments_scores; + tex_files.append (write_texscore_file (settings, this_settings, "TeX_Instruments.tex", "Instruments")) + else: + print " No separate instrumental scores, not creating instruments tex file." return [tex_files, tex_includes];