Skip to content

Commit

Permalink
feat(zita)#: Add parameter struct and helper for easier passing of zi…
Browse files Browse the repository at this point in the history
…ta parameters around
  • Loading branch information
BlueCyro committed Sep 11, 2024
1 parent 12e63db commit 86ea009
Show file tree
Hide file tree
Showing 3 changed files with 223 additions and 1 deletion.
134 changes: 133 additions & 1 deletion SharpPipe/Docs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 27 additions & 0 deletions SharpPipe/Helpers/ParameterHelper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
namespace SharpPipe;

/// <summary>
/// Helper class for easier manipulation of parameters
/// </summary>
public static class ParameterHelper
{
/// <summary>
/// Copies the parameters from one Zita filter implementation to another
/// </summary>
/// <param name="zita">This Zita filter</param>
/// <param name="other">The Zita filter to copy parameters from</param>
public static void FromOther(this IZitaFilter zita, in IZitaFilter other)
{
zita.InDelay = other.InDelay;
zita.Crossover = other.Crossover;
zita.RT60Low = other.RT60Low;
zita.RT60Mid = other.RT60Mid;
zita.HighFrequencyDamping = other.HighFrequencyDamping;
zita.EQ1Frequency = other.EQ1Frequency;
zita.EQ1Level = other.EQ1Level;
zita.EQ2Frequency = other.EQ2Frequency;
zita.EQ2Level = other.EQ2Level;
zita.Mix = other.Mix;
zita.Level = other.Level;
}
}
63 changes: 63 additions & 0 deletions SharpPipe/Structs/ZitaParameters.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
namespace SharpPipe;


/// <summary>
/// Parameter struct that implements the Zita filter interface
/// </summary>
public struct ZitaParameters : IZitaFilter
{
/// <summary>
/// The input delay (ms) before reverb is applied to the incoming signal (default: 60ms)
/// </summary>
public float InDelay { get; set; }

/// <summary>
/// The separation between 'high' and 'low' frequencies (default: 200hz)
/// </summary>
public float Crossover { get; set; }

/// <summary>
/// The time in seconds it takes for low frequencies to decrease by 60dB (default: 3 seconds)
/// </summary>
public float RT60Low { get; set; }

/// <summary>
/// The time in seconds it takes for mid frequencies to decrease by 60dB (default: 2 seconds)
/// </summary>
public float RT60Mid { get; set; }

/// <summary>
/// Frequencies (hz) above this one are heard half as long as as the mid-range frequencies - e.g. when their T60 is half of the middle-range's T60 (default: 6000hz)
/// </summary>
public float HighFrequencyDamping { get; set; }

/// <summary>
/// The center frequency (hz) of the Regalia Mitra peaking equalizer for the first section (default: 315hz)
/// </summary>
public float EQ1Frequency { get; set; }

/// <summary>
/// The peak level (dB) of equalizer 1 (default: 0dB)
/// </summary>
public float EQ1Level { get; set; }

/// <summary>
/// The center frequency (hz) of the Regalia Mitra peaking equalizer for the second section (default: 1500hz)
/// </summary>
public float EQ2Frequency { get; set; }

/// <summary>
/// The peak level (dB) of equalizer 2 (default: 0dB)
/// </summary>
public float EQ2Level { get; set; }

/// <summary>
/// Mixes the wet and dry signals - e.g. 0 is no reverb, 1 is only reverb (default: 1)
/// </summary>
public float Mix { get; set; }

/// <summary>
/// The factor (dB) to scale the output by (default: -20dB)
/// </summary>
public float Level { get; set; }
}

0 comments on commit 86ea009

Please sign in to comment.