From 72b16a12408506f7c65983ee4f312685af398b7f Mon Sep 17 00:00:00 2001 From: yyagi Date: Mon, 27 Sep 2021 23:03:03 +0900 Subject: [PATCH] =?utf8?q?#37271=20=E3=83=89=E3=83=A9=E3=83=A0=E3=81=A8?= =?utf8?q?=E3=82=AE=E3=82=BF=E3=83=BC/=E3=83=99=E3=83=BC=E3=82=B9=E3=81=AE?= =?utf8?q?=E6=9C=80=E5=A4=A7=E5=90=8C=E6=99=82=E7=99=BA=E9=9F=B3=E6=95=B0?= =?utf8?q?=E3=82=92=E7=8B=AC=E7=AB=8B=E3=81=97=E3=81=A6=E8=A8=AD=E5=AE=9A?= =?utf8?q?=E3=81=A7=E3=81=8D=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E3=81=97?= =?utf8?q?=E3=81=9F=E3=80=82CONFIGURATION/System/Sound=20Option/Polyphonic?= =?utf8?q?SoundsGB=E3=81=A7=E3=82=AE=E3=82=BF=E3=83=BC/=E3=83=99=E3=83=BC?= =?utf8?q?=E3=82=B9=E3=81=AE=E6=9C=80=E5=A4=A7=E5=90=8C=E6=99=82=E7=99=BA?= =?utf8?q?=E9=9F=B3=E6=95=B0=E3=82=92=E8=A8=AD=E5=AE=9A=E3=81=99=E3=82=8B?= =?utf8?q?=E3=80=82=E3=83=89=E3=83=A9=E3=83=A0=E3=81=AF=E5=BE=93=E6=9D=A5?= =?utf8?q?=E3=81=AEPolyphonicSounds=20(=E6=9C=AB=E5=B0=BE=E3=81=ABGB?= =?utf8?q?=E3=81=AA=E3=81=97)=20=E3=82=92=E3=81=9D=E3=81=AE=E3=81=BE?= =?utf8?q?=E3=81=BE=E4=BD=BF=E3=81=86=E3=80=82=E5=BE=93=E6=9D=A5=E3=82=AE?= =?utf8?q?=E3=82=BF=E3=83=BC/=E3=83=99=E3=83=BC=E3=82=B9=E3=81=AE=E6=9C=80?= =?utf8?q?=E5=A4=A7=E5=90=8C=E6=99=82=E7=99=BA=E9=9F=B3=E6=95=B0=E3=81=AF2?= =?utf8?q?=E5=8F=88=E3=81=AF1(=E3=83=89=E3=83=A9=E3=83=A0=E3=81=AE?= =?utf8?q?=E6=9C=80=E5=A4=A7=E5=90=8C=E6=99=82=E7=99=BA=E9=9F=B3=E6=95=B0?= =?utf8?q?=E3=81=A7=E5=A4=89=E5=8C=96)=E3=81=A0=E3=81=A3=E3=81=9F=E3=81=8C?= =?utf8?q?=E3=80=81=E3=83=89=E3=83=A9=E3=83=A0=E3=81=A8=E3=81=AF=E7=84=A1?= =?utf8?q?=E9=96=A2=E4=BF=82=E3=81=AB=E7=8B=AC=E7=AB=8B=E3=81=97=E3=81=A6?= =?utf8?q?=E6=9C=80=E5=A4=A7=E7=99=BA=E9=9F=B3=E6=95=B0=E3=82=92=E8=A8=AD?= =?utf8?q?=E5=AE=9A=E3=81=A7=E3=81=8D=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?= =?utf8?q?=E3=81=97=E3=81=9F=E3=80=82=E5=88=9D=E6=9C=9F=E5=80=A4=E3=81=AF?= =?utf8?q?=E3=83=89=E3=83=A9=E3=83=A0=E3=81=A8=E3=82=AE=E3=82=BF=E3=83=BC/?= =?utf8?q?=E3=83=99=E3=83=BC=E3=82=B9=E3=81=8C=E3=81=9D=E3=82=8C=E3=81=9E?= =?utf8?q?=E3=82=8C4=E3=81=A82=E3=80=82=E3=83=89=E3=83=A9=E3=83=A0?= =?utf8?q?=E3=81=AF=E5=BE=93=E6=9D=A5=E6=AF=94=E3=81=A7=E5=80=8D=E5=A2=97?= =?utf8?q?=E3=80=81=E3=82=AE=E3=82=BF=E3=83=BC/=E3=83=99=E3=83=BC=E3=82=B9?= =?utf8?q?=E3=81=AF=E5=BE=93=E6=9D=A5=E5=90=8C=E6=A7=98(=E3=81=A0=E3=81=8C?= =?utf8?q?=E8=A8=AD=E5=AE=9A=E3=81=A7=E5=A2=97=E5=8A=A0=E3=81=95=E3=81=9B?= =?utf8?q?=E3=82=8B=E3=81=93=E3=81=A8=E3=81=8C=E3=81=A7=E3=81=8D=E3=82=8B?= =?utf8?q?=E3=82=88=E3=81=86=E3=81=AB=E3=81=AA=E3=81=A3=E3=81=9F)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- DTXMania/コード/スコア、曲/CDTX.cs | 36 ++++++++++++---------- .../コード/スコア、曲/CDTXNestedTypes.cs | 8 ++--- .../04.コンフィグ/CActConfigList.cs | 1 + .../ステージ/04.コンフィグ/CConfigXml.cs | 11 +++++-- .../07.演奏/CStage演奏画面共通.cs | 6 ++-- DTXMania/コード/全体/CDTXMania.cs | 1 + 6 files changed, 37 insertions(+), 26 deletions(-) diff --git a/DTXMania/コード/スコア、曲/CDTX.cs b/DTXMania/コード/スコア、曲/CDTX.cs index ae9c38f8..b6c77a5a 100644 --- a/DTXMania/コード/スコア、曲/CDTX.cs +++ b/DTXMania/コード/スコア、曲/CDTX.cs @@ -216,6 +216,7 @@ namespace DTXMania #endregion this.nBGMAdjust = 0; this.nPolyphonicSounds = CDTXMania.Instance.ConfigIni.nPolyphonicSounds; + this.nPolyphonicSoundsGB = CDTXMania.Instance.ConfigIni.nPolyphonicSoundsGB; this.dbDTXVPlaySpeed = 1.0f; this.bUse556x710BGAAVI = false; this.n使用レーン数 = new STDGBSValue(); @@ -505,7 +506,7 @@ namespace DTXMania { if (wc.rSound[0] != null && wc.rSound[0].n総演奏時間ms >= 5000) { - for (int i = 0; i < nPolyphonicSounds; i++) + for (int i = 0; i < Math.Max(nPolyphonicSounds, nPolyphonicSoundsGB); i++) { if ((wc.rSound[i] != null) && (wc.rSound[i].b再生中)) { @@ -537,7 +538,7 @@ namespace DTXMania { if (wc.rSound[0] != null && wc.rSound[0].n総演奏時間ms >= 5000) { - for (int i = 0; i < nPolyphonicSounds; i++) + for (int i = 0; i < Math.Max(nPolyphonicSounds, nPolyphonicSoundsGB); i++) { if ((wc.rSound[i] != null) && (wc.rSound[i].b再生中)) { @@ -560,7 +561,7 @@ namespace DTXMania { if (wc.rSound[0] != null) { - for (int i = 0; i < nPolyphonicSounds; i++) + for (int i = 0; i < Math.Max(nPolyphonicSounds, nPolyphonicSoundsGB); i++) { if ((wc.rSound[i] != null) && (wc.rSound[i].b再生中)) { @@ -581,7 +582,7 @@ namespace DTXMania if (this.listWAV.ContainsKey(nWaveの内部番号)) { CWAV cwav = this.listWAV[nWaveの内部番号]; - for (int i = 0; i < nPolyphonicSounds; i++) + for (int i = 0; i < Math.Max(nPolyphonicSounds, nPolyphonicSoundsGB); i++) { if (cwav.rSound[i] != null && cwav.rSound[i].b再生中) { @@ -643,15 +644,15 @@ namespace DTXMania } #region [ 同時発音数を、チャンネルによって変える ] - int nPoly = nPolyphonicSounds; - if (!bIsDirectSound) // DShowでの再生の場合はミキシング負荷が高くないため、 - { // チップのライフタイム管理を行わない - if (cwav.bIsBassSound) nPoly = (nPolyphonicSounds >= 2) ? 2 : 1; - else if (cwav.bIsGuitarSound) nPoly = (nPolyphonicSounds >= 2) ? 2 : 1; + int nPoly = Math.Max(nPolyphonicSounds, nPolyphonicSoundsGB); + //if (!bIsDirectSound) // DShowでの再生の場合はミキシング負荷が高くないため、 + //{ // チップのライフタイム管理を行わない + if (cwav.bIsBassSound) nPoly = nPolyphonicSoundsGB; //(nPolyphonicSounds >= 2) ? 2 : 1; + else if (cwav.bIsGuitarSound) nPoly = nPolyphonicSoundsGB; //(nPolyphonicSounds >= 2) ? 2 : 1; else if (cwav.bIsSESound) nPoly = 1; else if (cwav.bIsBGMSound) nPoly = 1; - } - if (cwav.bIsBGMSound) nPoly = 1; + //} + //if (cwav.bIsBGMSound) nPoly = 1; #endregion // 残りはClone等で登録する @@ -662,7 +663,7 @@ namespace DTXMania cwav.rSound[i] = (CSound)cwav.rSound[0].Clone(); // #24007 2011.9.5 yyagi add: to accelerate loading chip sounds // CDTXMania.Instance.app.Sound管理.tサウンドを登録する( cwav.rSound[ j ] ); } - for (int i = nPoly; i < nPolyphonicSounds; i++) + for (int i = nPoly; i < Math.Max(nPolyphonicSounds, nPolyphonicSoundsGB); i++) { cwav.rSound[i] = null; } @@ -696,7 +697,7 @@ namespace DTXMania catch (Exception exception) { Trace.TraceError("サウンドの生成に失敗しました。({0})({1})({2})", exception.Message, cwav.strコメント文, str); - for (int j = 0; j < nPolyphonicSounds; j++) + for (int j = 0; j < Math.Max(nPolyphonicSounds, nPolyphonicSoundsGB); j++) { cwav.rSound[j] = null; } @@ -752,7 +753,7 @@ namespace DTXMania if (this.listWAV.ContainsKey(pChip.n整数値_内部番号)) { CWAV wc = this.listWAV[pChip.n整数値_内部番号]; - int index = wc.n現在再生中のサウンド番号 = (wc.n現在再生中のサウンド番号 + 1) % nPolyphonicSounds; + int index = wc.n現在再生中のサウンド番号 = (wc.n現在再生中のサウンド番号 + 1) % Math.Max(nPolyphonicSounds, nPolyphonicSoundsGB); if ((wc.rSound[0] != null) && (wc.rSound[0].bストリーム再生する || wc.rSound[index] == null)) { @@ -789,7 +790,7 @@ namespace DTXMania } foreach (CWAV cwav in this.listWAV.Values) { - for (int j = 0; j < nPolyphonicSounds; j++) + for (int j = 0; j < Math.Max(nPolyphonicSounds, nPolyphonicSoundsGB); j++) { if ((cwav.rSound[j] != null) && cwav.rSound[j].b再生中) { @@ -802,7 +803,7 @@ namespace DTXMania { foreach (CWAV cwav in this.listWAV.Values) { - for (int i = 0; i < nPolyphonicSounds; i++) + for (int i = 0; i < Math.Max(nPolyphonicSounds, nPolyphonicSoundsGB); i++) { if ((cwav.rSound[i] != null) && cwav.rSound[i].b再生中) { @@ -820,7 +821,7 @@ namespace DTXMania { foreach (CWAV cwav in this.listWAV.Values) { - for (int i = 0; i < nPolyphonicSounds; i++) + for (int i = 0; i < Math.Max(nPolyphonicSounds, nPolyphonicSoundsGB); i++) { if ((cwav.rSound[i] != null) && cwav.rSound[i].b一時停止中) { @@ -1265,6 +1266,7 @@ namespace DTXMania private int n現在の乱数; private int nPolyphonicSounds = 4; // #28228 2012.5.1 yyagi + private int nPolyphonicSoundsGB = 4; private int n内部番号BPM1to; private int n内部番号WAV1to; diff --git a/DTXMania/コード/スコア、曲/CDTXNestedTypes.cs b/DTXMania/コード/スコア、曲/CDTXNestedTypes.cs index 3baa80f0..117c169d 100644 --- a/DTXMania/コード/スコア、曲/CDTXNestedTypes.cs +++ b/DTXMania/コード/スコア、曲/CDTXNestedTypes.cs @@ -391,13 +391,13 @@ namespace DTXMania public List listこのWAVを使用するチャンネル番号の集合 = new List(16); public int nチップサイズ = 100; public int n位置; - public long[] n一時停止時刻 = new long[CDTXMania.Instance.ConfigIni.nPolyphonicSounds]; // 4 + public long[] n一時停止時刻 = new long[ Math.Max( CDTXMania.Instance.ConfigIni.nPolyphonicSounds, CDTXMania.Instance.ConfigIni.nPolyphonicSoundsGB) ]; // 4 public int n音量 = 100; public int n現在再生中のサウンド番号; - public long[] n再生開始時刻 = new long[CDTXMania.Instance.ConfigIni.nPolyphonicSounds]; // 4 + public long[] n再生開始時刻 = new long[ Math.Max( CDTXMania.Instance.ConfigIni.nPolyphonicSounds, CDTXMania.Instance.ConfigIni.nPolyphonicSoundsGB) ]; // 4 public int n内部番号; public int n表記上の番号; - public CSound[] rSound = new CSound[CDTXMania.Instance.ConfigIni.nPolyphonicSounds]; // 4 + public CSound[] rSound = new CSound[ Math.Max( CDTXMania.Instance.ConfigIni.nPolyphonicSounds, CDTXMania.Instance.ConfigIni.nPolyphonicSoundsGB) ]; // 4 public string strコメント文 = ""; public string strファイル名 = ""; public bool bBGMとして使わない @@ -448,7 +448,7 @@ namespace DTXMania if (bManagedリソースの解放も行う) { - for (int i = 0; i < CDTXMania.Instance.ConfigIni.nPolyphonicSounds; i++) // 4 + for (int i = 0; i < Math.Max(CDTXMania.Instance.ConfigIni.nPolyphonicSounds, CDTXMania.Instance.ConfigIni.nPolyphonicSoundsGB); i++) // 4 { if (this.rSound[i] != null) CDTXMania.Instance.Sound管理.tサウンドを破棄する(this.rSound[i]); diff --git a/DTXMania/コード/ステージ/04.コンフィグ/CActConfigList.cs b/DTXMania/コード/ステージ/04.コンフィグ/CActConfigList.cs index c76d0909..12f7a77c 100644 --- a/DTXMania/コード/ステージ/04.コンフィグ/CActConfigList.cs +++ b/DTXMania/コード/ステージ/04.コンフィグ/CActConfigList.cs @@ -504,6 +504,7 @@ namespace DTXMania list項目リスト.Add( CDTXMania.Instance.ConfigIni.bDynamicBassMixerManagement ); list項目リスト.Add( CDTXMania.Instance.ConfigIni.nMasterVolume ); list項目リスト.Add( CDTXMania.Instance.ConfigIni.nPolyphonicSounds ); + list項目リスト.Add( CDTXMania.Instance.ConfigIni.nPolyphonicSoundsGB ); list項目リスト.Add( CDTXMania.Instance.ConfigIni.eClickType ); list項目リスト.Add( CDTXMania.Instance.ConfigIni.nClickHighVolume ); list項目リスト.Add( CDTXMania.Instance.ConfigIni.nClickLowVolume ); diff --git a/DTXMania/コード/ステージ/04.コンフィグ/CConfigXml.cs b/DTXMania/コード/ステージ/04.コンフィグ/CConfigXml.cs index 88c1a363..cbe64a5b 100644 --- a/DTXMania/コード/ステージ/04.コンフィグ/CConfigXml.cs +++ b/DTXMania/コード/ステージ/04.コンフィグ/CConfigXml.cs @@ -415,8 +415,13 @@ namespace DTXMania /// 起動時にEnumerate Songsをする/しない /// [DataMember(Order = 119)] - public COptionBool bEnumerateSongsInBoot; // #40772 2020.10.12 add yyagi + public COptionBool bEnumerateSongsInBoot; // #40772 2020.10.12 add yyagi + /// + /// Guitar/BassのnPolyphonicSounds + /// + [DataMember(Order = 119)] + public COptionInteger nPolyphonicSoundsGB; // #37271 2021.9.27 add yyagi public int GetLaneX(ELane e) { @@ -635,7 +640,8 @@ namespace DTXMania nChipFadeoutTimeMs = new COptionInteger(2000); rcViewerWindow = new Coordinates.CRect(100, 100, 640, 360); nMasterVolume = new COptionInteger(100); - nPolyphonicSounds = new COptionInteger(2); // #38474 2018.8.3 yyagi 4 -> 2, to reduce sound mixing load + nPolyphonicSounds = new COptionInteger(4); // #38474 2018.8.3 yyagi 4 -> 2, to reduce sound mixing load + nPolyphonicSoundsGB = new COptionInteger(2); eClickType = new COptionEnum(EClickType.Off); nClickHighVolume = new COptionInteger(100); @@ -954,6 +960,7 @@ namespace DTXMania nMasterVolume.Initialize( "strCfgSysMasterVolume", 0, 201); nPolyphonicSounds.Initialize( "strCfgSysPolyphonicSounds", 1, 11 ); + nPolyphonicSoundsGB.Initialize("strCfgSysPolyphonicSoundsGB", 1, 11); // dgb for (EPart i = EPart.Drums; i <= EPart.Unknown; i++) diff --git a/DTXMania/コード/ステージ/07.演奏/CStage演奏画面共通.cs b/DTXMania/コード/ステージ/07.演奏/CStage演奏画面共通.cs index 762a0ab2..6f04634c 100644 --- a/DTXMania/コード/ステージ/07.演奏/CStage演奏画面共通.cs +++ b/DTXMania/コード/ステージ/07.演奏/CStage演奏画面共通.cs @@ -434,7 +434,7 @@ namespace DTXMania if (CDTXMania.Instance.DTX.listWAV.ContainsKey(pChip.n整数値_内部番号)) { CDTX.CWAV wc = CDTXMania.Instance.DTX.listWAV[pChip.n整数値_内部番号]; - for (int i = 0; i < CDTXMania.Instance.ConfigIni.nPolyphonicSounds; i++) + for (int i = 0; i < Math.Max(CDTXMania.Instance.ConfigIni.nPolyphonicSounds, CDTXMania.Instance.ConfigIni.nPolyphonicSoundsGB); i++) { if (wc.rSound[i] != null) { @@ -3257,7 +3257,7 @@ namespace DTXMania CDTX.CWAV wc = CDTXMania.Instance.DTX.listWAV[pChip.n整数値_内部番号]; //Debug.Write( "[AddMixer] BAR=" + pChip.n発声位置 / 384 + ", wav=" + Path.GetFileName( wc.strファイル名 ) + ", time=" + pChip.n発声時刻ms ); - for (int i = 0; i < CDTXMania.Instance.ConfigIni.nPolyphonicSounds; i++) + for (int i = 0; i < Math.Max(CDTXMania.Instance.ConfigIni.nPolyphonicSounds, CDTXMania.Instance.ConfigIni.nPolyphonicSoundsGB); i++) { if (wc.rSound[i] != null) { @@ -3284,7 +3284,7 @@ namespace DTXMania { CDTX.CWAV wc = CDTXMania.Instance.DTX.listWAV[pChip.n整数値_内部番号]; //Debug.Write( "[DelMixer] BAR=" + pChip.n発声位置 / 384 + ", wav=" + Path.GetFileName( wc.strファイル名 ) + ", time=" + pChip.n発声時刻ms ); - for (int i = 0; i < CDTXMania.Instance.ConfigIni.nPolyphonicSounds; i++) + for (int i = 0; i < Math.Max(CDTXMania.Instance.ConfigIni.nPolyphonicSounds, CDTXMania.Instance.ConfigIni.nPolyphonicSoundsGB); i++) { if (wc.rSound[i] != null) { diff --git a/DTXMania/コード/全体/CDTXMania.cs b/DTXMania/コード/全体/CDTXMania.cs index 0b3f05c0..556af49e 100644 --- a/DTXMania/コード/全体/CDTXMania.cs +++ b/DTXMania/コード/全体/CDTXMania.cs @@ -433,6 +433,7 @@ namespace DTXMania //多重再生数=4 CDTXMania.instance.ConfigIni.nPolyphonicSounds.Value = 4; + CDTXMania.instance.ConfigIni.nPolyphonicSoundsGB.Value = 2; //再生速度x1 CDTXMania.instance.ConfigIni.nPlaySpeed.Value = 20; -- 2.11.0