export volume with expansion sound enabled

General discussion about tracking, help and support.
jdbones
Posts: 2
Joined: Fri Jul 10, 2015 4:44 am

export volume with expansion sound enabled

Postby jdbones » Fri Jul 10, 2015 4:46 am

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?

User avatar
HertzDevil
Posts: 475
Joined: Thu Apr 23, 2015 7:39 pm
Location: Hong Kong SAR
Contact:

Re: export volume with expansion sound enabled

Postby HertzDevil » Fri Jul 10, 2015 4:56 am

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.
refactoring 0cc-famitracker

User avatar
rainwarrior
Forum Staff
Posts: 165
Joined: Thu Apr 23, 2015 8:23 pm
Location: Canada
Contact:

Re: export volume with expansion sound enabled

Postby rainwarrior » Fri Jul 10, 2015 5:05 am

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.

jdbones
Posts: 2
Joined: Fri Jul 10, 2015 4:44 am

Re: export volume with expansion sound enabled

Postby jdbones » Fri Jul 10, 2015 3:09 pm

OK cool, this makes sense. Thanks much guys!


Return to “General Talk”

Who is online

Users browsing this forum: No registered users and 2 guests