You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.1KB

  1. require_relative '../module'
  2. module DHE
  3. class Func6 < DHE::Module
  4. def initialize
  5. super(name: 'FUNC 6', hp: 12, foreground: [220, 100, 40], background: [40, 50, 96])
  6. center = @width / 2.0
  7. left = @width / 7.0
  8. right = @width - left
  9. left_center = (left + center) / 2.0
  10. right_center = @width - left_center
  11. row_count = 6
  12. last_row = row_count - 1
  13. top = 23.0
  14. bottom = 108.0
  15. delta_y = (bottom - top) / last_row
  16. port_offset = 1.25
  17. y = top
  18. (0..last_row).each do |row|
  19. y = top + row * delta_y
  20. connector(left: left, right: right, y: y)
  21. input_port(x: left, y: y + port_offset)
  22. toggle(x: left_center, y: y, labels: %w(ADD MULT), selection: 1)
  23. large_knob(x: center, y: y, label: ' ')
  24. counter(x: right_center, y: y, name: 'add', labels: %w(0–5 ±5 0–10 ±10), selection: 2)
  25. counter(x: right_center, y: y, name: 'mult', labels: %w(0–1 ±1 0–2 ±2), selection: 2, enabled: false)
  26. output_port(x: right, y: y + port_offset)
  27. end
  28. end
  29. end
  30. end
  31. MODULE_TO_FILENAME[DHE::Func6.new] = __FILE__