Class: MIDI::ChannelPressure
- Inherits:
-
ChannelEvent
- Object
- Event
- ChannelEvent
- MIDI::ChannelPressure
- Defined in:
- lib/midilib/event.rb
Instance Attribute Summary collapse
-
#pressure ⇒ Object
Returns the value of attribute pressure.
Attributes inherited from ChannelEvent
Attributes inherited from Event
#delta_time, #print_channel_numbers_from_one, #print_decimal_numbers, #print_note_names, #status, #time_from_start
Instance Method Summary collapse
- #data_as_bytes ⇒ Object
-
#initialize(channel = 0, pressure = 0, delta_time = 0) ⇒ ChannelPressure
constructor
A new instance of ChannelPressure.
- #to_s ⇒ Object
Methods inherited from Event
#<=>, #channel_to_s, #number_to_s, #quantize_to
Constructor Details
#initialize(channel = 0, pressure = 0, delta_time = 0) ⇒ ChannelPressure
Returns a new instance of ChannelPressure.
223 224 225 226 |
# File 'lib/midilib/event.rb', line 223 def initialize(channel = 0, pressure = 0, delta_time = 0) super(CHANNEL_PRESSURE, channel, delta_time) @pressure = pressure end |
Instance Attribute Details
#pressure ⇒ Object
Returns the value of attribute pressure.
221 222 223 |
# File 'lib/midilib/event.rb', line 221 def pressure @pressure end |
Instance Method Details
#data_as_bytes ⇒ Object
228 229 230 231 232 |
# File 'lib/midilib/event.rb', line 228 def data_as_bytes data = [] data << (@status + @channel) data << @pressure end |
#to_s ⇒ Object
234 235 236 |
# File 'lib/midilib/event.rb', line 234 def to_s return super << "chan press #{number_to_s(@pressure)}" end |