Class: MIDI::ProgramChange
- Inherits:
-
ChannelEvent
- Object
- Event
- ChannelEvent
- MIDI::ProgramChange
- Defined in:
- lib/midilib/event.rb
Instance Attribute Summary collapse
-
#program ⇒ Object
Returns the value of attribute program.
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, program = 0, delta_time = 0) ⇒ ProgramChange
constructor
A new instance of ProgramChange.
- #to_s ⇒ Object
Methods inherited from Event
#<=>, #channel_to_s, #number_to_s, #quantize_to
Constructor Details
#initialize(channel = 0, program = 0, delta_time = 0) ⇒ ProgramChange
Returns a new instance of ProgramChange.
208 209 210 211 |
# File 'lib/midilib/event.rb', line 208 def initialize(channel = 0, program = 0, delta_time = 0) super(PROGRAM_CHANGE, channel, delta_time) @program = program end |
Instance Attribute Details
#program ⇒ Object
Returns the value of attribute program.
206 207 208 |
# File 'lib/midilib/event.rb', line 206 def program @program end |
Instance Method Details
#data_as_bytes ⇒ Object
213 214 215 216 217 |
# File 'lib/midilib/event.rb', line 213 def data_as_bytes data = [] data << (@status + @channel) data << @program end |
#to_s ⇒ Object
219 220 221 |
# File 'lib/midilib/event.rb', line 219 def to_s super << "prog #{number_to_s(@program)}" end |