From 32d36f476fa85937983612845590931788b15417 Mon Sep 17 00:00:00 2001 From: VoidX Date: Fri, 16 Aug 2024 22:17:09 +0200 Subject: [PATCH] Yamaha RX-A series support --- .../FilterSet/BaseClasses/FilterSet.cs | 2 ++ .../FilterSet/BaseClasses/FilterSetTarget.cs | 13 ++++--- .../FilterSet/YPAOFilterSet.cs | 12 +++---- .../FilterSet/YPAOLiteFilterSet.cs | 6 ++-- .../FilterSet/YamahaRXAFilterSet.cs | 34 +++++++++++++++++++ 5 files changed, 54 insertions(+), 13 deletions(-) create mode 100644 Cavern.QuickEQ.Format/FilterSet/YamahaRXAFilterSet.cs diff --git a/Cavern.QuickEQ.Format/FilterSet/BaseClasses/FilterSet.cs b/Cavern.QuickEQ.Format/FilterSet/BaseClasses/FilterSet.cs index c048bb3..aa8472f 100644 --- a/Cavern.QuickEQ.Format/FilterSet/BaseClasses/FilterSet.cs +++ b/Cavern.QuickEQ.Format/FilterSet/BaseClasses/FilterSet.cs @@ -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), @@ -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), diff --git a/Cavern.QuickEQ.Format/FilterSet/BaseClasses/FilterSetTarget.cs b/Cavern.QuickEQ.Format/FilterSet/BaseClasses/FilterSetTarget.cs index a1adcdb..a1abf03 100644 --- a/Cavern.QuickEQ.Format/FilterSet/BaseClasses/FilterSetTarget.cs +++ b/Cavern.QuickEQ.Format/FilterSet/BaseClasses/FilterSetTarget.cs @@ -132,11 +132,15 @@ public enum FilterSetTarget { /// MultEQXTarget, /// - /// Processors supporting the latest YPAO with additional fine tuning PEQs. + /// Yamaha RX-A series AVRs. + /// + YamahaRXA, + /// + /// Yamaha RX series AVRs. /// YPAO, /// - /// Older Yamaha processors with fixed 7 bands. + /// Yamaha CX-A series AVRs. /// YPAOLite, @@ -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() }; diff --git a/Cavern.QuickEQ.Format/FilterSet/YPAOFilterSet.cs b/Cavern.QuickEQ.Format/FilterSet/YPAOFilterSet.cs index 613326c..f87b387 100644 --- a/Cavern.QuickEQ.Format/FilterSet/YPAOFilterSet.cs +++ b/Cavern.QuickEQ.Format/FilterSet/YPAOFilterSet.cs @@ -10,7 +10,7 @@ namespace Cavern.Format.FilterSet { /// - /// 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). /// public class YPAOFilterSet : LimitedIIRFilterSet { /// @@ -27,7 +27,7 @@ public class YPAOFilterSet : LimitedIIRFilterSet { /// public override double MinGain => minGain; - const double minGain = -6; + const double minGain = -20; /// public override double GainPrecision => gainPrecision; @@ -40,12 +40,12 @@ public class YPAOFilterSet : LimitedIIRFilterSet { protected override float[] QFactors => qFactors; /// - /// 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). /// public YPAOFilterSet(int channels, int sampleRate) : base(channels, sampleRate) { } /// - /// 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). /// public YPAOFilterSet(ReferenceChannel[] channels, int sampleRate) : base(channels, sampleRate) { } @@ -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)); /// - /// 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. /// 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, @@ -106,7 +106,7 @@ public static PeakingEQ[] GetFilters(Equalizer target, bool lfe, int sampleRate) const int lastBandFreqsFrom = 15; /// - /// 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. /// 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 }; } diff --git a/Cavern.QuickEQ.Format/FilterSet/YPAOLiteFilterSet.cs b/Cavern.QuickEQ.Format/FilterSet/YPAOLiteFilterSet.cs index 4fd4325..c277189 100644 --- a/Cavern.QuickEQ.Format/FilterSet/YPAOLiteFilterSet.cs +++ b/Cavern.QuickEQ.Format/FilterSet/YPAOLiteFilterSet.cs @@ -2,7 +2,7 @@ namespace Cavern.Format.FilterSet { /// - /// 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. /// public class YPAOLiteFilterSet : MultibandPEQFilterSet { /// @@ -18,12 +18,12 @@ public class YPAOLiteFilterSet : MultibandPEQFilterSet { public override bool RoundedBands => true; /// - /// 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. /// public YPAOLiteFilterSet(int channels, int sampleRate) : base(channels, sampleRate, 62.5, .75, 7) { } /// - /// 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. /// public YPAOLiteFilterSet(ReferenceChannel[] channels, int sampleRate) : base(channels, sampleRate, 62.5, .75, 7) { } } diff --git a/Cavern.QuickEQ.Format/FilterSet/YamahaRXAFilterSet.cs b/Cavern.QuickEQ.Format/FilterSet/YamahaRXAFilterSet.cs new file mode 100644 index 0000000..b71b3c1 --- /dev/null +++ b/Cavern.QuickEQ.Format/FilterSet/YamahaRXAFilterSet.cs @@ -0,0 +1,34 @@ +using Cavern.Channels; + +namespace Cavern.Format.FilterSet { + /// + /// IIR filter set for Yamaha RX-A series AVRs. + /// + public class YamahaRXAFilterSet : YPAOFilterSet { + /// + protected override float[] Frequencies => frequencies; + + /// + /// IIR filter set for Yamaha RX-A series AVRs. + /// + public YamahaRXAFilterSet(int channels, int sampleRate) : base(channels, sampleRate) { } + + /// + /// IIR filter set for Yamaha RX-A series AVRs. + /// + public YamahaRXAFilterSet(ReferenceChannel[] channels, int sampleRate) : base(channels, sampleRate) { } + + /// + /// All the possible bands that can be selected for Yamaha RX-A series amplifiers. These are 1/3 octaves apart. + /// + 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 + }; + } +} \ No newline at end of file