Class: Musicality::Transition

Inherits:
Function::Piecewise show all
Defined in:
lib/musicality/notation/util/transition.rb

Instance Attribute Summary

Attributes inherited from Function::Piecewise

#pieces

Attributes inherited from Function

#domain

Instance Method Summary collapse

Methods inherited from Function::Piecewise

#==, #add_piece, #at, #domain_include?

Methods inherited from Function

#==, #at, #sample, transform_domains

Constructor Details

#initialize(func, transition_domain) ⇒ Transition

Returns a new instance of Transition.



4
5
6
7
8
9
# File 'lib/musicality/notation/util/transition.rb', line 4

def initialize func, transition_domain
  super()
  add_piece(transition_domain, func)
  add_piece(transition_domain.last..DOMAIN_MAX,
            Function::Constant.new(func.at(transition_domain.last)))
end