wolffd@0: function varargout = mircompute(algo,varargin) wolffd@0: wolffd@0: l = length(varargin{1}); % number of audio files. wolffd@0: for i = 1:l wolffd@0: % for each audio file wolffd@0: v = varargin; wolffd@0: for j = 1:length(v) wolffd@0: % for each variable associated to that audio wolffd@0: if isa(v{j},'mirdata') wolffd@0: v{j} = get(v{j},'Data'); wolffd@0: end wolffd@0: if iscell(v{j}) wolffd@0: v{j} = v{j}{i}; wolffd@0: end wolffd@0: %if not(iscell(v{j})) wolffd@0: % v{j} = {v{j}}; wolffd@0: %end wolffd@0: end wolffd@0: % final result for that audio wolffd@0: for k = 1:length(v{1}) wolffd@0: % for each segment in that audio file wolffd@0: vk = v; wolffd@0: for j = 1:length(vk) wolffd@0: if iscell(vk{j}) wolffd@0: vk{j} = vk{j}{k}; wolffd@0: end wolffd@0: end wolffd@0: if 1 %nargout == 1 wolffd@0: res = algo(vk{:}); wolffd@0: else %% used for miremotion, provokes bug else... wolffd@0: [res res2 res3 res4] = algo(vk{:}); wolffd@0: end wolffd@0: if iscell(res) wolffd@0: lr = length(res); wolffd@0: for j = 1:lr wolffd@0: varargout{j}{i}{k} = res{j}; wolffd@0: end wolffd@0: else wolffd@0: varargout{1}{i}{k} = res; wolffd@0: if nargout == 4 wolffd@0: varargout{2}{i}{k} = res2; wolffd@0: varargout{3}{i}{k} = res3; wolffd@0: varargout{4}{i}{k} = res4; wolffd@0: end wolffd@0: end wolffd@0: end wolffd@0: end