This of course has the obvious disadvantage that everytime you want to make some change to the music fragment, you need to open it again in the external application, export it and insert it again, leading to quite an awkward workflow. I even remember some family member printing and scanning a piece of music to insert it into his text document!
Of course, when I started with this project I looked at existing Open Source music notation software to figure out if it might be possible to save myself a lot of work by not starting from scratch. Probably the best program currently available is Rosegarden, but one obvious disadvantage of using it is that it is still KDE3/QT3 based. Also, internally, Rosegarden seems to be centered around the various things needed for perfect playback of music, with notation support somewhat bolted on to it, while I wanted to focus more on the notation/printing side of music and keep playback as a nice, but not really required (and certainly not needed to be perfect) optional addition.
Another existing program I looked at integrating with is Canorus (the QT4 successor of NoteEdit), and in fact after one afternoon of hacking I already succeeded drawing music loaded from a Canorus file, but this approach also had several big disadvantages. For instance, Canorus is still a long way from being released (i'm not sure if a final/stable release has been planned even), but also Canorus isn't aiming at providing accurate renderings of music. For example, Canorus won't have printing support but will be relying on LilyPond for the final output.
Of course starting from scratch meant that I needed to write quite a lot of code to get anything to work at all (in its current state, the music notation in KOffice is 12,000 lines of code, with NoteEdit consisting of 54,000, and Rosegarden even having 260,000 lines of code), but it meant I could do things exactly as I wanted, and learn a lot doing it, implementing all the various (quite complicated) algorithms needed to create nice looking music. The very flexible design of KOffice's Flake framework also meant that I had to write very little code to get to some simple things to work, and also that it is possible without any extra code to embed music in any of the KOffice applications that use Flake (as can be seen in the screenshots).
In the current state of the codebase, it is only possible to input music with your mouse, by clicking at the position you want to insert a note, and also only very simple music is supported. There is no support yet for ties, slurs, tuples, dynamics and tempo markings, but you can write (or load from a MusicXML file) multi-voice, multi-part, multi-staff music. And also, since this week support for beams has been added (although many cases probably exist where the rebeaming algorithm will not make correct decisions on which notes to beam together yet).
One thing I would really like to see implemented before the KOffice 2.0 release is storing the music in some sort of pre-rendered format in ODF files, so that other programs can at least display/print something when they load a file. Also ties/slurs, tuples and some basic dynamics/tempo markings would be really nice, but I'm afraid there are too many nice things to implement them all in such a short time-span, so any help you could offer would be greatly appreciated!