segmentmaker¶
Classes
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 self as a function.
Returns LilyPond file.
Returns metadata.
Runs the segment-maker.
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.
-
overridden