module ShlispTools::Shnth
Macros and constants for use with the shlerb tool.
Light_*: simple light values, 1-8 across
Situation_*: macros representing stevek’s idiom for switching through situations using the tar button, using the lights from left to right to show which situation is running:
-
<%= Situation_1 %>
emits(jump (tar 1)) (lights 1)
-
<%= Situation_2 %>
emits(jump (tar 1)) (lights 4)
-
etc.
But_*: scale indexes by bar (Uppercase=major, lowercase=minor), using stevek’s arrangement:
-
But_A = 0
-
But_B = 1
-
etc.
Constants
- But_A
- But_B
- But_C
- But_D
- But_a
- But_b
- But_c
- But_d
- Light_1
- Light_2
- Light_3
- Light_4
- Light_5
- Light_6
- Light_7
- Light_8
- Situation_1
- Situation_2
- Situation_3
- Situation_4
- Situation_5
- Situation_6
- Situation_7
- Situation_8
Public Class Methods
join(*stuff)
click to toggle source
# File lib/shlisp_tools/shnth.rb, line 66 def self.join(*stuff) stuff.join(' ').squeeze(' ') end
light(position)
click to toggle source
# File lib/shlisp_tools/shnth.rb, line 49 def self.light(position) 2**(position-1) end
situ(position, method=:tar)
click to toggle source
# File lib/shlisp_tools/shnth.rb, line 53 def self.situ(position, method=:tar) case method when :tar jump = "(jump (tar 1))" when :minor_ab jump = "(jump (minorb 1 (minora -1)))" else ; end "#{jump} (lights #{light(position)})" end