* Added floating-point vorbis BPM tags to files in lmms/data/samples/beats * Added rounded BPM to filenames, surrounded by square brackets and separated from the rest of the filename by an underscore
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -127,7 +127,8 @@ private:
|
||||
void upgrade_mixerRename();
|
||||
void upgrade_bbTcoRename();
|
||||
void upgrade_sampleAndHold();
|
||||
void upgrade_midiCCIndexing();
|
||||
void upgrade_midiCCIndexing();
|
||||
void upgrade_loopsRename();
|
||||
|
||||
// List of all upgrade methods
|
||||
static const std::vector<UpgradeMethod> UPGRADE_METHODS;
|
||||
|
||||
@@ -80,7 +80,8 @@ const std::vector<DataFile::UpgradeMethod> DataFile::UPGRADE_METHODS = {
|
||||
&DataFile::upgrade_automationNodes , &DataFile::upgrade_extendedNoteRange,
|
||||
&DataFile::upgrade_defaultTripleOscillatorHQ,
|
||||
&DataFile::upgrade_mixerRename , &DataFile::upgrade_bbTcoRename,
|
||||
&DataFile::upgrade_sampleAndHold , &DataFile::upgrade_midiCCIndexing
|
||||
&DataFile::upgrade_sampleAndHold , &DataFile::upgrade_midiCCIndexing,
|
||||
&DataFile::upgrade_loopsRename
|
||||
};
|
||||
|
||||
// Vector of all versions that have upgrade routines.
|
||||
@@ -1807,7 +1808,76 @@ void DataFile::upgrade_sampleAndHold()
|
||||
// Correct old random wave LFO speeds
|
||||
if (e.attribute("wave").toInt() == 6)
|
||||
{
|
||||
e.setAttribute("speed",0.01f);
|
||||
e.setAttribute("speed", 0.01f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Change loops' filenames in <sampleclip>s
|
||||
void DataFile::upgrade_loopsRename()
|
||||
{
|
||||
static constexpr auto loopBPMs = std::array{
|
||||
std::pair{"bassloops/briff01", "140"},
|
||||
std::pair{"bassloops/rave_bass01", "180"},
|
||||
std::pair{"bassloops/rave_bass02", "180"},
|
||||
std::pair{"bassloops/tb303_01", "123"},
|
||||
std::pair{"bassloops/techno_bass01", "140"},
|
||||
std::pair{"bassloops/techno_bass02", "140"},
|
||||
std::pair{"bassloops/techno_synth01", "140"},
|
||||
std::pair{"bassloops/techno_synth02", "140"},
|
||||
std::pair{"bassloops/techno_synth03", "130"},
|
||||
std::pair{"bassloops/techno_synth04", "140"},
|
||||
std::pair{"beats/909beat01", "122"},
|
||||
std::pair{"beats/break01", "168"},
|
||||
std::pair{"beats/break02", "141"},
|
||||
std::pair{"beats/break03", "168"},
|
||||
std::pair{"beats/electro_beat01", "120"},
|
||||
std::pair{"beats/electro_beat02", "119"},
|
||||
std::pair{"beats/house_loop01", "142"},
|
||||
std::pair{"beats/jungle01", "168"},
|
||||
std::pair{"beats/rave_hihat01", "180"},
|
||||
std::pair{"beats/rave_hihat02", "180"},
|
||||
std::pair{"beats/rave_kick01", "180"},
|
||||
std::pair{"beats/rave_kick02", "180"},
|
||||
std::pair{"beats/rave_snare01", "180"},
|
||||
std::pair{"latin/latin_brass01", "140"},
|
||||
std::pair{"latin/latin_guitar01", "126"},
|
||||
std::pair{"latin/latin_guitar02", "140"},
|
||||
std::pair{"latin/latin_guitar03", "120"},
|
||||
};
|
||||
|
||||
const QString prefix = "factorysample:",
|
||||
extension = ".ogg";
|
||||
|
||||
// Replace loop sample names
|
||||
for (const auto& [elem, srcAttrs] : ELEMENTS_WITH_RESOURCES)
|
||||
{
|
||||
auto elements = elementsByTagName(elem);
|
||||
|
||||
for (const auto& srcAttr : srcAttrs)
|
||||
{
|
||||
for (int i = 0; i < elements.length(); ++i)
|
||||
{
|
||||
auto item = elements.item(i).toElement();
|
||||
|
||||
if (item.isNull() || !item.hasAttribute(srcAttr)) { continue; }
|
||||
for (const auto& cur : loopBPMs)
|
||||
{
|
||||
QString x = cur.first, // loop name
|
||||
y = cur.second, // BPM
|
||||
srcVal = item.attribute(srcAttr),
|
||||
pattern = prefix + x + extension;
|
||||
|
||||
if (srcVal == pattern)
|
||||
{
|
||||
// Add " - X BPM" to filename
|
||||
item.setAttribute(srcAttr,
|
||||
prefix + x + " - " + y + " BPM" +
|
||||
extension);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1984,5 +2054,4 @@ unsigned int DataFile::legacyFileVersion()
|
||||
return std::distance( UPGRADE_VERSIONS.begin(), firstRequiredUpgrade );
|
||||
}
|
||||
|
||||
|
||||
} // namespace lmms
|
||||
|
||||
Reference in New Issue
Block a user