Class: LFOTriangle

Inherits:
Base
  • Object
show all
Defined in:
lib/functions/lfo_triangle.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#frame_optimized, #name

Instance Method Summary collapse

Methods inherited from Base

#add_arduino_code, #add_cycle_level_scope, #add_top_level_scope, #append_tsortable, #buildit, #depends_on, #initialize, #resolve_frame_optimized, #top_level_scope_arduino_code

Constructor Details

This class inherits a constructor from Base

Instance Attribute Details

#cycle_msObject

Returns the value of attribute cycle_ms.



16
17
18
# File 'lib/functions/lfo_triangle.rb', line 16

def cycle_ms
  @cycle_ms
end

Instance Method Details

#arduino_codeObject



22
23
24
25
26
27
28
29
30
# File 'lib/functions/lfo_triangle.rb', line 22

def arduino_code
  unless @frame_optimized 
    [
      "lfo_triangle(mils, #{@cycle_ms.name}, #{@name});"
    ]
  else
    []
  end
end

#cycle_level_arduino_codeObject



32
33
34
35
36
37
38
39
40
# File 'lib/functions/lfo_triangle.rb', line 32

def cycle_level_arduino_code
  if @frame_optimized
    [
      "lfo_triangle(mils, #{@cycle_ms.name}, #{@name});"
    ]
  else
    []
  end
end

#param_keysObject



18
19
20
# File 'lib/functions/lfo_triangle.rb', line 18

def param_keys
  [:cycle_ms]
end

#top_level_scope_codeObject



42
43
44
45
46
# File 'lib/functions/lfo_triangle.rb', line 42

def top_level_scope_code
  [
    "long #{@name}[3];"
  ]
end