class SMF::ScaleTuningAdjust2ByteFormRealTime

Public Class Methods

new(offset, ch, ss_tt, dev=0x7f) click to toggle source
Calls superclass method SMF::ExclusiveF0::new
# File lib/smf/toy/gm.rb, line 250
def initialize(offset, ch, ss_tt, dev=0x7f)
  # ch:0/2**16-1, ss_tt:-2**13/2**13-1
  ff = ch & 0x3
  gg = (ch >> 2) & 0x7f
  hh = (ch >> 9) & 0x7f
  ss_tt.collect! do |x|
    x += 0x2000
    ss =  x       & 0x7f
    tt = (x >> 7) & 0x7f
    [ss, tt]
  end
  super(offset, [0x7f, dev, 0x08, 0x09, ff, gg, hh, ss_tt, 0xf7].
          flatten.pack('C*'))
end