Module: Musa::Datasets::AbsD
Constant Summary collapse
- NaturalKeys =
(NaturalKeys + [:duration, # duration of the process (note reproduction, dynamics evolution, etc) :note_duration, # duration of the note (a staccato note is effectively shorter than elapsed duration until next note) :forward_duration # duration to wait until next event (if 0 means the next event should be executed at the same time than this one) ]).freeze
Class Method Summary collapse
Instance Method Summary collapse
Methods included from E
Class Method Details
.is_compatible?(thing) ⇒ Boolean
64 65 66 |
# File 'lib/musa-dsl/datasets/e.rb', line 64 def self.is_compatible?(thing) thing.is_a?(AbsD) || thing.is_a?(Hash) && thing.has_key?(:duration) end |
.to_AbsD(thing) ⇒ Object
68 69 70 71 72 73 74 75 76 |
# File 'lib/musa-dsl/datasets/e.rb', line 68 def self.to_AbsD(thing) if thing.is_a?(AbsD) thing elsif thing.is_a?(Hash) && thing.has_key?(:duration) thing.clone.extend(AbsD) else raise ArgumentError, "Cannot convert #{thing} to AbsD dataset" end end |
Instance Method Details
#duration ⇒ Object
60 61 62 |
# File 'lib/musa-dsl/datasets/e.rb', line 60 def duration self[:duration] end |
#forward_duration ⇒ Object
52 53 54 |
# File 'lib/musa-dsl/datasets/e.rb', line 52 def forward_duration self[:forward_duration] || self[:duration] end |
#note_duration ⇒ Object
56 57 58 |
# File 'lib/musa-dsl/datasets/e.rb', line 56 def note_duration self[:note_duration] || self[:duration] end |