Code covered by the BSD License  

Highlights from

4.8 | 6 ratings Rate this file 161 Downloads (last 30 days) File Size: 17.4 MB File ID: #24583 Version: 1.10
image thumbnail




29 Jun 2009 (Updated )

An innovative environment, on top of Matlab, for music and audio analysis

| Watch this File

File Information

MIRtoolbox is a Matlab toolbox dedicated to the extraction of musical features from audio files, including routines for statistical analysis, segmentation and clustering. MIRtoolbox integrates a user-friendly syntax that enables to easily combine low and high-level operators into complex flowcharts. The modular design of MIRtoolbox is guided by a philosophy of expertise capitalization: techniques developed for certain domains of music analysis are turned into general operators that could be used for different analytical purposes.

Each feature extraction method can accept as argument an audio file, or any preliminary result from intermediary stages of the chain of operations. Also the same syntax can be used for analyses of single audio files, batches of files, series of audio segments, multi-channel signals, etc. For that purpose, the data and methods of the toolbox are organised in an object-oriented architecture.

Memory management mechanisms allow the analysis of large-scale corpus, through the integration of automated chunk decomposition mechanisms and of distinctive processes for flowchart design and evaluation. A set of meta-functions have been designed that enable the integration of user-defined algorithms with the help of simple templates.


Mp3read And Mp3write and Aiffread inspired this file.

Required Products Signal Processing Toolbox
MATLAB release MATLAB 7 (R14)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (19)
01 Oct 2015 Abigale Yu  
16 Nov 2014 Muhammad Naveed
tempo = mirtempo('file');



ans =


Comment only
31 Oct 2014 FRedie

FRedie (view profile)

Hi there,

Extremely happy to see the mirtoolbox functions..just to know how functions like mirtempo() which returns a mirscalar object to a direct format that matlab can understand.
tempo = mirtempo('file');
this makes tempo a mirscalar object.
how to conver 'tempo' variable to a double value so as to be used in a script.


Comment only
14 Aug 2014 Wendy

Wendy (view profile)

Hi there!
This is Wendy, a postgraduate student. I'm using MIRtool to extract features of music. Is it able to get the Standard Deviation(std) of features directly(e.g. MFCC)? Or, I have to calculate myself?
Your prompt reply, therefore, will be appreciated.

01 Jul 2013 JMD

JMD (view profile)

I'm using Matlab R2012a where I've installed Mirtoolbox. But .mp3 file is not analyzed when I'm using miraudio or mirrms functions.
Here are the error message returned by each reader:
Error using wavread (line 164)
Not a WAVE file.
Error using auread>read_sndhdr (line 91)
Not a NeXT/Sun sound file.
Error using wavread (line 67)
Invalid Wave File. Reason: Cannot open file.
Error using aiffread (line 127)
Unknown file extension '.mp3'.
Error using mirerror (line 4)
ERROR using MIRREAD: Cannot open file r1.mp3

Error in mirread>misread (line 142)
mirerror('MIRREAD',['Cannot open file ',file]);
Error in mirread (line 57)
misread(orig, err);

Error in mireval (line 68)
[d1,tp1,fp1,f1,lg,b,n,ch] = mirread([],file,0,0,0);

Error in mirfunction (line 69)
o = mireval(o,filename,nout);

Error in mirrms (line 27)
varargout = mirfunction(@mirrms,x,varargin,nargout,specif,@init,@main);
Please solve the problem.Waiting for your reply.

Comment only
11 Apr 2013 Olivier Lartillot

Hi Konstantinos,

kmeans.m belongs to the NETLAB toolbox which I included in the MIRtoolbox distribution. Netlab is used only for mirclassify, so if you don't use it, just remove the Netlab subfolder.



Comment only
29 Mar 2013 Konstantinos Drossos

Hi there,

Although MIR Toolbox is a really useful tool, it is overloading the built in function kmeans in MATLAB.

Would be possible to avoid this? If yes, how should be done?

Thank you.

16 Sep 2012 Funda Yazici  
04 Mar 2012 Eric Diaz  
04 Dec 2011 Maria

Maria (view profile)

Never mind the above question, I just realized I could use your mirgetdata function to do this. :)

Comment only
04 Dec 2011 Maria

Maria (view profile)

Hi Olivier,

This is a great tool! Thanks for working on it.

(I sent this note to an email listed in your README file also. So apologies if I am double spamming you!)

I had a quick question -- is there an easy way to get the toolbox scripts to simply return values (i.e., in double format, etc.) rather than returning a string?

For example, when I run the command:

c = mirlowenergy('1')

Variable c now stores the string, "The Low energy related to file 1 is 0.26588."

I was wondering if there is simple a way to return the value "0.26588" as a type double instead.
(My full goal is to analyze a set of audio files, and store their respective Low Energy values in a matrix for classification purposes. I can't currently store the c value in a matrix since it is not a simple, double value)

Thank you!

Comment only
20 Aug 2011 Olivier Lartillot

Hi Ayat,

Great to see very nice application of the toolbox!

The error you got is due to the fact that your version of Matlab, a little old, does not recognize the matlab command "parfor". I have found a simple way to solve that problem. I will send you by email the new version of mireval.m and will include it in the next version of MIRtoolbox.



Comment only
15 Aug 2011 Ayat

Ayat (view profile)

Hi, Oliver

I'm Jordanian student “Master degree” ,and I am working on my thesis “Building Arabic Multimedia Information Retrieval system “ ,Thank for your Mirtoolbox “great work”.

I have used your tool to analyze “wav file” structure , and during use miraudio () I have this error

??? Error: File: C:\MATLAB7\toolbox\mirtoolbox1.3.3_matlabcentral\mirtoolbox1.3.3_matlabcentral\mirtoolbox\mireval.m Line: 161 Column: 1
Illegal use of reserved keyword "else".

Error in ==> mirfunction at 69
o = mireval(o,filename,nout);

Could you help me please to solve this problem ? I need your help …

Ayat Al Ahmad

Comment only
17 Apr 2011 Dawei

Dawei (view profile)

Hi Oliver,

Thank you very much for your reply. The problem is resolved.Thank a lot !

Best Regards

dw dai

Comment only
13 Apr 2011 Dawei

Dawei (view profile)

Hi, Oliver
I'm a chinese student ,Thank for your work for music analysis.I use your tool to analyze a mp3 file structure. But i use the function miraudio and there are some errors as following :

??? Error: File: D:\sotware\matlab\toolbox\mirtoolbox1.2.4_matlabcentral\mirtoolbox\mireval.m Line: 127 Column: 1
Illegal use of reserved keyword "else".

Error in ==> mirfunction at 82
o = mireval(o,filename,nout);

Error in ==> miraudio.miraudio at 153
varargout = mirfunction(@miraudio,orig,varargin,nargout,specif,@init,@main);

Error in ==> my_envelope at 11
s_audiodata = miraudio(myfile);

would you please tell me the reason and how to settle the problem.Thanks a lot .
Best Regards,
dw dai

Comment only
08 Nov 2010 lee wei

Hi Oliver,

Thank you for your reply. The problem is resolved.Thank a lot !

Best Regards

Wei li .

Comment only
06 Nov 2010 Olivier Lartillot

Hi wei,

Thanks for your comment. I would need to see what is happening exactly in your case. Could you send me ( the mp3 file as well as the set of MIRtoolbox commands you used?



Comment only
20 Oct 2010 lee wei

Hi, Oliver
Thank for your work for music analysis. I use your music segmentation Demo to analyze a mp3 file structure. But i use the function mirpeaks and there are some errors as following :
Computing mirpeaks related to d...
??? Subscripted assignment dimension mismatch.

Error in ==> mirpeaks>main at 409
th2((l-1)*nl0+(1:nl0)',:,:) = th(:,:,:);

Error in ==> mirfunction at 196
o = main(orig,during,after);

Error in ==> mirpeaks at 203
varargout = mirfunction(@mirpeaks,orig,varargin,nargout,specif,@init,@main);
I read the mirpeaks script file and i find the 409 line
th2((l-1)*nl0+(1:nl0)',:,:) = th(:,:,:); and revised as following
th2((l-1)*nl0+(1:nl0)',:,:) = th(:,:,:,l);
but the errors are the same. would you please tell me the reason and how to settle the problem.Thanks a lot .
Best Regards,
wei li

Comment only
17 Oct 2010 Ioanna Karariga

Great tool, thanks

20 Jul 2009 1.1

bug fixes and conformity to Matlab BSD license.

20 Jul 2009 1.2

1.2.1: bug fixes and conformity to Matlab Central BSD license

15 Sep 2009 1.3

1.2.2: bug fixes and some improvements (cf. release notes)

16 Oct 2009 1.5

1.2.3 update: Memory-optimized evaluation of complex flowcharts, bug fixes, controllable number of bands in Mel-spectrum and MFCC.

01 Apr 2010 1.6

Recursive analysis of sub-folders, parallel processing, better and more efficient structural analysis, etc. + bug fixes

01 Apr 2010 1.7

Recursive analysis of sub-folders, parallel processing, better and more efficient structural analysis, etc. + bug fixes

14 Jul 2011 1.9

1.3.3: Lots of improvements and bug fixes.

14 Dec 2011 1.10

1.3.4 update (compatibility issues, bug fixes, improvements)

Contact us