wip: continious sound

This commit is contained in:
2023-08-09 23:13:08 +04:00
parent c63db4fa07
commit c16447f30e
6 changed files with 38 additions and 31 deletions

View File

@@ -9,7 +9,7 @@ struct Adder {
static std::vector<float>&
SumOscillators(const std::vector<Oscillator*>& oscillators,
float duration) {
size_t sample_count = (size_t)(duration * SAMPLE_RATE);
size_t sample_count = (size_t)(1.f/FPS * SAMPLE_RATE);
std::vector<float>* output = new std::vector<float>();
output->reserve(sample_count);

View File

@@ -6,7 +6,8 @@
#define PITCH_STANDARD 440.f
#define VOLUME 0.5f
#define ATTACK_MS 100.f
#define STREAM_BUFFER_SIZE 4096
#define STREAM_BUFFER_SIZE 1024
#define FPS 60
#define SYNTH_PI 3.1415926535f
#define SYNTH_VOLUME 0.5f