Class: Sidtool::MidiFileWriter::DeltaTime
- Inherits:
-
Struct
- Object
- Struct
- Sidtool::MidiFileWriter::DeltaTime
- Defined in:
- lib/sidtool/midi_file_writer.rb
Instance Attribute Summary collapse
-
#time ⇒ Object
Returns the value of attribute time.
Instance Method Summary collapse
Instance Attribute Details
#time ⇒ Object
Returns the value of attribute time
3 4 5 |
# File 'lib/sidtool/midi_file_writer.rb', line 3 def time @time end |
Instance Method Details
#bytes ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/sidtool/midi_file_writer.rb', line 4 def bytes quantity = time seven_bit_segments = [] while true seven_bit_segments << (quantity & 127) quantity = quantity >> 7 break if quantity == 0 end result = seven_bit_segments.reverse.map { |segment| segment | 128 } result[-1] &= 127 result end |