Commit 80f1fe3
Honour an explicit dynamics="0" on MusicXML note import
The dynamics attribute of the <note> element expresses the note velocity
as a percentage of the MIDI 1.0 default forte value of 90. Positive
values were imported correctly, but an explicit dynamics="0" (a silent
note, e.g. a ghost note or an unpitched gesture with an x notehead) was
indistinguishable from an absent attribute and silently dropped, so the
note played at full default velocity.
Detect the attribute's presence instead of testing the computed value,
and clamp the velocity to [1, 127]: the score model reserves velocity 0
for "unset", so 1 is the lowest representable (effectively silent)
value, and the upper bound matches the clamping already applied to
direction-level <sound dynamics> values.
Resolves: #33803
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent d53a8ed commit 80f1fe3
3 files changed
Lines changed: 111 additions & 2 deletions
File tree
- src/importexport/musicxml
- internal/import
- tests
- data
Lines changed: 6 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6929 | 6929 | | |
6930 | 6930 | | |
6931 | 6931 | | |
6932 | | - | |
| 6932 | + | |
| 6933 | + | |
| 6934 | + | |
| 6935 | + | |
| 6936 | + | |
6933 | 6937 | | |
6934 | 6938 | | |
6935 | 6939 | | |
| |||
7260 | 7264 | | |
7261 | 7265 | | |
7262 | 7266 | | |
7263 | | - | |
| 7267 | + | |
7264 | 7268 | | |
7265 | 7269 | | |
7266 | 7270 | | |
| |||
Lines changed: 73 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
27 | 31 | | |
28 | 32 | | |
29 | 33 | | |
| |||
1024 | 1028 | | |
1025 | 1029 | | |
1026 | 1030 | | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
1027 | 1059 | | |
1028 | 1060 | | |
1029 | 1061 | | |
| |||
0 commit comments