musescore/MuseScore — pull request #1460 by MarcSabatella (2014-11-18 05:50:02+00:00)
Title: fix #8924: native support for slash notation

Adds two new menu item under Edit / Tools: "Fill With Slashes" and "Toggle Rhythmic Slash Notation". The first fills the selected range with stemless slashes, one per "beat" (as determined by time sig), voice 1, fixed to the middle staff line (see below). The second converts any chords that already exist in the selected range into "rhythmic notation" - slash heads, fixed to middle line for voices 1 & 2, above the staff for voice 3, below for voice 4. Or, if run on an existing region with this notation, it converts those chords back to normal.

In either case, the "fixing" is done via two new note properties - FIXED (boolean) and FIXED_LINE (int), that can be accessed via the Inspector and are written / read normally. Rendering of accidentals is suppressed for notes with the FIXED property enabled. The slash notation tools also set notes to be silent (PLAY property disable), and if there is more than one note in a chord, all but one are made invisible, so all the original notes remain intact. For slash notation on tablature staves, fret marks are replaced with an ordinary "/" character for now.

No special handling is done for pitch, tpc, etc. Which is to say, slash notation actually transposes normally under the hood - Concert Pitch, Notes / Transpose, and the arrow keys all function normally with no changes. The fixing of notes to a given line is mostly handled by simply having Note::line() return the FIXED_LINE property if FIXED is set (also a few places where drum notation would otherwise reset the line and head). So there are essentially no changes to the "core" of MuseScore for regular notes. And even for slash notation, it's really just a matter of the fixing to a line and the suppression of accidentals if the FIXED property is set. This is the simplest, least invasive, and yet effective solution I found.

BTW, the change to inspectorNote.ui should really just be the addition of the new properties, but sometimes QtDesigner has a mind of its own.

I added the mtests to test the two actions (fill with slashes, toggle rhythmci slash notation) themselves, and a couple of vtests to test the rendering.

There is currently no special MusicXML handling. Finale does not appear to export slash rhythmic notation as anything but ordinary slash-headed notes, so neither do we. Finale's basic slash notation (the "fill with slashes" equivalent) is handled different - via measure styles, which we don't support. Eventually we could convert from Finale style to our style (which is more like how Sibelius does it), but I elected to postpone that.