mirror of https://github.com/AxioDL/amuse.git
Remove VolumeLUT; SoundMacro mixing appears to be linear
This commit is contained in:
parent
2836e73812
commit
ecd990e94e
|
@ -27,7 +27,6 @@ set(SOURCES
|
||||||
lib/SongConverter.cpp
|
lib/SongConverter.cpp
|
||||||
lib/SongState.cpp
|
lib/SongState.cpp
|
||||||
lib/Voice.cpp
|
lib/Voice.cpp
|
||||||
lib/VolumeLUT.c
|
|
||||||
lib/Submix.cpp
|
lib/Submix.cpp
|
||||||
lib/Studio.cpp
|
lib/Studio.cpp
|
||||||
lib/EffectReverb.cpp
|
lib/EffectReverb.cpp
|
||||||
|
|
|
@ -384,12 +384,10 @@ std::shared_ptr<Sequencer> Engine::seqPlay(int groupId, int songId, const unsign
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" const float VolumeLUT[];
|
|
||||||
|
|
||||||
/** Set total volume of engine */
|
/** Set total volume of engine */
|
||||||
void Engine::setVolume(float vol)
|
void Engine::setVolume(float vol)
|
||||||
{
|
{
|
||||||
m_backend.setVolume(VolumeLUT[int(clamp(0.f, vol, 1.f) * 65536)] * 1.46245869f);
|
m_backend.setVolume(vol);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Find voice from VoiceId */
|
/** Find voice from VoiceId */
|
||||||
|
|
|
@ -12,7 +12,6 @@
|
||||||
|
|
||||||
namespace amuse
|
namespace amuse
|
||||||
{
|
{
|
||||||
extern "C" const float VolumeLUT[];
|
|
||||||
|
|
||||||
void Voice::_destroy()
|
void Voice::_destroy()
|
||||||
{
|
{
|
||||||
|
@ -193,8 +192,7 @@ std::list<std::shared_ptr<Voice>>::iterator Voice::_destroyVoice(std::list<std::
|
||||||
template <typename T>
|
template <typename T>
|
||||||
static T ApplyVolume(float vol, T samp)
|
static T ApplyVolume(float vol, T samp)
|
||||||
{
|
{
|
||||||
/* -10dB to 0dB mapped to full volume range */
|
return samp * 0.5f * vol;
|
||||||
return samp * VolumeLUT[int(vol * 65536)];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Voice::_procSamplePre(int16_t& samp)
|
void Voice::_procSamplePre(int16_t& samp)
|
||||||
|
|
65550
lib/VolumeLUT.c
65550
lib/VolumeLUT.c
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue