Change numCC to uint16_t and increase the max number of ccs

This commit is contained in:
Paul Fd 2020-03-16 23:47:54 +01:00 committed by Paul Ferrand
parent bce6258827
commit f8801e78e4
4 changed files with 8 additions and 8 deletions

View file

@ -52,7 +52,7 @@ namespace config {
constexpr float A440 { 440.0 };
constexpr size_t powerHistoryLength { 16 };
constexpr float voiceStealingThreshold { 0.00001f };
constexpr uint8_t numCCs { 143 };
constexpr uint16_t numCCs { 512 };
constexpr int chunkSize { 1024 };
constexpr float defaultAmpEGRelease { 0.02f };
constexpr int filtersInPool { maxVoices * 2 };

View file

@ -69,7 +69,7 @@ namespace Default
// Region logic: MIDI conditions
constexpr Range<uint8_t> channelRange { 1, 16 };
constexpr Range<uint8_t> midiChannelRange { 0, 15 };
constexpr Range<uint8_t> ccNumberRange { 0, config::numCCs };
constexpr Range<uint16_t> ccNumberRange { 0, config::numCCs };
constexpr Range<uint8_t> ccValueRange { 0, 127 };
constexpr uint8_t cc { 0 };
constexpr Range<int> bendRange { -8192, 8192 };

View file

@ -104,7 +104,7 @@ void sfz::MidiState::reset(int delay) noexcept
void sfz::MidiState::resetAllControllers(int delay) noexcept
{
for (int idx = 0; idx < config::numCCs; idx++)
for (unsigned idx = 0; idx < config::numCCs; idx++)
cc[idx] = 0;
pitchBend = 0;

View file

@ -379,14 +379,14 @@ bool sfz::Synth::loadSfzFile(const fs::path& file)
noteActivationLists[note].push_back(region);
}
for (auto cc = 0; cc < config::numCCs; cc++) {
for (unsigned cc = 0; cc < config::numCCs; cc++) {
if (region->ccTriggers.contains(cc) || region->ccConditions.contains(cc))
ccActivationLists[cc].push_back(region);
}
// Defaults
for (int ccIndex = 0; ccIndex < config::numCCs; ccIndex++) {
region->registerCC(ccIndex, resources.midiState.getCCValue(ccIndex));
for (unsigned cc = 0; cc < config::numCCs; cc++) {
region->registerCC(cc, resources.midiState.getCCValue(cc));
}
if (defaultSwitch) {
@ -953,12 +953,12 @@ void sfz::Synth::resetAllControllers(int delay) noexcept
resources.midiState.resetAllControllers(delay);
for (auto& voice: voices) {
voice->registerPitchWheel(delay, 0);
for (int cc = 0; cc < config::numCCs; ++cc)
for (unsigned cc = 0; cc < config::numCCs; ++cc)
voice->registerCC(delay, cc, 0);
}
for (auto& region: regions) {
for (int cc = 0; cc < config::numCCs; ++cc)
for (unsigned cc = 0; cc < config::numCCs; ++cc)
region->registerCC(cc, 0);
}
}