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.
284 lines
5.3 KiB
C++
284 lines
5.3 KiB
C++
// AUTOGENERATED — do not edit. Source: schemas/modes/xiasri.json. Run `bun run codegen/generate.ts` to regenerate.
|
|
#ifndef NISPS_GENERATED_XIASRI_SCHEMA_HPP
|
|
#define NISPS_GENERATED_XIASRI_SCHEMA_HPP
|
|
|
|
#include "schema_types.hpp"
|
|
#include "../../ml/mlp.hpp"
|
|
|
|
namespace nisps::modes::generated {
|
|
|
|
inline constexpr std::string_view kXiasriModeId = "xiasri";
|
|
inline constexpr std::string_view kXiasriEngineId = "xiasri";
|
|
|
|
inline constexpr std::array<std::string_view, 4> kXiasriInputChannels = {{
|
|
"joy_x",
|
|
"joy_y",
|
|
"joy_z",
|
|
"joy_w",
|
|
}};
|
|
|
|
inline constexpr std::array<std::size_t, 3> kXiasriHiddenLayers = {{
|
|
10u,
|
|
10u,
|
|
14u,
|
|
}};
|
|
|
|
inline constexpr MLConfig kXiasriMLConfig = {
|
|
4u,
|
|
24u,
|
|
0.6f,
|
|
1.0f,
|
|
1000u,
|
|
};
|
|
|
|
inline constexpr std::size_t kXiasriParamCount = 24u;
|
|
inline constexpr std::array<Param, kXiasriParamCount> kXiasriParams = {{
|
|
Param{
|
|
"dl1_mix",
|
|
"Delay 1 Mix",
|
|
0.0f,
|
|
1.0f,
|
|
0.0f,
|
|
Curve::linear,
|
|
"delays",
|
|
},
|
|
Param{
|
|
"dl2_mix",
|
|
"Delay 2 Mix",
|
|
0.0f,
|
|
1.0f,
|
|
0.0f,
|
|
Curve::linear,
|
|
"delays",
|
|
},
|
|
Param{
|
|
"dl3_mix",
|
|
"Delay 3 Mix",
|
|
0.0f,
|
|
1.0f,
|
|
0.0f,
|
|
Curve::linear,
|
|
"delays",
|
|
},
|
|
Param{
|
|
"p03",
|
|
"Param 03",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::linear,
|
|
"general",
|
|
},
|
|
Param{
|
|
"allp1_fb",
|
|
"Allpass 1 Feedback",
|
|
0.0f,
|
|
1.0f,
|
|
0.0f,
|
|
Curve::linear,
|
|
"verb",
|
|
},
|
|
Param{
|
|
"allp2_fb",
|
|
"Allpass 2 Feedback",
|
|
0.0f,
|
|
1.0f,
|
|
0.0f,
|
|
Curve::linear,
|
|
"verb",
|
|
},
|
|
Param{
|
|
"comb1_fb",
|
|
"Comb 1 Feedback",
|
|
0.0f,
|
|
1.0f,
|
|
0.0f,
|
|
Curve::linear,
|
|
"verb",
|
|
},
|
|
Param{
|
|
"comb2_fb",
|
|
"Comb 2 Feedback",
|
|
0.0f,
|
|
1.0f,
|
|
0.0f,
|
|
Curve::linear,
|
|
"verb",
|
|
},
|
|
Param{
|
|
"dl1_fb",
|
|
"Delay 1 Feedback",
|
|
0.0f,
|
|
1.0f,
|
|
0.0f,
|
|
Curve::linear,
|
|
"delays",
|
|
},
|
|
Param{
|
|
"dl2_fb",
|
|
"Delay 2 Feedback",
|
|
0.0f,
|
|
1.0f,
|
|
0.0f,
|
|
Curve::linear,
|
|
"delays",
|
|
},
|
|
Param{
|
|
"dl3_fb",
|
|
"Delay 3 Feedback",
|
|
0.0f,
|
|
1.0f,
|
|
0.0f,
|
|
Curve::linear,
|
|
"delays",
|
|
},
|
|
Param{
|
|
"wetdry_mix",
|
|
"Wet/Dry Mix",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::linear,
|
|
"mix",
|
|
},
|
|
Param{
|
|
"pitch_transp",
|
|
"Pitch Transpose",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::linear,
|
|
"pitch",
|
|
},
|
|
Param{
|
|
"pitch_mix",
|
|
"Pitch Mix",
|
|
0.0f,
|
|
1.0f,
|
|
0.0f,
|
|
Curve::linear,
|
|
"pitch",
|
|
},
|
|
Param{
|
|
"allp3_fb",
|
|
"Allpass 3 Feedback",
|
|
0.0f,
|
|
1.0f,
|
|
0.0f,
|
|
Curve::linear,
|
|
"verb",
|
|
},
|
|
Param{
|
|
"allp4_fb",
|
|
"Allpass 4 Feedback",
|
|
0.0f,
|
|
1.0f,
|
|
0.0f,
|
|
Curve::linear,
|
|
"verb",
|
|
},
|
|
Param{
|
|
"allp5_fb",
|
|
"Allpass 5 Feedback",
|
|
0.0f,
|
|
1.0f,
|
|
0.0f,
|
|
Curve::linear,
|
|
"verb",
|
|
},
|
|
Param{
|
|
"allp6_fb",
|
|
"Allpass 6 Feedback",
|
|
0.0f,
|
|
1.0f,
|
|
0.0f,
|
|
Curve::linear,
|
|
"verb",
|
|
},
|
|
Param{
|
|
"allp3_mix",
|
|
"Allpass 3 Mix",
|
|
0.0f,
|
|
1.0f,
|
|
0.0f,
|
|
Curve::linear,
|
|
"verb",
|
|
},
|
|
Param{
|
|
"allp4_mix",
|
|
"Allpass 4 Mix",
|
|
0.0f,
|
|
1.0f,
|
|
0.0f,
|
|
Curve::linear,
|
|
"verb",
|
|
},
|
|
Param{
|
|
"allp5_mix",
|
|
"Allpass 5 Mix",
|
|
0.0f,
|
|
1.0f,
|
|
0.0f,
|
|
Curve::linear,
|
|
"verb",
|
|
},
|
|
Param{
|
|
"allp6_mix",
|
|
"Allpass 6 Mix",
|
|
0.0f,
|
|
1.0f,
|
|
0.0f,
|
|
Curve::linear,
|
|
"verb",
|
|
},
|
|
Param{
|
|
"dl4_mix",
|
|
"Delay 4 Mix",
|
|
0.0f,
|
|
1.0f,
|
|
0.0f,
|
|
Curve::square,
|
|
"delays",
|
|
},
|
|
Param{
|
|
"dl4_fb",
|
|
"Delay 4 Feedback",
|
|
0.0f,
|
|
1.0f,
|
|
0.0f,
|
|
Curve::linear,
|
|
"delays",
|
|
},
|
|
}};
|
|
|
|
inline constexpr std::size_t kXiasriVoiceSpaceCount = 1u;
|
|
inline constexpr std::array<std::string_view, kXiasriVoiceSpaceCount> kXiasriVoiceSpaces = {{
|
|
"Direct",
|
|
}};
|
|
|
|
inline constexpr UIConfig kXiasriUI = {
|
|
PrimaryInput::Joystick,
|
|
false,
|
|
false,
|
|
};
|
|
|
|
using XiasriMLP = ::nisps::ml::MLP<kXiasriMLConfig.input_size, kXiasriHiddenLayers[0], kXiasriHiddenLayers[1], kXiasriHiddenLayers[2], kXiasriMLConfig.output_size>;
|
|
|
|
inline constexpr ::nisps::ParamSchema kXiasriSchema = {
|
|
kXiasriModeId,
|
|
kXiasriEngineId,
|
|
std::span<const std::string_view>(kXiasriInputChannels),
|
|
kXiasriMLConfig.input_size,
|
|
std::span<const std::size_t>(kXiasriHiddenLayers),
|
|
kXiasriMLConfig.output_size,
|
|
kXiasriMLConfig.default_spread,
|
|
kXiasriMLConfig.default_learning_rate,
|
|
kXiasriMLConfig.default_max_iterations,
|
|
std::span<const Param>(kXiasriParams),
|
|
std::span<const std::string_view>(kXiasriVoiceSpaces),
|
|
kXiasriUI,
|
|
};
|
|
|
|
} // namespace nisps::modes::generated
|
|
|
|
#endif // NISPS_GENERATED_XIASRI_SCHEMA_HPP
|