bun-runnable TypeScript script (codegen/generate.ts) that:
- Validates each schemas/modes/*.json against the meta-schema via
ajv (Draft 2020-12).
- Cross-checks params.length == ml.output_size and
ml.input_channels.length == ml.input_size.
- Emits constexpr C++ data into nisps/modes/generated/ (one
schema_types.hpp + one <mode_id>_schema.hpp per mode). Uses
std::string_view + std::array; no std::vector, no heap, .f
suffixed float literals (perf contract §3.3).
- Emits TS modules into playground/src/modes/generated/ (one
types.ts + one <mode_id>_schema.ts + index.ts barrel).
- Idempotent: re-running yields byte-identical output.
- Exits non-zero on schema validation failure.
Reference templates live in codegen/templates/ (not consumed at
codegen time -- for human reviewers).
Golden test (codegen/tests/golden_test.ts) snapshots
paf_synth_schema.{hpp,ts} and verifies regeneration matches the
golden + that a second run is idempotent.
Until stream 1 lands nisps/core/math.hpp, schema_types.hpp ships
its own minimal Curve enum with a TODO marker pointing at the
eventual include.
353 lines
6 KiB
C++
353 lines
6 KiB
C++
// AUTOGENERATED — do not edit. Source: schemas/modes/paf_synth.json. Run `bun run codegen/generate.ts` to regenerate.
|
|
#ifndef NISPS_GENERATED_PAF_SYNTH_SCHEMA_HPP
|
|
#define NISPS_GENERATED_PAF_SYNTH_SCHEMA_HPP
|
|
|
|
#include "schema_types.hpp"
|
|
|
|
namespace nisps::modes::generated {
|
|
|
|
inline constexpr std::string_view kPafSynthModeId = "paf_synth";
|
|
inline constexpr std::string_view kPafSynthEngineId = "paf_synth";
|
|
|
|
inline constexpr std::array<std::string_view, 4> kPafSynthInputChannels = {{
|
|
"joy_x",
|
|
"joy_y",
|
|
"joy_z",
|
|
"joy_w",
|
|
}};
|
|
|
|
inline constexpr std::array<std::size_t, 3> kPafSynthHiddenLayers = {{
|
|
10u,
|
|
10u,
|
|
14u,
|
|
}};
|
|
|
|
inline constexpr MLConfig kPafSynthMLConfig = {
|
|
4u,
|
|
33u,
|
|
0.6f,
|
|
1.0f,
|
|
1000u,
|
|
};
|
|
|
|
inline constexpr std::size_t kPafSynthParamCount = 33u;
|
|
inline constexpr std::array<Param, kPafSynthParamCount> kPafSynthParams = {{
|
|
Param{
|
|
"p00",
|
|
"Param 00",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::Linear,
|
|
"general",
|
|
},
|
|
Param{
|
|
"p01",
|
|
"Param 01",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::Linear,
|
|
"general",
|
|
},
|
|
Param{
|
|
"paf0_cf",
|
|
"PAF0 Center Freq",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::Linear,
|
|
"operators",
|
|
},
|
|
Param{
|
|
"paf1_cf",
|
|
"PAF1 Center Freq",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::Linear,
|
|
"operators",
|
|
},
|
|
Param{
|
|
"p04",
|
|
"Param 04",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::Linear,
|
|
"general",
|
|
},
|
|
Param{
|
|
"paf0_bw",
|
|
"PAF0 Bandwidth",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::Linear,
|
|
"operators",
|
|
},
|
|
Param{
|
|
"paf1_bw",
|
|
"PAF1 Bandwidth",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::Linear,
|
|
"operators",
|
|
},
|
|
Param{
|
|
"p07",
|
|
"Param 07",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::Linear,
|
|
"general",
|
|
},
|
|
Param{
|
|
"paf0_vib",
|
|
"PAF0 Vibrato Depth",
|
|
0.0f,
|
|
1.0f,
|
|
0.0f,
|
|
Curve::Square,
|
|
"modulation",
|
|
},
|
|
Param{
|
|
"paf1_vib",
|
|
"PAF1 Vibrato Depth",
|
|
0.0f,
|
|
1.0f,
|
|
0.0f,
|
|
Curve::Square,
|
|
"modulation",
|
|
},
|
|
Param{
|
|
"p10",
|
|
"Param 10",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::Linear,
|
|
"general",
|
|
},
|
|
Param{
|
|
"paf0_vfr",
|
|
"PAF0 Vibrato Rate",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::Square,
|
|
"modulation",
|
|
},
|
|
Param{
|
|
"paf1_vfr",
|
|
"PAF1 Vibrato Rate",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::Square,
|
|
"modulation",
|
|
},
|
|
Param{
|
|
"p13",
|
|
"Param 13",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::Linear,
|
|
"general",
|
|
},
|
|
Param{
|
|
"paf0_shift",
|
|
"PAF0 Shift",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::Linear,
|
|
"operators",
|
|
},
|
|
Param{
|
|
"paf1_shift",
|
|
"PAF1 Shift",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::Linear,
|
|
"operators",
|
|
},
|
|
Param{
|
|
"p16",
|
|
"Param 16",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::Linear,
|
|
"general",
|
|
},
|
|
Param{
|
|
"dl1mix",
|
|
"Delay Mix",
|
|
0.0f,
|
|
1.0f,
|
|
0.0f,
|
|
Curve::Square,
|
|
"delay",
|
|
},
|
|
Param{
|
|
"p18",
|
|
"Param 18",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::Linear,
|
|
"general",
|
|
},
|
|
Param{
|
|
"dlfb",
|
|
"Delay Feedback",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::Linear,
|
|
"delay",
|
|
},
|
|
Param{
|
|
"env_decay",
|
|
"Env Decay",
|
|
0.0f,
|
|
1.0f,
|
|
0.3f,
|
|
Curve::Square,
|
|
"envelope",
|
|
},
|
|
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{
|
|
"p23",
|
|
"Param 23",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::Linear,
|
|
"general",
|
|
},
|
|
Param{
|
|
"p24",
|
|
"Param 24",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::Linear,
|
|
"general",
|
|
},
|
|
Param{
|
|
"p25",
|
|
"Param 25",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::Linear,
|
|
"general",
|
|
},
|
|
Param{
|
|
"shape_gain",
|
|
"Sine Shape Gain",
|
|
0.0f,
|
|
1.0f,
|
|
0.0f,
|
|
Curve::Square,
|
|
"shaper",
|
|
},
|
|
Param{
|
|
"shape_asym",
|
|
"Sine Shape Asym",
|
|
0.0f,
|
|
1.0f,
|
|
0.0f,
|
|
Curve::Square,
|
|
"shaper",
|
|
},
|
|
Param{
|
|
"shape_mix",
|
|
"Sine Shape Mix",
|
|
0.0f,
|
|
1.0f,
|
|
0.0f,
|
|
Curve::Linear,
|
|
"shaper",
|
|
},
|
|
Param{
|
|
"rm_gain",
|
|
"Ring Mod Gain",
|
|
0.0f,
|
|
1.0f,
|
|
0.0f,
|
|
Curve::Square,
|
|
"shaper",
|
|
},
|
|
Param{
|
|
"env_attack",
|
|
"Env Attack",
|
|
0.0f,
|
|
1.0f,
|
|
0.0f,
|
|
Curve::Linear,
|
|
"envelope",
|
|
},
|
|
Param{
|
|
"env_sustain",
|
|
"Env Sustain",
|
|
0.0f,
|
|
1.0f,
|
|
0.5f,
|
|
Curve::Linear,
|
|
"envelope",
|
|
},
|
|
Param{
|
|
"env_release",
|
|
"Env Release",
|
|
0.0f,
|
|
1.0f,
|
|
0.3f,
|
|
Curve::Linear,
|
|
"envelope",
|
|
},
|
|
}};
|
|
|
|
inline constexpr std::size_t kPafSynthVoiceSpaceCount = 7u;
|
|
inline constexpr std::array<std::string_view, kPafSynthVoiceSpaceCount> kPafSynthVoiceSpaces = {{
|
|
"Ellipticacacia",
|
|
"Rowantares",
|
|
"Neemeda",
|
|
"Aquillow",
|
|
"Magnetarch",
|
|
"Elderstar",
|
|
"Ipeleiades",
|
|
}};
|
|
|
|
inline constexpr UIConfig kPafSynthUI = {
|
|
PrimaryInput::XYPad,
|
|
true,
|
|
true,
|
|
};
|
|
|
|
} // namespace nisps::modes::generated
|
|
|
|
#endif // NISPS_GENERATED_PAF_SYNTH_SCHEMA_HPP
|