リビジョン | 72b16a12408506f7c65983ee4f312685af398b7f (tree) |
---|---|
日時 | 2021-09-27 23:03:03 |
作者 | yyagi <yyagi.dtxmania@gmai...> |
コミッター | yyagi |
#37271 ドラムとギター/ベースの最大同時発音数を独立して設定できるようにした。CONFIGURATION/System/Sound Option/PolyphonicSoundsGBでギター/ベースの最大同時発音数を設定する。ドラムは従来のPolyphonicSounds (末尾にGBなし) をそのまま使う。従来ギター/ベースの最大同時発音数は2又は1(ドラムの最大同時発音数で変化)だったが、ドラムとは無関係に独立して最大発音数を設定できるようにした。初期値はドラムとギター/ベースがそれぞれ4と2。ドラムは従来比で倍増、ギター/ベースは従来同様(だが設定で増加させることができるようになった)
@@ -216,6 +216,7 @@ namespace DTXMania | ||
216 | 216 | #endregion |
217 | 217 | this.nBGMAdjust = 0; |
218 | 218 | this.nPolyphonicSounds = CDTXMania.Instance.ConfigIni.nPolyphonicSounds; |
219 | + this.nPolyphonicSoundsGB = CDTXMania.Instance.ConfigIni.nPolyphonicSoundsGB; | |
219 | 220 | this.dbDTXVPlaySpeed = 1.0f; |
220 | 221 | this.bUse556x710BGAAVI = false; |
221 | 222 | this.n使用レーン数 = new STDGBSValue<EUseLanes>(); |
@@ -505,7 +506,7 @@ namespace DTXMania | ||
505 | 506 | { |
506 | 507 | if (wc.rSound[0] != null && wc.rSound[0].n総演奏時間ms >= 5000) |
507 | 508 | { |
508 | - for (int i = 0; i < nPolyphonicSounds; i++) | |
509 | + for (int i = 0; i < Math.Max(nPolyphonicSounds, nPolyphonicSoundsGB); i++) | |
509 | 510 | { |
510 | 511 | if ((wc.rSound[i] != null) && (wc.rSound[i].b再生中)) |
511 | 512 | { |
@@ -537,7 +538,7 @@ namespace DTXMania | ||
537 | 538 | { |
538 | 539 | if (wc.rSound[0] != null && wc.rSound[0].n総演奏時間ms >= 5000) |
539 | 540 | { |
540 | - for (int i = 0; i < nPolyphonicSounds; i++) | |
541 | + for (int i = 0; i < Math.Max(nPolyphonicSounds, nPolyphonicSoundsGB); i++) | |
541 | 542 | { |
542 | 543 | if ((wc.rSound[i] != null) && (wc.rSound[i].b再生中)) |
543 | 544 | { |
@@ -560,7 +561,7 @@ namespace DTXMania | ||
560 | 561 | { |
561 | 562 | if (wc.rSound[0] != null) |
562 | 563 | { |
563 | - for (int i = 0; i < nPolyphonicSounds; i++) | |
564 | + for (int i = 0; i < Math.Max(nPolyphonicSounds, nPolyphonicSoundsGB); i++) | |
564 | 565 | { |
565 | 566 | if ((wc.rSound[i] != null) && (wc.rSound[i].b再生中)) |
566 | 567 | { |
@@ -581,7 +582,7 @@ namespace DTXMania | ||
581 | 582 | if (this.listWAV.ContainsKey(nWaveの内部番号)) |
582 | 583 | { |
583 | 584 | CWAV cwav = this.listWAV[nWaveの内部番号]; |
584 | - for (int i = 0; i < nPolyphonicSounds; i++) | |
585 | + for (int i = 0; i < Math.Max(nPolyphonicSounds, nPolyphonicSoundsGB); i++) | |
585 | 586 | { |
586 | 587 | if (cwav.rSound[i] != null && cwav.rSound[i].b再生中) |
587 | 588 | { |
@@ -643,15 +644,15 @@ namespace DTXMania | ||
643 | 644 | } |
644 | 645 | |
645 | 646 | #region [ 同時発音数を、チャンネルによって変える ] |
646 | - int nPoly = nPolyphonicSounds; | |
647 | - if (!bIsDirectSound) // DShowでの再生の場合はミキシング負荷が高くないため、 | |
648 | - { // チップのライフタイム管理を行わない | |
649 | - if (cwav.bIsBassSound) nPoly = (nPolyphonicSounds >= 2) ? 2 : 1; | |
650 | - else if (cwav.bIsGuitarSound) nPoly = (nPolyphonicSounds >= 2) ? 2 : 1; | |
647 | + int nPoly = Math.Max(nPolyphonicSounds, nPolyphonicSoundsGB); | |
648 | + //if (!bIsDirectSound) // DShowでの再生の場合はミキシング負荷が高くないため、 | |
649 | + //{ // チップのライフタイム管理を行わない | |
650 | + if (cwav.bIsBassSound) nPoly = nPolyphonicSoundsGB; //(nPolyphonicSounds >= 2) ? 2 : 1; | |
651 | + else if (cwav.bIsGuitarSound) nPoly = nPolyphonicSoundsGB; //(nPolyphonicSounds >= 2) ? 2 : 1; | |
651 | 652 | else if (cwav.bIsSESound) nPoly = 1; |
652 | 653 | else if (cwav.bIsBGMSound) nPoly = 1; |
653 | - } | |
654 | - if (cwav.bIsBGMSound) nPoly = 1; | |
654 | + //} | |
655 | + //if (cwav.bIsBGMSound) nPoly = 1; | |
655 | 656 | #endregion |
656 | 657 | |
657 | 658 | // 残りはClone等で登録する |
@@ -662,7 +663,7 @@ namespace DTXMania | ||
662 | 663 | cwav.rSound[i] = (CSound)cwav.rSound[0].Clone(); // #24007 2011.9.5 yyagi add: to accelerate loading chip sounds |
663 | 664 | // CDTXMania.Instance.app.Sound管理.tサウンドを登録する( cwav.rSound[ j ] ); |
664 | 665 | } |
665 | - for (int i = nPoly; i < nPolyphonicSounds; i++) | |
666 | + for (int i = nPoly; i < Math.Max(nPolyphonicSounds, nPolyphonicSoundsGB); i++) | |
666 | 667 | { |
667 | 668 | cwav.rSound[i] = null; |
668 | 669 | } |
@@ -696,7 +697,7 @@ namespace DTXMania | ||
696 | 697 | catch (Exception exception) |
697 | 698 | { |
698 | 699 | Trace.TraceError("サウンドの生成に失敗しました。({0})({1})({2})", exception.Message, cwav.strコメント文, str); |
699 | - for (int j = 0; j < nPolyphonicSounds; j++) | |
700 | + for (int j = 0; j < Math.Max(nPolyphonicSounds, nPolyphonicSoundsGB); j++) | |
700 | 701 | { |
701 | 702 | cwav.rSound[j] = null; |
702 | 703 | } |
@@ -752,7 +753,7 @@ namespace DTXMania | ||
752 | 753 | if (this.listWAV.ContainsKey(pChip.n整数値_内部番号)) |
753 | 754 | { |
754 | 755 | CWAV wc = this.listWAV[pChip.n整数値_内部番号]; |
755 | - int index = wc.n現在再生中のサウンド番号 = (wc.n現在再生中のサウンド番号 + 1) % nPolyphonicSounds; | |
756 | + int index = wc.n現在再生中のサウンド番号 = (wc.n現在再生中のサウンド番号 + 1) % Math.Max(nPolyphonicSounds, nPolyphonicSoundsGB); | |
756 | 757 | if ((wc.rSound[0] != null) && |
757 | 758 | (wc.rSound[0].bストリーム再生する || wc.rSound[index] == null)) |
758 | 759 | { |
@@ -789,7 +790,7 @@ namespace DTXMania | ||
789 | 790 | } |
790 | 791 | foreach (CWAV cwav in this.listWAV.Values) |
791 | 792 | { |
792 | - for (int j = 0; j < nPolyphonicSounds; j++) | |
793 | + for (int j = 0; j < Math.Max(nPolyphonicSounds, nPolyphonicSoundsGB); j++) | |
793 | 794 | { |
794 | 795 | if ((cwav.rSound[j] != null) && cwav.rSound[j].b再生中) |
795 | 796 | { |
@@ -802,7 +803,7 @@ namespace DTXMania | ||
802 | 803 | { |
803 | 804 | foreach (CWAV cwav in this.listWAV.Values) |
804 | 805 | { |
805 | - for (int i = 0; i < nPolyphonicSounds; i++) | |
806 | + for (int i = 0; i < Math.Max(nPolyphonicSounds, nPolyphonicSoundsGB); i++) | |
806 | 807 | { |
807 | 808 | if ((cwav.rSound[i] != null) && cwav.rSound[i].b再生中) |
808 | 809 | { |
@@ -820,7 +821,7 @@ namespace DTXMania | ||
820 | 821 | { |
821 | 822 | foreach (CWAV cwav in this.listWAV.Values) |
822 | 823 | { |
823 | - for (int i = 0; i < nPolyphonicSounds; i++) | |
824 | + for (int i = 0; i < Math.Max(nPolyphonicSounds, nPolyphonicSoundsGB); i++) | |
824 | 825 | { |
825 | 826 | if ((cwav.rSound[i] != null) && cwav.rSound[i].b一時停止中) |
826 | 827 | { |
@@ -1265,6 +1266,7 @@ namespace DTXMania | ||
1265 | 1266 | private int n現在の乱数; |
1266 | 1267 | |
1267 | 1268 | private int nPolyphonicSounds = 4; // #28228 2012.5.1 yyagi |
1269 | + private int nPolyphonicSoundsGB = 4; | |
1268 | 1270 | |
1269 | 1271 | private int n内部番号BPM1to; |
1270 | 1272 | private int n内部番号WAV1to; |
@@ -391,13 +391,13 @@ namespace DTXMania | ||
391 | 391 | public List<EChannel> listこのWAVを使用するチャンネル番号の集合 = new List<EChannel>(16); |
392 | 392 | public int nチップサイズ = 100; |
393 | 393 | public int n位置; |
394 | - public long[] n一時停止時刻 = new long[CDTXMania.Instance.ConfigIni.nPolyphonicSounds]; // 4 | |
394 | + public long[] n一時停止時刻 = new long[ Math.Max( CDTXMania.Instance.ConfigIni.nPolyphonicSounds, CDTXMania.Instance.ConfigIni.nPolyphonicSoundsGB) ]; // 4 | |
395 | 395 | public int n音量 = 100; |
396 | 396 | public int n現在再生中のサウンド番号; |
397 | - public long[] n再生開始時刻 = new long[CDTXMania.Instance.ConfigIni.nPolyphonicSounds]; // 4 | |
397 | + public long[] n再生開始時刻 = new long[ Math.Max( CDTXMania.Instance.ConfigIni.nPolyphonicSounds, CDTXMania.Instance.ConfigIni.nPolyphonicSoundsGB) ]; // 4 | |
398 | 398 | public int n内部番号; |
399 | 399 | public int n表記上の番号; |
400 | - public CSound[] rSound = new CSound[CDTXMania.Instance.ConfigIni.nPolyphonicSounds]; // 4 | |
400 | + public CSound[] rSound = new CSound[ Math.Max( CDTXMania.Instance.ConfigIni.nPolyphonicSounds, CDTXMania.Instance.ConfigIni.nPolyphonicSoundsGB) ]; // 4 | |
401 | 401 | public string strコメント文 = ""; |
402 | 402 | public string strファイル名 = ""; |
403 | 403 | public bool bBGMとして使わない |
@@ -448,7 +448,7 @@ namespace DTXMania | ||
448 | 448 | |
449 | 449 | if (bManagedリソースの解放も行う) |
450 | 450 | { |
451 | - for (int i = 0; i < CDTXMania.Instance.ConfigIni.nPolyphonicSounds; i++) // 4 | |
451 | + for (int i = 0; i < Math.Max(CDTXMania.Instance.ConfigIni.nPolyphonicSounds, CDTXMania.Instance.ConfigIni.nPolyphonicSoundsGB); i++) // 4 | |
452 | 452 | { |
453 | 453 | if (this.rSound[i] != null) |
454 | 454 | CDTXMania.Instance.Sound管理.tサウンドを破棄する(this.rSound[i]); |
@@ -504,6 +504,7 @@ namespace DTXMania | ||
504 | 504 | list項目リスト.Add( CDTXMania.Instance.ConfigIni.bDynamicBassMixerManagement ); |
505 | 505 | list項目リスト.Add( CDTXMania.Instance.ConfigIni.nMasterVolume ); |
506 | 506 | list項目リスト.Add( CDTXMania.Instance.ConfigIni.nPolyphonicSounds ); |
507 | + list項目リスト.Add( CDTXMania.Instance.ConfigIni.nPolyphonicSoundsGB ); | |
507 | 508 | list項目リスト.Add( CDTXMania.Instance.ConfigIni.eClickType ); |
508 | 509 | list項目リスト.Add( CDTXMania.Instance.ConfigIni.nClickHighVolume ); |
509 | 510 | list項目リスト.Add( CDTXMania.Instance.ConfigIni.nClickLowVolume ); |
@@ -415,8 +415,13 @@ namespace DTXMania | ||
415 | 415 | /// 起動時にEnumerate Songsをする/しない |
416 | 416 | /// </summary> |
417 | 417 | [DataMember(Order = 119)] |
418 | - public COptionBool bEnumerateSongsInBoot; // #40772 2020.10.12 add yyagi | |
418 | + public COptionBool bEnumerateSongsInBoot; // #40772 2020.10.12 add yyagi | |
419 | 419 | |
420 | + /// <summary> | |
421 | + /// Guitar/BassのnPolyphonicSounds | |
422 | + /// </summary> | |
423 | + [DataMember(Order = 119)] | |
424 | + public COptionInteger nPolyphonicSoundsGB; // #37271 2021.9.27 add yyagi | |
420 | 425 | |
421 | 426 | public int GetLaneX(ELane e) |
422 | 427 | { |
@@ -635,7 +640,8 @@ namespace DTXMania | ||
635 | 640 | nChipFadeoutTimeMs = new COptionInteger(2000); |
636 | 641 | rcViewerWindow = new Coordinates.CRect(100, 100, 640, 360); |
637 | 642 | nMasterVolume = new COptionInteger(100); |
638 | - nPolyphonicSounds = new COptionInteger(2); // #38474 2018.8.3 yyagi 4 -> 2, to reduce sound mixing load | |
643 | + nPolyphonicSounds = new COptionInteger(4); // #38474 2018.8.3 yyagi 4 -> 2, to reduce sound mixing load | |
644 | + nPolyphonicSoundsGB = new COptionInteger(2); | |
639 | 645 | |
640 | 646 | eClickType = new COptionEnum<EClickType>(EClickType.Off); |
641 | 647 | nClickHighVolume = new COptionInteger(100); |
@@ -954,6 +960,7 @@ namespace DTXMania | ||
954 | 960 | |
955 | 961 | nMasterVolume.Initialize( "strCfgSysMasterVolume", 0, 201); |
956 | 962 | nPolyphonicSounds.Initialize( "strCfgSysPolyphonicSounds", 1, 11 ); |
963 | + nPolyphonicSoundsGB.Initialize("strCfgSysPolyphonicSoundsGB", 1, 11); | |
957 | 964 | |
958 | 965 | // dgb |
959 | 966 | for (EPart i = EPart.Drums; i <= EPart.Unknown; i++) |
@@ -434,7 +434,7 @@ namespace DTXMania | ||
434 | 434 | if (CDTXMania.Instance.DTX.listWAV.ContainsKey(pChip.n整数値_内部番号)) |
435 | 435 | { |
436 | 436 | CDTX.CWAV wc = CDTXMania.Instance.DTX.listWAV[pChip.n整数値_内部番号]; |
437 | - for (int i = 0; i < CDTXMania.Instance.ConfigIni.nPolyphonicSounds; i++) | |
437 | + for (int i = 0; i < Math.Max(CDTXMania.Instance.ConfigIni.nPolyphonicSounds, CDTXMania.Instance.ConfigIni.nPolyphonicSoundsGB); i++) | |
438 | 438 | { |
439 | 439 | if (wc.rSound[i] != null) |
440 | 440 | { |
@@ -3257,7 +3257,7 @@ namespace DTXMania | ||
3257 | 3257 | CDTX.CWAV wc = CDTXMania.Instance.DTX.listWAV[pChip.n整数値_内部番号]; |
3258 | 3258 | //Debug.Write( "[AddMixer] BAR=" + pChip.n発声位置 / 384 + ", wav=" + Path.GetFileName( wc.strファイル名 ) + ", time=" + pChip.n発声時刻ms ); |
3259 | 3259 | |
3260 | - for (int i = 0; i < CDTXMania.Instance.ConfigIni.nPolyphonicSounds; i++) | |
3260 | + for (int i = 0; i < Math.Max(CDTXMania.Instance.ConfigIni.nPolyphonicSounds, CDTXMania.Instance.ConfigIni.nPolyphonicSoundsGB); i++) | |
3261 | 3261 | { |
3262 | 3262 | if (wc.rSound[i] != null) |
3263 | 3263 | { |
@@ -3284,7 +3284,7 @@ namespace DTXMania | ||
3284 | 3284 | { |
3285 | 3285 | CDTX.CWAV wc = CDTXMania.Instance.DTX.listWAV[pChip.n整数値_内部番号]; |
3286 | 3286 | //Debug.Write( "[DelMixer] BAR=" + pChip.n発声位置 / 384 + ", wav=" + Path.GetFileName( wc.strファイル名 ) + ", time=" + pChip.n発声時刻ms ); |
3287 | - for (int i = 0; i < CDTXMania.Instance.ConfigIni.nPolyphonicSounds; i++) | |
3287 | + for (int i = 0; i < Math.Max(CDTXMania.Instance.ConfigIni.nPolyphonicSounds, CDTXMania.Instance.ConfigIni.nPolyphonicSoundsGB); i++) | |
3288 | 3288 | { |
3289 | 3289 | if (wc.rSound[i] != null) |
3290 | 3290 | { |
@@ -433,6 +433,7 @@ namespace DTXMania | ||
433 | 433 | |
434 | 434 | //多重再生数=4 |
435 | 435 | CDTXMania.instance.ConfigIni.nPolyphonicSounds.Value = 4; |
436 | + CDTXMania.instance.ConfigIni.nPolyphonicSoundsGB.Value = 2; | |
436 | 437 | |
437 | 438 | //再生速度x1 |
438 | 439 | CDTXMania.instance.ConfigIni.nPlaySpeed.Value = 20; |