add soft-clipping of mixed sounds using tanh

expose ADSR to TinyAudio API
enable envelope when playing wav files
This commit is contained in:
Erwin Coumans
2017-04-28 12:39:51 -07:00
parent 821ad96549
commit c95a1c9c33
8 changed files with 51 additions and 19 deletions

View File

@@ -2,6 +2,7 @@
#define B3_SOUND_ENGINE_H
#include "Bullet3Common/b3Scalar.h"
#include "b3Sound_C_Api.h"
struct b3SoundMessage
{
@@ -11,10 +12,22 @@ struct b3SoundMessage
double m_frequency;
int m_wavId;
double m_attack;
double m_decay;
double m_sustain;
double m_release;
double m_attackRate;
double m_decayRate;
double m_sustainLevel;
double m_releaseRate;
b3SoundMessage()
:m_type(B3_SOUND_SOURCE_SINE_OSCILLATOR),
m_amplitude(0.5),
m_frequency(440),
m_wavId(-1),
m_attackRate(0.001),
m_decayRate(0.00001),
m_sustainLevel(0.5),
m_releaseRate(0.0005)
{
}
};
class b3SoundEngine