Class: Sidtool::MidiFileWriter::ProgramChange

Inherits:
Struct
  • Object
show all
Defined in:
lib/sidtool/midi_file_writer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#channelObject

Returns the value of attribute channel

Returns:

  • (Object)

    the current value of channel



58
59
60
# File 'lib/sidtool/midi_file_writer.rb', line 58

def channel
  @channel
end

#program_numberObject

Returns the value of attribute program_number

Returns:

  • (Object)

    the current value of program_number



58
59
60
# File 'lib/sidtool/midi_file_writer.rb', line 58

def program_number
  @program_number
end

Instance Method Details

#bytesObject



59
60
61
62
63
64
65
66
# File 'lib/sidtool/midi_file_writer.rb', line 59

def bytes
  raise "Channel too big: #{channel}" if channel > 15
  raise "Program number is too big: #{program_number}" if program_number > 255
  [
    0xC0 + channel,
    program_number
  ]
end