fixed the "no sound" problem for the Auxiliary percussion instruments

This commit is contained in:
Roman Pudashkin 2022-05-13 15:44:12 +02:00 committed by pereverzev+v
parent 0107687e58
commit 0f34610367
8 changed files with 14 additions and 11 deletions

View file

@ -1412,7 +1412,7 @@ B. Tbn.</shortName>
<barLineSpan>1</barLineSpan>
</Staff>
<trackName>Percussion 1</trackName>
<Instrument id="drumset">
<Instrument id="percussion">
<longName>Percussion 1</longName>
<shortName>Perc. 1</shortName>
<trackName>Percussion</trackName>
@ -1632,7 +1632,7 @@ B. Tbn.</shortName>
<defaultClef>PERC</defaultClef>
</Staff>
<trackName>Percussion 2</trackName>
<Instrument id="drumset">
<Instrument id="percussion">
<longName>Percussion 2</longName>
<shortName>Perc. 2</shortName>
<trackName>Percussion</trackName>

View file

@ -1561,7 +1561,7 @@
<barLineSpan>1</barLineSpan>
</Staff>
<trackName>Auxiliary Percussion 1</trackName>
<Instrument id="drumset">
<Instrument id="percussion">
<longName>Auxiliary Percussion 1</longName>
<shortName>Aux. 1</shortName>
<trackName>Percussion</trackName>
@ -1779,7 +1779,7 @@
<defaultClef>PERC</defaultClef>
</Staff>
<trackName>Auxiliary Percussion 2</trackName>
<Instrument id="drumset">
<Instrument id="percussion">
<longName>Auxiliary Percussion 2</longName>
<shortName>Aux. 2</shortName>
<trackName>Percussion</trackName>

View file

@ -880,7 +880,7 @@
<defaultClef>PERC</defaultClef>
</Staff>
<trackName>Auxiliary Percussion</trackName>
<Instrument id="drumset">
<Instrument id="percussion">
<longName>Aux. Perc.</longName>
<shortName>Aux.</shortName>
<trackName>Percussion</trackName>

View file

@ -2365,7 +2365,7 @@ B. Tbn.</shortName>
<barLineSpan>1</barLineSpan>
</Staff>
<trackName>Percussion 1</trackName>
<Instrument id="drumset">
<Instrument id="percussion">
<longName>Percussion 1</longName>
<shortName>Perc. 1</shortName>
<trackName>Percussion</trackName>
@ -2585,7 +2585,7 @@ B. Tbn.</shortName>
<defaultClef>PERC</defaultClef>
</Staff>
<trackName>Percussion 2</trackName>
<Instrument id="drumset">
<Instrument id="percussion">
<longName>Percussion 2</longName>
<shortName>Perc. 2</shortName>
<trackName>Percussion</trackName>

View file

@ -181,7 +181,7 @@ const PlaybackSetupData& PercussionsSetupDataResolver::doResolve(const Ms::Instr
SoundSubCategory::Wind }, {} } },
{ "shell-wind-chimes", { SoundId::Chimes, SoundCategory::Percussions, { SoundSubCategory::Shell,
SoundSubCategory::Wind }, {} } },
{ "percussion", { SoundId::Drumset, SoundCategory::Percussions, {}, {} } },
{ "percussion", { SoundId::Drumset, SoundCategory::Percussions, { SoundSubCategory::Orchestral }, {} } },
{ "stones", { SoundId::Stones, SoundCategory::Percussions, {}, {} } },
{ "tambourine", { SoundId::Tambourine, SoundCategory::Percussions, {}, {} } },
{ "tubo", { SoundId::Tubo, SoundCategory::Percussions, {}, {} } },

View file

@ -553,6 +553,7 @@ static const auto& mappingByCategory(const mpe::SoundCategory category)
{ { mpe::SoundId::Cuica, {} }, { midi::Program(128, 0) } },
{ { mpe::SoundId::Drumset, {} }, { midi::Program(128, 0) } },
{ { mpe::SoundId::Drumset, { mpe::SoundSubCategory::Orchestral } }, { midi::Program(128, 48) } },
{ { mpe::SoundId::Drum, { mpe::SoundSubCategory::Bass } }, { midi::Program(128, 48) } },
{ { mpe::SoundId::Drum, { mpe::SoundSubCategory::Snare } }, { midi::Program(128, 48) } },

View file

@ -127,7 +127,7 @@ Ret ProjectMigrator::askAboutMigration(MigrationOptions& out, const QString& app
return true;
}
void ProjectMigrator::fixHarmonicaIds(Ms::MasterScore* score)
void ProjectMigrator::fixInstrumentIds(Ms::MasterScore* score)
{
for (Ms::Part* part : score->parts()) {
for (auto pair : part->instruments()) {
@ -147,6 +147,8 @@ void ProjectMigrator::fixHarmonicaIds(Ms::MasterScore* score)
id = "harmonica-d10a";
} else if (id == "harmonica-d12-g") {
id = "harmonica-d10g";
} else if (id == "drumset" && pair.second->trackName() == "Percussion") {
id = "percussion";
}
pair.second->setId(id);
}
@ -201,7 +203,7 @@ Ret ProjectMigrator::migrateProject(engraving::EngravingProjectPtr project, cons
ok = resetAllElementsPositions(score);
}
if (score->mscVersion() <= 302) {
fixHarmonicaIds(score);
fixInstrumentIds(score);
}
if (ok && score->mscVersion() != Ms::MSCVERSION) {
score->undo(new Ms::ChangeMetaText(score, "mscVersion", MSC_VERSION));

View file

@ -47,7 +47,7 @@ private:
bool applyLelandStyle(Ms::MasterScore* score);
bool applyEdwinStyle(Ms::MasterScore* score);
bool resetAllElementsPositions(Ms::MasterScore* score);
void fixHarmonicaIds(Ms::MasterScore* score);
void fixInstrumentIds(Ms::MasterScore* score);
void resetStyleSettings(Ms::MasterScore* score);
bool m_resetStyleSettings{ false };