Sha256: 110bc072b39e6d667cc83a0bad24d7fac15a4210c0434c9917f5dccbdb2021a9
Contents?: true
Size: 411 Bytes
Versions: 12
Compression:
Stored size: 411 Bytes
Contents
class Numeric # # +mtopch+: MIDI note to pitch class converter # # interprets its receiver as a MIDI note and returns its corresponing pitch class # #:nodoc: def mtopch intv = (self - MIDI_MIDDLE_C) / CHROMATIC_NOTES_PER_OCTAVE intv_octave = intv.to_i intv_semi = (intv - intv_octave) * CHROMATIC_NOTES_PER_OCTAVE; PITCH_MIDDLE_C + intv_octave + (intv_semi/100.0); end end
Version data entries
12 entries across 12 versions & 1 rubygems