def get_melody_staff(instrument_class, instrument_name, short_instrument_name): staff = Staff([]) staff.name = instrument_name instrument = instrument_class(instrument_name=instrument_name, short_instrument_name=short_instrument_name) attach(instrument, staff) add_time_signature(staff) add_tempo(staff) if instrument_name == 'Cello': attach(Clef('bass'), staff) return staff
def get_synthesizer_staff(): staff = Staff([], name='Synthesizer Staff') staff.name = 'Synthesizer' clef = Clef('treble') attach(clef, staff) synth = Instrument( instrument_name='Synthesizer', short_instrument_name='Syn' ) attach(synth, staff) add_time_signature(staff) add_tempo(staff) return staff
def get_piano_staff(): piano_staff = StaffGroup() piano_staff.name = 'Piano' piano_staff.context_name = 'PianoStaff' upper_staff = Staff([]) upper_staff.name = 'Piano upper' add_time_signature(upper_staff) add_tempo(upper_staff) lower_staff = Staff([]) lower_staff.name = 'Piano lower' add_time_signature(lower_staff) add_tempo(lower_staff) piano_staff.append(upper_staff) piano_staff.append(lower_staff) piano = Piano(short_instrument_name='Pno') attach(piano, piano_staff) bass_clef = Clef('bass') attach(bass_clef, lower_staff) return piano_staff