class TEF::Sequencing::Sheet
Sheet
class
This class is meant as a container for the minimum amount of information necessary to instantiate a {SheetSequence}.
It provides a clean and easy way for the user to define a sequence of events, as well as minimally necessary information such as the speed of the sequence or the starting and ending times.
Attributes
@return [Numeric] The local ending-time. Defaults to nil, i.e.
it will be auto-determined by the notes in the sheet. Affects when the sheet is torn down and stops execution!
@return [nil, Proc] Block to call when setting up the {SheetSequence}.
This is the main way of letting the user configure the {SheetSequence}, as this block is called from the context of the sheet itself. Look at the functions of the Sheet Sequence for more details.
@see SheetSequence#at
@see SheetSequence#after
@see SheetSequence#play
If set non-nil, determines the timespan after which a given sequence will repeat itself. Does not influence start_time
and end_time.
@return [Numeric] The local starting time. Defaults to
0, i.e the sheet will start playing immediately. This does not affect the actual time scaling, but instead is merely used to know when to instantiate the {SheetSequence}
@return [Numeric, nil] Tempo of the sheet. Defines the execution
speed in BPM. If left nil, the execution speed of the parent sheet is used.
Public Class Methods
Initialize a new Sheet
.
The user should configure the sheet by writing into {#start_time}, {#end_time} and by supplying at least a {#sequence}
# File lib/tef/Sequencing/Sheet.rb, line 55 def initialize() @start_time = nil; @end_time = nil; @repeat_time = nil; @tempo = nil @fill_block = nil; @setup_block = nil; @teardown_block = nil; yield(self) if(block_given?) end
Public Instance Methods
# File lib/tef/Sequencing/Sheet.rb, line 81 def notes(&block) @fill_block = block; end
Configure a block to call when setting up the {SheetSequence}. This is the main way of letting the user configure the {SheetSequence}, as this block is called from the context of the sheet itself. Look at the functions of the Sheet
Sequence for more details.
@see SheetSequence#at
@see SheetSequence#after
@see SheetSequence#play
# File lib/tef/Sequencing/Sheet.rb, line 77 def setup(&block) @setup_block = block; end
Configure the block to call when the {SheetSequence} is about to be torn down. Use this to stop or delete any resources allocated to the sheet.
Guaranteed to always be called.
# File lib/tef/Sequencing/Sheet.rb, line 90 def teardown(&block) @teardown_block = block; end