Skip to content

Commit

Permalink
Add basic tests for Kyma
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiashienzsch committed Feb 20, 2024
1 parent 8f49963 commit 64fe8ff
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/grit/eurorack.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
/// \defgroup grit-eurorack Eurorack

#include <grit/eurorack/ares.hpp>
#include <grit/eurorack/kyma.hpp>
#include <grit/eurorack/poseidon.hpp>
32 changes: 32 additions & 0 deletions lib/grit/eurorack_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,38 @@ TEST_CASE("eurorack: Ares")
}
}

TEST_CASE("eurorack: Kyma")
{
static constexpr auto blockSize = 32;

auto const sampleRate = GENERATE(44100.0F, 48000.0F, 88200.0F, 96000.0F);

auto rng = etl::xoshiro128plusplus{Catch::getSeed()};
auto dist = etl::uniform_real_distribution<float>{-1.0F, 1.0F};

auto ares = grit::Kyma{};
ares.prepare(sampleRate, blockSize);

SECTION("fire")
{
for (auto i{0}; i < 100; ++i) {
auto buffer = [&] {
auto buf = etl::array<float, static_cast<size_t>(2 * blockSize)>{};
etl::generate(buf.begin(), buf.end(), [&] { return dist(rng); });
return buf;
}();
auto block = grit::StereoBlock<float>{buffer.data(), blockSize};

ares.process(block, {});

for (auto i{0}; i < blockSize; ++i) {
REQUIRE(etl::isfinite(block(0, i)));
REQUIRE(etl::isfinite(block(1, i)));
}
}
}
}

TEST_CASE("eurorack: Poseidon")
{
static constexpr auto blockSize = 32;
Expand Down

0 comments on commit 64fe8ff

Please sign in to comment.