IOException,
InvalidSmafDataException {
Track[] smafTracks = smafSequence.getTracks();
MidiContext midiContext = new MidiContext();
int resolution = midiContext.getResolution(smafTracks);
Debug.println("resolution: " + resolution);
Sequence midiSequence = new SmafVaviSequence(Sequence.PPQ, resolution, 1);
javax.sound.midi.Track midiTrack = midiSequence.getTracks()[0];
midiTrack.add(midiContext.getTempoEvent());
for (int i = 0; i < smafTracks.length; i++) {
midiContext.setMidiTrack(midiTrack);
midiContext.setSmafTrackNumber(i);
midiContext.setTrack(smafTracks[i]);
midiContext.setCurrentTick(0);
Track smafTrack = smafTracks[i];
for (int j = 0; j < smafTrack.size(); j++) {
SmafEvent smafEvent = smafTrack.get(j);
SmafMessage smafMessage = smafEvent.getMessage();
midiContext.addCurrentTick(midiContext.getTicksOf(smafMessage.getDuration()));
//Debug.println("����������(" + i + ":" + j + ") ticks: " + midiContext.getCurrentTick() + "(" + midiContext.getTicksOf(smafMessage.getDuration()) + "," + smafMessage.getDuration() + "), " + smafMessage.getClass().getSimpleName());
if (smafMessage instanceof MidiConvertible) {
if (!(smafMessage instanceof vavi.sound.smaf.message.NoteMessage) &&
!(smafMessage instanceof vavi.sound.smaf.message.ModulationMessage) &&