Class: Cyclotone::MiniNotation::AST::Euclidean

Inherits:
Node
  • Object
show all
Defined in:
lib/cyclotone/mini_notation/ast.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Node

#==, deep_freeze, #hash, #to_mn

Constructor Details

#initialize(pattern:, pulses:, steps:, rotation: 0) ⇒ Euclidean

Returns a new instance of Euclidean.



198
199
200
201
202
203
204
205
# File 'lib/cyclotone/mini_notation/ast.rb', line 198

def initialize(pattern:, pulses:, steps:, rotation: 0)
  super()
  @pattern = pattern
  @pulses = pulses.to_i
  @steps = steps.to_i
  @rotation = rotation.to_i
  freeze
end

Instance Attribute Details

#patternObject (readonly)

Returns the value of attribute pattern.



196
197
198
# File 'lib/cyclotone/mini_notation/ast.rb', line 196

def pattern
  @pattern
end

#pulsesObject (readonly)

Returns the value of attribute pulses.



196
197
198
# File 'lib/cyclotone/mini_notation/ast.rb', line 196

def pulses
  @pulses
end

#rotationObject (readonly)

Returns the value of attribute rotation.



196
197
198
# File 'lib/cyclotone/mini_notation/ast.rb', line 196

def rotation
  @rotation
end

#stepsObject (readonly)

Returns the value of attribute steps.



196
197
198
# File 'lib/cyclotone/mini_notation/ast.rb', line 196

def steps
  @steps
end

Instance Method Details

#to_hObject



207
208
209
# File 'lib/cyclotone/mini_notation/ast.rb', line 207

def to_h
  { pattern: pattern, pulses: pulses, steps: steps, rotation: rotation }
end