Skip to content

Commit

Permalink
Yamaha RX-A series support
Browse files Browse the repository at this point in the history
  • Loading branch information
VoidXH committed Aug 16, 2024
1 parent 0da9ee3 commit 32d36f4
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 13 deletions.
2 changes: 2 additions & 0 deletions Cavern.QuickEQ.Format/FilterSet/BaseClasses/FilterSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ public static FilterSet Create(FilterSetTarget device, int channels, int sampleR
FilterSetTarget.MultEQX => new MultEQXFilterSet(channels, sampleRate),
FilterSetTarget.MultEQXRaw => new MultEQXRawFilterSet(channels, sampleRate),
FilterSetTarget.MultEQXTarget => new MultEQXTargetFilterSet(channels, sampleRate),
FilterSetTarget.YamahaRXA => new YamahaRXAFilterSet(channels, sampleRate),
FilterSetTarget.YPAO => new YPAOFilterSet(channels, sampleRate),
FilterSetTarget.YPAOLite => new YPAOLiteFilterSet(channels, sampleRate),
FilterSetTarget.Multiband31 => new Multiband31FilterSet(channels, sampleRate),
Expand Down Expand Up @@ -141,6 +142,7 @@ public static FilterSet Create(FilterSetTarget device, ReferenceChannel[] channe
FilterSetTarget.MultEQX => new MultEQXFilterSet(channels, sampleRate),
FilterSetTarget.MultEQXRaw => new MultEQXRawFilterSet(channels, sampleRate),
FilterSetTarget.MultEQXTarget => new MultEQXTargetFilterSet(channels, sampleRate),
FilterSetTarget.YamahaRXA => new YamahaRXAFilterSet(channels, sampleRate),
FilterSetTarget.YPAO => new YPAOFilterSet(channels, sampleRate),
FilterSetTarget.YPAOLite => new YPAOLiteFilterSet(channels, sampleRate),
FilterSetTarget.Multiband31 => new Multiband31FilterSet(channels, sampleRate),
Expand Down
13 changes: 9 additions & 4 deletions Cavern.QuickEQ.Format/FilterSet/BaseClasses/FilterSetTarget.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,15 @@ public enum FilterSetTarget {
/// </summary>
MultEQXTarget,
/// <summary>
/// Processors supporting the latest YPAO with additional fine tuning PEQs.
/// Yamaha RX-A series AVRs.
/// </summary>
YamahaRXA,
/// <summary>
/// Yamaha RX series AVRs.
/// </summary>
YPAO,
/// <summary>
/// Older Yamaha processors with fixed 7 bands.
/// Yamaha CX-A series AVRs.
/// </summary>
YPAOLite,

Expand Down Expand Up @@ -188,8 +192,9 @@ public static class FilterSetTargetExtensions {
FilterSetTarget.MultEQX => "MultEQ-X - MQX file",
FilterSetTarget.MultEQXRaw => "MultEQ-X - peaking EQ",
FilterSetTarget.MultEQXTarget => "MultEQ-X - filter curves",
FilterSetTarget.YPAO => "YPAO - free bands",
FilterSetTarget.YPAOLite => "YPAO - fixed bands",
FilterSetTarget.YamahaRXA => "Yamaha RX-A series",
FilterSetTarget.YPAO => "Yamaha RX series",
FilterSetTarget.YPAOLite => "Yamaha CX-A series",
FilterSetTarget.Multiband31 => "31-band graphic EQ",
_ => throw new NotSupportedException()
};
Expand Down
12 changes: 6 additions & 6 deletions Cavern.QuickEQ.Format/FilterSet/YPAOFilterSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace Cavern.Format.FilterSet {
/// <summary>
/// Filter set limited to 1/3 octave band choices for some versions of YPAO.
/// Filter set limited to 1/3 octave band choices for Yamaha RX series AVRs (2015-2018).
/// </summary>
public class YPAOFilterSet : LimitedIIRFilterSet {
/// <inheritdoc/>
Expand All @@ -27,7 +27,7 @@ public class YPAOFilterSet : LimitedIIRFilterSet {

/// <inheritdoc/>
public override double MinGain => minGain;
const double minGain = -6;
const double minGain = -20;

/// <inheritdoc/>
public override double GainPrecision => gainPrecision;
Expand All @@ -40,12 +40,12 @@ public class YPAOFilterSet : LimitedIIRFilterSet {
protected override float[] QFactors => qFactors;

/// <summary>
/// Filter set limited to 1/3 octave band choices for some versions of YPAO.
/// Filter set limited to 1/3 octave band choices for Yamaha RX series AVRs (2015-2018).
/// </summary>
public YPAOFilterSet(int channels, int sampleRate) : base(channels, sampleRate) { }

/// <summary>
/// Filter set limited to 1/3 octave band choices for some versions of YPAO.
/// Filter set limited to 1/3 octave band choices Yamaha RX series AVRs (2015-2018).
/// </summary>
public YPAOFilterSet(ReferenceChannel[] channels, int sampleRate) : base(channels, sampleRate) { }

Expand Down Expand Up @@ -93,7 +93,7 @@ public static PeakingEQ[] GetFilters(Equalizer target, bool lfe, int sampleRate)
public override void Export(string path) => File.WriteAllText(path, Export(false));

/// <summary>
/// All the possible bands that can be selected for YPAO. These are 1/3 octaves apart.
/// All the possible bands that can be selected for Yamaha RX series AVRs. These are 1/3 octaves apart.
/// </summary>
static readonly float[] frequencies = {
15.6f, 19.7f, 24.8f, 31.3f, 39.4f, 49.6f, 62.5f, 78.7f, 99.2f, 125.0f, 157.5f, 198.4f, 250, 315, 396.9f, 500, 630, 793.7f,
Expand All @@ -106,7 +106,7 @@ public static PeakingEQ[] GetFilters(Equalizer target, bool lfe, int sampleRate)
const int lastBandFreqsFrom = 15;

/// <summary>
/// All the possible Q-factors that can be selected for YPAO.
/// All the possible Q-factors that can be selected for Yamaha RX series AVRs.
/// </summary>
static readonly float[] qFactors = { 0.5f, 0.63f, 0.794f, 1f, 1.26f, 1.587f, 2f, 2.520f, 3.175f, 4f, 5.04f, 6.350f, 8f, 10.08f };
}
Expand Down
6 changes: 3 additions & 3 deletions Cavern.QuickEQ.Format/FilterSet/YPAOLiteFilterSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Cavern.Format.FilterSet {
/// <summary>
/// Filter set limited to 4/3 octave band choices for some versions of YPAO.
/// Filter set limited to 4/3 octave band choices for Yamaha CX-A series amplifiers.
/// </summary>
public class YPAOLiteFilterSet : MultibandPEQFilterSet {
/// <inheritdoc/>
Expand All @@ -18,12 +18,12 @@ public class YPAOLiteFilterSet : MultibandPEQFilterSet {
public override bool RoundedBands => true;

/// <summary>
/// Filter set limited to 4/3 octave band choices for some versions of YPAO.
/// Filter set limited to 4/3 octave band choices for Yamaha CX-A series amplifiers.
/// </summary>
public YPAOLiteFilterSet(int channels, int sampleRate) : base(channels, sampleRate, 62.5, .75, 7) { }

/// <summary>
/// Filter set limited to 4/3 octave band choices for some versions of YPAO.
/// Filter set limited to 4/3 octave band choices for Yamaha CX-A series amplifiers.
/// </summary>
public YPAOLiteFilterSet(ReferenceChannel[] channels, int sampleRate) : base(channels, sampleRate, 62.5, .75, 7) { }
}
Expand Down
34 changes: 34 additions & 0 deletions Cavern.QuickEQ.Format/FilterSet/YamahaRXAFilterSet.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
using Cavern.Channels;

namespace Cavern.Format.FilterSet {
/// <summary>
/// IIR filter set for Yamaha RX-A series AVRs.
/// </summary>
public class YamahaRXAFilterSet : YPAOFilterSet {
/// <inheritdoc/>
protected override float[] Frequencies => frequencies;

/// <summary>
/// IIR filter set for Yamaha RX-A series AVRs.
/// </summary>
public YamahaRXAFilterSet(int channels, int sampleRate) : base(channels, sampleRate) { }

/// <summary>
/// IIR filter set for Yamaha RX-A series AVRs.
/// </summary>
public YamahaRXAFilterSet(ReferenceChannel[] channels, int sampleRate) : base(channels, sampleRate) { }

/// <summary>
/// All the possible bands that can be selected for Yamaha RX-A series amplifiers. These are 1/3 octaves apart.
/// </summary>
static readonly float[] frequencies = {
15.6f, 16.6f, 17.5f, 18.6f, 19.7f, 20.9f, 22.1f, 23.4f, 24.8f, 26.3f, 27.8f, 29.5f, 31.3f, 33.1f, 35.1f, 37.2f, 39.4f, 42,
44.2f, 47, 49.6f, 53, 55.7f, 59, 62.5f, 66, 70.2f, 74, 78.7f, 83.4f, 88.4f, 93.6f, 99.2f, 105.1f, 111.4f, 118, 125, 132.4f,
140.3f, 148.7f, 157.5f, 166.9f, 176.8f, 187.3f, 198.4f, 210.2f, 222.7f, 236, 250, 264.9f, 280.6f, 297.3f, 315, 333.7f, 353.6f,
374.6f, 396.9f, 420.4f, 445.4f, 471.9f, 500, 529.7f, 561.2f, 594.6f, 630, 667.4f, 707.1f, 749.2f, 793.7f, 840.9f, 890.9f,
943.9f, 1000, 1060, 1120, 1190, 1260, 1330, 1410, 1500, 1590, 1680, 1780, 1890, 2000, 2120, 2240, 2380, 2520, 2670, 2830, 3000,
3170, 3360, 3560, 3780, 4000, 4240, 4490, 4760, 5040, 5340, 5660, 5990, 6350, 6730, 7130, 7550, 8000, 8480, 8980, 9510, 10100,
10700, 11300, 12000, 12700, 13500, 14300, 15100, 16000
};
}
}

0 comments on commit 32d36f4

Please sign in to comment.