Class: Sunniesnow::Charter::TimeDependent::DataPoint

Inherits:
Object
  • Object
show all
Includes:
Metronomic
Defined in:
lib/sscharter/charter/event.rb

Instance Attribute Summary collapse

Attributes included from Metronomic

#beat, #bpm_changes, #duration_beats, #offset

Instance Method Summary collapse

Methods included from Metronomic

#<=>, #beat_state, #end_time, #time, #time_at_relative_beat

Constructor Details

#initialize(beat, bpm_changes, value) ⇒ DataPoint

Returns a new instance of DataPoint.

Parameters:

  • beat (Rational)
  • bpm_changes (BpmChangeList)
  • value (Float, String)


106
107
108
109
110
111
# File 'lib/sscharter/charter/event.rb', line 106

def initialize beat, bpm_changes, value
	@offset = 0.0
	@beat = beat
	@bpm_changes = bpm_changes
	@value = value
end

Instance Attribute Details

#valueFloat, String

Returns:

  • (Float, String)


101
102
103
# File 'lib/sscharter/charter/event.rb', line 101

def value
  @value
end

Instance Method Details

#to_sunniesnowHash

Returns:

  • (Hash)


114
115
116
# File 'lib/sscharter/charter/event.rb', line 114

def to_sunniesnow
	{time: time, value: @value}
end