Class: SMF::ScaleTuningAdjust2ByteFormNonRealTime
- Inherits:
-
ExclusiveF0
- Object
- Event
- SystemMessage
- ExclusiveMessage
- ExclusiveF0
- SMF::ScaleTuningAdjust2ByteFormNonRealTime
- Defined in:
- lib/smf/toy/gm.rb
Instance Attribute Summary
Attributes inherited from ExclusiveF0
Attributes inherited from Event
Instance Method Summary collapse
-
#initialize(offset, ch, ss_tt, dev = 0x7f) ⇒ ScaleTuningAdjust2ByteFormNonRealTime
constructor
A new instance of ScaleTuningAdjust2ByteFormNonRealTime.
Methods inherited from ExclusiveF0
Methods inherited from Event
Constructor Details
#initialize(offset, ch, ss_tt, dev = 0x7f) ⇒ ScaleTuningAdjust2ByteFormNonRealTime
Returns a new instance of ScaleTuningAdjust2ByteFormNonRealTime.
269 270 271 272 273 274 275 276 277 278 279 280 281 282 |
# File 'lib/smf/toy/gm.rb', line 269 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, [0x7e, dev, 0x08, 0x09, ff, gg, hh, ss_tt, 0xf7]. flatten.pack('C*')) end |