Class: Sidtool::MidiFileWriter::NoteOff

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



81
82
83
# File 'lib/sidtool/midi_file_writer.rb', line 81

def channel
  @channel
end

#keyObject

Returns the value of attribute key

Returns:

  • (Object)

    the current value of key



81
82
83
# File 'lib/sidtool/midi_file_writer.rb', line 81

def key
  @key
end

Instance Method Details

#bytesObject



82
83
84
85
86
87
88
89
90
# File 'lib/sidtool/midi_file_writer.rb', line 82

def bytes
  raise "Channel too big: #{channel}" if channel > 15
  raise "Key is too big: #{key}" if key > 255
  [
    0x80 + channel,
    key,
    40 # Default velocity
  ]
end