// SPDX-FileCopyrightText: 2026 Reactorcoremeltdown // SPDX-License-Identifier: GPL-3.0-or-later #pragma once // The hook the reference tests use to play a note script through one instrument // voice (see IosGoldenInstruments.kt and tests/golden_test.cpp). Each instrument // port provides its maker (strong definition) in its own source file; the weak // placeholders in src/TestVoices.cpp return nullptr for kinds not ported yet. #include #include "sizzle/Params.hpp" namespace sizzle { class TestVoice { public: virtual ~TestVoice() = default; /** Called before each block of [frames] (AudioEngine advances shared clocks * such as the Morph Pad's FrasilClock here). */ virtual void blockStart(int frames) { (void)frames; } virtual void noteOn(int midi, int velocity) = 0; virtual void noteOff(int midi) = 0; virtual float render() = 0; }; struct TestVoiceSetup { const char *type; // ToolboxType name, e.g. "MORPH_PAD" const Params *params; // the slot's values int sampleRate; float tempoBpm; double clock0; // FrasilClock.seconds when the scenario started }; /** kind "SYNTH": SynthVoice with the engine's patch for [setup.type]. */ std::unique_ptr makeSynthTestVoice(const TestVoiceSetup &setup); /** kind "FRASIL": FrasilVoice alone (Morph Pad). */ std::unique_ptr makeFrasilTestVoice(const TestVoiceSetup &setup); /** kind "WAVE": WaveVoice alone (Wavetable). */ std::unique_ptr makeWaveTestVoice(const TestVoiceSetup &setup); /** kind "GRAIN": GrainCloud (Grain Cloud), notes owned by live input. */ std::unique_ptr makeGrainTestVoice(const TestVoiceSetup &setup); std::unique_ptr makeTestVoice(const char *kind, const TestVoiceSetup &setup); } // namespace sizzle