Last 2 weeks mainly focussed on adding new features which now have significant effect on the activitiy and has brought lot of changes and improvements.
- All the type of rests were added corresponding to each note: whole time, half time, quarter time and eighth time.
- Added replace feature. When the user enters the replace mode, he can replace any note/rest in the music with another note/rest from the piano.
- Added erase feature. When in the erase mode, the user can erase any note from its position and that note will be replaced by a rest of equivalent time.
- Added undo feature. We decided to store the most recent 5 changes to allow for undo action. Whenever a change has been made by the user, the changed data is pushed into a stack and when undo action is done, the last change is reverted back and is popped off the stack. For maintaining the most recent 5 changes, we follow the queue approach here and keep removing the 1st change data present in the data structure and add the latest data at the end (which becomes the top-most data when it is used as a stack).
- A major change was separating the data which we display (notes) from the staffs view and make them independent. Previously each staff had it’s on model of notes data that we displayed and the code was little difficult to follow in the first instance. Also it was little lengthy.
But thanks to my mentor Emmanuel Charruau who gave me a new approach to make them independent of each other and have a single model for all the notes. Then we would calculate the positions of each note and just display over the corresponding staff.
As a result, the code became pretty clean, easy to maintain and better understandable.
- Another nice feature which was added was that while we played the melody, it would be cool if for every playing note the code could ,on its own, switch to the corresponding displayed keyboard and indicate the respective piano key to actually show the user how that music is composed by automating the playing of piano.
- Next was addition of feature to display lyrics and other datas of the music which was loaded and played.
This feature brought a two toggable-modes: Lyrics mode and piano mode. In the lyrics mode, the user can read the lyrics and in the piano mode he can watch the automatic playing of piano as the music progresses.
- At last there were lots of bug fixes, added contexts for translators and improvements.
This was all for the last 2 weeks and now the activity is under testing and review for the 1st phase.
Hope to have great summers ahead!