Class: Aud::Tick

Inherits:
Object
  • Object
show all
Defined in:
lib/aud/tick.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(output, properties, _midi = nil) ⇒ Tick

Returns a new instance of Tick.



10
11
12
13
# File 'lib/aud/tick.rb', line 10

def initialize(output, properties, _midi=nil)
  self.midi = _midi || MIDI::IO.new(output)
  self.properties = properties
end

Instance Attribute Details

#midiObject

Returns the value of attribute midi.



6
7
8
# File 'lib/aud/tick.rb', line 6

def midi
  @midi
end

#outputObject

Returns the value of attribute output.



7
8
9
# File 'lib/aud/tick.rb', line 7

def output
  @output
end

#propertiesObject

Returns the value of attribute properties.



8
9
10
# File 'lib/aud/tick.rb', line 8

def properties
  @properties
end

Instance Method Details

#process(line) ⇒ Object



15
16
17
18
19
# File 'lib/aud/tick.rb', line 15

def process(line)
  self.midi.octave(properties[:octave])
  self.midi.note(properties[:note], :channel => properties[:channel])
  self.midi.off
end