Open oggy22 opened 6 years ago
This is a great feature of the app! A recurrent motif/theme can be altered a bit and when the whole piece is played back it will give improvisational style to it. Imagine any 2-part invention by Bach played with the theme spiced-up in a jazz style!
It depends on #66
There are two conceivable ways a melody node can be edited: 1) The edit applies only to that melody node i.e. all its occurrences. A new melody node containing a list of all notes should be added instead of existing node. It means excluding the existing node and replacing it with an edited copy. It also means that its children's references decrease by 1. 2) The edit applies recursively down to the appropriate leaf and leaf is edited. Consequently the edit applies wherever the leaf is referenced.
If the node edited is a leaf there is no distinction between 1) and 2).
An edit may be:
Invariants: Edits may not change the total duration.
Implementation-wise the edits may be implemented by having another implementation of IMelodyPart which keeps both original and edited versions of node, so the edits can be undone easily.
"Twinkle twinkle little start" can be altered by one simple edit to: BC F#G G#A G EF D#E C#D C
On the wpf app provide the user interface for editing the music parts. Once edited, the part can be played back, but also the entire musical piece can be played back with the edited part.