Add support of some Cakewalk aliases
This commit is contained in:
parent
35fc1f0105
commit
d18da2060c
4 changed files with 793 additions and 600 deletions
File diff suppressed because it is too large
Load diff
|
|
@ -76,6 +76,7 @@ end_region_oncc:
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
|
|
||||||
if (scope == kOpcodeScopeRegion) {
|
if (scope == kOpcodeScopeRegion) {
|
||||||
|
again_region:
|
||||||
|
|
||||||
YYCURSOR = opcode.c_str();
|
YYCURSOR = opcode.c_str();
|
||||||
|
|
||||||
|
|
@ -137,6 +138,11 @@ end_region_oncc:
|
||||||
goto end_region;
|
goto end_region;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
"gain_random" END {
|
||||||
|
opcode = "amp_random";
|
||||||
|
goto end_region;
|
||||||
|
}
|
||||||
|
|
||||||
"gain" ("_" any)? END {
|
"gain" ("_" any)? END {
|
||||||
opcode = absl::StrCat("volume", group(1));
|
opcode = absl::StrCat("volume", group(1));
|
||||||
goto end_region;
|
goto end_region;
|
||||||
|
|
@ -155,6 +161,11 @@ end_region_oncc:
|
||||||
goto end_region;
|
goto end_region;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
"cutoff" (number)? "_random" END {
|
||||||
|
opcode = absl::StrCat("fil", group(1), "_random");
|
||||||
|
goto again_region;
|
||||||
|
}
|
||||||
|
|
||||||
"fil_" (any) END {
|
"fil_" (any) END {
|
||||||
opcode = absl::StrCat("fil1_", group(1));
|
opcode = absl::StrCat("fil1_", group(1));
|
||||||
goto end_region;
|
goto end_region;
|
||||||
|
|
|
||||||
|
|
@ -654,7 +654,7 @@ bool sfz::Region::parseOpcode(const Opcode& rawOpcode)
|
||||||
setValueFromOpcode(opcode, filters[filterIndex].veltrack, Default::filterVeltrackRange);
|
setValueFromOpcode(opcode, filters[filterIndex].veltrack, Default::filterVeltrackRange);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case hash("fil&_random"): // also fil_random
|
case hash("fil&_random"): // also fil_random, cutoff_random, cutoff&_random
|
||||||
{
|
{
|
||||||
const auto filterIndex = opcode.parameters.front() - 1;
|
const auto filterIndex = opcode.parameters.front() - 1;
|
||||||
if (!extendIfNecessary(filters, filterIndex + 1, Default::numFilters))
|
if (!extendIfNecessary(filters, filterIndex + 1, Default::numFilters))
|
||||||
|
|
|
||||||
|
|
@ -233,6 +233,11 @@ TEST_CASE("[Opcode] Normalization")
|
||||||
{"cutoff_foobar", "cutoff1_foobar"},
|
{"cutoff_foobar", "cutoff1_foobar"},
|
||||||
{"resonance", "resonance1"},
|
{"resonance", "resonance1"},
|
||||||
{"resonance_foobar", "resonance1_foobar"},
|
{"resonance_foobar", "resonance1_foobar"},
|
||||||
|
// Cakewalk aliases
|
||||||
|
{"cutoff_random", "fil1_random"},
|
||||||
|
{"cutoff1_random", "fil1_random"},
|
||||||
|
{"cutoff2_random", "fil2_random"},
|
||||||
|
{"gain_random", "amp_random"},
|
||||||
};
|
};
|
||||||
|
|
||||||
for (auto pair : regionSpecific) {
|
for (auto pair : regionSpecific) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue