1#ifndef NANOMMO_CLIENT_SYNTH_H_
2#define NANOMMO_CLIENT_SYNTH_H_
20 explicit Noise(uint32_t seed);
26 float Between(
float low,
float high);
48 Out Run(
float in,
float hertz,
float q = 0.7f);
59 float Next(
float hertz);
68float Envelope(
float t,
float attack,
float decay);
Out Run(float in, float hertz, float q=0.7f)
float Between(float low, float high)
From low to high.
float Uniform()
From 0 to 1.
float Next()
From -1 to 1: white noise, a sample at a time.
std::vector< float > Samples
One channel of sound, at kRate.
int SamplesIn(float seconds)
The seconds, as a count of samples.
void Mix(Samples &mix, const Samples &sound, float at, float gain)
void FadeOut(Samples &samples)
float Peak(const Samples &samples)
The loudest sample, whichever way it goes.
void Limit(Samples &samples)
void Normalize(Samples &samples, float peak)
Louder or quieter, so that the loudest sample is at the peak.
float Envelope(float t, float attack, float decay)