Class: GotimeObject
- Inherits:
-
Object
- Object
- GotimeObject
- Defined in:
- lib/melody_object/Mo_h_hc.rb
Instance Attribute Summary collapse
-
#curraryval ⇒ Object
Returns the value of attribute curraryval.
-
#gotimary ⇒ Object
Returns the value of attribute gotimary.
-
#internalgranularity ⇒ Object
Returns the value of attribute internalgranularity.
-
#offset ⇒ Object
Returns the value of attribute offset.
-
#val ⇒ Object
Returns the value of attribute val.
Instance Method Summary collapse
- #granularity ⇒ Object
-
#initialize(v) ⇒ GotimeObject
constructor
A new instance of GotimeObject.
- #status ⇒ Object
Constructor Details
#initialize(v) ⇒ GotimeObject
Returns a new instance of GotimeObject.
56 57 58 59 60 61 62 63 64 65 |
# File 'lib/melody_object/Mo_h_hc.rb', line 56 def initialize(v) if v.class==Fixnum @val=v @internalgranularity=v @curraryval=0 else @gotimary=v @curraryval=0 end end |
Instance Attribute Details
#curraryval ⇒ Object
Returns the value of attribute curraryval.
54 55 56 |
# File 'lib/melody_object/Mo_h_hc.rb', line 54 def curraryval @curraryval end |
#gotimary ⇒ Object
Returns the value of attribute gotimary.
53 54 55 |
# File 'lib/melody_object/Mo_h_hc.rb', line 53 def gotimary @gotimary end |
#internalgranularity ⇒ Object
Returns the value of attribute internalgranularity.
51 52 53 |
# File 'lib/melody_object/Mo_h_hc.rb', line 51 def internalgranularity @internalgranularity end |
#offset ⇒ Object
Returns the value of attribute offset.
52 53 54 |
# File 'lib/melody_object/Mo_h_hc.rb', line 52 def offset @offset end |
#val ⇒ Object
Returns the value of attribute val.
50 51 52 |
# File 'lib/melody_object/Mo_h_hc.rb', line 50 def val @val end |
Instance Method Details
#granularity ⇒ Object
67 68 69 |
# File 'lib/melody_object/Mo_h_hc.rb', line 67 def granularity @internalgranularity#+rand(2) end |
#status ⇒ Object
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/melody_object/Mo_h_hc.rb', line 71 def status if @gotimary.nil? if Midistack.ticker==0 #~ puts 'zero' return true else #~ puts 'slipped' x=Midistack.ticker%@internalgranularity==0 #~ if x then puts 'yeh' end return x end else #~ puts "mt:#{Midistack.ticker} os:#{@offset} cv#{@curraryval} cvv#{@gotimary[@curraryval]} t/f: #{Midistack.ticker-@offset==@gotimary[@curraryval]-1}" #~ $fyl.puts " #{@offset}, #{@curraryval}, len:#{@gotimary.length} #{@gotimary[@curraryval]}" #~ return Midistack.ticker-@offset==@gotimary[@curraryval]-1 end end |