Solves the shift of the fingering on the grace note, and therefor the shift of the line above the fingering.
The root cause was StemSlash. Shapes for the StemSlash are created during the layout of the
beams of the grace notes and the layout of these beams is with the layout of the complete Chord
to which the grace notes belong. As a result, the shapes of StemSlash are added to the skyline
after the layout of the Fingering so the layout of the Fingering was based of the layout of the
Stem only.
After a re-layout the StemSlash is included in the skyline so the re-layout will move
the Fingering and, in this case, also the line.
The solution was a extra layout of the StemSlash in Score::layoutChords3() so it StemSlash is
included in the skyline in time.
Although this issue is vert similar as #302316 and fix#297501, the root cause is
different.
Calling merge() on non-adjacent text diffs should probably not happen
and reveals a potential bug in score diff code, but it is not a fatal
error and should not lead to MuseScore crash. This commit avoids
terminating MuseScore in this case. Score comparison still produces
sensible results in case of such error.
Root cause is a nice catch-22 in collectSystems().
First setInstrumentNames() is called to create InstrumentName elements. To do so correctly,
it needs information on which staves are hidden but this is information becomes available
much later, after it is know which measures are a system because now we know which staves
are empty and can be hidden.
The InstrumentName elements are required because this affects the available space for
measures.
The choosen solution is to move the InstrumentName elements from the top staff to the
first visible staff of the part. Since this is known in a very late stage, checks of
whether a staff is visible or not had to be removed or replaced by a check whether the
part owning the staff is visible.
To support these checks, new method are added, firstSysStaffOfPart(), firstVisibleSysStaffOfPart(),
lastSysStaffOfPart() and lastVisibleSysStaffOfPart().
Resolves: https://musescore.org/en/node/302011.
When creating a tie from a grace note to its main note, make sure not to overwrite the main note's chord, thus destroying the grace note and creating a tie from a note to itself.
Resolves: https://musescore.org/en/node/300693
Continuation lines are drawn to the right edge of the last note
that starts before the end of the figure's duration.
The code that finds this note was only looking in voice 1.
That resulted in continuation lines ending short, or disappearing,
if the last note was in another voice.
Fix is to be sure to check all voices when searchiing for the end CR.
This preference key represents the minimal amount of ticks that can occur
between a pedal off event and a pedal on event. Currently, its default
value is 1, thus there is no difference with the previous implementation.
When increasing its value, the pedal off event will be moving backwards by
the specified amount of ticks (i.e. it will happen earlier), so that the
distance with the next pedal on (if any) event will grow.
as requested/discussed in PR #4989, by using size_t or at least
unsigned instead of casting to int when using the size() method of stl
containers (vectors etc.) in for loops.
Doesn't work everywhere though, not without either adding more casts
elsewhere or with massive code changes or with different compiler(s')
warnings.
Tested with MinGW 64-bit, MinGW 32-bit and MSVC 64-bit.
Resolves: https://musescore.org/en/node/290987.
Make sure that B#, B##, Cb, and Cbb describe themselves as being in the correct octave. This is accomplished by calculating the octave based on what the pitch would be if there were no accidental. Thus, there is no need to special-case certain tpcs.
Resolves: https://musescore.org/en/node/301605.
Prior to this commit, ScoreView::cmdAddSlur() could be called multiple times from within ScoreView::addSlur(), resulting in the need for multiple "undo" commands to completely undo a single "add-slur" command. This commit swaps the names of these two functions, and, more importantly, only calls Score::startCmd() and Score::endCmd() once for the entire operation.
Resolves: https://musescore.org/en/node/301496
Alt+Left/Right commands were skipping voltas because
we were checking start element and checking against the active staff,
but the start element is actually the measure for voltas.
The main change here is to go ahead and visit the volta
if the active staff if you are navigating the top staff.
Arguably, it could make sense to check for the top *visible* staff,
since that is what the volta at least appears to be attached to.
So I have code here to that.
But I disabled it because in practice,
neither the navigation commands themsevles nor the screen reader
treat invisible staves specially.
So a blind user navigating would have no way of knowing
the top staff is not visible.
So they would likely continue to see it as relevant.
I would not the same issue occurs for system text,
which we always treat as attached to the top staff only.
I added a TODO to indicate where this code would need updating.
Eventually we could consider coming up with some way
of presenting information about hidden staves.
Perhaps in conjunction with a facility allow user
to hide staves on specific systems only,
which seems to be a fairly common request.
This issue reports two problems:
1) Broken tie for notes under the split pitch.
2) Corrupted file because of uncorrect split triplets.
This commit solves the first issue by creating a new Tie when for a note under
the split pitch a forward tie is detected. The patch temporarily saves the
new note and the old pitch in a map in which the old tied is used as key.
When this old tied note is detected, a new tie is created between the two new
notes and the old tie is removed.
The second issue is solved by creating tuplets in the splitted staff. This can
cause tuplets with only rest. These tuplets are not removed, this should
cleaned up by the Regroup Rhythms function. Unfortunately, this function
isn't able tuplet that well. But that's another issue which should be solved
there.
Resolves: https://musescore.org/en/node/301478.
When importing scores from 1.x or 2.x, the property flags for styled properties must be set to UNSTYLED. Otherwise, the properties will not be written when the score is saved. ScoreElement::readProperty() should be used wherever possible, since it takes care of setting the property flags correctly. When it is not possible to use ScoreElement::readProperty(), ScoreElement::setPropertyFlags() must be called after setting the property.
Resolves: https://musescore.org/en/node/301436
The accessibility navigation commands
(Alt+Left/Right, also Ctrl+Alt+Shift+Left/Right)
were not properly checking for mmrests,
resulting in selection of elements in the underlying measures
that were not valid in the current layout.
This adds the necessary checks.
Mostly just a matter of adding "MM" to various function calls.
In a couple of places, the appropriate function did not exist,
so I added it.
Also corrected errors in Ctrl+Alt+Shift+Left/Right
that occurs when going past the end of a staff,
the code to wrap around to the next staff this case well.
In part this is because the implementation of barlines changed
since the code was written.
Barlines are per-staff now even when spanned,
so the use and management of prevTrack is no longer appropriate.
Resolves: https://musescore.org/en/node/301414.
During paste, if a note has a tie, that tie is remembered as a pending connector which is later added to the score when XmlReader::checkConnectors() is called. If a note is too long to fit in the measure, it is split up into a series of tied notes, but the pending tie needs to be adjusted to begin at the last tied note in the series, instead of at the original note.
Corrects first problem: Status doesn't display the pitch of note that have an
ottave line. This is solved in Note::tpcUserName().
Solves the second problem in issue 293593: Accidentals do apply if 8va sign is added.
This is solved in Note::updateAccidental(). All calculations are based on the
effective pitch of the a note rather than the actual pitch. The solution now
takes to ottava signs into account by using the actual pitch.
For easily find out wheather an ottava is applied, a new method ottavaCapoFret()
is added which returns the pitch offset by an ottava (or capo fret). To prevent
code dublication, ppitch() also use this new ottavaCapoFret() method.
Original code was using the height of the staff to calculate the hight of the
brackets. But for single line staff (percussion instruments!) there is only one
line, resulting in a height of zero, meaning a height of zero.
Now, for single line staves, the height of the barlines is taken. Since barlines
can span several staves in a system the calculation of the barline height has to
implemented in this code itself.
By setting the correct bbox and yOffset for the SysStaff object, this changes will
affect the layout of the system. Compared with version 3.4 all staves of a system
are on exactly the same position.
Resolves: https://musescore.org/en/node/301174.
When restoring a range selection that ends on the last tick of a measure, make sure that it is not extended to the first tick of the next measure.
The staff index did not count `staffMove()` in, which resulted in possibly getting the wrong clef for `line2pitch()`. This commit uses `chord->vStaffIdx()` to get the right staff index.
but continue to use it directly in excerpt.h (but before the 'internal'
headers) and use it directly in xm.h and changeMap.h too, which so far
don't seem to include them directly nor indirectly
Spanner segments need to have `_offset2` scaled too, so I created `SpannerSegment::spatiumChanged()`. For text lines, neither `_offset` nor `_offset2` is scaled, so I called `LineSegment::spatiumChanged()` (which is inherited from `SpannerSegment::spatiumChanged()`) in `TextLineBaseSegment::spatiumChanged()`.
Resolves: https://musescore.org/en/node/300926.
This allows a full measure rest to be changed into a "normal" rest even if the actual length of the rest is not being changed.
PR5321 solved [#110386]. However, there were still some beaming shortcuts missing and it
was suggested by Jojo-Schmitz to implement there too. Due a misunderstanding from me this
wasn't done by then.
This PR implements these suggestions and makes the shortcuts for beaming complete.
This happened because the acceptDrop check wasn't checking that the
editData it had for the text element was TextEditData. So, if the text
had been moved before, then it would have ElementEditData, and
acceptDrop would incorrectly return true.
This fixes the problem by adding a type() method to ElementEditData and
its derived classes so a proper check can be carried out in acceptDrop.
Methods StaffType::doty1() and StaffType::doty2() return the y coordinates for the dots
but these where more or less fixed number in a switch which was limited to 6 staff lines.
In both methods the switch is now replaced by an simple formula which has in fact no
limitations.
Was partial fixed in Score::makeGap() by defining a filter for deleteAnnotationsFromRange()
and deleteSpannersFromRange(). However, a simiar filter was missing in Score::makeGap1().
Creating thumbnails on autosave was already disabled in
4cd48850a3
but only for the first score autosave. Subsequent autosaves still
generated thumbnails. This commit makes all autosaves not create
thumbnails.
When calculating the length of the beams the width of the stems was neglected.
To support this calculation, a new method lineWidthMag() is the class Stem was
created, returning the scaled width of the stem.
Measure rest was drawn on fix y coordinate. Now the y coordinate is calculated
taking the staff height into account so it is always vertically centered.
Also the size of the symbol is sized depending on the staff line distance.
Resolves: https://musescore.org/en/node/287998
Resolves: https://musescore.org/en/node/102676
When a measure contains a line or page break **and** the next measure contains a key/time
signature or clef change, a courtesy element is drawn at the end of the measure.
However, if all measures **after** the line or page break are deleted, these courtesy
elements are not removed because Measure::addSystemTrailer(Measure*) is never called
in Score::collectSystem(LayoutContext&) since there is no next measure. As a result
these courtesy elements are not disabled by Measure::addSystemTrailer(Measure*).
The solution is to call Measure::addSystemTrailer(Measure*) even when nm equals 0 and
Measure::addSystemTrailer(Measure*) will disable all courtesy elements in case nm equals 0.
- move most of the logic to velo.cpp and VeloList
- allow dynamic playback of tremolos
- get velocity directly in note collection code
- allow use of poly aftertouch in the future
Adds special handling for errors raised with
QXmlStreamError::raiseError() which could be used to detect data
not related to XML format but to MSCX-specific errors.
see discussion in https://musescore.org/en/node/277609.
Solves for example the playback of bagpipe embellishments (which are to
be played as acciaccaturas , but not written as such)
Resolves: https://musescore.org/en/node/278169
The code to read an Image tag attached to a note was present in read206.cpp
but the analogous code for a rest was missing. The same has been added.
Resolves: https://musescore.org/en/node/298959.
Note: In the following paragraphs, I use the word "microtonal" to refer to all accidentals for which Accidental::isMicrotonal() currently returns true. That is, all proper microtonal accidentals as well as NATURAL_FLAT, NATURAL_SHARP, and SHARP_SHARP.
When force adding or force removing an accidental, Score::changeAccidental() will remove a note's existing accidental (if any) from the score. When not force adding or force removing an accidental, the note's pitch is changed, but the accidental is left alone until Note::updateAccidental() is called. But Note::updateAccidental() does not touch microtonal accidentals, so any existing microtonal accidentals must be removed in Score::changeAccidental().
Also, when changing from a microtonal accidental to a non-microtonal accidental that results in the same change to the pitch of the note, the new accidental's role is currently set to USER every time, when in fact this should only be done if it truly is a courtesy accidental. So when determining whether or not the accidental is being force added, when we are comparing the new pitch to the old pitch, we should also look at whether the old accidental was microtonal or not, to make sure that the accidental's role is not being set incorrectly.
`staff()->genKeySig()` always checks for `Fraction(0, 1)` while `staff()->staffType(tick())->genKeysig()` checks for the property at the exact tick.
The patch also fixes the `StaffType` generation of tablature staves, making `genKeysig` default (and always) to false.
* Found via `codespell -q 3 -S ./share/locale,./thirdparty -L ba,cann,clas,dur,foto,iff,nd,ois,ot,pres,possibile,snaped,strack,tage,te,uint,thru,valu`
* Some revisions made per feedback given during review.
* Follow-up typos for review
* Add revisions per feedback
Complements the fix in c136532975 to
take "play" property of articulations into account in MIDI rendering.
Also fix a test for this to be actually executed and to cover the
case of single-note dynamics MIDI rendering.
Move updateGrips() and other view state-related calls after an
score()->endCmd() call so grips are always updated with actual
layout state.
Also reset BarLineEditData parameters in BarLine::endEditDrag()
Resolves: https://musescore.org/en/node/298564
We currently write the offsets for slur grips
scaled according to the staff, but we read them
scaled according to the score. That's because
on read, the slur hasn't been added yet, so the track is not set.
I fixed the exact same issue for other lines in
812a2811b9
but slurs have their own own read/write and I neglected
to make the corresponding change for them.
This fixes the issue by explicitly scaling according to score.
Note there are other reasons why this makes sense,
see other comments in https://github.com/musescore/MuseScore/pull/4827
for more information on the scaling of offsets and other properties.
We have code to replaced existing chord symbols in the destination
when copying and pasting.
Unfortunately, if there are multiple chord symbols to paste on a tick,
that same code causes each chord symbol to replace the one just pasted.
End result is only the last chord symbol is preserved.
This change uses a container pastedHarmony to track the chords symbols
as we paste them, so we can check and not delete them later.
The following warnings are covered:
this statement may fall through [-Wimplicit-fallthrough=]
type qualifiers ignored on cast result type [-Wignored-qualifiers]
Resolves: https://musescore.org/en/node/298471
Strings in fret diagrams with no X or O have no marker,
but in some Linux systems, we are rendering a "?" character,
as we are actuall trying to draw a null character in FreeSans,
and that is the result depending on the specific version
of the font, rendering libraries, etc.
Fix is simplky to skip the draw if the market is null.
This is the approach used in the Inspector,
and is also what was done prior to the big fret diagram refactor,
Resolves: https://musescore.org/en/node/298273
System dividers were not being displayed in certain cases:
if a fixed spacer is used, or in single page view.
In addition, dividers were displaying that shouldn't be
if layout changes and a system that was formerly not last on page
suddenly becomes last on page,
This is due to a series of errors in layoutPage()
where the dividers are managed.
This fix involves a number of aspects:
1) checkDivider now takes an extra boolean parameter to force deletion
2) we always call checkDivider with that parameter set to true
for the last system of a page
3) in the case where we don't stretch system distance
(the clause checking sList, noVerticalStretch, or System layout mode),
don't just remove dividers, but do the normal checkDivider call,
which adds or removes dividers as appropriate
4) in the calls to checkDivider at the end of the function
(which handle the normal case of non-final systems on the page),
dion't skip the checkDivider calls if a system hasFixedDownDistance.
I believe that check was added because it is appropriate in other places
that also check vBox, so it may have looked like this code should match.
But it shouldn't, there is no reason to skip dividers in this case.
Only the stretch calculations should be skipped.
When the element is being dragged, it is selected, but if it's deleted, then the selection changes. This causes `this` in `endDrag()` to change to the parent element, but since the `EditData` parameter (`ed`) is still that of the deleted element, `ed.getData(this)` returns a `nullptr` which directly leads to a crash.
Resolves: https://musescore.org/en/node/298121.
In addition to making the "Add Interval" commands apply the highlighted accidental when in note input mode, I have corrected a few cases where I had chosen the wrong tpc to use to calculate the AccidentalType for a user accidental, given the current value of styleB(Sid::concertPitch).
- Don't pass staff number to adjustCanvasPosition if trying to
adjust viewport to a frame. This avoids a crash itself.
- Implement a more robust approach to determine a measure relevant
to the current edit operation in CmdState. This avoids trying to
unnecessarily jump to the frame at the end of a score.
In a corrupted score tick values may sometimes be not synchronized
between master score and parts. This may lead to incorrect setting
of layoutAll flag as ticks from different scores are compared.
Ensuring that only master score ticks are compared fixes layoutAll
flag for scores corrupted that way and prevents a crash due to not
making a full layout on score loading. This change makes no
difference for correctly saved scores.
Resolves: https://musescore.org/en/node/297957.
When searching for a note to complete a tie, what matters is not so much that the note doesn't already have a tieBack(), but rather that the two notes have the same unisonIndex().
This commit fixes the "Same duration" field's bug by adding an additional field - same note length. The original field matches note's `actualDurationType` and the new one matches the `actualTicks` value
Resolves: https://musescore.org/en/node/297477.
4/4 and alla breve have different `_sig` value, so `setSig()` is called, but if it's called after `_timeSigType` is changed, `setSig()` will make the type `NORMAL` again, because if it's called by `setProperty()`, there isn't a `TimeSigType` parameter available (making it available will cause further issues), so `setSig()` uses the default `NORMAL` as the type, thus the new type is overwritten.
If `setSig()` is called before `_timeSigType` is changed, all will be fine.
when handling paste, a switch statement is used on dropElement.type() (result is of type ElementType). Before this commit, there was no case for ElementType::STICKING, and paste wouldn't work (default behavior).
Now "Tie" button:
- is highlighted when all selected notes have ties;
- if any ties can be added, adds ties;
- if no ties can be added, removes existing ties.
1) Fix incorrect track2 assignment to spanners on pasting in some
situations due to not handling the case of track2 == -1.
2) Fix staff index checks in ScoreView code to avoid a crash if
incorrect staff index gets recorded to CmdState.
3) Add an assertion to catch invalid negative staff indices recorded
to CmdState.
1) Pasting symbol lists (lyrics, dynamics, chord symbols etc.) to
tuplets work correctly so we don't need to impose any restrictions
here.
2) Pasting a staff range to the first chord/rest of a tuplet correctly
replaces the tuplet with the clipboard content. We need to restrict
pasting a range only if trying to paste to the middle of a tuplet.
Previosly, these functions returned the SysStaff itself,
but there is no way to get the numeric index from that.
The functions now return the numeric index,
and their callers are adjusted to derived the SysStaff from that
(if necessary, in one case the index was the goal all along).
Resolves: https://musescore.org/en/node/281253
A staff spacer on the bottom system of a page does not work correctly:
we are looking foir a spacer on the *first* staff rather than the *last*.
So a spacer on the last staff is ignored, and one on the first is used
when it shouldn't be.
The code to calculate the amount of spacer required below the last
system of a page relies on System::lastVisibleSysStaff(),
which is return the correct SysStaff, but we are then attempting
to access the idx member, which has never been set up and is always 0.
Fix is to initialize idx when setting up the list of staves.
which seems to not belong to any segment, so dereferences a NULL pointer
leading to a segment violation (pun intended).
The fix simply ignores this, and this avoids the crash, but also looses
the 'visible' property of that clef for some yet unknown but unrelated reason.