#! /usr/bin/env ruby

require 'smf'
include  SMF

sq = Sequence.new
tr = Track.new
sq << tr
tr << SequenceName.new(0, 'rand1')
srand
for ch in 0..7
  offset = 0
  for i in 0..127
    note = rand(128)
    vel  = rand(127) + 1
    tr << NoteOn .new(offset, ch, note, vel)
    offset += rand(128)
    tr << NoteOff.new(offset, ch, note, 64)
  end
end
sq.save('rand1.mid')
