Appendix A: Program code


This CD is an addition to the bachelor's thesis "Music Genre Detection using the Naive Bayes Classifier" 
written by Anastassia Semjonova (2009). It provides the code of the features extraction used during the work 
on the thesis.


What to do?

Program code itself could be found in the file code.sci that could be read by any of text reader programs (notepad, editplus, etc).
To execute the code that will start to extract features from Your data set, You should:

0. copy the .sci file to some folder on Your computer.
1. Prepare a data set of music files in WAV with names like {genre_name_3letters_acronym}{number_of_the composition_of_that_genre}.wav (e.g. "pop13.wav")
All files should be in one folder.
2. Download, setup and open SciLab software.
3. Set the directory of the data set: 
-->chdir("X:\path\to\the\dataset");
4. Define the vector of music genres/styles
-->styles = ["pop","clr","cla","pnk","rhh","hrm","tra"];
5. Define the number of the compositions of each genre (should be equal for each genre)
-->numberOfFiles = 50;
6. Execute the program (File->Exec->.../code.sci)
7. Wait... It takes time.
8. When the program finishes its work, You will find the file named "output.csv" in the same folder where is the code.sci file. 
The file contains info about extracted features. 


Questions?

Contact the author(Anastassia Semjonova) by e-mail: semjonova.anastassia@gmail.com 
