def add_accompanists_dynamics(self): for section in self.volume_sections: first_bar_conf = section[0] bar_index = first_bar_conf["bar_index"] for acc_name in first_bar_conf["accompanists"]: acc = self.score[acc_name] first_note = acc[bar_index][0] add_dynamic(first_note, first_bar_conf["dynamics"]["accompanists"])
def add_piano_dynamics(self): piano = self.score["Piano"][1] for section in self.volume_sections: first_bar_conf = section[0] bar_index = first_bar_conf["bar_index"] piano_first_note = piano[bar_index][0] add_dynamic(piano_first_note, first_bar_conf["dynamics"]["piano"])
def add_synth_dynamics(self): synth = self.score["Synthesizer"] # TODO use the section where the drone is actually sounding, not the square section for section in self.drone_sections: first_bar_conf = section[0] bar_index = first_bar_conf["bar_index"] synth_first_note = synth[bar_index][0] if not isinstance(synth_first_note, Rest): add_dynamic(synth_first_note, first_bar_conf["dynamics"]["drone"])
def add_soloist_dynamics(self): dynamic = None previous_soloist = None for bar in self.bars: i = bar["bar_index"] soloist_name = bar["soloist"] if soloist_name: dyn = bar["dynamics"]["soloist"] if dyn != dynamic or soloist_name != previous_soloist: dynamic = dyn previous_soloist = soloist_name soloist = self.score[soloist_name] first_note = soloist[i][0] add_dynamic(first_note, dynamic)