本文整理汇总了Python中abjad.tools.spannertools.Spanner.Spanner类的典型用法代码示例。如果您正苦于以下问题:Python Spanner类的具体用法?Python Spanner怎么用?Python Spanner使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Spanner类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(
self,
descriptor='<',
direction=None,
include_rests=False,
overrides=None,
):
Spanner.__init__(
self,
overrides=overrides,
)
direction = stringtools.expr_to_tridirectional_lilypond_symbol(
direction)
self._direction = direction
self._include_rests = include_rests
start_dynamic, shape_string, stop_dynamic = \
self._parse_descriptor(descriptor)
self._descriptor = descriptor
assert shape_string in ('<', '>')
self._shape_string = shape_string
if start_dynamic is not None:
start_dynamic = indicatortools.Dynamic(start_dynamic)
self._start_dynamic = start_dynamic
if stop_dynamic is not None:
stop_dynamic = indicatortools.Dynamic(stop_dynamic)
self._stop_dynamic = stop_dynamic
示例2: _copy_keyword_args
def _copy_keyword_args(self, new):
Spanner._copy_keyword_args(self, new)
new._direction = self.direction
new._include_rests = self.include_rests
new._shape_string = self.shape_string
new._start_dynamic = self.start_dynamic
new._stop_dynamic = self.stop_dynamic
示例3: __init__
def __init__(
self,
durations=None,
include_long_duration_notes=False,
include_long_duration_rests=False,
isolated_nib_direction=None,
use_stemlets=False,
vertical_direction=None,
):
Spanner.__init__(
self,
)
if durations:
durations = tuple(durationtools.Duration(x) for x in durations)
self._durations = durations
self._include_long_duration_notes = bool(include_long_duration_notes)
self._include_long_duration_rests = bool(include_long_duration_rests)
assert isolated_nib_direction in (Left, Right, None)
self._isolated_nib_direction = isolated_nib_direction
if self._durations is not None:
self._span_points = mathtools.cumulative_sums(self.durations)[1:]
else:
self._span_points = [self._get_duration()]
self._use_stemlets = bool(use_stemlets)
assert vertical_direction in (Up, Down, Center, None)
self._vertical_direction = vertical_direction
示例4: __init__
def __init__(
self,
overrides=None,
):
Spanner.__init__(
self,
overrides=overrides,
)
示例5: __init__
def __init__(
self,
color='white',
overrides=None,
):
Spanner.__init__(
self,
overrides=overrides,
)
self._color = color
示例6: __init__
def __init__(
self,
components=None,
overrides=None,
):
Spanner.__init__(
self,
components,
overrides=overrides,
)
示例7: __init__
def __init__(
self,
clef='percussion',
overrides=None,
):
Spanner.__init__(
self,
overrides=overrides,
)
clef = indicatortools.Clef(clef)
self._clef = clef
示例8: __init__
def __init__(
self,
include_tied_leaves=False,
overrides=None,
):
Spanner.__init__(
self,
overrides=overrides,
)
assert isinstance(include_tied_leaves, bool), repr(include_tied_leaves)
self._include_tied_leaves = include_tied_leaves
示例9: __init__
def __init__(self, lines=5, overrides=None):
Spanner.__init__(self, overrides=overrides)
if isinstance(lines, int) and 0 < lines:
self._lines = lines
elif isinstance(lines, (tuple, list)) and all(isinstance(x, (int, float)) for x in lines):
self._lines = tuple(lines)
else:
message = "must be integer or a sequence of integers: {!r}."
message = message.format(lines)
raise ValueError(message)
self._lines = lines
示例10: __init__
def __init__(
self,
components=None,
mark='',
overrides=None,
):
Spanner.__init__(
self,
components,
overrides=overrides,
)
self.mark = mark
示例11: __init__
def __init__(
self,
components=None,
overrides=None,
):
Spanner.__init__(
self,
components,
overrides=overrides,
)
self.kind = 'sustain'
self.style = 'mixed'
示例12: __init__
def __init__(
self,
minimum_duration=None,
overrides=None,
):
Spanner.__init__(
self,
overrides=overrides,
)
if minimum_duration is not None:
minimum_duration = durationtools.Duration(minimum_duration)
self._minimum_duration = minimum_duration
示例13: __init__
def __init__(
self,
overrides=None,
pitch=None,
):
Spanner.__init__(
self,
overrides=overrides,
)
if pitch is not None:
pitch = pitchtools.NamedPitch(pitch)
self._pitch = pitch
示例14: __init__
def __init__(
self,
overrides=None,
interval=None,
):
Spanner.__init__(
self,
overrides=overrides,
)
if interval is not None:
interval = pitchtools.NamedInterval(interval)
self._interval = interval
示例15: __init__
def __init__(
self,
components=[],
direction=None,
overrides=None,
):
Spanner.__init__(
self,
components,
overrides=overrides,
)
self.direction = direction