module SMF::Sequence::Checker

Public Instance Methods

allnotesoff(ch) click to toggle source
Calls superclass method
# File lib/smf/io.rb, line 638
def allnotesoff(ch) no_channelmodemessage(ch, 0x7b, 0); super end
allsoundoff(ch) click to toggle source
Calls superclass method
# File lib/smf/io.rb, line 635
def allsoundoff(ch) no_channelmodemessage(ch, 0x78, 0); super end
channelprefix(ch) click to toggle source
Calls superclass method
# File lib/smf/io.rb, line 681
def channelprefix(ch)
  cr('channelprefix/ch', ch, (0..2**8-1), (0..2**4-1))
  super
end
channelpressure(ch, val) click to toggle source
Calls superclass method
# File lib/smf/io.rb, line 611
def channelpressure(ch, val)
  cr('channelpressure/ch', ch, (0..2**4-1))
  cr('channelpressure/val', val, (0..2**7-1))
  super
end
controlchange(ch, num, val) click to toggle source
Calls superclass method
# File lib/smf/io.rb, line 598
def controlchange(ch, num, val)
  cr('controlchange/ch', ch, (0..2**4-1))
  cr('controlchange/num', num, (0..0x77))
  cr('controlchange/val', val, (0..2**7-1))
  super
end
copyrightnotice(text) click to toggle source
Calls superclass method
# File lib/smf/io.rb, line 666
def copyrightnotice(text) no_text(0x2, text); super end
cuepoint(text) click to toggle source
Calls superclass method
# File lib/smf/io.rb, line 671
def cuepoint(text) no_text(0x7, text); super end
delta(delta) click to toggle source
Calls superclass method
# File lib/smf/io.rb, line 572
def delta(delta)
  cr('delta', delta, (0..2**28-1))
  super
end
devicename(text) click to toggle source
Calls superclass method
# File lib/smf/io.rb, line 673
def devicename(text) no_text(0x9, text); super end
exclusivef0(data) click to toggle source
Calls superclass method
# File lib/smf/io.rb, line 644
def exclusivef0(data)
  cr('exclusive size', data.length, (0..2**28-1), (1..2**28-1))
  super
end
exclusivef7(data) click to toggle source
Calls superclass method
# File lib/smf/io.rb, line 649
def exclusivef7(data)
  cr('exclusive size', data.length, (0..2**28-1), (1..2**28-1))
  super
end
generalpurposetext(text) click to toggle source
Calls superclass method
# File lib/smf/io.rb, line 665
def generalpurposetext(text) no_text(0x1, text); super end
header(format, ntrks, division, tc) click to toggle source
Calls superclass method
# File lib/smf/io.rb, line 545
def header(format, ntrks, division, tc)
  cr('header/format', format, (0..2**16-1), (0..2))
  if format == 0
    cr('header/ntrks', ntrks, (0..2**16-1), (1..1))
  else
    cr('header/ntrks', ntrks, (0..2**16-1), (1..2**16-1))
  end
  unless tc
    cr('header/division', division, (1..2**15-1))
  else
    cr('header/division', division, (1..2**8-1))
    cr('header/tc', tc, (0..2**7))
    unless [24, 25, 29, 30].include? tc
      warn('header/tc: invalid format')
    end
  end
  super
end
instrumentname(text) click to toggle source
Calls superclass method
# File lib/smf/io.rb, line 668
def instrumentname(text) no_text(0x4, text); super end
keysignature(sf, mi) click to toggle source
Calls superclass method
# File lib/smf/io.rb, line 717
def keysignature(sf, mi)
  cr('keysignature/sf', sf, (-2**7..2**7-1))
  cr('keysignature/mi', mi, (0..1))
  super
end
localcontrol(ch, val) click to toggle source
Calls superclass method
# File lib/smf/io.rb, line 637
def localcontrol(ch, val) no_channelmodemessage(ch, 0x7a, val); super end
lyric(text) click to toggle source
Calls superclass method
# File lib/smf/io.rb, line 669
def lyric(text) no_text(0x5, text); super end
marker(text) click to toggle source
Calls superclass method
# File lib/smf/io.rb, line 670
def marker(text) no_text(0x6, text); super end
midiport(num) click to toggle source
Calls superclass method
# File lib/smf/io.rb, line 686
def midiport(num)
  cr('midiport/num', num, (0..2**8-1))
  super
end
monomode(ch, val) click to toggle source
Calls superclass method
# File lib/smf/io.rb, line 641
def monomode(ch, val) no_channelmodemessage(ch, 0x7e, val); super end
noteoff(ch, note, vel) click to toggle source
Calls superclass method
# File lib/smf/io.rb, line 577
def noteoff(ch, note, vel)
  cr('noteoff/ch', ch, (0..2**4-1))
  cr('noteoff/note', note, (0..2**7-1))
  cr('noteoff/vel', vel, (0..2**7-1))
  super
end
noteon(ch, note, vel) click to toggle source
Calls superclass method
# File lib/smf/io.rb, line 584
def noteon(ch, note, vel)
  cr('noteon/ch', ch, (0..2**4-1))
  cr('noteon/note', note, (0..2**7-1))
  cr('noteon/vel', vel, (0..2**7-1))
  super
end
omnioff(ch) click to toggle source
Calls superclass method
# File lib/smf/io.rb, line 639
def omnioff(ch) no_channelmodemessage(ch, 0x7c, 0); super end
omnion(ch) click to toggle source
Calls superclass method
# File lib/smf/io.rb, line 640
def omnion(ch) no_channelmodemessage(ch, 0x7d, 0); super end
pitchbendchange(ch, val) click to toggle source
Calls superclass method
# File lib/smf/io.rb, line 617
def pitchbendchange(ch, val)
  cr('pitchbendchange/ch', ch, (0..2**4-1))
  cr('pitchbendchange/val', val, (-2**13..2**13-1))
  super
end
polymode(ch) click to toggle source
Calls superclass method
# File lib/smf/io.rb, line 642
def polymode(ch) no_channelmodemessage(ch, 0x7f, 0); super end
polyphonickeypressure(ch, note, val) click to toggle source
Calls superclass method
# File lib/smf/io.rb, line 591
def polyphonickeypressure(ch, note, val)
  cr('polyphonickeypressure/ch', ch, (0..2**4-1))
  cr('polyphonickeypressure/note', note, (0..2**7-1))
  cr('polyphonickeypressure/val', val, (0..2**7-1))
  super
end
programchange(ch, num) click to toggle source
Calls superclass method
# File lib/smf/io.rb, line 605
def programchange(ch, num)
  cr('programchange/ch', ch, (0..2**4-1))
  cr('programchange/num', num, (0..2**7-1))
  super
end
programname(text) click to toggle source
Calls superclass method
# File lib/smf/io.rb, line 672
def programname(text) no_text(0x8, text); super end
resetallcontrollers(ch) click to toggle source
Calls superclass method
# File lib/smf/io.rb, line 636
def resetallcontrollers(ch) no_channelmodemessage(ch, 0x79, 0); super end
sequencenumber(num) click to toggle source
Calls superclass method
# File lib/smf/io.rb, line 654
def sequencenumber(num)
  cr('sequencenumber/num', num, (0..2**16-1))
  super
end
sequencerspecific(data) click to toggle source
Calls superclass method
# File lib/smf/io.rb, line 723
def sequencerspecific(data)
  unless data.length <= 2**28-1
    error('sequencerspecific: too large')
  end
  super
end
settempo(tempo) click to toggle source
Calls superclass method
# File lib/smf/io.rb, line 691
def settempo(tempo)
  cr('settempo/tempo', tempo, (1..2**24-1))
  super
end
smpteoffset(hr, mn, se, fr, ff, tc) click to toggle source
Calls superclass method
# File lib/smf/io.rb, line 696
def smpteoffset(hr, mn, se, fr, ff, tc)
  cr('smpteoffset/hr', hr, (0..2**8-1), (1..23))
  cr('smpteoffset/mn', mn, (0..2**8-1), (1..59))
  cr('smpteoffset/se', se, (0..2**8-1), (1..59))
  cr('smpteoffset/fr', fr, (0..2**8-1), (1..29))
  cr('smpteoffset/ff', ff, (0..2**8-1), (1..99))
  cr('smpteoffset/tc', tc, (0..2**8-1))
  unless [24, 25, 29, 30].include? tc
    warn('smpteoffset/tc: invalid format')
  end
  super
end
text0a(text) click to toggle source
Calls superclass method
# File lib/smf/io.rb, line 674
def text0a(text) no_text(0xa, text); super end
text0b(text) click to toggle source
Calls superclass method
# File lib/smf/io.rb, line 675
def text0b(text) no_text(0xb, text); super end
text0c(text) click to toggle source
Calls superclass method
# File lib/smf/io.rb, line 676
def text0c(text) no_text(0xc, text); super end
text0d(text) click to toggle source
Calls superclass method
# File lib/smf/io.rb, line 677
def text0d(text) no_text(0xd, text); super end
text0e(text) click to toggle source
Calls superclass method
# File lib/smf/io.rb, line 678
def text0e(text) no_text(0xe, text); super end
text0f(text) click to toggle source
Calls superclass method
# File lib/smf/io.rb, line 679
def text0f(text) no_text(0xf, text); super end
timesignature(nn, dd, cc, bb) click to toggle source
Calls superclass method
# File lib/smf/io.rb, line 709
def timesignature(nn, dd, cc, bb)
  cr('timesignature/nn', nn, (1..2**8-1))
  cr('timesignature/dd', dd, (0..2**8-1))
  cr('timesignature/cc', cc, (1..2**8-1))
  cr('timesignature/bb', bb, (1..2**8-1))
  super
end
trackname(text) click to toggle source
Calls superclass method
# File lib/smf/io.rb, line 667
def trackname(text) no_text(0x3, text); super end
unknownmeta(type, data) click to toggle source
Calls superclass method
# File lib/smf/io.rb, line 730
def unknownmeta(type, data)
  unless data.length <= 2**28-1
    error('unknownmeta: too large')
  end
  super
end

Private Instance Methods

chunk_body(body) click to toggle source
# File lib/smf/io.rb, line 564
def chunk_body(body)
  unless body.length <= 2**32-1
    error('chunk size: too large')
  end
end
cr(n, v, e, w=nil) click to toggle source
# File lib/smf/io.rb, line 531
def cr(n, v, e, w=nil)
  unless e === v
    error("#{n}: out of range")
  return
  end
  if w
    unless w === v
      warn("#{n}: out of range")
    end
  end
end
no_channelmodemessage(ch, num, val) click to toggle source
# File lib/smf/io.rb, line 623
def no_channelmodemessage(ch, num, val)
  cr('channelmodemessage/ch', ch, (0..2**4-1))
  cr('channelmodemessage/num', num, (0x78..0x7f))
  unless num == 0x7e
    cr('channelmodemessage/val', val, (0..2**7-1))
  else
    cr('channelmodemessage/val', val, (0..2**7-1), (0..16))
  end
end
no_text(type, text) click to toggle source
# File lib/smf/io.rb, line 659
def no_text(type, text)
  cr('text size', text.length, (0..2**28-1), (1..2**28-1))
end