Skip to content

Commit fb3c202

Browse files
MarcSabatellavpereverzev
authored andcommitted
fix #307005: chord playback default not consistent
Resolves: https://musescore.org/en/node/307005 Currently chord symbols playback is off by default controlled by a global program preference. This means a given user has to learn the feature exists before using it, which is not how we handle playback of dynamics, ornaments, etc. And worse, it means a user might turn it on, hear the chord playback, save and share a score that relies on it, but the people he sahres it with (including musescore.com) will not hear the chords unless they happen to have enabled the option. And musescore.com won't play it no matter what (or else, it will always play chords symbols for everyone, which isn't good either). This commit removes the preference and enables chord sytmbol playback according to the style setting and property on the chord symbol itself, which is exactly how it is done for ornaments etc. The style setting and property already existed, they were just being overridden by the program preference.
1 parent 979001e commit fb3c202

File tree

7 files changed

+3
-28
lines changed

7 files changed

+3
-28
lines changed

global/settings/types/preferencekeys.h

-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@
103103
#define PREF_IO_PORTMIDI_OUTPUTLATENCYMILLISECONDS "io/portMidi/outputLatencyMilliseconds"
104104
#define PREF_IO_PULSEAUDIO_USEPULSEAUDIO "io/pulseAudio/usePulseAudio"
105105
#define PREF_SCORE_CHORD_PLAYONADDNOTE "score/chord/playOnAddNote"
106-
#define PREF_SCORE_HARMONY_PLAY "score/harmony/play"
107106
#define PREF_SCORE_HARMONY_PLAY_ONEDIT "score/harmony/play/onedit"
108107
#define PREF_SCORE_NOTE_PLAYONCLICK "score/note/playOnClick"
109108
#define PREF_SCORE_NOTE_DEFAULTPLAYDURATION "score/note/defaultPlayDuration"

libmscore/rendermidi.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -2162,7 +2162,7 @@ void Score::renderMidi(EventMap* events, bool metronome, bool expandRepeats, con
21622162
masterScore()->setExpandRepeats(expandRepeats);
21632163
MidiRenderer::Context ctx(synthState);
21642164
ctx.metronome = metronome;
2165-
ctx.renderHarmony = preferences.getBool(PREF_SCORE_HARMONY_PLAY);
2165+
ctx.renderHarmony = true;
21662166
MidiRenderer(this).renderScore(events, ctx);
21672167
}
21682168

mscore/musescore.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -4761,7 +4761,6 @@ void MuseScore::play(Element* e) const
47614761
seq->startNoteTimer(MScore::defaultPlayDuration);
47624762
}
47634763
else if (e->isHarmony()
4764-
&& preferences.getBool(PREF_SCORE_HARMONY_PLAY)
47654764
&& preferences.getBool(PREF_SCORE_HARMONY_PLAY_ONEDIT)) {
47664765
seq->stopNotes();
47674766
Harmony* h = toHarmony(e);

mscore/preferences.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@ void Preferences::init(bool storeInMemoryOnly)
177177
{PREF_IO_PORTMIDI_OUTPUTLATENCYMILLISECONDS, new IntPreference(0)},
178178
{PREF_IO_PULSEAUDIO_USEPULSEAUDIO, new BoolPreference(defaultUsePulseAudio, false)},
179179
{PREF_SCORE_CHORD_PLAYONADDNOTE, new BoolPreference(true, false)},
180-
{PREF_SCORE_HARMONY_PLAY, new BoolPreference(false, false)},
181180
{PREF_SCORE_HARMONY_PLAY_ONEDIT, new BoolPreference(true, false)},
182181
{PREF_SCORE_NOTE_PLAYONCLICK, new BoolPreference(true, false)},
183182
{PREF_SCORE_NOTE_DEFAULTPLAYDURATION, new IntPreference(300 /* ms */, false)},

mscore/prefsdialog.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,6 @@ void PreferenceDialog::start()
306306
new IntPreferenceItem(PREF_IO_OSC_PORTNUMBER, oscPort),
307307
new BoolPreferenceItem(PREF_IO_OSC_USEREMOTECONTROL, oscServer),
308308
new BoolPreferenceItem(PREF_SCORE_CHORD_PLAYONADDNOTE, playChordOnAddNote),
309-
new BoolPreferenceItem(PREF_SCORE_HARMONY_PLAY, playHarmony),
310309
new BoolPreferenceItem(PREF_SCORE_HARMONY_PLAY_ONEDIT, playHarmonyOnEdit),
311310
new IntPreferenceItem(PREF_SCORE_NOTE_DEFAULTPLAYDURATION, defaultPlayDuration),
312311
new BoolPreferenceItem(PREF_SCORE_NOTE_PLAYONCLICK, playNotes),

mscore/prefsdialog.ui

+1-22
Original file line numberDiff line numberDiff line change
@@ -1474,28 +1474,7 @@
14741474
</property>
14751475
</widget>
14761476
</item>
1477-
</layout>
1478-
</widget>
1479-
</item>
1480-
<item>
1481-
<widget class="QGroupBox" name="playHarmony">
1482-
<property name="enabled">
1483-
<bool>true</bool>
1484-
</property>
1485-
<property name="mouseTracking">
1486-
<bool>true</bool>
1487-
</property>
1488-
<property name="title">
1489-
<string>Play Chord Symbols</string>
1490-
</property>
1491-
<property name="checkable">
1492-
<bool>true</bool>
1493-
</property>
1494-
<property name="checked">
1495-
<bool>false</bool>
1496-
</property>
1497-
<layout class="QGridLayout" name="gridLayout_41">
1498-
<item row="0" column="0">
1477+
<item row="2" column="0">
14991478
<widget class="QCheckBox" name="playHarmonyOnEdit">
15001479
<property name="text">
15011480
<string>Play chord symbol when editing</string>

mscore/seq.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1043,7 +1043,7 @@ void Seq::renderChunk(const MidiRenderer::Chunk& ch, EventMap* eventMap)
10431043
SynthesizerState synState = mscore->synthesizerState();
10441044
MidiRenderer::Context ctx(synState);
10451045
ctx.metronome = true;
1046-
ctx.renderHarmony = preferences.getBool(PREF_SCORE_HARMONY_PLAY);
1046+
ctx.renderHarmony = true;
10471047
midi.renderChunk(ch, eventMap, ctx);
10481048
renderEventsStatus.setOccupied(ch.utick1(), ch.utick2());
10491049
}

0 commit comments

Comments
 (0)