Class MIDI::Utils
In: lib/midilib/utils.rb
Parent: Object

Utility methods.

Methods

Constants

NOTE_NAMES = [ 'C', 'C#', 'D', 'D#', 'E', 'F', 'F#', 'G', 'G#', 'A', 'A#', 'B'   MIDI note names. NOTE_NAMES[0] is ‘C’, NOTE_NAMES[1] is ‘C#’, etc.

Public Class methods

Given an integer, returns it as a variable length array of bytes (the format used by MIDI files).

The converse operation—converting a var len into a number—requires input from a stream of bytes. Therefore we don’t supply it here. That is a part of the MIDIFile class.

Given a MIDI note number, return the name and octave as a string.

[Validate]