14constexpr int kSynthRate = 32000;
15constexpr double kSynthMaxSeconds = 330.0;
18 std::vector<int16_t> pcm;
19 uint32_t loopStart = 0;
25 double startSec = 0.0;
26 double soundSec = 0.0;
27 float freqScale = 1.0f;
31 std::shared_ptr<SynthSample> sample;
36 std::vector<std::pair<float, float>> envPoints;
37 float envLoopStartT = -1.0f;
42 float releaseSec = 0.1f;
43 float sustainLevel = 0.0f;
44 float sustainHoldSec = 128.0f / 240.0f;
45 float vibDelaySec = 0.0f;
46 float vibRampSec = 0.0f;
47 float vibDepthStart = 0.0f;
48 float vibDepthEnd = 0.0f;
49 float vibRateStartHz = 0.0f;
50 float vibRateEndHz = 0.0f;
51 float vibRateRampSec = 0.0f;
52 float portaRatio = 1.0f;
53 float portaSec = 0.0f;
61 std::vector<Seg> segs;
66using GainAutomation = std::vector<std::pair<float, float>>;
67using PitchAutomation = std::vector<std::pair<float, float>>;
70 std::vector<int16_t> pcm;
75std::vector<int16_t> Synthesize(
const std::vector<SynthNote>& notes,
const GainAutomation (&gainAuto)[16],
76 const PitchAutomation (&pitchAuto)[16],
double lengthSec);