From d3e6ab0894d47b25edcf77ab0ac07bbff6e4e4b5 Mon Sep 17 00:00:00 2001 From: Holger Wirtz Date: Tue, 26 Feb 2019 08:19:31 +0100 Subject: [PATCH] Fixed volume again. --- MicroDexed.ino | 4 ++-- config.h | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/MicroDexed.ino b/MicroDexed.ino index 70f8bb1..d9d4c5e 100644 --- a/MicroDexed.ino +++ b/MicroDexed.ino @@ -703,9 +703,9 @@ void set_volume(float v, float p) // http://files.csound-tutorial.net/floss_manual/Release03/Cs_FM_03_ScrapBook/b-panning-and-spatialization.html #ifdef TEENSY_AUDIO_BOARD - sgtl5000_1.dacVolume(pow(v,0.2) * sinf(p * PI / 2), pow(v,0.2) * cosf(p * PI / 2)); + sgtl5000_1.dacVolume(pow(v,VOLUME_CURVE) * sinf(p * PI / 2), pow(v, VOLUME_CURVE) * cosf(p * PI / 2)); #else - volume_master.gain(v); + volume_master.gain(VOLUME_CURVE); volume_r.gain(sinf(p * PI / 2)); volume_l.gain(cosf(p * PI / 2)); #endif diff --git a/config.h b/config.h index 0312a90..bbb0603 100644 --- a/config.h +++ b/config.h @@ -67,8 +67,9 @@ //************************************************************************************************* //* AUDIO SETTINGS //************************************************************************************************* - +// https://rechneronline.de/funktionsgraphen/ #define VOLUME 0.8 +#define VOLUME_CURVE 0.1 #ifndef TEENSY_AUDIO_BOARD #if AUDIO_BLOCK_SAMPLES == 64 #define AUDIO_MEM 450