Ejemplo n.º 1
0
def make_sketch_lilypond_file(component):
    abjad.override(component).bar_line.stencil = False
    abjad.override(component).bar_number.stencil = False
    abjad.override(component).beam.positions = abjad.SchemePair((4, 4))
    abjad.override(component).spacing_spanner.strict_grace_spacing = True
    abjad.override(component).spacing_spanner.strict_note_spacing = True
    abjad.override(component).spacing_spanner.uniform_stretching = True
    abjad.override(component).stem.length = 8.25
    abjad.override(component).text_script.outside_staff_padding = 1
    abjad.override(component).time_signature.stencil = False
    abjad.override(component).tuplet_bracket.bracket_visibility = True
    abjad.override(component).tuplet_bracket.minimum_length = 3
    abjad.override(component).tuplet_bracket.outside_staff_padding = 1.5
    abjad.override(component).tuplet_bracket.padding = 1.5
    abjad.override(component).tuplet_bracket.springs_and_rods = \
        abjad.Scheme('ly:spanner::set-spacing-rods', verbatim=True)
    abjad.override(component).tuplet_bracket.staff_padding = 2.25
    abjad.override(component).tuplet_number.text = \
        abjad.Scheme('tuplet-number::calc-fraction-text', verbatim=True)
    abjad.setting(component).proportional_notation_duration = \
        abjad.SchemeMoment((1, 24))
    abjad.setting(component).tuplet_full_length = True
    lilypond_file = abjad.LilyPondFile.new(component)
    lilypond_file.layout_block.indent = 0
    lilypond_file.paper_block.system_system_spacing = abjad.Scheme(
        "#'((basic-distance . 28)(minimum-distance . 1)(padding . 4)(stretchability . 1))",
        verbatim=True)
    return lilypond_file
Ejemplo n.º 2
0
    def format_lilypond_value(argument):
        r'''Formats LilyPond `argument` according to Scheme formatting
        conventions.

        Returns string.
        '''
        import abjad
        if '_get_lilypond_format' in dir(argument) and not isinstance(argument, str):
            pass
        elif argument in (True, False):
            argument = abjad.Scheme(argument)
        elif argument in (
            abjad.Up, abjad.Down, abjad.Left, abjad.Right, abjad.Center):
            argument = abjad.Scheme(repr(argument).lower())
        elif isinstance(argument, int) or isinstance(argument, float):
            argument = abjad.Scheme(argument)
        elif argument in LilyPondFormatManager.lilypond_color_constants:
            argument = abjad.Scheme(argument)
        elif isinstance(argument, str) and '::' in argument:
            argument = abjad.Scheme(argument)
        elif isinstance(argument, tuple) and len(argument) == 2:
            argument = abjad.SchemePair(argument)
        elif isinstance(argument, str) and ' ' not in argument:
            argument = abjad.Scheme(argument, quoting="'")
        elif isinstance(argument, str) and ' ' in argument:
            argument = abjad.Scheme(argument)
        else:
            argument = abjad.Scheme(argument, quoting="'")
        return format(argument, 'lilypond')
Ejemplo n.º 3
0
    def __call__(self):
        '''Calls woodwind fingering.

        Returns markup command.
        '''
        import abjad
        key_groups_as_scheme = []
        cc_scheme_pair = abjad.SchemePair(('cc', self._center_column))
        key_groups_as_scheme.append(cc_scheme_pair)
        lh_scheme_pair = abjad.SchemePair(('lh', self._left_hand))
        key_groups_as_scheme.append(lh_scheme_pair)
        rh_scheme_pair = abjad.SchemePair(('rh', self._right_hand))
        key_groups_as_scheme.append(rh_scheme_pair)
        key_groups_as_scheme = abjad.Scheme(
            key_groups_as_scheme,
            quoting="'",
            )
        instrument_as_scheme = abjad.Scheme(self._name, quoting="'")
        return abjad.MarkupCommand(
            'woodwind-diagram',
            instrument_as_scheme,
            key_groups_as_scheme,
            )
 def _make_glissando_map(fret_combination, context_name):
     binary_list = fret_combination.as_binary_list()
     binary_list.reverse()
     glissando_map_list = []
     for i, finger in enumerate(binary_list):
         if finger == 1:
             mapping = abjad.SchemePair((i, i))
             glissando_map_list.append(mapping)
     if binary_list is None or binary_list == [0, 0, 0, 0, 0, 0]:
         return None
     else:
         glissando_map_vector = abjad.SchemeVector(glissando_map_list)
         glissando_map = abjad.lilypondnametools.LilyPondContextSetting(
             context_name=context_name,
             context_property='glissandoMap',
             value=glissando_map_vector)
         return glissando_map