segmentmaker

digraph InheritanceGraph { graph [bgcolor=transparent, color=lightsteelblue2, fontname=Arial, fontsize=10, outputorder=edgesfirst, overlap=prism, penwidth=2, rankdir=LR, splines=spline, style="dashed, rounded", truecolor=true]; node [colorscheme=pastel19, fontname=Arial, fontsize=10, height=0, penwidth=2, shape=box, style="filled, rounded", width=0]; edge [color=lightslategrey, penwidth=1]; subgraph cluster_builtins { graph [label=builtins]; node [color=1]; "builtins.object" [URL="https://docs.python.org/3.9/library/functions.html#object", label=object, target=_top]; } subgraph "cluster_pang.segmentmaker" { graph [label="pang.segmentmaker"]; node [color=2]; "pang.segmentmaker.SegmentMaker" [URL="../api/pang/segmentmaker.html#pang.segmentmaker.SegmentMaker", color=black, fontcolor=white, label="Segment\nMaker", target=_top]; } "builtins.object" -> "pang.segmentmaker.SegmentMaker"; }


Classes

SegmentMaker

Segment-maker.

class pang.segmentmaker.SegmentMaker(environment=None, score_template=None)

Segment-maker.

>>> template = pang.make_single_staff_score_template()
>>> maker = pang.SegmentMaker(
...     score_template=template,
... )
>>> instances = [0, 1, 2, 3]
>>> durations = [1, 1, 0.5, 0.5]
>>> sound_points_generator = pang.ManualSoundPointsGenerator(
...     instances=instances,
...     durations=durations,
... )
>>> sequence = pang.Sequence(
...     sound_points_generator=sound_points_generator,
... )
>>> command = pang.QuantizeSequenceCommand(sequence)
>>> scope = pang.Scope(voice_name="Voice")
>>> maker(scope, command)
>>> lilypond_file = maker.run(environment="docs")
>>> abjad.show(lilypond_file)  

Attributes Summary

__call__

Call self as a function.

lilypond_file

Returns LilyPond file.

metadata

Returns metadata.

run

Runs the segment-maker.

score

Returns Score.


Special methods

overridden __call__(scope, command)

Call self as a function.


Methods

run(environment=None, metadata=None)

Runs the segment-maker.


Read-only properties

lilypond_file

Returns LilyPond file.

metadata

Returns metadata.

>>> template = pang.make_single_staff_score_template()
>>> maker = pang.SegmentMaker(
...     score_template=template,
... )
>>> instances = [0, 1, 2, 3]
>>> durations = [1, 1, 0.5, 0.5]
>>> sound_points_generator = pang.ManualSoundPointsGenerator(
...     instances=instances,
...     durations=durations,
... )
>>> sequence = pang.Sequence(
...     sound_points_generator=sound_points_generator,
... )
>>> command = pang.QuantizeSequenceCommand(sequence)
>>> scope = pang.Scope(voice_name="Voice")
>>> maker(scope, command)
>>> lilypond_file = maker.run(environment="docs")
>>> abjad.show(lilypond_file)  
>>> string = abjad.storage(maker.metadata)
>>> print(string)
abjad.OrderedDict(
    [
        (
            'last_time_signature',
            abjad.TimeSignature((4, 4)),
            ),
        (
            'empty_beatspan',
            abjad.Duration(1, 8),
            ),
        ]
    )
score

Returns Score.