Ported by parallel agents against reference renders. The export now records Kotlin's global voice-seed counters and every factory wavetable's data, and adds Sampler/SF2 scenarios (not ported yet). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
36 lines
1.1 KiB
C++
36 lines
1.1 KiB
C++
// SPDX-FileCopyrightText: 2026 Reactorcoremeltdown
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
// The reference-test maker for kind "WAVE" (see TestVoice.hpp, IosGoldenInstruments.kt):
|
|
// WaveVoice alone, patch from the slot, factory tables built up front.
|
|
|
|
#include <memory>
|
|
#include "sizzle/TestVoice.hpp"
|
|
#include "WaveTables.hpp"
|
|
#include "WaveVoice.hpp"
|
|
|
|
namespace sizzle {
|
|
namespace {
|
|
|
|
class WaveTestVoice final : public TestVoice {
|
|
public:
|
|
explicit WaveTestVoice(const TestVoiceSetup &s)
|
|
: voice_(s.sampleRate), patch_(wavetable::WavePatch::from(s.params, s.tempoBpm)) {}
|
|
void noteOn(int midi, int velocity) override { voice_.noteOn(midi, (float)velocity / 127.f, patch_); }
|
|
void noteOff(int) override { voice_.noteOff(); }
|
|
float render() override { return voice_.render(); }
|
|
|
|
private:
|
|
wavetable::WaveVoice voice_;
|
|
wavetable::WavePatch patch_;
|
|
};
|
|
|
|
} // namespace
|
|
|
|
std::unique_ptr<TestVoice> makeWaveTestVoice(const TestVoiceSetup &setup) {
|
|
wavetable::WaveTables::prewarmBlocking();
|
|
return std::make_unique<WaveTestVoice>(setup);
|
|
}
|
|
|
|
} // namespace sizzle
|