summaryrefslogtreecommitdiff
path: root/src/main.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cc')
-rw-r--r--src/main.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/main.cc b/src/main.cc
index 5f74302..aa41647 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -48,7 +48,7 @@ void generate_tone(float *buffer, float freq) {
memset(buffer, 0, SPEC_FRAMES * DCT_SIZE * sizeof(float));
for (int frame = 0; frame < SPEC_FRAMES; ++frame) {
float *spec_frame = buffer + frame * DCT_SIZE;
- float amplitude = powf(1.0f - (float)frame / SPEC_FRAMES, 2.0f);
+ float amplitude = 1000. * powf(1.0f - (float)frame / SPEC_FRAMES, 2.0f);
int bin = (int)(freq / (32000.0f / 2.0f) * DCT_SIZE);
if (bin > 0 && bin < DCT_SIZE) {
@@ -107,7 +107,7 @@ int main(int argc, char **argv) {
// Snare on 4, 12
if (step == 4 || step == 12) {
- synth_trigger_voice(snare_id, 0.8f, 0.0f);
+ synth_trigger_voice(snare_id, 0.8f, step & 8 ? -1.0f : 1.0f);
}
// Hihat on every offbeat
@@ -117,13 +117,13 @@ int main(int argc, char **argv) {
// Bass pattern
if (step % 4 == 0) {
- float bass_freq = (step < 8) ? 110.0f : 82.41f; // A2 then E2
float *back_buffer = synth_begin_update(bass_id);
if (back_buffer) {
+ float bass_freq = (step < 8) ? 110.0f : 164.82f; // A3 then E3
generate_tone(back_buffer, bass_freq);
synth_commit_update(bass_id);
}
- synth_trigger_voice(bass_id, 0.6f, -0.2f);
+ synth_trigger_voice(bass_id, 0.9f, 1.2f);
}
beat_count++;
@@ -145,4 +145,4 @@ int main(int argc, char **argv) {
gpu_shutdown();
platform_shutdown();
return 0;
-} \ No newline at end of file
+}