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.
289 lines
5.5 KiB
C++
289 lines
5.5 KiB
C++
// AUTOGENERATED — do not edit. Source: schemas/modes/channel_strip.json. Run `bun run codegen/generate.ts` to regenerate.
|
|
#ifndef NISPS_GENERATED_CHANNEL_STRIP_SCHEMA_HPP
|
|
#define NISPS_GENERATED_CHANNEL_STRIP_SCHEMA_HPP
|
|
|
|
#include "schema_types.hpp"
|
|
#include "../../ml/mlp.hpp"
|
|
|
|
namespace nisps::modes::generated {
|
|
|
|
inline constexpr std::string_view kChannelStripModeId = "channel_strip";
|
|
inline constexpr std::string_view kChannelStripEngineId = "channel_strip";
|
|
|
|
inline constexpr std::array<std::string_view, 4> kChannelStripInputChannels = {{
|
|
"joy_x",
|
|
"joy_y",
|
|
"joy_z",
|
|
"joy_w",
|
|
}};
|
|
|
|
inline constexpr std::array<std::size_t, 3> kChannelStripHiddenLayers = {{
|
|
10u,
|
|
10u,
|
|
14u,
|
|
}};
|
|
|
|
inline constexpr MLConfig kChannelStripMLConfig = {
|
|
4u,
|
|
24u,
|
|
0.6f,
|
|
1.0f,
|
|
1000u,
|
|
};
|
|
|
|
inline constexpr std::size_t kChannelStripParamCount = 24u;
|
|
inline constexpr std::array<Param, kChannelStripParamCount> kChannelStripParams = {{
|
|
Param{
|
|
"pre_gain",
|
|
"Pre Gain",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::square,
|
|
"gain",
|
|
},
|
|
Param{
|
|
"peak0_freq",
|
|
"Peak0 Freq",
|
|
0.0f,
|
|
1.0f,
|
|
0.3f,
|
|
Curve::square,
|
|
"eq",
|
|
},
|
|
Param{
|
|
"p02",
|
|
"Param 02",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::linear,
|
|
"general",
|
|
},
|
|
Param{
|
|
"p03",
|
|
"Param 03",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::linear,
|
|
"general",
|
|
},
|
|
Param{
|
|
"peak1_freq",
|
|
"Peak1 Freq",
|
|
0.0f,
|
|
1.0f,
|
|
0.3f,
|
|
Curve::square,
|
|
"eq",
|
|
},
|
|
Param{
|
|
"peak_q",
|
|
"Peak Q",
|
|
0.0f,
|
|
1.0f,
|
|
0.3f,
|
|
Curve::linear,
|
|
"eq",
|
|
},
|
|
Param{
|
|
"peak_gain",
|
|
"Peak Gain",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::linear,
|
|
"eq",
|
|
},
|
|
Param{
|
|
"in_lpf_cutoff",
|
|
"Input LPF",
|
|
0.0f,
|
|
1.0f,
|
|
0.7f,
|
|
Curve::square,
|
|
"filters",
|
|
},
|
|
Param{
|
|
"in_hpf_cutoff",
|
|
"Input HPF",
|
|
0.0f,
|
|
1.0f,
|
|
0.2f,
|
|
Curve::square,
|
|
"filters",
|
|
},
|
|
Param{
|
|
"p09",
|
|
"Param 09",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::linear,
|
|
"general",
|
|
},
|
|
Param{
|
|
"comp_threshold",
|
|
"Comp Threshold",
|
|
0.0f,
|
|
1.0f,
|
|
0.0f,
|
|
Curve::linear,
|
|
"comp",
|
|
},
|
|
Param{
|
|
"comp_ratio",
|
|
"Comp Ratio",
|
|
0.0f,
|
|
1.0f,
|
|
0.0f,
|
|
Curve::linear,
|
|
"comp",
|
|
},
|
|
Param{
|
|
"comp_attack",
|
|
"Comp Attack",
|
|
0.0f,
|
|
1.0f,
|
|
0.1f,
|
|
Curve::linear,
|
|
"comp",
|
|
},
|
|
Param{
|
|
"comp_release",
|
|
"Comp Release",
|
|
0.0f,
|
|
1.0f,
|
|
0.3f,
|
|
Curve::square,
|
|
"comp",
|
|
},
|
|
Param{
|
|
"lowshelf_freq",
|
|
"Lowshelf Freq",
|
|
0.0f,
|
|
1.0f,
|
|
0.3f,
|
|
Curve::square,
|
|
"eq",
|
|
},
|
|
Param{
|
|
"lowshelf_q",
|
|
"Lowshelf Q",
|
|
0.0f,
|
|
1.0f,
|
|
0.3f,
|
|
Curve::linear,
|
|
"eq",
|
|
},
|
|
Param{
|
|
"lowshelf_gain",
|
|
"Lowshelf Gain",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::linear,
|
|
"eq",
|
|
},
|
|
Param{
|
|
"highshelf_freq",
|
|
"Highshelf Freq",
|
|
0.0f,
|
|
1.0f,
|
|
0.3f,
|
|
Curve::square,
|
|
"eq",
|
|
},
|
|
Param{
|
|
"highshelf_q",
|
|
"Highshelf Q",
|
|
0.0f,
|
|
1.0f,
|
|
0.3f,
|
|
Curve::linear,
|
|
"eq",
|
|
},
|
|
Param{
|
|
"highshelf_gain",
|
|
"Highshelf Gain",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::linear,
|
|
"eq",
|
|
},
|
|
Param{
|
|
"p20",
|
|
"Param 20",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::linear,
|
|
"general",
|
|
},
|
|
Param{
|
|
"p21",
|
|
"Param 21",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::linear,
|
|
"general",
|
|
},
|
|
Param{
|
|
"p22",
|
|
"Param 22",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::linear,
|
|
"general",
|
|
},
|
|
Param{
|
|
"post_gain",
|
|
"Post Gain",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::square,
|
|
"gain",
|
|
},
|
|
}};
|
|
|
|
inline constexpr std::size_t kChannelStripVoiceSpaceCount = 6u;
|
|
inline constexpr std::array<std::string_view, kChannelStripVoiceSpaceCount> kChannelStripVoiceSpaces = {{
|
|
"WannabeNeve66",
|
|
"SSL 4K G-ist",
|
|
"SSL 9K-inda",
|
|
"MaleVox",
|
|
"FemaleVox",
|
|
"Neve 80",
|
|
}};
|
|
|
|
inline constexpr UIConfig kChannelStripUI = {
|
|
PrimaryInput::Joystick,
|
|
true,
|
|
false,
|
|
};
|
|
|
|
using ChannelStripMLP = ::nisps::ml::MLP<kChannelStripMLConfig.input_size, kChannelStripHiddenLayers[0], kChannelStripHiddenLayers[1], kChannelStripHiddenLayers[2], kChannelStripMLConfig.output_size>;
|
|
|
|
inline constexpr ::nisps::ParamSchema kChannelStripSchema = {
|
|
kChannelStripModeId,
|
|
kChannelStripEngineId,
|
|
std::span<const std::string_view>(kChannelStripInputChannels),
|
|
kChannelStripMLConfig.input_size,
|
|
std::span<const std::size_t>(kChannelStripHiddenLayers),
|
|
kChannelStripMLConfig.output_size,
|
|
kChannelStripMLConfig.default_spread,
|
|
kChannelStripMLConfig.default_learning_rate,
|
|
kChannelStripMLConfig.default_max_iterations,
|
|
std::span<const Param>(kChannelStripParams),
|
|
std::span<const std::string_view>(kChannelStripVoiceSpaces),
|
|
kChannelStripUI,
|
|
};
|
|
|
|
} // namespace nisps::modes::generated
|
|
|
|
#endif // NISPS_GENERATED_CHANNEL_STRIP_SCHEMA_HPP
|