Significant Steps Forward for JFugue Music NotePad (Part 1)

One of the biggest issues in the free and open source JFugue Music NotePad has always been the fact that one wasn't able to move notes after dropping them. That, all on its own, made the application unusable in real world scenarios. But... guess what? Someone called Michal Fapso, studying Graphical User Interfaces in Java at the Faculty of Information Technology in Brno in the Czech Republic, came across the project. And he had chosen to work on a music score editor for a term project. Instead of starting from scratch, he proposed to start with the existing JFugue Music NotePad and... enhance it with editing capabilities. His project instructor agreed and now... can select a note (or multiple notes, by using the Ctrl key), which results in the selected notes turning red. Then you can press the up and down arrow keys to move the selected notes up and down in the score! How cool is that? Here you see three red notes, which means I selected them for moving up and down with the arrow keys:

In addition, you can see above that Michal added flats and sharps (which weren't supported before) and I added a Save button (so that you can save your compositions). The Save functionality needs to be enhanced, but basically does the job for now.

I asked Michal to explain how the editing capabilities work and he summarized the story as follows:

  • Created this class for selecting notes with mouse (holding CTRL key allows selecting more than 1 note) and moving notes with up/down arrow keys.
  • Added code for setting the StaveListener.
  • Added method getNoteAtPos(...) and in method paint(...), added code for drawing the key signature (sharps, flats), and filtering the selected notes with the "red filter", added method selectNotePrefixSymbol(...) for drawing sharps, flats and restores beside notes.
  • Added some hash tables and arrays for working with notes, added method setKeySignature(...) for setting the score's basic scale and for filling the arrays: nativeNoteValues, alteredNoteValues and restoreNoteValues (these arrays are used in SingleStave::paint method).
  • Created the "red filter" used for selected notes.

And here's a pic of Michal, the newest contributor to the JFugue Music NotePad project on (click here):

Finally... guess what happened when he handed his project in to his instructor? He got full marks. 20 out of 20. Michal graduated this year and will continue with his PhD. Well done Michal, that sounds like music to my ears! About the JFugue Music NotePad, Michal writes: "It was really nice to work on this project. It is well designed and I had to do only some minor changes to the existing code for implementing the editing capabilities." That's great to hear Michal, and mainly due to the Belgian developer Pierre Matthijs, who added a lot of insight and structure (and lots of code) to the project after I open sourced a rather humble beginning. It is extremely cool to hear that this project has proved beneficial to someone in their studies, who has now also learned about the NetBeans Platform. Plus, very cool that the enhancements have been contributed back to the project. Hurray for everyone!


interesting :)

Posted by sohbet on December 01, 2007 at 09:26 PM PST #

Post a Comment:
  • HTML Syntax: NOT allowed

Geertjan Wielenga (@geertjanw) is a Principal Product Manager in the Oracle Developer Tools group living & working in Amsterdam. He is a Java technology enthusiast, evangelist, trainer, speaker, and writer. He blogs here daily.

The focus of this blog is mostly on NetBeans (a development tool primarily for Java programmers), with an occasional reference to NetBeans, and sometimes diverging to topics relating to NetBeans. And then there are days when NetBeans is mentioned, just for a change.


« April 2014