Accomplishments this week:
As discussed last week, we were to layout the details of the swing plugin framework this week. There was a consensus that having certain ‘properties’ for NoteEvents would be beneficial, which could be exposed to plugins.
Hence it was decided to make NoteEvent ontime, NoteEvent len and NoteEvent pitch (which are ‘fields’ of a ‘noteveent’) as ‘properties’ (in the MuseScore sense) of ‘noteevent’.
The idea was to have them as MuseScore properties (defined in property.h/property.cpp) as well as Qt properties. For example, we would have
P_ONTIME, P_EVENT_PITCH, P_LEN
This would also make it easy to add them to the Inspector. Other than that, it would have potential benefits like:
Getting “undo” done easily, as we have “automatic undo” for MuseScore properties, recovering default value easily, and so on.
But unfortunately, it turned out that NoteEvent is not capable of being ‘MuseScore-property’ enabled. The reason behind this is that the methods writeProperty, getProperty, setProperty, etc. are declared in element.h and the property system is only available to element. It can be seen here: https://github.com/shredpub/MuseScore/tree/noteevent-properties/libmscore
So rather than exposing the NoteEvent to the inspector, maybe it is a good idea to expose a fake ontime/len on a note, but that would work only if it has a single element. This restriction is what makes the problem trickier.
Tasks for next week:
It was decided that it is a better idea to start working on implementing the swing in MuseScore itself rather than worrying about having a plugin.
The tentative plan is to implement a basic version of it, so that we can get on par with MuseScore 1.3. The idea is to get a score to swing completely if a boolean is set.
For undo, we could remove the swing text and invoke rendermidi again, which would not be a big deal, as we are storing the information about what is user applied.
The current design of how the swing playback should be implemented is illustrated well in this write up by Marc Sabatella:
The first task would be to study this write up and understand how the swing will be implemented. After that, a basic implementation as mentioned earlier is to be coded.