Commit graph

62 commits

Author SHA1 Message Date
Maurizio M. Gavioli
49edb8d0c3 Fixes #19155, #22861 (duplicate of the former) and #23100.
__References__:
Issues:	https://musescore.org/en/node/19155 https://musescore.org/en/node/22861 https://musescore.org/en/node/23100

__Description__:
Allows to change the start and end note to which a glissando is anchored after it has been entered. Either anchor can be changed independently.

The user interface follows the current working of other 'snappable' lines. Once either the start or end grip is selected:
- `[Shift]+[Left]` snaps the anchor to the previous chord, defaulting to its top note.
- `[Shift]+[Right]` snaps to the next chord, defaulting to its top note.
- `[Shift]+[Up]` snaps to the note above (possibly in a chord, voice or staff above the current one).
- `[Shift]+[Down]` snaps to the note below (possibly in a chord, voice or staff below the current one).

This permits to set the anchor points of a glissando to any note in the score, allowing several glissandi between the notes of the same two chords and other complex configurations (glissandi skipping intermediate chords, start and end notes in different voices or staves, and so on).

It is possible to move the anchor to a different staff of the same instrument, but not to a different instrument; also, it is not possible to 'cross' a change of instrument in the same staff.

__Known limitations__:
- The `[Shift]+[Up]` and `[Shift]+[Down]` use the same note-finding functions as the `[Alt]+[Up]` and `[Alt]+[Down]`actions which move the selection cursor to the above and below note, even across voices or staves. Occasionally, in particular if the note immediately above or below is not time-aligned, the algorithm has little expected results; however, the behaviour is already known to the user. Improving the algorithm would benefit both uses.

__Notes__:
- Most of the added infrastructure is not specific to glissando but to any spanner anchored to notes, then it should also add after-the-fact "snap to" note support to note-anchored text line.
- When moving an anchor, the algorithm usually prefers a note in the same voice/staff of the old note if it exists; if there is none, it tries other voices of the same staff.
- The change of anchor is undoable.
- The fix corrects the management of the `Chord::_endsGlissando` flag, taking into account that a chord can be the ending point of several glissandi and removing one of them not necessarily means the chord no longer ends a glissando (another glissando may still exists).
- The fix also improved the rendering of the glissando wavy line, with better alignment with anchor notes and, with glissando text, better text-line spacing.
2015-09-30 09:16:47 +02:00
lasconic
c0bb98b04a ugly fix #68846: The trill glissando line has a poor rendering 2015-07-13 17:56:46 +02:00
lasconic
f6959ace91 replace playGlissando and playArticulation by existing play property 2015-06-23 09:19:06 +02:00
Marc Sabatella
5803aa5a55 fix #63481: scale symbols, trill lines, arpeggios, and glissandi with staff size 2015-06-05 14:55:52 -06:00
lasconic
1dc19c4c0c review indentation and code style for PR #1946 2015-05-18 16:38:29 +02:00
jimka2001
98fb35b544 some changes for consistency, as requested by lasconic 2015-05-16 10:46:03 +02:00
jimka2001
782e592ad4 implementation of glissando playback
added play button for glissando
also updated test case
updated glissando accidentals to work correctly based on end note, even if in different staff
2015-05-16 10:46:02 +02:00
ws
3e383af345 fix arpeggio and glissando lines 2015-05-08 08:59:34 +02:00
ws
01952574e3 add tests for scripting interface 2015-04-03 18:24:12 +02:00
ws
8282094dd6 code cleanups; rename instr() to instrument() 2015-03-26 13:11:46 +01:00
Maurizio M. Gavioli
5b32a3c18d Fix #49881 - Glissando to wrong note if other notes in other voices
Original issue: http://musescore.org/en/node/49881

Adding a glissando to a note encompassing intervening notes in other voices or staves of the same instrument, the glissando ends into the first intervening note in another voice / staff, rather than on the 'obvious' end note in the same voice / staff.

Fixed and added more tests for these cases.
2015-03-09 13:47:02 +01:00
lasconic
92d7e1369a revert commit 6dbdd05a 2015-03-06 13:38:22 +01:00
lasconic
169e5b6028 fix glissando layout in tab, see vtest tablature-1 2015-03-05 19:43:46 +01:00
Maurizio M. Gavioli
d4133f98d1 Fix #49521 - Glissando starting from a system-initial grace note. 2015-03-03 22:29:25 +01:00
Nicolas Froment
c50f44ca2b Merge pull request #1814 from mgavioli/Fix_21725_Gliisando_from_grace_note
Fix #21725 - Glissando from grace note.
2015-03-03 14:17:56 +01:00
Nicolas Froment
e9af05b95f Merge pull request #1822 from mgavioli/Fix_49126_Glissando_and_Inspector
Fix #49126 Glissando and the Inspector / Fix #49141 - Glissando dragging
2015-03-03 12:18:03 +01:00
Maurizio M. Gavioli
87103f3b73 Fix #49136 - Duplicate cross-page glissando.
`scanElements()` was scanning glissando segments both through the `Glissando` and through the system each segment belongs to.

Original issue: http://musescore.org/en/node/49136
2015-02-28 18:06:36 +01:00
Maurizio M. Gavioli
b12132258d Fix #49126 Glissando and the Inspector / Fix #49141 - Glissando dragging
**Common part**: Both issues stemmed by the fact that clicking a glissando sometime selected the whole `Glissando` and sometime one of its segments.

It depended on the order in which element types appear in `element.h` enum: for all other spanners the segment type is listed **before** the whole element type, while for `GLISSANDO` and `GLISSANDO_SEGMENT` it is opposite.

Changing the order ensures that the segment is always selected rather than the whole `Glissando` element.

**Inspector**: adding property management to `GlissandoSegment` routing whole `Glissando` properties from the segment to the `Glissando` fixes `Glissando` access in Inspector once one of its segment(s) is selected.

This is parallel to how other spanners are currently managed (see for instance, `TextLine` and `TextLineSegment`).

**Dragging** and Saving: fixed by treating glissando segment user offset as user offset rather as position component (parallel to how VOLTA is managed).
2015-02-28 12:15:56 +01:00
Maurizio M. Gavioli
db2589ff0f Fix reading old format scores & some missing cases involving before-after graces
*) Old scores:
- grace_before-to-note glissandi in old scores are read correctly.

*) New glissandi involving graces
- In all cases, the ending note is identified correctly in the main chord, in the next main chord, in the graces-after of the main chord, in the graces-before of the next chord, whichever comes first.
- Spacing of cases involving graces-before is correct.

*) Spacing of cases involving graces-after.

It is not always optimal, as layout of graces-after pushes them as to the right as possible.

So, for instance, when a glissando is added between a grace-after of a chord and the next chord, the additional spacing added before the next chord to accommodate the gliss. is skipped by the grace-after.

I took the decision to ignore such cases as the usage of grace-after and of glissando has a very little intersection. Those cases will need manual adjusting.
2015-02-26 22:04:17 +01:00
Maurizio M. Gavioli
32843dcc38 Fix #21725 - Glissando from grace note. 2015-02-26 18:47:19 +01:00
Maurizio M. Gavioli
05c5ae222a Fix crash on dragging gliss. from palette
Also, some code clean-up (mainly deleting old code commented out)
2015-02-18 12:25:10 +01:00
Maurizio M. Gavioli
f5d831a023 Glissando as a multi-segment line.
- Implemented as a sub-class of `SLine`.
- Anchor type changed from CHORD to NOTE: allows to attach glissando start and end points to individual notes, rather than generically to chords (with note within the chord chosen by the program).
- The Glissando element is now stored in the `Note::_spannerFor` list.
- `Chord::_glissando` has been removed and replaced by a `bool _endsGlissando`, recording whether the chord is at the end of glissando (as gliss.-end chords require more space if mid-measure or system-initial).
- Debugger UI for `Chord` updated accordingly.
- Glissando in now save into score file as a spanner, within the initial note, and with appropriate `<endSpanner>` tag in the Glissando ending note.
- Existing scores with the old Glissando file format are correctly read back.

Notes:

- MusicXML import/export of the new Glissando implementation NOT IMPLEMENTED.
- This version can read scores from older versions, but older versions **cannot read** scored from this version (they do not expect a <Glissando> tag within a Note). Does this require a NEW FILE VERSION NUMBER?
- This implementation would allow rather easily to move the start and end anchors around (as for slurs) to override the note/chord chosen by the program when the glissando is initially created; but the UI for this is not implemented yet.
2015-02-18 12:21:56 +01:00
lasconic
825b5827d1 init uninitialized variables 2014-12-30 23:39:47 +01:00
lasconic
23af7b0090 fix possible crash when layouting glissando when chord has dot but notes doesn't because in a tabstaff 2014-11-11 14:38:10 +00:00
Marc Sabatella
98235e52b2 fix #38501: cheap partial fix for start position of cross-staff and cross-system gliss 2014-11-07 13:23:07 -07:00
Dag Henning Liodden Sørbø
551fb14ba9 fix #21110 : Glissando text raised more above wavy line 2014-09-01 08:30:56 +02:00
Bartlomiej Lewandowski
cbaa128e4d Added comments and spaces 2014-08-15 22:49:59 +02:00
Bartlomiej Lewandowski
4453a0c3b5 Added glissando filter. 2014-07-30 14:49:54 +02:00
Joachim Schmitz
5bc83194af move GlissandoType to Glissando::Type
needed to make it available to the plugin framework
2014-06-26 11:57:50 +02:00
Joachim Schmitz
e6e7436177 move SegmentType to Segment::Type and make int again
needed to make it available to the plugin framework
and the memory saved is not worth the performance penalty
2014-06-26 11:57:39 +02:00
Joachim Schmitz
75623c53dc move ElementType to Element::Type
needed to make it available to the Plugin framework
2014-06-26 11:57:35 +02:00
ws
e1b1246e0c make SegmentType an global enum class 2014-06-01 20:24:29 +02:00
Joachim Schmitz
79474e3fcc convert unnamed enum into enum TextStyleType
more work needed to make it an enum class
2014-05-30 13:37:30 +02:00
Joachim Schmitz
7f1b612615 convert enum P_ID into enum class 2014-05-26 18:18:01 +02:00
Joachim Schmitz
931e837c5e convert enum ElementType into enum class 2014-05-23 10:35:27 +02:00
Joachim Schmitz
a1c6c8c493 improve enum ElementFlag
more work needed to convert it into a class, same issue as with
ArticulationShowIn.
2014-05-23 10:35:22 +02:00
ws
e534cccef8 bug fixes for concert pitch switch 2014-04-09 16:09:21 +02:00
Joachim Schmitz
5977488174 eliminating needless \n in qDebug() calls
searching for 'qDebug.*\\n\'
2014-03-25 14:59:32 +01:00
ws
e6e7abbd6d smufl integration: articulation 2 2013-11-12 09:29:13 +01:00
ws
02b264f068 smufl integration, part II 2013-11-12 09:29:12 +01:00
ws
733c1934db smufl integration, part I 2013-11-12 09:29:12 +01:00
lasconic
9c6e6d3fc5 fix #22858: slide layout in guitar tab 2013-09-24 21:34:15 +02:00
lasconic
0b96ea5112 fix #22629: Arpeggio and glissando symbol moves are not imported 2013-09-09 18:24:44 +02:00
wschweer
ab6120f85e refactoring grace notes 2013-06-12 14:23:57 +02:00
Maurizio M. Gavioli
44262e2c54 Improving dot width detection 2013-05-21 00:34:12 +02:00
Maurizio M. Gavioli
1606b2de6f Smarter algorithm for avoiding collision with start note ledger line.
Added detection of start note dot(s).
2013-05-20 09:29:00 +02:00
Maurizio M. Gavioli
ceb8bdf256 Fix #21110 - position the text of glissando according to its physical sizes and no longer by a hard-coded vert. offset
It should also fix #20970: collision of glissando with ledger lines.
2013-05-19 13:17:12 +02:00
Maurizio M. Gavioli
e22cc5262a Fix #21110 - Wavy glissando text position
- Text over a glissando wavy line collided with line.
- The wavy line occasionally collided with final note and was not always centred within the two notes.

Fixed in Glissando::draw() by:

- linking text vert. offset to line type
- always rounding down the number of wavy elements and positioning the line according to the number of actual elements
2013-05-18 14:49:01 +02:00
Dag Henning Liodden Sørbø
626b77ce54 fix #20947 : Glissando not angled between notes with the same pitch letter 2013-05-16 21:03:19 +02:00
Dag Henning Liodden Sørbø
8f8af3bf4b fix #20970 : Glissando collides with elements before note 2013-05-15 08:26:25 +02:00