memlnaut-nisps/nisps/modes/generated/elysiamorf_schema.hpp
monkey-w1n5t0n f5b571412f refactor(codegen): codegen owns mode identity, per-mode schemas and net dims
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.
2026-07-21 14:02:23 +02:00

426 lines
7.7 KiB
C++

// AUTOGENERATED — do not edit. Source: schemas/modes/elysiamorf.json. Run `bun run codegen/generate.ts` to regenerate.
#ifndef NISPS_GENERATED_ELYSIAMORF_SCHEMA_HPP
#define NISPS_GENERATED_ELYSIAMORF_SCHEMA_HPP
#include "schema_types.hpp"
#include "../../ml/mlp.hpp"
namespace nisps::modes::generated {
inline constexpr std::string_view kElysiamorfModeId = "elysiamorf";
inline constexpr std::string_view kElysiamorfEngineId = "elysiamorf";
inline constexpr std::array<std::string_view, 4> kElysiamorfInputChannels = {{
"joy_x",
"joy_y",
"joy_z",
"joy_w",
}};
inline constexpr std::array<std::size_t, 3> kElysiamorfHiddenLayers = {{
10u,
14u,
18u,
}};
inline constexpr MLConfig kElysiamorfMLConfig = {
4u,
40u,
0.6f,
1.0f,
1000u,
};
inline constexpr std::size_t kElysiamorfParamCount = 40u;
inline constexpr std::array<Param, kElysiamorfParamCount> kElysiamorfParams = {{
Param{
"fm0_carrier",
"FM0 Carrier",
0.0f,
1.0f,
0.5f,
Curve::linear,
"fm0",
},
Param{
"fm0_mod_freq",
"FM0 Mod Freq",
0.0f,
1.0f,
0.5f,
Curve::linear,
"fm0",
},
Param{
"fm0_mod_index",
"FM0 Mod Index",
0.0f,
1.0f,
0.0f,
Curve::linear,
"fm0",
},
Param{
"fm0_phasor_mul",
"FM0 Phasor Mul",
0.0f,
1.0f,
0.0f,
Curve::linear,
"fm0",
},
Param{
"fm0_phase_off",
"FM0 Phase Off",
0.0f,
1.0f,
0.0f,
Curve::linear,
"fm0",
},
Param{
"fm1_carrier",
"FM1 Carrier",
0.0f,
1.0f,
0.5f,
Curve::linear,
"fm1",
},
Param{
"fm1_mod_freq",
"FM1 Mod Freq",
0.0f,
1.0f,
0.5f,
Curve::linear,
"fm1",
},
Param{
"fm1_mod_index",
"FM1 Mod Index",
0.0f,
1.0f,
0.0f,
Curve::linear,
"fm1",
},
Param{
"fm1_phasor_mul",
"FM1 Phasor Mul",
0.0f,
1.0f,
0.0f,
Curve::linear,
"fm1",
},
Param{
"fm1_phase_off",
"FM1 Phase Off",
0.0f,
1.0f,
0.0f,
Curve::linear,
"fm1",
},
Param{
"fm2_carrier",
"FM2 Carrier",
0.0f,
1.0f,
0.5f,
Curve::linear,
"fm2",
},
Param{
"fm2_mod_freq",
"FM2 Mod Freq",
0.0f,
1.0f,
0.5f,
Curve::linear,
"fm2",
},
Param{
"fm2_mod_index",
"FM2 Mod Index",
0.0f,
1.0f,
0.0f,
Curve::linear,
"fm2",
},
Param{
"fm2_phasor_mul",
"FM2 Phasor Mul",
0.0f,
1.0f,
0.0f,
Curve::linear,
"fm2",
},
Param{
"fm2_phase_off",
"FM2 Phase Off",
0.0f,
1.0f,
0.0f,
Curve::linear,
"fm2",
},
Param{
"fm3_carrier",
"FM3 Carrier",
0.0f,
1.0f,
0.5f,
Curve::linear,
"fm3",
},
Param{
"fm3_mod_freq",
"FM3 Mod Freq",
0.0f,
1.0f,
0.5f,
Curve::linear,
"fm3",
},
Param{
"fm3_mod_index",
"FM3 Mod Index",
0.0f,
1.0f,
0.0f,
Curve::linear,
"fm3",
},
Param{
"fm3_phasor_mul",
"FM3 Phasor Mul",
0.0f,
1.0f,
0.0f,
Curve::linear,
"fm3",
},
Param{
"fm3_phase_off",
"FM3 Phase Off",
0.0f,
1.0f,
0.0f,
Curve::linear,
"fm3",
},
Param{
"fm4_carrier",
"FM4 Carrier",
0.0f,
1.0f,
0.5f,
Curve::linear,
"fm4",
},
Param{
"fm4_mod_freq",
"FM4 Mod Freq",
0.0f,
1.0f,
0.5f,
Curve::linear,
"fm4",
},
Param{
"fm4_mod_index",
"FM4 Mod Index",
0.0f,
1.0f,
0.0f,
Curve::linear,
"fm4",
},
Param{
"fm4_phasor_mul",
"FM4 Phasor Mul",
0.0f,
1.0f,
0.0f,
Curve::linear,
"fm4",
},
Param{
"fm4_phase_off",
"FM4 Phase Off",
0.0f,
1.0f,
0.0f,
Curve::linear,
"fm4",
},
Param{
"fm5_carrier",
"FM5 Carrier",
0.0f,
1.0f,
0.5f,
Curve::linear,
"fm5",
},
Param{
"fm5_mod_freq",
"FM5 Mod Freq",
0.0f,
1.0f,
0.5f,
Curve::linear,
"fm5",
},
Param{
"fm5_mod_index",
"FM5 Mod Index",
0.0f,
1.0f,
0.0f,
Curve::linear,
"fm5",
},
Param{
"fm5_phasor_mul",
"FM5 Phasor Mul",
0.0f,
1.0f,
0.0f,
Curve::linear,
"fm5",
},
Param{
"fm5_phase_off",
"FM5 Phase Off",
0.0f,
1.0f,
0.0f,
Curve::linear,
"fm5",
},
Param{
"fm6_carrier",
"FM6 Carrier",
0.0f,
1.0f,
0.5f,
Curve::linear,
"fm6",
},
Param{
"fm6_mod_freq",
"FM6 Mod Freq",
0.0f,
1.0f,
0.5f,
Curve::linear,
"fm6",
},
Param{
"fm6_mod_index",
"FM6 Mod Index",
0.0f,
1.0f,
0.0f,
Curve::linear,
"fm6",
},
Param{
"fm6_phasor_mul",
"FM6 Phasor Mul",
0.0f,
1.0f,
0.0f,
Curve::linear,
"fm6",
},
Param{
"fm6_phase_off",
"FM6 Phase Off",
0.0f,
1.0f,
0.0f,
Curve::linear,
"fm6",
},
Param{
"fm7_carrier",
"FM7 Carrier",
0.0f,
1.0f,
0.5f,
Curve::linear,
"fm7",
},
Param{
"fm7_mod_freq",
"FM7 Mod Freq",
0.0f,
1.0f,
0.5f,
Curve::linear,
"fm7",
},
Param{
"fm7_mod_index",
"FM7 Mod Index",
0.0f,
1.0f,
0.0f,
Curve::linear,
"fm7",
},
Param{
"fm7_phasor_mul",
"FM7 Phasor Mul",
0.0f,
1.0f,
0.0f,
Curve::linear,
"fm7",
},
Param{
"fm7_phase_off",
"FM7 Phase Off",
0.0f,
1.0f,
0.0f,
Curve::linear,
"fm7",
},
}};
inline constexpr std::size_t kElysiamorfVoiceSpaceCount = 0u;
inline constexpr std::array<std::string_view, 0> kElysiamorfVoiceSpaces = {};
inline constexpr UIConfig kElysiamorfUI = {
PrimaryInput::XYPad,
false,
false,
};
using ElysiamorfMLP = ::nisps::ml::MLP<kElysiamorfMLConfig.input_size, kElysiamorfHiddenLayers[0], kElysiamorfHiddenLayers[1], kElysiamorfHiddenLayers[2], kElysiamorfMLConfig.output_size>;
inline constexpr ::nisps::ParamSchema kElysiamorfSchema = {
kElysiamorfModeId,
kElysiamorfEngineId,
std::span<const std::string_view>(kElysiamorfInputChannels),
kElysiamorfMLConfig.input_size,
std::span<const std::size_t>(kElysiamorfHiddenLayers),
kElysiamorfMLConfig.output_size,
kElysiamorfMLConfig.default_spread,
kElysiamorfMLConfig.default_learning_rate,
kElysiamorfMLConfig.default_max_iterations,
std::span<const Param>(kElysiamorfParams),
std::span<const std::string_view>(kElysiamorfVoiceSpaces),
kElysiamorfUI,
};
} // namespace nisps::modes::generated
#endif // NISPS_GENERATED_ELYSIAMORF_SCHEMA_HPP