Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase pitch ranges by 2 octaves #474

Merged
merged 1 commit into from
Oct 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions src/sfizz/Defaults.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ namespace Default
constexpr Range<int> oscillatorModeRange { 0, 2 };
constexpr Range<int> oscillatorMultiRange { 1, config::oscillatorsPerVoice };
constexpr float oscillatorDetune { 0 };
constexpr Range<float> oscillatorDetuneRange { -9600, 9600 };
constexpr Range<float> oscillatorDetuneCCRange { -9600, 9600 };
constexpr Range<float> oscillatorDetuneRange { -12000, 12000 };
constexpr Range<float> oscillatorDetuneCCRange { -12000, 12000 };
constexpr float oscillatorModDepth { 0 };
constexpr Range<float> oscillatorModDepthRange { 0, 10000 }; // depth%, allowed to be >100 for FM
constexpr Range<float> oscillatorModDepthCCRange { 0, 10000 };
Expand Down Expand Up @@ -166,12 +166,12 @@ namespace Default
constexpr float filterResonanceCC { 0 };
constexpr float filterGainCC { 0 };
constexpr Range<float> filterCutoffRange { 0.0f, 20000.0f };
constexpr Range<float> filterCutoffModRange { -9600, 9600 };
constexpr Range<float> filterCutoffModRange { -12000, 12000 };
constexpr Range<float> filterGainRange { -96.0f, 96.0f };
constexpr Range<float> filterGainModRange { -96.0f, 96.0f };
constexpr Range<int> filterKeytrackRange { 0, 1200 };
constexpr Range<float> filterRandomRange { 0, 9600 };
constexpr Range<int> filterVeltrackRange { -9600, 9600 };
constexpr Range<float> filterRandomRange { 0, 12000 };
constexpr Range<int> filterVeltrackRange { -12000, 12000 };
constexpr Range<float> filterResonanceRange { 0.0f, 96.0f };
constexpr Range<float> filterResonanceModRange { 0.0f, 96.0f };

Expand Down Expand Up @@ -200,15 +200,15 @@ namespace Default
constexpr int pitchKeytrack { 100 };
constexpr Range<int> pitchKeytrackRange { -1200, 1200 };
constexpr float pitchRandom { 0 };
constexpr Range<float> pitchRandomRange { 0, 9600 };
constexpr Range<float> pitchRandomRange { 0, 12000 };
constexpr int pitchVeltrack { 0 };
constexpr Range<int> pitchVeltrackRange { -9600, 9600 };
constexpr Range<int> pitchVeltrackRange { -12000, 12000 };
constexpr int transpose { 0 };
constexpr Range<int> transposeRange { -127, 127 };
constexpr int tune { 0 };
constexpr Range<int> tuneRange { -9600, 9600 }; // ±100 in SFZv1, more in ARIA
constexpr Range<float> tuneCCRange { -9600, 9600 };
constexpr Range<int> bendBoundRange { -9600, 9600 };
constexpr Range<int> tuneRange { -12000, 12000 }; // ±100 in SFZv1, more in ARIA
constexpr Range<float> tuneCCRange { -12000, 12000 };
constexpr Range<int> bendBoundRange { -12000, 12000 };
constexpr Range<int> bendStepRange { 1, 1200 };
constexpr int bendUp { 200 }; // No range here because the bounds can be inverted
constexpr int bendDown { -200 };
Expand Down
38 changes: 19 additions & 19 deletions tests/RegionT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -960,8 +960,8 @@ TEST_CASE("[Region] Parsing opcodes")
REQUIRE(region.pitchRandom == 40);
region.parseOpcode({ "pitch_random", "-1" });
REQUIRE(region.pitchRandom == 0);
region.parseOpcode({ "pitch_random", "10320" });
REQUIRE(region.pitchRandom == 9600);
region.parseOpcode({ "pitch_random", "12320" });
REQUIRE(region.pitchRandom == 12000);
}

SECTION("pitch_veltrack")
Expand All @@ -972,9 +972,9 @@ TEST_CASE("[Region] Parsing opcodes")
region.parseOpcode({ "pitch_veltrack", "-1" });
REQUIRE(region.pitchVeltrack == -1);
region.parseOpcode({ "pitch_veltrack", "13020" });
REQUIRE(region.pitchVeltrack == 9600);
REQUIRE(region.pitchVeltrack == 12000);
region.parseOpcode({ "pitch_veltrack", "-13020" });
REQUIRE(region.pitchVeltrack == -9600);
REQUIRE(region.pitchVeltrack == -12000);
}

SECTION("transpose")
Expand All @@ -998,9 +998,9 @@ TEST_CASE("[Region] Parsing opcodes")
region.parseOpcode({ "tune", "-1" });
REQUIRE(region.tune == -1);
region.parseOpcode({ "tune", "15432" });
REQUIRE(region.tune == 9600);
REQUIRE(region.tune == 12000);
region.parseOpcode({ "tune", "-15432" });
REQUIRE(region.tune == -9600);
REQUIRE(region.tune == -12000);
}

SECTION("bend_up, bend_down, bend_step, bend_smooth")
Expand All @@ -1012,18 +1012,18 @@ TEST_CASE("[Region] Parsing opcodes")
REQUIRE(region.bendUp == 400);
region.parseOpcode({ "bend_up", "-200" });
REQUIRE(region.bendUp == -200);
region.parseOpcode({ "bend_up", "9700" });
REQUIRE(region.bendUp == 9600);
region.parseOpcode({ "bend_up", "-9700" });
REQUIRE(region.bendUp == -9600);
region.parseOpcode({ "bend_up", "12700" });
REQUIRE(region.bendUp == 12000);
region.parseOpcode({ "bend_up", "-12700" });
REQUIRE(region.bendUp == -12000);
region.parseOpcode({ "bend_down", "400" });
REQUIRE(region.bendDown == 400);
region.parseOpcode({ "bend_down", "-200" });
REQUIRE(region.bendDown == -200);
region.parseOpcode({ "bend_down", "9700" });
REQUIRE(region.bendDown == 9600);
region.parseOpcode({ "bend_down", "-9700" });
REQUIRE(region.bendDown == -9600);
region.parseOpcode({ "bend_down", "12700" });
REQUIRE(region.bendDown == 12000);
region.parseOpcode({ "bend_down", "-12700" });
REQUIRE(region.bendDown == -12000);
region.parseOpcode({ "bend_step", "400" });
REQUIRE(region.bendStep == 400);
region.parseOpcode({ "bend_step", "-200" });
Expand Down Expand Up @@ -1389,10 +1389,10 @@ TEST_CASE("[Region] Parsing opcodes")
REQUIRE(region.filters[0].veltrack == 50);
region.parseOpcode({ "fil_veltrack", "-5" });
REQUIRE(region.filters[0].veltrack == -5);
region.parseOpcode({ "fil_veltrack", "10000" });
REQUIRE(region.filters[0].veltrack == 9600);
region.parseOpcode({ "fil_veltrack", "-10000" });
REQUIRE(region.filters[0].veltrack == -9600);
region.parseOpcode({ "fil_veltrack", "13000" });
REQUIRE(region.filters[0].veltrack == 12000);
region.parseOpcode({ "fil_veltrack", "-13000" });
REQUIRE(region.filters[0].veltrack == -12000);

REQUIRE(region.filters[0].keycenter == 60);
region.parseOpcode({ "fil_keycenter", "50" });
Expand Down Expand Up @@ -1729,7 +1729,7 @@ TEST_CASE("[Region] Parsing opcodes")
region.parseOpcode({ "tune_stepcc120", "24" });
REQUIRE(view.at(120).step == 24.0f);
region.parseOpcode({ "pitch_stepcc120", "15482" });
REQUIRE(view.at(120).step == 9600.0f);
REQUIRE(view.at(120).step == 12000.0f);
region.parseOpcode({ "tune_stepcc120", "-2" });
REQUIRE(view.at(120).step == 0.0f);
}
Expand Down