Phase 3 (S1, S5, S6, S25, L11, L37, ST11, ST12). Behaviour-preserving by construction: the diff on the generated directories is PURELY ADDITIVE (217 insertions, 0 deletions), so no emitted constant changed value. This moves where truth lives; it does not change what truth says. - S5: nine mode headers each carried a mechanically identical 12-field positional ParamSchema aggregate. codegen now emits one `inline constexpr ParamSchema k<Mode>Schema` per mode, and the struct itself moved into generated/schema_types.hpp. Each param_schema() is a one-line return. - S6 + S25: every mode hand-typed its net shape a second time as MLP template args, duplicating the schema's own dims. codegen emits a `<Mode>MLP` alias built from the already-emitted constants (not re-literalled), and all nine modes use it. NMaxExamples still defaults from kDefaultMaxExamples (Phase 2). - S1: model.ts hand-imported all nine schemas by name and hand-paired each with its overlay — so the SET of modes was hand-maintained and could silently drift from codegen. codegen now emits ALL_MODE_SCHEMAS; SCHEMA_MODE_OVERLAYS is purely display truth (label/glyph/css/order), which stays hand-curated. - L37: deleted the hand-written modeEngineId switch, which duplicated schema.engine_id and silently defaulted unknown modes to 'thru'. Routes on MFMode.engineId with exactly one documented exception: sound_analysis_midi declares engine_id 'thru' because its ModeBase audio slot really is NoOpEngine, while it separately drives the real AnalysisEngine. - L11: ExternalSynthMIDIMode's shape was literal in two places; now named once in an ext_synth_defaults namespace with an ExtSynthMIDIMLP alias. Full folding into the JSON pipeline is NOT done and the reason is recorded in-file: it is a template family over an externally-supplied Device and variable NOut, with no single (device, NOut) schema to author. - ST12: extracted codegen/lib.ts for the helpers both generators duplicated, and corrected the comment that claimed they had to be separate. Proof the extraction was behaviour-free: regenerating the MIDI-device outputs produces a byte-identical tree. - ST11: deleted codegen/templates/ — dead "reference" files no generator reads, already drifted from the real emitters. Gates: run-all-tests.sh ALL GREEN; codegen idempotent (re-running both generators yields no further diff), which is what CI's dirty-diff gate checks.
502 lines
8.9 KiB
C++
502 lines
8.9 KiB
C++
// AUTOGENERATED — do not edit. Source: schemas/modes/verb_fx.json. Run `bun run codegen/generate.ts` to regenerate.
|
|
#ifndef NISPS_GENERATED_VERB_FX_SCHEMA_HPP
|
|
#define NISPS_GENERATED_VERB_FX_SCHEMA_HPP
|
|
|
|
#include "schema_types.hpp"
|
|
#include "../../ml/mlp.hpp"
|
|
|
|
namespace nisps::modes::generated {
|
|
|
|
inline constexpr std::string_view kVerbFxModeId = "verb_fx";
|
|
inline constexpr std::string_view kVerbFxEngineId = "verb_fx";
|
|
|
|
inline constexpr std::array<std::string_view, 4> kVerbFxInputChannels = {{
|
|
"joy_x",
|
|
"joy_y",
|
|
"joy_z",
|
|
"joy_w",
|
|
}};
|
|
|
|
inline constexpr std::array<std::size_t, 3> kVerbFxHiddenLayers = {{
|
|
10u,
|
|
14u,
|
|
18u,
|
|
}};
|
|
|
|
inline constexpr MLConfig kVerbFxMLConfig = {
|
|
4u,
|
|
47u,
|
|
0.6f,
|
|
1.0f,
|
|
1000u,
|
|
};
|
|
|
|
inline constexpr std::size_t kVerbFxParamCount = 47u;
|
|
inline constexpr std::array<Param, kVerbFxParamCount> kVerbFxParams = {{
|
|
Param{
|
|
"fb_delay_xfade",
|
|
"Bank/Delay XFade",
|
|
0.0f,
|
|
1.0f,
|
|
0.0f,
|
|
Curve::linear,
|
|
"routing",
|
|
},
|
|
Param{
|
|
"lp0_fb",
|
|
"LP Comb 0 FB",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::linear,
|
|
"verb",
|
|
},
|
|
Param{
|
|
"lp0_cutoff",
|
|
"LP Comb 0 Cutoff",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::linear,
|
|
"verb",
|
|
},
|
|
Param{
|
|
"lp1_fb",
|
|
"LP Comb 1 FB",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::linear,
|
|
"verb",
|
|
},
|
|
Param{
|
|
"lp1_cutoff",
|
|
"LP Comb 1 Cutoff",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::linear,
|
|
"verb",
|
|
},
|
|
Param{
|
|
"lp2_fb",
|
|
"LP Comb 2 FB",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::linear,
|
|
"verb",
|
|
},
|
|
Param{
|
|
"lp2_cutoff",
|
|
"LP Comb 2 Cutoff",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::linear,
|
|
"verb",
|
|
},
|
|
Param{
|
|
"lp3_fb",
|
|
"LP Comb 3 FB",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::linear,
|
|
"verb",
|
|
},
|
|
Param{
|
|
"lp3_cutoff",
|
|
"LP Comb 3 Cutoff",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::linear,
|
|
"verb",
|
|
},
|
|
Param{
|
|
"lp4_fb",
|
|
"LP Comb 4 FB",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::linear,
|
|
"verb",
|
|
},
|
|
Param{
|
|
"lp4_cutoff",
|
|
"LP Comb 4 Cutoff",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::linear,
|
|
"verb",
|
|
},
|
|
Param{
|
|
"lp5_fb",
|
|
"LP Comb 5 FB",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::linear,
|
|
"verb",
|
|
},
|
|
Param{
|
|
"lp5_cutoff",
|
|
"LP Comb 5 Cutoff",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::linear,
|
|
"verb",
|
|
},
|
|
Param{
|
|
"lp6_fb",
|
|
"LP Comb 6 FB",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::linear,
|
|
"verb",
|
|
},
|
|
Param{
|
|
"lp6_cutoff",
|
|
"LP Comb 6 Cutoff",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::linear,
|
|
"verb",
|
|
},
|
|
Param{
|
|
"lp7_fb",
|
|
"LP Comb 7 FB",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::linear,
|
|
"verb",
|
|
},
|
|
Param{
|
|
"lp7_cutoff",
|
|
"LP Comb 7 Cutoff",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::linear,
|
|
"verb",
|
|
},
|
|
Param{
|
|
"allp0_fb",
|
|
"Allpass 0 FB",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::linear,
|
|
"verb",
|
|
},
|
|
Param{
|
|
"allp1_fb",
|
|
"Allpass 1 FB",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::linear,
|
|
"verb",
|
|
},
|
|
Param{
|
|
"allp2_fb",
|
|
"Allpass 2 FB",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::linear,
|
|
"verb",
|
|
},
|
|
Param{
|
|
"allp3_fb",
|
|
"Allpass 3 FB",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::linear,
|
|
"verb",
|
|
},
|
|
Param{
|
|
"fbank_f0",
|
|
"Filterbank Freq 0",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::linear,
|
|
"filterbank",
|
|
},
|
|
Param{
|
|
"fbank_f1",
|
|
"Filterbank Freq 1",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::linear,
|
|
"filterbank",
|
|
},
|
|
Param{
|
|
"fbank_f2",
|
|
"Filterbank Freq 2",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::linear,
|
|
"filterbank",
|
|
},
|
|
Param{
|
|
"fbank_f3",
|
|
"Filterbank Freq 3",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::linear,
|
|
"filterbank",
|
|
},
|
|
Param{
|
|
"fbank_f4",
|
|
"Filterbank Freq 4",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::linear,
|
|
"filterbank",
|
|
},
|
|
Param{
|
|
"fbank_f5",
|
|
"Filterbank Freq 5",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::linear,
|
|
"filterbank",
|
|
},
|
|
Param{
|
|
"fbank_f6",
|
|
"Filterbank Freq 6",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::linear,
|
|
"filterbank",
|
|
},
|
|
Param{
|
|
"fbank_f7",
|
|
"Filterbank Freq 7",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::linear,
|
|
"filterbank",
|
|
},
|
|
Param{
|
|
"fbank_res0",
|
|
"Filterbank Res 0",
|
|
0.0f,
|
|
1.0f,
|
|
0.0f,
|
|
Curve::linear,
|
|
"filterbank",
|
|
},
|
|
Param{
|
|
"fbank_res1",
|
|
"Filterbank Res 1",
|
|
0.0f,
|
|
1.0f,
|
|
0.0f,
|
|
Curve::linear,
|
|
"filterbank",
|
|
},
|
|
Param{
|
|
"fbank_res2",
|
|
"Filterbank Res 2",
|
|
0.0f,
|
|
1.0f,
|
|
0.0f,
|
|
Curve::linear,
|
|
"filterbank",
|
|
},
|
|
Param{
|
|
"fbank_res3",
|
|
"Filterbank Res 3",
|
|
0.0f,
|
|
1.0f,
|
|
0.0f,
|
|
Curve::linear,
|
|
"filterbank",
|
|
},
|
|
Param{
|
|
"fbank_res4",
|
|
"Filterbank Res 4",
|
|
0.0f,
|
|
1.0f,
|
|
0.0f,
|
|
Curve::linear,
|
|
"filterbank",
|
|
},
|
|
Param{
|
|
"fbank_res5",
|
|
"Filterbank Res 5",
|
|
0.0f,
|
|
1.0f,
|
|
0.0f,
|
|
Curve::linear,
|
|
"filterbank",
|
|
},
|
|
Param{
|
|
"fbank_res6",
|
|
"Filterbank Res 6",
|
|
0.0f,
|
|
1.0f,
|
|
0.0f,
|
|
Curve::linear,
|
|
"filterbank",
|
|
},
|
|
Param{
|
|
"fbank_res7",
|
|
"Filterbank Res 7",
|
|
0.0f,
|
|
1.0f,
|
|
0.0f,
|
|
Curve::linear,
|
|
"filterbank",
|
|
},
|
|
Param{
|
|
"delay0_time",
|
|
"Long Delay Time",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::linear,
|
|
"delays",
|
|
},
|
|
Param{
|
|
"delay0_fb",
|
|
"Long Delay FB",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::linear,
|
|
"delays",
|
|
},
|
|
Param{
|
|
"delay1_time",
|
|
"Med Delay Time",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::linear,
|
|
"delays",
|
|
},
|
|
Param{
|
|
"delay1_fb",
|
|
"Med Delay FB",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::linear,
|
|
"delays",
|
|
},
|
|
Param{
|
|
"delay2_time",
|
|
"Short Delay Time",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::linear,
|
|
"delays",
|
|
},
|
|
Param{
|
|
"delay2_fb",
|
|
"Short Delay FB",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::linear,
|
|
"delays",
|
|
},
|
|
Param{
|
|
"verb_vs_delay",
|
|
"Verb vs Delay",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::linear,
|
|
"routing",
|
|
},
|
|
Param{
|
|
"delay_to_verb",
|
|
"Delay→Verb Send",
|
|
0.0f,
|
|
1.0f,
|
|
0.0f,
|
|
Curve::linear,
|
|
"routing",
|
|
},
|
|
Param{
|
|
"delay_morph",
|
|
"Delay Morph",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::linear,
|
|
"delays",
|
|
},
|
|
Param{
|
|
"delay_blend",
|
|
"Delay Blend",
|
|
0.0f,
|
|
1.0f,
|
|
0.0f,
|
|
Curve::linear,
|
|
"delays",
|
|
},
|
|
}};
|
|
|
|
inline constexpr std::size_t kVerbFxVoiceSpaceCount = 12u;
|
|
inline constexpr std::array<std::string_view, kVerbFxVoiceSpaceCount> kVerbFxVoiceSpaces = {{
|
|
"Default",
|
|
"Resonant",
|
|
"Soft",
|
|
"Cathedral",
|
|
"Shimmer",
|
|
"Chamber",
|
|
"Metallic",
|
|
"Granular",
|
|
"Diffuse",
|
|
"Dark",
|
|
"Bright",
|
|
"Harmonic",
|
|
}};
|
|
|
|
inline constexpr UIConfig kVerbFxUI = {
|
|
PrimaryInput::Joystick,
|
|
true,
|
|
false,
|
|
};
|
|
|
|
using VerbFxMLP = ::nisps::ml::MLP<kVerbFxMLConfig.input_size, kVerbFxHiddenLayers[0], kVerbFxHiddenLayers[1], kVerbFxHiddenLayers[2], kVerbFxMLConfig.output_size>;
|
|
|
|
inline constexpr ::nisps::ParamSchema kVerbFxSchema = {
|
|
kVerbFxModeId,
|
|
kVerbFxEngineId,
|
|
std::span<const std::string_view>(kVerbFxInputChannels),
|
|
kVerbFxMLConfig.input_size,
|
|
std::span<const std::size_t>(kVerbFxHiddenLayers),
|
|
kVerbFxMLConfig.output_size,
|
|
kVerbFxMLConfig.default_spread,
|
|
kVerbFxMLConfig.default_learning_rate,
|
|
kVerbFxMLConfig.default_max_iterations,
|
|
std::span<const Param>(kVerbFxParams),
|
|
std::span<const std::string_view>(kVerbFxVoiceSpaces),
|
|
kVerbFxUI,
|
|
};
|
|
|
|
} // namespace nisps::modes::generated
|
|
|
|
#endif // NISPS_GENERATED_VERB_FX_SCHEMA_HPP
|