Skip to content

Commit cf3cbc2

Browse files
committed
[Binaural] Adjusts reverb directionality attenuation
1 parent ac5737a commit cf3cbc2

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

3dti_Toolkit/BinauralSpatializer/Listener.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -277,11 +277,12 @@ namespace Binaural
277277

278278
for (int c = 0; c <= NUM_STEPS_TO_INTEGRATE_CARDIOID_FOR_REVERB; c++)
279279
{
280-
v += std::pow(CalculateDirectionalityLinearAttenuation(directionalityExtend_dB, angle_rad),2);
280+
// Weighted sum of the directionality of the sphere rings
281+
v += std::pow(CalculateDirectionalityLinearAttenuation(directionalityExtend_dB, angle_rad),2) * std::sin(angle_rad);
281282
angle_rad += angleStep;
282283
}
283-
284-
v = std::sqrt(v / NUM_STEPS_TO_INTEGRATE_CARDIOID_FOR_REVERB);
284+
// Normalizing (making omnidirectional non-attenuating)
285+
v = std::sqrt(v /(2 * (NUM_STEPS_TO_INTEGRATE_CARDIOID_FOR_REVERB + 1)));
285286

286287
return v;
287288
}

0 commit comments

Comments
 (0)