Page 1 of 1

export volume with expansion sound enabled

Posted: Fri Jul 10, 2015 4:46 am
by jdbones
When I export a song to a .wav, the overall volume is much quieter if I have an expansion module enabled, as opposed to just the basic NES channels. Does anyone know how to disable this?

Re: export volume with expansion sound enabled

Posted: Fri Jul 10, 2015 4:56 am
by HertzDevil
At this moment no as there is no way to prevent the mixer from calling CMixer::GetAttenuation():

Code: Select all

float CMixer::GetAttenuation() const
{
   const float ATTENUATION_VRC6 = 0.80f;
   const float ATTENUATION_VRC7 = 0.64f;
   const float ATTENUATION_N163 = 0.70f;
   const float ATTENUATION_MMC5 = 0.83f;
   const float ATTENUATION_FDS  = 0.90f;

   float Attenuation = 1.0f;

   // Increase headroom if some expansion chips are enabled

   if (m_iExternalChip & SNDCHIP_VRC7)
      Attenuation *= ATTENUATION_VRC7;

   if (m_iExternalChip & SNDCHIP_N163)
      Attenuation *= ATTENUATION_N163;

   if (m_iExternalChip & SNDCHIP_VRC6)
      Attenuation *= ATTENUATION_VRC6;

   if (m_iExternalChip & SNDCHIP_MMC5)
      Attenuation *= ATTENUATION_MMC5;

   if (m_iExternalChip & SNDCHIP_FDS)
      Attenuation *= ATTENUATION_FDS;

   return Attenuation;
}

void CMixer::UpdateSettings(int LowCut, int HighCut, int HighDamp, float OverallVol)
{
   float Volume = OverallVol * GetAttenuation();
   // ...

Indeed it is not FamiTracker's responsibility to perform compression on the sound output, so the attenuation is required to prevent the song from easily clipping (as some expansion chips, like VRC7, are inherently much louder than the internal channels), as well as maintain volume balance between having no expansion chips and having one or multiple of them.

Re: export volume with expansion sound enabled

Posted: Fri Jul 10, 2015 5:05 am
by rainwarrior
By the way, this is also how the Famicom expansion carts have to do it (for a different reason). Either the 2A03 audio is attenuated during passive mixing with the expansion sound, or it has to have an on-cart amplifier to boost the levels. (Only the 5B takes the amplifier approach. All others attenuate the 2A03 audio.) This has nothing to do with why Famitracker does it (Famitracker does it for digital headroom), but it's a similar situation in effect.

Re: export volume with expansion sound enabled

Posted: Fri Jul 10, 2015 3:09 pm
by jdbones
OK cool, this makes sense. Thanks much guys!