Class: JSound::Midi::Messages::NoteOn

Inherits:
JSound::Midi::Message show all
Defined in:
lib/jsound/midi/messages/note_on.rb

Direct Known Subclasses

NoteOff

Constant Summary

Constants inherited from JSound::Midi::Message

JSound::Midi::Message::CLASS_FOR_STATUS, JSound::Midi::Message::STATUS_FOR_CLASS, JSound::Midi::Message::STATUS_FOR_TYPE, JSound::Midi::Message::TYPE_FOR_STATUS

Instance Attribute Summary

Attributes inherited from JSound::Midi::Message

#channel, #data, #source, #type

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from JSound::Midi::Message

#==, #data1, #data1=, #data2, #data2=, inherited, #status, #to_java, #to_s, #update_java_message, #value

Methods included from TypeFromClassName

included

Constructor Details

#initialize(pitch, velocity = 127, channel = 0, options = {}) ⇒ NoteOn

Returns a new instance of NoteOn.



7
8
9
# File 'lib/jsound/midi/messages/note_on.rb', line 7

def initialize(pitch, velocity=127, channel=0, options={})
  super([pitch,velocity], channel, options)
end

Class Method Details

.from_java(java_message, options = {}) ⇒ Object



17
18
19
# File 'lib/jsound/midi/messages/note_on.rb', line 17

def self.from_java(java_message, options={})
  new java_message.data1, java_message.data2, java_message.channel, options.merge({:java_message => java_message})
end

Instance Method Details

#cloneObject



21
22
23
# File 'lib/jsound/midi/messages/note_on.rb', line 21

def clone
  self.class.new(pitch,velocity,@channel)
end