Class: Stretto::MusicElements::Timing
- Inherits:
-
MusicElement
- Object
- MusicElement
- Stretto::MusicElements::Timing
- Defined in:
- lib/stretto/music_elements/timing.rb
Overview
Timing information places the elements at the specified position in time,
This information is mostly used when reading a MIDI file or using it live, to synchronize with playback. The quantity is expressed in miliseconds.
Instance Attribute Summary
Attributes inherited from MusicElement
Attributes included from Node
Instance Method Summary (collapse)
-
- (Timing) initialize(string_or_options, pattern = nil)
constructor
A new instance of Timing.
-
- (Object) substitute_variables!
private.
- - (Object) value
Methods inherited from MusicElement
#build_music_string, #duration, #end_of_tie?, #start_of_tie?, #to_s
Constructor Details
- (Timing) initialize(string_or_options, pattern = nil)
A new instance of Timing
12 13 14 15 16 17 18 19 |
# File 'lib/stretto/music_elements/timing.rb', line 12 def initialize(, pattern = nil) token = case when String then Stretto::Parser.parse_timing!() else end super(token[:text_value], pattern) @original_value = token[:value] end |
Instance Method Details
- (Object) substitute_variables!
private
26 27 28 |
# File 'lib/stretto/music_elements/timing.rb', line 26 def substitute_variables! @value = self.value end |
- (Object) value
21 22 23 |
# File 'lib/stretto/music_elements/timing.rb', line 21 def value @value || @original_value.to_i(@pattern) end |