Class: Sidtool::MidiFileWriter::NoteOn

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



69
70
71
# File 'lib/sidtool/midi_file_writer.rb', line 69

def channel
  @channel
end

#keyObject

Returns the value of attribute key

Returns:

  • (Object)

    the current value of key



69
70
71
# File 'lib/sidtool/midi_file_writer.rb', line 69

def key
  @key
end

Instance Method Details

#bytesObject



70
71
72
73
74
75
76
77
78
# File 'lib/sidtool/midi_file_writer.rb', line 70

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