#! /usr/bin/env ruby

# smf2smf.rb: Written by Tadayoshi Funaba 1999, 2000, 2003
# $Id: smf2smf.rb,v 1.5 2000-12-29 00:08:37+09 tadf Exp $

require 'smf'
include  SMF

def usage
  warn 'usage: smf2smf ifile [ofile]'
  exit 1
end

usage unless $*.size >= 1 and $*.size <= 2
ifile = $*.shift
ofile = $*.shift
ofile ||= File.basename(ifile, '.mid') + '-smf2smf.mid'

sq = Sequence.decodefile(ifile)
sq.encodefile(ofile)
