function m = mft2mf(ifname,ofname)
% Conversion of text file containing MIDI information into a proper MIDI file
% m = mft2mf(ifname,ofname)
% Converts a text file containing MIDI information into a proper MIDI file
%
% Input arguments: 
%	IFNAME = Input filename
%	OFNAME = output filename
%
% Output: MIDI file
%
% Remarks:
%
% Example:
%
%  Author		Date
%  T. Eerola	3.1.2003
%© Part of the MIDI Toolbox, Copyright © 2004, University of Jyvaskyla, Finland
% See License.txt


nmat=[];
% PLATFORM DEPENDENT

if strcmp(computer,'MAC')
    currdir = char(bitand(double(cd),255));
	toolboxpath = which('readmidi');
	toolboxpath=toolboxpath(1:end-11); % remove ':readmidi.m'
	%cd(toolboxpath);

    d = which('playmidi'); d = d(1:end-10);
    cmd = ['! ''' d 't2mfmac.app'' ''' ifname ''' ''' ofname '''']
    eval(cmd);

elseif strcmp(computer,'PCWIN')
	t2mf(ifname,ofname); % mex converter, works in Windows, but see next
	clear mex % because the converter is still a bit dodgy ...
else
	disp('This function works only on Macintosh and Windows!');
	return;
end
