ExpressionContext equality ignores the other velocity override

Open
#381 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@0xMashiro is already working on this.

Since Oct 24, 2026.

  • #382 by @0xMashiro — open

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
45/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
cpp
Domain
backend

Research direction

The defect is in ExpressionContext::operator== in mpe/events.h, where velocityOverride is compared with itself instead of the other context's member. Read that operator, confirm the self-comparison, and add cases covering present/absent overrides in both operand orders to the native muse_mpe_test target. However, a linked pull request (#382) already proposes the fix, so a newcomer should coordinate there or pick a different issue rather than duplicate the work.

Written by the indexing model from the issue text.

Description

On muse_framework main at 3e0eae57a9aa3dedb0a1e1d05d3ebf0cbc1b5e36, ExpressionContext::operator== compares velocityOverride with itself instead of the other context's override.

Minimal native reproduction (mpe/events.h):

muse::mpe::ExpressionContext first;
muse::mpe::ExpressionContext second;
first.velocityOverride = 0.5f;
second.velocityOverride = 0.75f;
EXPECT_FALSE(first == second); // Fails: returns true.

Expected: otherwise identical contexts with different override values compare unequal. A present override and an absent override should also compare unequal, in both operand orders. Equal values and two absent overrides should compare equal.

A regression added to the native muse_mpe_test target fails on the unmodified production header (four failed assertions) and passes after replacing the right operand with other.velocityOverride. The full MPE suite then passes (16 tests, zero failures). Tested on Linux with GCC 14 and Qt 6.10.2.

This report establishes an equality defect only; it does not claim a reproduced audible playback problem.

The self-comparison was introduced in 4beac5fc68c6d2490e2f9eba41eb656726d123cd. Searches for ExpressionContext, velocityOverride, and velocity/equality in the framework and Studio trackers found no matching equality fix. Related framework PR #221 concerns forwarding overrides to MuseSampler, a separate operation.

AI assistance: OpenAI Codex assisted with investigation, the patch, regression tests, and this report.

Dominant language
C++
Stars
15
Forks
80
Avg merge
1d 13h
Merged PRs (30d)
58

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from musescore/muse_framework

All issues in musescore/muse_framework

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.