refactored and fixed a problem writing duplicate notes
added random score generation and note playing functionality