memlnaut-nisps/nisps/modes/generated/slp_workshop_schema.hpp

569 lines
10 KiB
C++
Raw Normal View History

// AUTOGENERATED — do not edit. Source: schemas/modes/slp_workshop.json. Run `bun run codegen/generate.ts` to regenerate.
#ifndef NISPS_GENERATED_SLP_WORKSHOP_SCHEMA_HPP
#define NISPS_GENERATED_SLP_WORKSHOP_SCHEMA_HPP
#include "schema_types.hpp"
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
#include "../../ml/mlp.hpp"
namespace nisps::modes::generated {
inline constexpr std::string_view kSlpWorkshopModeId = "slp_workshop";
inline constexpr std::string_view kSlpWorkshopEngineId = "memlcelium";
inline constexpr std::array<std::string_view, 4> kSlpWorkshopInputChannels = {{
"joy_x",
"joy_y",
"joy_z",
"joy_w",
}};
inline constexpr std::array<std::size_t, 3> kSlpWorkshopHiddenLayers = {{
10u,
14u,
18u,
}};
inline constexpr MLConfig kSlpWorkshopMLConfig = {
4u,
56u,
0.6f,
};
inline constexpr std::size_t kSlpWorkshopParamCount = 56u;
inline constexpr std::array<Param, kSlpWorkshopParamCount> kSlpWorkshopParams = {{
Param{
"seq0_ratio0",
"Seq0 Ratio 0",
0.0f,
1.0f,
0.5f,
Curve::linear,
"sequencer",
},
Param{
"seq0_ratio1",
"Seq0 Ratio 1",
0.0f,
1.0f,
0.5f,
Curve::linear,
"sequencer",
},
Param{
"seq0_ratio2",
"Seq0 Ratio 2",
0.0f,
1.0f,
0.5f,
Curve::linear,
"sequencer",
},
Param{
"seq0_phasor_mul",
"Seq0 Phasor Mul",
0.0f,
1.0f,
0.0f,
Curve::linear,
"sequencer",
},
Param{
"seq0_phase_off",
"Seq0 Phase Off",
0.0f,
1.0f,
0.0f,
Curve::linear,
"sequencer",
},
Param{
"seq0_amp0",
"Seq0 Amp 0",
0.0f,
1.0f,
0.5f,
Curve::linear,
"sequencer",
},
Param{
"seq0_amp1",
"Seq0 Amp 1",
0.0f,
1.0f,
0.5f,
Curve::linear,
"sequencer",
},
Param{
"seq1_ratio0",
"Seq1 Ratio 0",
0.0f,
1.0f,
0.5f,
Curve::linear,
"sequencer",
},
Param{
"seq1_ratio1",
"Seq1 Ratio 1",
0.0f,
1.0f,
0.5f,
Curve::linear,
"sequencer",
},
Param{
"seq1_ratio2",
"Seq1 Ratio 2",
0.0f,
1.0f,
0.5f,
Curve::linear,
"sequencer",
},
Param{
"seq1_phasor_mul",
"Seq1 Phasor Mul",
0.0f,
1.0f,
0.0f,
Curve::linear,
"sequencer",
},
Param{
"seq1_phase_off",
"Seq1 Phase Off",
0.0f,
1.0f,
0.0f,
Curve::linear,
"sequencer",
},
Param{
"seq1_amp0",
"Seq1 Amp 0",
0.0f,
1.0f,
0.5f,
Curve::linear,
"sequencer",
},
Param{
"seq1_amp1",
"Seq1 Amp 1",
0.0f,
1.0f,
0.5f,
Curve::linear,
"sequencer",
},
Param{
"v0_base_freq",
"V0 Base Freq",
0.0f,
1.0f,
0.5f,
Curve::linear,
"v0_synth",
},
Param{
"v0_paf0_cf",
"V0 PAF0 CF",
0.0f,
1.0f,
0.5f,
Curve::linear,
"v0_synth",
},
Param{
"v0_paf1_cf",
"V0 PAF1 CF",
0.0f,
1.0f,
0.5f,
Curve::linear,
"v0_synth",
},
Param{
"v0_paf2_cf",
"V0 PAF2 CF",
0.0f,
1.0f,
0.5f,
Curve::linear,
"v0_synth",
},
Param{
"v0_paf0_bw",
"V0 PAF0 BW",
0.0f,
1.0f,
0.5f,
Curve::linear,
"v0_synth",
},
Param{
"v0_paf1_bw",
"V0 PAF1 BW",
0.0f,
1.0f,
0.5f,
Curve::linear,
"v0_synth",
},
Param{
"v0_paf2_bw",
"V0 PAF2 BW",
0.0f,
1.0f,
0.5f,
Curve::linear,
"v0_synth",
},
Param{
"v0_paf_vib",
"V0 PAF Vib",
0.0f,
1.0f,
0.0f,
Curve::square,
"v0_synth",
},
Param{
"v0_paf_vfr",
"V0 PAF Vib Rate",
0.0f,
1.0f,
0.5f,
Curve::square,
"v0_synth",
},
Param{
"v0_paf0_shift",
"V0 PAF0 Shift",
0.0f,
1.0f,
0.5f,
Curve::linear,
"v0_synth",
},
Param{
"v0_paf1_shift",
"V0 PAF1 Shift",
0.0f,
1.0f,
0.5f,
Curve::linear,
"v0_synth",
},
Param{
"v0_paf2_shift",
"V0 PAF2 Shift",
0.0f,
1.0f,
0.5f,
Curve::linear,
"v0_synth",
},
Param{
"v0_amp_attack",
"V0 Amp Attack",
0.0f,
1.0f,
0.0f,
Curve::linear,
"v0_env",
},
Param{
"v0_amp_decay",
"V0 Amp Decay",
0.0f,
1.0f,
0.3f,
Curve::square,
"v0_env",
},
Param{
"v0_amp_sustain",
"V0 Amp Sustain",
0.0f,
1.0f,
0.5f,
Curve::linear,
"v0_env",
},
Param{
"v0_amp_release",
"V0 Amp Release",
0.0f,
1.0f,
0.3f,
Curve::square,
"v0_env",
},
Param{
"v0_pitch_attack",
"V0 Pitch Attack",
0.0f,
1.0f,
0.0f,
Curve::linear,
"v0_env",
},
Param{
"v0_pitch_decay",
"V0 Pitch Decay",
0.0f,
1.0f,
0.3f,
Curve::square,
"v0_env",
},
Param{
"v0_pitch_emph",
"V0 Pitch Emph",
0.0f,
1.0f,
0.0f,
Curve::linear,
"v0_env",
},
Param{
"v0_shape_gain",
"V0 Shape Gain",
0.0f,
1.0f,
0.0f,
Curve::linear,
"v0_synth",
},
Param{
"v0_shape_asym",
"V0 Shape Asym",
0.0f,
1.0f,
0.0f,
Curve::linear,
"v0_synth",
},
Param{
"v0_shape_mix",
"V0 Shape Mix",
0.0f,
1.0f,
0.0f,
Curve::linear,
"v0_synth",
},
Param{
"v0_rm_gain",
"V0 RingMod Gain",
0.0f,
1.0f,
0.0f,
Curve::linear,
"v0_synth",
},
Param{
"v1_base_freq",
"V1 Base Freq",
0.0f,
1.0f,
0.5f,
Curve::linear,
"v1_synth",
},
Param{
"v1_detune1",
"V1 Detune 1",
0.0f,
1.0f,
0.0f,
Curve::linear,
"v1_synth",
},
Param{
"v1_detune2",
"V1 Detune 2",
0.0f,
1.0f,
0.0f,
Curve::linear,
"v1_synth",
},
Param{
"v1_paf0_cf",
"V1 PAF0 CF",
0.0f,
1.0f,
0.5f,
Curve::linear,
"v1_synth",
},
Param{
"v1_paf1_cf",
"V1 PAF1 CF",
0.0f,
1.0f,
0.5f,
Curve::linear,
"v1_synth",
},
Param{
"v1_paf2_cf",
"V1 PAF2 CF",
0.0f,
1.0f,
0.5f,
Curve::linear,
"v1_synth",
},
Param{
"v1_paf0_bw",
"V1 PAF0 BW",
0.0f,
1.0f,
0.5f,
Curve::linear,
"v1_synth",
},
Param{
"v1_paf1_bw",
"V1 PAF1 BW",
0.0f,
1.0f,
0.5f,
Curve::linear,
"v1_synth",
},
Param{
"v1_paf2_bw",
"V1 PAF2 BW",
0.0f,
1.0f,
0.5f,
Curve::linear,
"v1_synth",
},
Param{
"v1_paf0_shift",
"V1 PAF0 Shift",
0.0f,
1.0f,
0.5f,
Curve::linear,
"v1_synth",
},
Param{
"v1_paf1_shift",
"V1 PAF1 Shift",
0.0f,
1.0f,
0.5f,
Curve::linear,
"v1_synth",
},
Param{
"v1_paf2_shift",
"V1 PAF2 Shift",
0.0f,
1.0f,
0.5f,
Curve::linear,
"v1_synth",
},
Param{
"v1_amp_attack",
"V1 Amp Attack",
0.0f,
1.0f,
0.0f,
Curve::linear,
"v1_env",
},
Param{
"v1_amp_decay",
"V1 Amp Decay",
0.0f,
1.0f,
0.3f,
Curve::square,
"v1_env",
},
Param{
"v1_amp_sustain",
"V1 Amp Sustain",
0.0f,
1.0f,
0.5f,
Curve::linear,
"v1_env",
},
Param{
"v1_amp_release",
"V1 Amp Release",
0.0f,
1.0f,
0.3f,
Curve::square,
"v1_env",
},
Param{
"v1_pitch_attack",
"V1 Pitch Attack",
0.0f,
1.0f,
0.0f,
Curve::linear,
"v1_env",
},
Param{
"v1_pitch_decay",
"V1 Pitch Decay",
0.0f,
1.0f,
0.3f,
Curve::square,
"v1_env",
},
Param{
"v1_pitch_emph",
"V1 Pitch Emph",
0.0f,
1.0f,
0.0f,
Curve::linear,
"v1_env",
},
}};
inline constexpr std::size_t kSlpWorkshopVoiceSpaceCount = 1u;
inline constexpr std::array<std::string_view, kSlpWorkshopVoiceSpaceCount> kSlpWorkshopVoiceSpaces = {{
"Direct",
}};
inline constexpr UIConfig kSlpWorkshopUI = {
PrimaryInput::XYPad,
false,
true,
};
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
using SlpWorkshopMLP = ::nisps::ml::MLP<kSlpWorkshopMLConfig.input_size, kSlpWorkshopHiddenLayers[0], kSlpWorkshopHiddenLayers[1], kSlpWorkshopHiddenLayers[2], kSlpWorkshopMLConfig.output_size>;
inline constexpr ::nisps::ParamSchema kSlpWorkshopSchema = {
kSlpWorkshopModeId,
kSlpWorkshopEngineId,
std::span<const std::string_view>(kSlpWorkshopInputChannels),
kSlpWorkshopMLConfig.input_size,
std::span<const std::size_t>(kSlpWorkshopHiddenLayers),
kSlpWorkshopMLConfig.output_size,
kSlpWorkshopMLConfig.default_spread,
std::span<const Param>(kSlpWorkshopParams),
std::span<const std::string_view>(kSlpWorkshopVoiceSpaces),
kSlpWorkshopUI,
};
} // namespace nisps::modes::generated
#endif // NISPS_GENERATED_SLP_WORKSHOP_SCHEMA_HPP