Example #1
0
def configure_score(score, reading_index, tefer_index):
    reading_number = reading_index + 1
    tefer_number = tefer_index + 1
    instrument_names = reading_index_to_instrument_names(reading_index)
    pnd = Fraction(1, 16)
    score.spacing.proportional_notation_duration = pnd
    score.spacing.uniform_stretching = True
    score.spacing.strict_note_spacing = True
    score.meter.stencil = False
    score.bar_number.transparent = True
    score.beam.auto_beaming = False
    score.stem.stencil = False
    score.text_script.staff_padding = 2
    for staff, instrument_name in zip(
        iterate.naive_forward_in(score, Staff), instrument_names):
        staff.name = instrument_name.capitalize()
        if staff.name == 'Cello':
            staff.clef.forced = Clef('bass')
    lilypond_file = lilytools.make_basic_lilypond_file(score)
    lilypond_file.layout.indent = 0
    lilypond_file.layout.ragged_right = True
    lilypond_file.paper.top_margin = 10
    lilypond_file.paper.print_page_number = False
    lilypond_file.paper.oddFooterMarkup = Markup(
        r'\fill-line { "désir - reading %s, tefer %s" } ' % (
        reading_number, tefer_number))
    lilypond_file.paper.minimal_page_breaking = True
    lilypond_file.paper.ragged_bottom = True
    lilypond_file.paper.ragged_last_bottom = True
    lilypond_file.global_staff_size = 14
    lilypond_file.default_paper_size = '11x17', 'landscape'
    return score
def apply_instrumentation_to_section_array(array, reading_index):
    names = reading_index_to_instrument_names(reading_index)
    for row, name in zip(array.rows, names):
        row.name = name
        instrument_range = instrument_name_to_instrument_range(name)
        row.pitch_range = instrument_range
def fit_best_pitches_to_reading(score, reading_index):
    instrument_names = reading_index_to_instrument_names(reading_index)
    instrument_names = [x.capitalize() for x in instrument_names]
    voice_leading_array = merge_for_reading(reading_index)
    for instrument_name, voice_leading_row in zip(instrument_names, voice_leading_array.rows):
        fit_best_pitches_to_instrument_reading(score, voice_leading_row, reading_index, instrument_name)