Skip to content

Commit

Permalink
TAG021 2019/12/19
Browse files Browse the repository at this point in the history
  Core
    ・o(オクターブ)、v(ボリューム)コマンドの修正
    コマンドのみ記述したとき、前回使用した値が使用するように修正。
    例)
     o4 c>c>coc  ->  o4 c>c>co4 c と同じ
     v15c(c(cvc  ->  v15c(c(cv15c と同じ
  • Loading branch information
kumatan committed Dec 18, 2019
1 parent c3e79d1 commit 5ddb0bc
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 21 deletions.
8 changes: 8 additions & 0 deletions CHANGE.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
�X�V����
TAG021 2019/12/19
Core
�Eo(�I�N�^�[�u)�Av(�{�����[��)�R�}���h�̏C��
�R�}���h�̂݋L�q�����Ƃ��A�O��g�p�����l���g�p����悤�ɏC���B
��)
�@o4 c>c>coc -> o4 c>c>co4 c �Ɠ���
�@v15c(c(cvc -> v15c(c(cv15c �Ɠ���

TAG020 2019/12/03
�R�}���h����
�Esox��url���Ԉ���Ă����̂ŏC���B
Expand Down
41 changes: 23 additions & 18 deletions Core/MMLAnalyze.cs
Original file line number Diff line number Diff line change
Expand Up @@ -434,17 +434,18 @@ private void CmdVolume(partWork pw, MML mml)
mml.type = enmMMLType.Volume;
mml.args = new List<object>();

if (!pw.getNum(out n))
if (pw.getNum(out n))
{
msgBox.setErrMsg(msg.get("E05003"), pw.getSrcFn(), pw.getLineNumber());
n = (int)(pw.MaxVolumeEasy * 0.9);
}
//相対音量調整
n = n + pw.RelVolume;

//相対音量調整
n = n + pw.RelVolume;

n = Common.CheckRange(n, 0, pw.MaxVolumeEasy);
mml.args.Add(n);
n = Common.CheckRange(n, 0, pw.MaxVolumeEasy);
mml.args.Add(n);
}
else
{
mml.args = null;
}
}
}

Expand Down Expand Up @@ -478,17 +479,21 @@ private void CmdTotalVolume(partWork pw, MML mml)
private void CmdOctave(partWork pw, MML mml)
{
pw.incPos();
if (!pw.getNum(out int n))
if (pw.getNum(out int n))
{
msgBox.setErrMsg(msg.get("E05005"), pw.getSrcFn(), pw.getLineNumber());
n = 4;
}
n = Common.CheckRange(n, 1, 8);
n = Common.CheckRange(n, 1, 8);

mml.type = enmMMLType.Octave;
mml.args = new List<object>();
mml.args.Add(n);
pw.octaveNow = n;
mml.type = enmMMLType.Octave;
mml.args = new List<object>();
mml.args.Add(n);
pw.octaveNow = n;
pw.latestOctave = n;
}
else
{
mml.args = null;
pw.octaveNow = pw.latestOctave;
}
}

private void CmdOctaveUp(partWork pw, MML mml)
Expand Down
5 changes: 4 additions & 1 deletion Core/chips/clsChip.cs
Original file line number Diff line number Diff line change
Expand Up @@ -900,8 +900,11 @@ public virtual void CmdTotalVolume(partWork pw, MML mml)

public virtual void CmdVolume(partWork pw, MML mml)
{
int n = (int)mml.args[0];
int n;
n = (mml.args != null && mml.args.Count > 0) ? (int)mml.args[0] : pw.latestVolume;
pw.volume = Common.CheckRange(n, 0, pw.MaxVolume);
pw.latestVolume = n;

SetVolume(pw);
}

Expand Down
5 changes: 3 additions & 2 deletions Core/chips/clsOPN.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1218,9 +1218,10 @@ public override void CmdEnvelope(partWork pw, MML mml)

public override void CmdVolume(partWork pw, MML mml)
{
int n = (int)mml.args[0];
n = Common.CheckRange(n, 0, 15);
int n;
n = (mml.args != null && mml.args.Count > 0) ? (int)mml.args[0] : pw.latestVolume;
pw.volumeEasy = n;
pw.latestVolume = n;
if (pw.Type == enmChannelType.FMOPN || pw.Type == enmChannelType.FMOPNex)
{
n = FMVDAT[n + 4];
Expand Down
4 changes: 4 additions & 0 deletions Core/partWork.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ public class partWork

public int octaveNew = 4;

public int latestOctave = 0;

public int TdA = -1;
public int op1ml = -1;
public int op2ml = -1;
Expand All @@ -145,6 +147,8 @@ public class partWork
/// </summary>
public int volume = 0;

public int latestVolume = 0;

/// <summary>
/// 簡易ボリューム
/// </summary>
Expand Down

0 comments on commit 5ddb0bc

Please sign in to comment.