Skip to content

Commit

Permalink
TAG722 2024/02/29 2nd
Browse files Browse the repository at this point in the history
  Core:XGM2:PCMmapモードを追加。
  • Loading branch information
kumatan committed Feb 29, 2024
1 parent 9151dec commit 980074a
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
3 changes: 3 additions & 0 deletions mml2vgm/CHANGE.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
�X�V����
TAG722 2024/02/29 2nd
Core:XGM2:PCMmap���[�h��lj��B

TAG721 2024/02/29
Core,IDE:XGM2��lj��B

Expand Down
1 change: 0 additions & 1 deletion mml2vgm/Core/XGM2maker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ public XGM2maker()
public outDatum[] Build(ClsVgm mmlInfo,bool outVgmFile,bool writeFileMode)
{
exportMode = outVgmFile && writeFileMode;
exportMode = true;
this.mmlInfo = mmlInfo;
mmlInfo.dat = new List<outDatum>();

Expand Down
33 changes: 33 additions & 0 deletions mml2vgm/Core/chips/YM2612X2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,39 @@ public void OutYM2612X2PcmKeyOFF(MML mml, partPage page)

public void OutYM2612X2PcmKeyON(MML mml, partPage page)
{
MML mmlDmy = mml != null ? mml : lastKeyOnMML;
if (page.isPcmMap)
{
int n = Const.NOTE.IndexOf(page.noteCmd);
int arpNote = page.arpFreqMode ? 0 : page.arpDelta;
int f = page.octaveNow * 12 + n + page.shift + page.keyShift + arpNote;
if (parent.instPCMMap.ContainsKey(page.pcmMapNo))
{
if (parent.instPCMMap[page.pcmMapNo].ContainsKey(f))
{
page.instrument = parent.instPCMMap[page.pcmMapNo][f];
}
else
{
msgBox.setErrMsg(
string.Format(msg.get("E10025"), page.octaveNow, page.noteCmd, page.shift + page.keyShift + arpNote),
mmlDmy != null ? mmlDmy.line.Lp : null);
return;
}
}
else
{
msgBox.setErrMsg(string.Format(msg.get("E10024"), page.pcmMapNo), mmlDmy != null ? mmlDmy.line.Lp : null);
return;
}
}

if (!parent.instPCM.ContainsKey(page.instrument))
{
msgBox.setErrMsg(string.Format(msg.get("E21000"), page.instrument), mmlDmy != null ? mmlDmy.line.Lp : null);
return;
}

int id = parent.instPCM[page.instrument].Item2.seqNum + 1;
int ch = Math.Max(0, page.ch - 8);
bool hiPriority = true;
Expand Down

0 comments on commit 980074a

Please sign in to comment.