#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<EUseLanes>();
{
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再生中))
{
{
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再生中))
{
{
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再生中))
{
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再生中)
{
}
#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等で登録する
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;
}
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;
}
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))
{
}
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再生中)
{
{
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再生中)
{
{
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一時停止中)
{
private int n現在の乱数;
private int nPolyphonicSounds = 4; // #28228 2012.5.1 yyagi
+ private int nPolyphonicSoundsGB = 4;
private int n内部番号BPM1to;
private int n内部番号WAV1to;
public List<EChannel> listこのWAVを使用するチャンネル番号の集合 = new List<EChannel>(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として使わない
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]);
/// 起動時にEnumerate Songsをする/しない
/// </summary>
[DataMember(Order = 119)]
- public COptionBool bEnumerateSongsInBoot; // #40772 2020.10.12 add yyagi
+ public COptionBool bEnumerateSongsInBoot; // #40772 2020.10.12 add yyagi
+ /// <summary>
+ /// Guitar/BassのnPolyphonicSounds
+ /// </summary>
+ [DataMember(Order = 119)]
+ public COptionInteger nPolyphonicSoundsGB; // #37271 2021.9.27 add yyagi
public int GetLaneX(ELane e)
{
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>(EClickType.Off);
nClickHighVolume = new COptionInteger(100);
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++)
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)
{
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)
{
{
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)
{