Class: NoteSender

Inherits:
Object
  • Object
show all
Defined in:
lib/midinous/proc_midi.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(note, chan, vel, mute) ⇒ NoteSender

Returns a new instance of NoteSender.



104
105
106
107
108
109
# File 'lib/midinous/proc_midi.rb', line 104

def initialize(note,chan,vel,mute)
  @note = note
  @chan = chan
  @vel  = vel
  @mute = mute
end

Instance Attribute Details

#chanObject (readonly)

Returns the value of attribute chan.



103
104
105
# File 'lib/midinous/proc_midi.rb', line 103

def chan
  @chan
end

#noteObject (readonly)

Returns the value of attribute note.



103
104
105
# File 'lib/midinous/proc_midi.rb', line 103

def note
  @note
end

#velObject (readonly)

Returns the value of attribute vel.



103
104
105
# File 'lib/midinous/proc_midi.rb', line 103

def vel
  @vel
end

Instance Method Details

#playObject



111
112
113
# File 'lib/midinous/proc_midi.rb', line 111

def play
  Pm.note_send(@chan,@note,@vel) unless @mute
end

#stopObject



114
115
116
# File 'lib/midinous/proc_midi.rb', line 114

def stop
  Pm.note_rlse(@chan,@note) unless @mute
end