Class: Sunniesnow::Charter::TimeDependent

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

Defined Under Namespace

Classes: DataPoint, InterpolablePiecewiseData, PiecewiseData, UninterpolablePiecewiseData

Constant Summary collapse

INTERPOLABLE =
%i[
	x y opacity size scale_x scale_y skew_x skew_y rotation text tint_red tint_green tint_blue
	circle_opacity circle_scale_x circle_scale_y circle_skew_x circle_skew_y circle_rotation
	circle_tint_red circle_tint_green circle_tint_blue
	width height anchor_x anchor_y
].freeze
INTERPOLABLE_SET =
INTERPOLABLE.to_set.freeze
UNINTERPOLABLE =
%i[z blend_mode circle_blend_mode text].freeze
UNINTERPOLABLE_SET =
UNINTERPOLABLE.to_set.freeze
BLEND_MODES =
%i[
	normal add multiply screen darken lighten erase color_dodge color_burn linear_burn linear_dodge
	linear_light hard_light soft_light pin_light difference exclusion overlay saturation color luminosity
	normal_npm add_npm screen_npm none subtract divide vivid_light hard_mix negation min max
].freeze
BLEND_MODES_SET =
BLEND_MODES.to_set
UNINTERPOLABLE_TYPES =
{
	blend_mode: BLEND_MODES_SET,
	circle_blend_mode: BLEND_MODES_SET,
	text: String
}.tap { _1.default = Numeric }.freeze

Instance Attribute Summary collapse

Attributes included from BeatSeries

#bpm_changes, #current_beat

DSL Methods collapse

Methods included from BeatSeries

#beat, #beat!, #bpm

Instance Method Summary collapse

Methods included from BeatSeries

#current_beat_state, #restore_beat_state, #time_at

Constructor Details

#initialize(beat, bpm_changes) ⇒ TimeDependent

Returns a new instance of TimeDependent.

Parameters:



217
218
219
220
221
# File 'lib/sscharter/charter/event.rb', line 217

def initialize beat, bpm_changes
	@current_beat = beat
	@bpm_changes = bpm_changes
	@data = Hash.new { |h, k| h[k] = (INTERPOLABLE_SET.include?(k) ? InterpolablePiecewiseData : UninterpolablePiecewiseData).new beat, bpm_changes }
end

Instance Attribute Details

#dataHash{INTERPOLABLE_SET, UNINTERPOLABLE_SET => PiecewiseData}



213
214
215
# File 'lib/sscharter/charter/event.rb', line 213

def data
  @data
end

Instance Method Details

#[](key) ⇒ PiecewiseData?

Parameters:

  • key (Symbol)

Returns:



225
226
227
# File 'lib/sscharter/charter/event.rb', line 225

def [] key
	@data.has_key?(key) ? @data[key] : nil
end

#anchor_x(data_value) ⇒ DataPoint #anchor_x(speed:) ⇒ Float #anchor_x(s:) ⇒ Float

Overloads:

  • #anchor_x(data_value) ⇒ DataPoint

    Parameters:

    • data_value (Numeric)

    Returns:

  • #anchor_x(speed:) ⇒ Float

    Parameters:

    • speed (Numeric)

    Returns:

    • (Float)
  • #anchor_x(s:) ⇒ Float

    This overload is the same as the speed: overload, but with a shorter name for convenience.

    Parameters:

    • s (Numeric)

    Returns:

    • (Float)

Returns:



298
299
300
301
302
303
304
305
306
307
308
309
310
311
# File 'lib/sscharter/charter/event.rb', line 298

INTERPOLABLE.each do |property|
	define_method property do |data_value = nil, speed: nil, s: nil|
		raise ArgumentError, 'cannot specify both speed and s' if !speed.nil? && !s.nil?
		speed = s if speed.nil?
		raise ArgumentError, 'must specify one and only one of data_value and speed' if [data_value, speed].compact.size != 1
		if !data_value.nil?
			raise ArgumentError, "#{property} must be a number" unless data_value.is_a? Numeric
			@data[property].data_point @current_beat, data_value.to_f
		else
			raise ArgumentError, "speed must be a number" unless speed.is_a? Numeric
			@data[property].speed = speed.to_f
		end
	end
end

#anchor_y(data_value) ⇒ DataPoint #anchor_y(speed:) ⇒ Float #anchor_y(s:) ⇒ Float

Overloads:

  • #anchor_y(data_value) ⇒ DataPoint

    Parameters:

    • data_value (Numeric)

    Returns:

  • #anchor_y(speed:) ⇒ Float

    Parameters:

    • speed (Numeric)

    Returns:

    • (Float)
  • #anchor_y(s:) ⇒ Float

    This overload is the same as the speed: overload, but with a shorter name for convenience.

    Parameters:

    • s (Numeric)

    Returns:

    • (Float)

Returns:



298
299
300
301
302
303
304
305
306
307
308
309
310
311
# File 'lib/sscharter/charter/event.rb', line 298

INTERPOLABLE.each do |property|
	define_method property do |data_value = nil, speed: nil, s: nil|
		raise ArgumentError, 'cannot specify both speed and s' if !speed.nil? && !s.nil?
		speed = s if speed.nil?
		raise ArgumentError, 'must specify one and only one of data_value and speed' if [data_value, speed].compact.size != 1
		if !data_value.nil?
			raise ArgumentError, "#{property} must be a number" unless data_value.is_a? Numeric
			@data[property].data_point @current_beat, data_value.to_f
		else
			raise ArgumentError, "speed must be a number" unless speed.is_a? Numeric
			@data[property].speed = speed.to_f
		end
	end
end

#blend_mode(data_value) ⇒ DataPoint #blend_mode(value:) ⇒ BLEND_MODES_SET #blend_mode(v:) ⇒ BLEND_MODES_SET

Overloads:

Returns:



331
332
333
334
335
336
337
338
339
340
341
342
343
344
# File 'lib/sscharter/charter/event.rb', line 331

UNINTERPOLABLE.each do |property|
	define_method property do |data_value = nil, value: nil, v: nil|
		raise ArgumentError, "cannot specify both value and v" if !value.nil? && !v.nil?
		value = v if value.nil?
		raise ArgumentError, "must specify one and only one of data_value and value" if [data_value, value].compact.size != 1
		if !data_value.nil?
			raise ArgumentError, "wrong data type for data_value of #{property}" unless UNINTERPOLABLE_TYPES[property] === data_value
			@data[property].data_point @current_beat, data_value
		else
			raise ArgumentError, "wrong data type for value of #{property}" unless UNINTERPOLABLE_TYPES[property] === value
			@data[property].value = value
		end
	end
end

#circle_blend_mode(data_value) ⇒ DataPoint #circle_blend_mode(value:) ⇒ BLEND_MODES_SET #circle_blend_mode(v:) ⇒ BLEND_MODES_SET

Overloads:

Returns:



331
332
333
334
335
336
337
338
339
340
341
342
343
344
# File 'lib/sscharter/charter/event.rb', line 331

UNINTERPOLABLE.each do |property|
	define_method property do |data_value = nil, value: nil, v: nil|
		raise ArgumentError, "cannot specify both value and v" if !value.nil? && !v.nil?
		value = v if value.nil?
		raise ArgumentError, "must specify one and only one of data_value and value" if [data_value, value].compact.size != 1
		if !data_value.nil?
			raise ArgumentError, "wrong data type for data_value of #{property}" unless UNINTERPOLABLE_TYPES[property] === data_value
			@data[property].data_point @current_beat, data_value
		else
			raise ArgumentError, "wrong data type for value of #{property}" unless UNINTERPOLABLE_TYPES[property] === value
			@data[property].value = value
		end
	end
end

#circle_opacity(data_value) ⇒ DataPoint #circle_opacity(speed:) ⇒ Float #circle_opacity(s:) ⇒ Float

Overloads:

  • #circle_opacity(data_value) ⇒ DataPoint

    Parameters:

    • data_value (Numeric)

    Returns:

  • #circle_opacity(speed:) ⇒ Float

    Parameters:

    • speed (Numeric)

    Returns:

    • (Float)
  • #circle_opacity(s:) ⇒ Float

    This overload is the same as the speed: overload, but with a shorter name for convenience.

    Parameters:

    • s (Numeric)

    Returns:

    • (Float)

Returns:



298
299
300
301
302
303
304
305
306
307
308
309
310
311
# File 'lib/sscharter/charter/event.rb', line 298

INTERPOLABLE.each do |property|
	define_method property do |data_value = nil, speed: nil, s: nil|
		raise ArgumentError, 'cannot specify both speed and s' if !speed.nil? && !s.nil?
		speed = s if speed.nil?
		raise ArgumentError, 'must specify one and only one of data_value and speed' if [data_value, speed].compact.size != 1
		if !data_value.nil?
			raise ArgumentError, "#{property} must be a number" unless data_value.is_a? Numeric
			@data[property].data_point @current_beat, data_value.to_f
		else
			raise ArgumentError, "speed must be a number" unless speed.is_a? Numeric
			@data[property].speed = speed.to_f
		end
	end
end

#circle_rotation(data_value) ⇒ DataPoint #circle_rotation(speed:) ⇒ Float #circle_rotation(s:) ⇒ Float

Overloads:

  • #circle_rotation(data_value) ⇒ DataPoint

    Parameters:

    • data_value (Numeric)

    Returns:

  • #circle_rotation(speed:) ⇒ Float

    Parameters:

    • speed (Numeric)

    Returns:

    • (Float)
  • #circle_rotation(s:) ⇒ Float

    This overload is the same as the speed: overload, but with a shorter name for convenience.

    Parameters:

    • s (Numeric)

    Returns:

    • (Float)

Returns:



298
299
300
301
302
303
304
305
306
307
308
309
310
311
# File 'lib/sscharter/charter/event.rb', line 298

INTERPOLABLE.each do |property|
	define_method property do |data_value = nil, speed: nil, s: nil|
		raise ArgumentError, 'cannot specify both speed and s' if !speed.nil? && !s.nil?
		speed = s if speed.nil?
		raise ArgumentError, 'must specify one and only one of data_value and speed' if [data_value, speed].compact.size != 1
		if !data_value.nil?
			raise ArgumentError, "#{property} must be a number" unless data_value.is_a? Numeric
			@data[property].data_point @current_beat, data_value.to_f
		else
			raise ArgumentError, "speed must be a number" unless speed.is_a? Numeric
			@data[property].speed = speed.to_f
		end
	end
end

#circle_scale_x(data_value) ⇒ DataPoint #circle_scale_x(speed:) ⇒ Float #circle_scale_x(s:) ⇒ Float

Overloads:

  • #circle_scale_x(data_value) ⇒ DataPoint

    Parameters:

    • data_value (Numeric)

    Returns:

  • #circle_scale_x(speed:) ⇒ Float

    Parameters:

    • speed (Numeric)

    Returns:

    • (Float)
  • #circle_scale_x(s:) ⇒ Float

    This overload is the same as the speed: overload, but with a shorter name for convenience.

    Parameters:

    • s (Numeric)

    Returns:

    • (Float)

Returns:



298
299
300
301
302
303
304
305
306
307
308
309
310
311
# File 'lib/sscharter/charter/event.rb', line 298

INTERPOLABLE.each do |property|
	define_method property do |data_value = nil, speed: nil, s: nil|
		raise ArgumentError, 'cannot specify both speed and s' if !speed.nil? && !s.nil?
		speed = s if speed.nil?
		raise ArgumentError, 'must specify one and only one of data_value and speed' if [data_value, speed].compact.size != 1
		if !data_value.nil?
			raise ArgumentError, "#{property} must be a number" unless data_value.is_a? Numeric
			@data[property].data_point @current_beat, data_value.to_f
		else
			raise ArgumentError, "speed must be a number" unless speed.is_a? Numeric
			@data[property].speed = speed.to_f
		end
	end
end

#circle_scale_y(data_value) ⇒ DataPoint #circle_scale_y(speed:) ⇒ Float #circle_scale_y(s:) ⇒ Float

Overloads:

  • #circle_scale_y(data_value) ⇒ DataPoint

    Parameters:

    • data_value (Numeric)

    Returns:

  • #circle_scale_y(speed:) ⇒ Float

    Parameters:

    • speed (Numeric)

    Returns:

    • (Float)
  • #circle_scale_y(s:) ⇒ Float

    This overload is the same as the speed: overload, but with a shorter name for convenience.

    Parameters:

    • s (Numeric)

    Returns:

    • (Float)

Returns:



298
299
300
301
302
303
304
305
306
307
308
309
310
311
# File 'lib/sscharter/charter/event.rb', line 298

INTERPOLABLE.each do |property|
	define_method property do |data_value = nil, speed: nil, s: nil|
		raise ArgumentError, 'cannot specify both speed and s' if !speed.nil? && !s.nil?
		speed = s if speed.nil?
		raise ArgumentError, 'must specify one and only one of data_value and speed' if [data_value, speed].compact.size != 1
		if !data_value.nil?
			raise ArgumentError, "#{property} must be a number" unless data_value.is_a? Numeric
			@data[property].data_point @current_beat, data_value.to_f
		else
			raise ArgumentError, "speed must be a number" unless speed.is_a? Numeric
			@data[property].speed = speed.to_f
		end
	end
end

#circle_skew_x(data_value) ⇒ DataPoint #circle_skew_x(speed:) ⇒ Float #circle_skew_x(s:) ⇒ Float

Overloads:

  • #circle_skew_x(data_value) ⇒ DataPoint

    Parameters:

    • data_value (Numeric)

    Returns:

  • #circle_skew_x(speed:) ⇒ Float

    Parameters:

    • speed (Numeric)

    Returns:

    • (Float)
  • #circle_skew_x(s:) ⇒ Float

    This overload is the same as the speed: overload, but with a shorter name for convenience.

    Parameters:

    • s (Numeric)

    Returns:

    • (Float)

Returns:



298
299
300
301
302
303
304
305
306
307
308
309
310
311
# File 'lib/sscharter/charter/event.rb', line 298

INTERPOLABLE.each do |property|
	define_method property do |data_value = nil, speed: nil, s: nil|
		raise ArgumentError, 'cannot specify both speed and s' if !speed.nil? && !s.nil?
		speed = s if speed.nil?
		raise ArgumentError, 'must specify one and only one of data_value and speed' if [data_value, speed].compact.size != 1
		if !data_value.nil?
			raise ArgumentError, "#{property} must be a number" unless data_value.is_a? Numeric
			@data[property].data_point @current_beat, data_value.to_f
		else
			raise ArgumentError, "speed must be a number" unless speed.is_a? Numeric
			@data[property].speed = speed.to_f
		end
	end
end

#circle_skew_y(data_value) ⇒ DataPoint #circle_skew_y(speed:) ⇒ Float #circle_skew_y(s:) ⇒ Float

Overloads:

  • #circle_skew_y(data_value) ⇒ DataPoint

    Parameters:

    • data_value (Numeric)

    Returns:

  • #circle_skew_y(speed:) ⇒ Float

    Parameters:

    • speed (Numeric)

    Returns:

    • (Float)
  • #circle_skew_y(s:) ⇒ Float

    This overload is the same as the speed: overload, but with a shorter name for convenience.

    Parameters:

    • s (Numeric)

    Returns:

    • (Float)

Returns:



298
299
300
301
302
303
304
305
306
307
308
309
310
311
# File 'lib/sscharter/charter/event.rb', line 298

INTERPOLABLE.each do |property|
	define_method property do |data_value = nil, speed: nil, s: nil|
		raise ArgumentError, 'cannot specify both speed and s' if !speed.nil? && !s.nil?
		speed = s if speed.nil?
		raise ArgumentError, 'must specify one and only one of data_value and speed' if [data_value, speed].compact.size != 1
		if !data_value.nil?
			raise ArgumentError, "#{property} must be a number" unless data_value.is_a? Numeric
			@data[property].data_point @current_beat, data_value.to_f
		else
			raise ArgumentError, "speed must be a number" unless speed.is_a? Numeric
			@data[property].speed = speed.to_f
		end
	end
end

#circle_tint_blue(data_value) ⇒ DataPoint #circle_tint_blue(speed:) ⇒ Float #circle_tint_blue(s:) ⇒ Float

Overloads:

  • #circle_tint_blue(data_value) ⇒ DataPoint

    Parameters:

    • data_value (Numeric)

    Returns:

  • #circle_tint_blue(speed:) ⇒ Float

    Parameters:

    • speed (Numeric)

    Returns:

    • (Float)
  • #circle_tint_blue(s:) ⇒ Float

    This overload is the same as the speed: overload, but with a shorter name for convenience.

    Parameters:

    • s (Numeric)

    Returns:

    • (Float)

Returns:



298
299
300
301
302
303
304
305
306
307
308
309
310
311
# File 'lib/sscharter/charter/event.rb', line 298

INTERPOLABLE.each do |property|
	define_method property do |data_value = nil, speed: nil, s: nil|
		raise ArgumentError, 'cannot specify both speed and s' if !speed.nil? && !s.nil?
		speed = s if speed.nil?
		raise ArgumentError, 'must specify one and only one of data_value and speed' if [data_value, speed].compact.size != 1
		if !data_value.nil?
			raise ArgumentError, "#{property} must be a number" unless data_value.is_a? Numeric
			@data[property].data_point @current_beat, data_value.to_f
		else
			raise ArgumentError, "speed must be a number" unless speed.is_a? Numeric
			@data[property].speed = speed.to_f
		end
	end
end

#circle_tint_green(data_value) ⇒ DataPoint #circle_tint_green(speed:) ⇒ Float #circle_tint_green(s:) ⇒ Float

Overloads:

  • #circle_tint_green(data_value) ⇒ DataPoint

    Parameters:

    • data_value (Numeric)

    Returns:

  • #circle_tint_green(speed:) ⇒ Float

    Parameters:

    • speed (Numeric)

    Returns:

    • (Float)
  • #circle_tint_green(s:) ⇒ Float

    This overload is the same as the speed: overload, but with a shorter name for convenience.

    Parameters:

    • s (Numeric)

    Returns:

    • (Float)

Returns:



298
299
300
301
302
303
304
305
306
307
308
309
310
311
# File 'lib/sscharter/charter/event.rb', line 298

INTERPOLABLE.each do |property|
	define_method property do |data_value = nil, speed: nil, s: nil|
		raise ArgumentError, 'cannot specify both speed and s' if !speed.nil? && !s.nil?
		speed = s if speed.nil?
		raise ArgumentError, 'must specify one and only one of data_value and speed' if [data_value, speed].compact.size != 1
		if !data_value.nil?
			raise ArgumentError, "#{property} must be a number" unless data_value.is_a? Numeric
			@data[property].data_point @current_beat, data_value.to_f
		else
			raise ArgumentError, "speed must be a number" unless speed.is_a? Numeric
			@data[property].speed = speed.to_f
		end
	end
end

#circle_tint_red(data_value) ⇒ DataPoint #circle_tint_red(speed:) ⇒ Float #circle_tint_red(s:) ⇒ Float

Overloads:

  • #circle_tint_red(data_value) ⇒ DataPoint

    Parameters:

    • data_value (Numeric)

    Returns:

  • #circle_tint_red(speed:) ⇒ Float

    Parameters:

    • speed (Numeric)

    Returns:

    • (Float)
  • #circle_tint_red(s:) ⇒ Float

    This overload is the same as the speed: overload, but with a shorter name for convenience.

    Parameters:

    • s (Numeric)

    Returns:

    • (Float)

Returns:



298
299
300
301
302
303
304
305
306
307
308
309
310
311
# File 'lib/sscharter/charter/event.rb', line 298

INTERPOLABLE.each do |property|
	define_method property do |data_value = nil, speed: nil, s: nil|
		raise ArgumentError, 'cannot specify both speed and s' if !speed.nil? && !s.nil?
		speed = s if speed.nil?
		raise ArgumentError, 'must specify one and only one of data_value and speed' if [data_value, speed].compact.size != 1
		if !data_value.nil?
			raise ArgumentError, "#{property} must be a number" unless data_value.is_a? Numeric
			@data[property].data_point @current_beat, data_value.to_f
		else
			raise ArgumentError, "speed must be a number" unless speed.is_a? Numeric
			@data[property].speed = speed.to_f
		end
	end
end

#dupTimeDependent

TODO: use initialize_copy.

Returns:



355
356
357
358
359
360
# File 'lib/sscharter/charter/event.rb', line 355

def dup
	result = super
	result.data = @data.transform_values { _1.dup }
	result.data.default_proc = @data.default_proc
	result
end

#empty?Boolean

Returns:

  • (Boolean)


349
350
351
# File 'lib/sscharter/charter/event.rb', line 349

def empty?
	@data.empty?
end

#height(data_value) ⇒ DataPoint #height(speed:) ⇒ Float #height(s:) ⇒ Float

Overloads:

  • #height(data_value) ⇒ DataPoint

    Parameters:

    • data_value (Numeric)

    Returns:

  • #height(speed:) ⇒ Float

    Parameters:

    • speed (Numeric)

    Returns:

    • (Float)
  • #height(s:) ⇒ Float

    This overload is the same as the speed: overload, but with a shorter name for convenience.

    Parameters:

    • s (Numeric)

    Returns:

    • (Float)

Returns:



298
299
300
301
302
303
304
305
306
307
308
309
310
311
# File 'lib/sscharter/charter/event.rb', line 298

INTERPOLABLE.each do |property|
	define_method property do |data_value = nil, speed: nil, s: nil|
		raise ArgumentError, 'cannot specify both speed and s' if !speed.nil? && !s.nil?
		speed = s if speed.nil?
		raise ArgumentError, 'must specify one and only one of data_value and speed' if [data_value, speed].compact.size != 1
		if !data_value.nil?
			raise ArgumentError, "#{property} must be a number" unless data_value.is_a? Numeric
			@data[property].data_point @current_beat, data_value.to_f
		else
			raise ArgumentError, "speed must be a number" unless speed.is_a? Numeric
			@data[property].speed = speed.to_f
		end
	end
end

#opacity(data_value) ⇒ DataPoint #opacity(speed:) ⇒ Float #opacity(s:) ⇒ Float

Overloads:

  • #opacity(data_value) ⇒ DataPoint

    Parameters:

    • data_value (Numeric)

    Returns:

  • #opacity(speed:) ⇒ Float

    Parameters:

    • speed (Numeric)

    Returns:

    • (Float)
  • #opacity(s:) ⇒ Float

    This overload is the same as the speed: overload, but with a shorter name for convenience.

    Parameters:

    • s (Numeric)

    Returns:

    • (Float)

Returns:



298
299
300
301
302
303
304
305
306
307
308
309
310
311
# File 'lib/sscharter/charter/event.rb', line 298

INTERPOLABLE.each do |property|
	define_method property do |data_value = nil, speed: nil, s: nil|
		raise ArgumentError, 'cannot specify both speed and s' if !speed.nil? && !s.nil?
		speed = s if speed.nil?
		raise ArgumentError, 'must specify one and only one of data_value and speed' if [data_value, speed].compact.size != 1
		if !data_value.nil?
			raise ArgumentError, "#{property} must be a number" unless data_value.is_a? Numeric
			@data[property].data_point @current_beat, data_value.to_f
		else
			raise ArgumentError, "speed must be a number" unless speed.is_a? Numeric
			@data[property].speed = speed.to_f
		end
	end
end

#rotation(data_value) ⇒ DataPoint #rotation(speed:) ⇒ Float #rotation(s:) ⇒ Float

Overloads:

  • #rotation(data_value) ⇒ DataPoint

    Parameters:

    • data_value (Numeric)

    Returns:

  • #rotation(speed:) ⇒ Float

    Parameters:

    • speed (Numeric)

    Returns:

    • (Float)
  • #rotation(s:) ⇒ Float

    This overload is the same as the speed: overload, but with a shorter name for convenience.

    Parameters:

    • s (Numeric)

    Returns:

    • (Float)

Returns:



298
299
300
301
302
303
304
305
306
307
308
309
310
311
# File 'lib/sscharter/charter/event.rb', line 298

INTERPOLABLE.each do |property|
	define_method property do |data_value = nil, speed: nil, s: nil|
		raise ArgumentError, 'cannot specify both speed and s' if !speed.nil? && !s.nil?
		speed = s if speed.nil?
		raise ArgumentError, 'must specify one and only one of data_value and speed' if [data_value, speed].compact.size != 1
		if !data_value.nil?
			raise ArgumentError, "#{property} must be a number" unless data_value.is_a? Numeric
			@data[property].data_point @current_beat, data_value.to_f
		else
			raise ArgumentError, "speed must be a number" unless speed.is_a? Numeric
			@data[property].speed = speed.to_f
		end
	end
end

#scale_x(data_value) ⇒ DataPoint #scale_x(speed:) ⇒ Float #scale_x(s:) ⇒ Float

Overloads:

  • #scale_x(data_value) ⇒ DataPoint

    Parameters:

    • data_value (Numeric)

    Returns:

  • #scale_x(speed:) ⇒ Float

    Parameters:

    • speed (Numeric)

    Returns:

    • (Float)
  • #scale_x(s:) ⇒ Float

    This overload is the same as the speed: overload, but with a shorter name for convenience.

    Parameters:

    • s (Numeric)

    Returns:

    • (Float)

Returns:



298
299
300
301
302
303
304
305
306
307
308
309
310
311
# File 'lib/sscharter/charter/event.rb', line 298

INTERPOLABLE.each do |property|
	define_method property do |data_value = nil, speed: nil, s: nil|
		raise ArgumentError, 'cannot specify both speed and s' if !speed.nil? && !s.nil?
		speed = s if speed.nil?
		raise ArgumentError, 'must specify one and only one of data_value and speed' if [data_value, speed].compact.size != 1
		if !data_value.nil?
			raise ArgumentError, "#{property} must be a number" unless data_value.is_a? Numeric
			@data[property].data_point @current_beat, data_value.to_f
		else
			raise ArgumentError, "speed must be a number" unless speed.is_a? Numeric
			@data[property].speed = speed.to_f
		end
	end
end

#scale_y(data_value) ⇒ DataPoint #scale_y(speed:) ⇒ Float #scale_y(s:) ⇒ Float

Overloads:

  • #scale_y(data_value) ⇒ DataPoint

    Parameters:

    • data_value (Numeric)

    Returns:

  • #scale_y(speed:) ⇒ Float

    Parameters:

    • speed (Numeric)

    Returns:

    • (Float)
  • #scale_y(s:) ⇒ Float

    This overload is the same as the speed: overload, but with a shorter name for convenience.

    Parameters:

    • s (Numeric)

    Returns:

    • (Float)

Returns:



298
299
300
301
302
303
304
305
306
307
308
309
310
311
# File 'lib/sscharter/charter/event.rb', line 298

INTERPOLABLE.each do |property|
	define_method property do |data_value = nil, speed: nil, s: nil|
		raise ArgumentError, 'cannot specify both speed and s' if !speed.nil? && !s.nil?
		speed = s if speed.nil?
		raise ArgumentError, 'must specify one and only one of data_value and speed' if [data_value, speed].compact.size != 1
		if !data_value.nil?
			raise ArgumentError, "#{property} must be a number" unless data_value.is_a? Numeric
			@data[property].data_point @current_beat, data_value.to_f
		else
			raise ArgumentError, "speed must be a number" unless speed.is_a? Numeric
			@data[property].speed = speed.to_f
		end
	end
end

#size(data_value) ⇒ DataPoint #size(speed:) ⇒ Float #size(s:) ⇒ Float

Overloads:

  • #size(data_value) ⇒ DataPoint

    Parameters:

    • data_value (Numeric)

    Returns:

  • #size(speed:) ⇒ Float

    Parameters:

    • speed (Numeric)

    Returns:

    • (Float)
  • #size(s:) ⇒ Float

    This overload is the same as the speed: overload, but with a shorter name for convenience.

    Parameters:

    • s (Numeric)

    Returns:

    • (Float)

Returns:



298
299
300
301
302
303
304
305
306
307
308
309
310
311
# File 'lib/sscharter/charter/event.rb', line 298

INTERPOLABLE.each do |property|
	define_method property do |data_value = nil, speed: nil, s: nil|
		raise ArgumentError, 'cannot specify both speed and s' if !speed.nil? && !s.nil?
		speed = s if speed.nil?
		raise ArgumentError, 'must specify one and only one of data_value and speed' if [data_value, speed].compact.size != 1
		if !data_value.nil?
			raise ArgumentError, "#{property} must be a number" unless data_value.is_a? Numeric
			@data[property].data_point @current_beat, data_value.to_f
		else
			raise ArgumentError, "speed must be a number" unless speed.is_a? Numeric
			@data[property].speed = speed.to_f
		end
	end
end

#skew_x(data_value) ⇒ DataPoint #skew_x(speed:) ⇒ Float #skew_x(s:) ⇒ Float

Overloads:

  • #skew_x(data_value) ⇒ DataPoint

    Parameters:

    • data_value (Numeric)

    Returns:

  • #skew_x(speed:) ⇒ Float

    Parameters:

    • speed (Numeric)

    Returns:

    • (Float)
  • #skew_x(s:) ⇒ Float

    This overload is the same as the speed: overload, but with a shorter name for convenience.

    Parameters:

    • s (Numeric)

    Returns:

    • (Float)

Returns:



298
299
300
301
302
303
304
305
306
307
308
309
310
311
# File 'lib/sscharter/charter/event.rb', line 298

INTERPOLABLE.each do |property|
	define_method property do |data_value = nil, speed: nil, s: nil|
		raise ArgumentError, 'cannot specify both speed and s' if !speed.nil? && !s.nil?
		speed = s if speed.nil?
		raise ArgumentError, 'must specify one and only one of data_value and speed' if [data_value, speed].compact.size != 1
		if !data_value.nil?
			raise ArgumentError, "#{property} must be a number" unless data_value.is_a? Numeric
			@data[property].data_point @current_beat, data_value.to_f
		else
			raise ArgumentError, "speed must be a number" unless speed.is_a? Numeric
			@data[property].speed = speed.to_f
		end
	end
end

#skew_y(data_value) ⇒ DataPoint #skew_y(speed:) ⇒ Float #skew_y(s:) ⇒ Float

Overloads:

  • #skew_y(data_value) ⇒ DataPoint

    Parameters:

    • data_value (Numeric)

    Returns:

  • #skew_y(speed:) ⇒ Float

    Parameters:

    • speed (Numeric)

    Returns:

    • (Float)
  • #skew_y(s:) ⇒ Float

    This overload is the same as the speed: overload, but with a shorter name for convenience.

    Parameters:

    • s (Numeric)

    Returns:

    • (Float)

Returns:



298
299
300
301
302
303
304
305
306
307
308
309
310
311
# File 'lib/sscharter/charter/event.rb', line 298

INTERPOLABLE.each do |property|
	define_method property do |data_value = nil, speed: nil, s: nil|
		raise ArgumentError, 'cannot specify both speed and s' if !speed.nil? && !s.nil?
		speed = s if speed.nil?
		raise ArgumentError, 'must specify one and only one of data_value and speed' if [data_value, speed].compact.size != 1
		if !data_value.nil?
			raise ArgumentError, "#{property} must be a number" unless data_value.is_a? Numeric
			@data[property].data_point @current_beat, data_value.to_f
		else
			raise ArgumentError, "speed must be a number" unless speed.is_a? Numeric
			@data[property].speed = speed.to_f
		end
	end
end

#text(data_value) ⇒ DataPoint #text(value:) ⇒ String #text(v:) ⇒ String

Overloads:

  • #text(data_value) ⇒ DataPoint

    Parameters:

    • data_value (String)

    Returns:

  • #text(value:) ⇒ String

    Parameters:

    • value (String)

    Returns:

    • (String)
  • #text(v:) ⇒ String

    This overload is the same as the value: overload, but with a shorter name for convenience.

    Parameters:

    • v (String)

    Returns:

    • (String)

Returns:



298
299
300
301
302
303
304
305
306
307
308
309
310
311
# File 'lib/sscharter/charter/event.rb', line 298

INTERPOLABLE.each do |property|
	define_method property do |data_value = nil, speed: nil, s: nil|
		raise ArgumentError, 'cannot specify both speed and s' if !speed.nil? && !s.nil?
		speed = s if speed.nil?
		raise ArgumentError, 'must specify one and only one of data_value and speed' if [data_value, speed].compact.size != 1
		if !data_value.nil?
			raise ArgumentError, "#{property} must be a number" unless data_value.is_a? Numeric
			@data[property].data_point @current_beat, data_value.to_f
		else
			raise ArgumentError, "speed must be a number" unless speed.is_a? Numeric
			@data[property].speed = speed.to_f
		end
	end
end

#tint_blue(data_value) ⇒ DataPoint #tint_blue(speed:) ⇒ Float #tint_blue(s:) ⇒ Float

Overloads:

  • #tint_blue(data_value) ⇒ DataPoint

    Parameters:

    • data_value (Numeric)

    Returns:

  • #tint_blue(speed:) ⇒ Float

    Parameters:

    • speed (Numeric)

    Returns:

    • (Float)
  • #tint_blue(s:) ⇒ Float

    This overload is the same as the speed: overload, but with a shorter name for convenience.

    Parameters:

    • s (Numeric)

    Returns:

    • (Float)

Returns:



298
299
300
301
302
303
304
305
306
307
308
309
310
311
# File 'lib/sscharter/charter/event.rb', line 298

INTERPOLABLE.each do |property|
	define_method property do |data_value = nil, speed: nil, s: nil|
		raise ArgumentError, 'cannot specify both speed and s' if !speed.nil? && !s.nil?
		speed = s if speed.nil?
		raise ArgumentError, 'must specify one and only one of data_value and speed' if [data_value, speed].compact.size != 1
		if !data_value.nil?
			raise ArgumentError, "#{property} must be a number" unless data_value.is_a? Numeric
			@data[property].data_point @current_beat, data_value.to_f
		else
			raise ArgumentError, "speed must be a number" unless speed.is_a? Numeric
			@data[property].speed = speed.to_f
		end
	end
end

#tint_green(data_value) ⇒ DataPoint #tint_green(speed:) ⇒ Float #tint_green(s:) ⇒ Float

Overloads:

  • #tint_green(data_value) ⇒ DataPoint

    Parameters:

    • data_value (Numeric)

    Returns:

  • #tint_green(speed:) ⇒ Float

    Parameters:

    • speed (Numeric)

    Returns:

    • (Float)
  • #tint_green(s:) ⇒ Float

    This overload is the same as the speed: overload, but with a shorter name for convenience.

    Parameters:

    • s (Numeric)

    Returns:

    • (Float)

Returns:



298
299
300
301
302
303
304
305
306
307
308
309
310
311
# File 'lib/sscharter/charter/event.rb', line 298

INTERPOLABLE.each do |property|
	define_method property do |data_value = nil, speed: nil, s: nil|
		raise ArgumentError, 'cannot specify both speed and s' if !speed.nil? && !s.nil?
		speed = s if speed.nil?
		raise ArgumentError, 'must specify one and only one of data_value and speed' if [data_value, speed].compact.size != 1
		if !data_value.nil?
			raise ArgumentError, "#{property} must be a number" unless data_value.is_a? Numeric
			@data[property].data_point @current_beat, data_value.to_f
		else
			raise ArgumentError, "speed must be a number" unless speed.is_a? Numeric
			@data[property].speed = speed.to_f
		end
	end
end

#tint_red(data_value) ⇒ DataPoint #tint_red(speed:) ⇒ Float #tint_red(s:) ⇒ Float

Overloads:

  • #tint_red(data_value) ⇒ DataPoint

    Parameters:

    • data_value (Numeric)

    Returns:

  • #tint_red(speed:) ⇒ Float

    Parameters:

    • speed (Numeric)

    Returns:

    • (Float)
  • #tint_red(s:) ⇒ Float

    This overload is the same as the speed: overload, but with a shorter name for convenience.

    Parameters:

    • s (Numeric)

    Returns:

    • (Float)

Returns:



298
299
300
301
302
303
304
305
306
307
308
309
310
311
# File 'lib/sscharter/charter/event.rb', line 298

INTERPOLABLE.each do |property|
	define_method property do |data_value = nil, speed: nil, s: nil|
		raise ArgumentError, 'cannot specify both speed and s' if !speed.nil? && !s.nil?
		speed = s if speed.nil?
		raise ArgumentError, 'must specify one and only one of data_value and speed' if [data_value, speed].compact.size != 1
		if !data_value.nil?
			raise ArgumentError, "#{property} must be a number" unless data_value.is_a? Numeric
			@data[property].data_point @current_beat, data_value.to_f
		else
			raise ArgumentError, "speed must be a number" unless speed.is_a? Numeric
			@data[property].speed = speed.to_f
		end
	end
end

#to_sunniesnowHash

Returns:

  • (Hash)


363
364
365
366
367
368
369
370
371
372
# File 'lib/sscharter/charter/event.rb', line 363

def to_sunniesnow
	result = @data.transform_keys &:snake_to_camel
	result.transform_values! &:to_sunniesnow
	%i[blendMode circleBlendMode].each do |key|
		next unless result.has_key? key
		result[key][:dataPoints]&.each { _1[:value] = _1[:value].to_s.tr ?_, ?- }
		result[key][:value] = result[key][:value].to_s.tr ?_, ?- if result[key][:value]
	end
	result
end

#width(data_value) ⇒ DataPoint #width(speed:) ⇒ Float #width(s:) ⇒ Float

Overloads:

  • #width(data_value) ⇒ DataPoint

    Parameters:

    • data_value (Numeric)

    Returns:

  • #width(speed:) ⇒ Float

    Parameters:

    • speed (Numeric)

    Returns:

    • (Float)
  • #width(s:) ⇒ Float

    This overload is the same as the speed: overload, but with a shorter name for convenience.

    Parameters:

    • s (Numeric)

    Returns:

    • (Float)

Returns:



298
299
300
301
302
303
304
305
306
307
308
309
310
311
# File 'lib/sscharter/charter/event.rb', line 298

INTERPOLABLE.each do |property|
	define_method property do |data_value = nil, speed: nil, s: nil|
		raise ArgumentError, 'cannot specify both speed and s' if !speed.nil? && !s.nil?
		speed = s if speed.nil?
		raise ArgumentError, 'must specify one and only one of data_value and speed' if [data_value, speed].compact.size != 1
		if !data_value.nil?
			raise ArgumentError, "#{property} must be a number" unless data_value.is_a? Numeric
			@data[property].data_point @current_beat, data_value.to_f
		else
			raise ArgumentError, "speed must be a number" unless speed.is_a? Numeric
			@data[property].speed = speed.to_f
		end
	end
end

#x(data_value) ⇒ DataPoint #x(speed:) ⇒ Float #x(s:) ⇒ Float

Overloads:

  • #x(data_value) ⇒ DataPoint

    Parameters:

    • data_value (Numeric)

    Returns:

  • #x(speed:) ⇒ Float

    Parameters:

    • speed (Numeric)

    Returns:

    • (Float)
  • #x(s:) ⇒ Float

    This overload is the same as the speed: overload, but with a shorter name for convenience.

    Parameters:

    • s (Numeric)

    Returns:

    • (Float)

Returns:



298
299
300
301
302
303
304
305
306
307
308
309
310
311
# File 'lib/sscharter/charter/event.rb', line 298

INTERPOLABLE.each do |property|
	define_method property do |data_value = nil, speed: nil, s: nil|
		raise ArgumentError, 'cannot specify both speed and s' if !speed.nil? && !s.nil?
		speed = s if speed.nil?
		raise ArgumentError, 'must specify one and only one of data_value and speed' if [data_value, speed].compact.size != 1
		if !data_value.nil?
			raise ArgumentError, "#{property} must be a number" unless data_value.is_a? Numeric
			@data[property].data_point @current_beat, data_value.to_f
		else
			raise ArgumentError, "speed must be a number" unless speed.is_a? Numeric
			@data[property].speed = speed.to_f
		end
	end
end

#y(data_value) ⇒ DataPoint #y(speed:) ⇒ Float #y(s:) ⇒ Float

Overloads:

  • #y(data_value) ⇒ DataPoint

    Parameters:

    • data_value (Numeric)

    Returns:

  • #y(speed:) ⇒ Float

    Parameters:

    • speed (Numeric)

    Returns:

    • (Float)
  • #y(s:) ⇒ Float

    This overload is the same as the speed: overload, but with a shorter name for convenience.

    Parameters:

    • s (Numeric)

    Returns:

    • (Float)

Returns:



298
299
300
301
302
303
304
305
306
307
308
309
310
311
# File 'lib/sscharter/charter/event.rb', line 298

INTERPOLABLE.each do |property|
	define_method property do |data_value = nil, speed: nil, s: nil|
		raise ArgumentError, 'cannot specify both speed and s' if !speed.nil? && !s.nil?
		speed = s if speed.nil?
		raise ArgumentError, 'must specify one and only one of data_value and speed' if [data_value, speed].compact.size != 1
		if !data_value.nil?
			raise ArgumentError, "#{property} must be a number" unless data_value.is_a? Numeric
			@data[property].data_point @current_beat, data_value.to_f
		else
			raise ArgumentError, "speed must be a number" unless speed.is_a? Numeric
			@data[property].speed = speed.to_f
		end
	end
end

#z(data_value) ⇒ DataPoint #z(value:) ⇒ Numeric #z(v:) ⇒ Numeric

Overloads:

  • #z(data_value) ⇒ DataPoint

    Parameters:

    • data_value (Numeric)

    Returns:

  • #z(value:) ⇒ Numeric

    Parameters:

    • value (Numeric)

    Returns:

    • (Numeric)
  • #z(v:) ⇒ Numeric

    This overload is the same as the value: overload, but with a shorter name for convenience.

    Parameters:

    • v (Numeric)

    Returns:

    • (Numeric)

Returns:



331
332
333
334
335
336
337
338
339
340
341
342
343
344
# File 'lib/sscharter/charter/event.rb', line 331

UNINTERPOLABLE.each do |property|
	define_method property do |data_value = nil, value: nil, v: nil|
		raise ArgumentError, "cannot specify both value and v" if !value.nil? && !v.nil?
		value = v if value.nil?
		raise ArgumentError, "must specify one and only one of data_value and value" if [data_value, value].compact.size != 1
		if !data_value.nil?
			raise ArgumentError, "wrong data type for data_value of #{property}" unless UNINTERPOLABLE_TYPES[property] === data_value
			@data[property].data_point @current_beat, data_value
		else
			raise ArgumentError, "wrong data type for value of #{property}" unless UNINTERPOLABLE_TYPES[property] === value
			@data[property].value = value
		end
	end
end