Refactored js with addNote function, a little more logic for 16th notes.