From 79dbc70de1e44d0c4af7a35f645c704241359b7e Mon Sep 17 00:00:00 2001 From: kumatan Date: Sun, 23 Apr 2023 18:57:26 +0900 Subject: [PATCH] =?UTF-8?q?TAG199=202023/04/23=202nd=20=20=20Compiler&Driv?= =?UTF-8?q?er=20=20=20=20=20EX(=E3=82=B9=E3=83=AD=E3=83=83=E3=83=88?= =?UTF-8?q?=E6=8C=87=E5=AE=9A)=E3=82=B3=E3=83=9E=E3=83=B3=E3=83=89?= =?UTF-8?q?=E3=81=AE=E6=A9=9F=E8=83=BD=E6=8B=A1=E5=BC=B5=E3=80=82=20=20=20?= =?UTF-8?q?=20=20=E6=BC=94=E5=A5=8F=E9=96=8B=E5=A7=8B=E3=82=BF=E3=82=A4?= =?UTF-8?q?=E3=83=9F=E3=83=B3=E3=82=B0=E3=81=A7=E5=8A=B9=E6=9E=9C=E9=9F=B3?= =?UTF-8?q?=E3=83=A2=E3=83=BC=E3=83=89=E3=82=92=E4=BD=BF=E7=94=A8=E3=81=97?= =?UTF-8?q?=E3=81=9F=E6=99=82=E3=80=81=E7=99=BA=E9=9F=B3=E3=81=A7=E3=81=8D?= =?UTF-8?q?=E3=81=AA=E3=81=84=E3=83=90=E3=82=B0=E3=81=AE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGE.txt | 5 ++++ MML.txt | 4 ++- mucomDotNETCompiler/muc88.cs | 25 ++++++++++++------- .../Properties/launchSettings.json | 2 +- mucomDotNETDriver/SoundWork.cs | 1 + mucomDotNETDriver/music2.cs | 15 ++++++++--- 6 files changed, 37 insertions(+), 15 deletions(-) diff --git a/CHANGE.txt b/CHANGE.txt index 9189f5c..aa99006 100644 --- a/CHANGE.txt +++ b/CHANGE.txt @@ -1,4 +1,9 @@ 更新履歴 +TAG199 2023/04/23 2nd + Compiler&Driver + EX(スロット指定)コマンドの機能拡張。 + 演奏開始タイミングで効果音モードを使用した時、発音できないバグの修正 + TAG198 2023/04/23 Driver 効果音モード時に音量が反映されないのバグ修正 diff --git a/MML.txt b/MML.txt index cc000f6..ef106af 100644 --- a/MML.txt +++ b/MML.txt @@ -863,7 +863,8 @@ mub 書式 EXn 値の範囲 - 使用するスロットの番号(1〜4)を列挙する + 使用するスロットの番号(1〜4)を列挙する。 + 又は0でスロットを使用しないことを指定する。 デフォルト値 EX1234 使用可能なパート @@ -880,6 +881,7 @@ mub 同様に音量変更時も、有効なスロットのみ変更処理が行われます。 音色変更時、FB/ALGは毎回更新されますが、ページ毎にその値を保持していますのでその値に違いがあると想定外の音量変更が行われます。 よって同じFB/ALGの音色を使用することをお勧めします。 + スロット番号に0を指定するとそのパートの割り当てはクリア(キーオン対象のスロットが無しの状態に)されます。 mubファイルでのフォーマット 0xFF 0xF8 0x01 n (n : bit3,2,1,0 がそれぞれスロット4,3,2,1の有効:1、無効:0を示す) diff --git a/mucomDotNETCompiler/muc88.cs b/mucomDotNETCompiler/muc88.cs index 3f935df..883b768 100644 --- a/mucomDotNETCompiler/muc88.cs +++ b/mucomDotNETCompiler/muc88.cs @@ -1503,7 +1503,7 @@ private EnmFCOMPNextRtn SETCh3SpecialMode() mucInfo.srcCPtr = ptr; //邁。譏薙メ繧ァ繝繧ッ - if (n < 1 || n > 4321) + if (n < 0 || n > 4321) { //error throw new MucException(string.Format(msg.get("E0535"), n) @@ -1512,17 +1512,24 @@ private EnmFCOMPNextRtn SETCh3SpecialMode() string s = n.ToString(); int sw = 0; - //驥崎、謖螳壹〒縺阪k縺代←縺セ縺り憶縺暦ス - foreach (char c in s) + if (n == 0) + { + sw = 0; + } + else { - if (c < '1' || c > '4') + //驥崎、謖螳壹〒縺阪k縺代←縺セ縺り憶縺暦ス + foreach (char c in s) { - //error - throw new MucException(string.Format(msg.get("E0536"), c) - , mucInfo.row, mucInfo.col); + if (c < '1' || c > '4') + { + //error + throw new MucException(string.Format(msg.get("E0536"), c) + , mucInfo.row, mucInfo.col); + } + int d = int.Parse(c.ToString()); + sw |= (1 << (d - 1)); } - int d = int.Parse(c.ToString()); - sw |= (1 << (d - 1)); } //EX繧ウ繝槭Φ繝峨ョ逋コ陦 diff --git a/mucomDotNETConsole/Properties/launchSettings.json b/mucomDotNETConsole/Properties/launchSettings.json index 986733e..4a71e9a 100644 --- a/mucomDotNETConsole/Properties/launchSettings.json +++ b/mucomDotNETConsole/Properties/launchSettings.json @@ -2,7 +2,7 @@ "profiles": { "Console": { "commandName": "Project", - "commandLineArgs": "-LOGLEVEL=TRACE \"C:\\Users\\kuma\\Downloads\\test2608_01\\test2608_Ch3SpecialMode.muc\"" + "commandLineArgs": "-LOGLEVEL=TRACE \"C:\\Users\\kuma\\Downloads\\test2608_01\\test2608_Ch3SpecialMode_OK.muc\"" } } } \ No newline at end of file diff --git a/mucomDotNETDriver/SoundWork.cs b/mucomDotNETDriver/SoundWork.cs index ef4ee94..80a917e 100644 --- a/mucomDotNETDriver/SoundWork.cs +++ b/mucomDotNETDriver/SoundWork.cs @@ -515,6 +515,7 @@ public class PGDAT public int portaTotalClock = 0; public double portaBeforeFNum = 0; public bool enblKeyOff = true; + public bool useKeyOn = false; //髻ウ濶イ繧ー繝ゥ繝繝シ繧キ繝ァ繝ウ public bool instrumentGradationSwitch = false; diff --git a/mucomDotNETDriver/music2.cs b/mucomDotNETDriver/music2.cs index 7b78746..d83d4fa 100644 --- a/mucomDotNETDriver/music2.cs +++ b/mucomDotNETDriver/music2.cs @@ -1483,10 +1483,13 @@ public void KEYOFF(bool force = false) if (CheckCh3SpecialMode()) { - work.cd.ch3KeyOn &= (byte)~(work.pg.useSlot << 4); - byte a = (byte)(work.cd.ch3KeyOn | 0x2); - PSGOUT(0x28, a);//KEY-OFF - //Console.WriteLine("KEYOFF : {0:x02}", a); + if (work.pg.useKeyOn) + { + work.cd.ch3KeyOn &= (byte)~(work.pg.useSlot << 4); + byte a = (byte)(work.cd.ch3KeyOn | 0x2); + PSGOUT(0x28, a);//KEY-OFF + //Console.WriteLine("KEYOFF : {0:x02}", a); + } } else { @@ -2303,6 +2306,7 @@ public void KEYON() //KEYON2: a += (byte)work.pg.channelNumber; PSGOUT(0x28, a);//KEY-ON + work.pg.useKeyOn = true; if (work.pg.reverbFlg) { @@ -2351,6 +2355,7 @@ public void KEYONex() work.cd.ch3KeyOn |= (byte)(work.pg.useSlot << 4); a &= (byte)(work.cd.ch3KeyOn | 0xf); PSGOUT(0x28, a);//KEY-ON + work.pg.useKeyOn = true; if (work.pg.reverbFlg) { @@ -2394,6 +2399,7 @@ public void KEYONopm() //KEYON2: a += (byte)work.pg.channelNumber; PSGOUT(0x08, a);//KEY-ON + work.pg.useKeyOn = true; if (work.pg.reverbFlg) { @@ -5487,6 +5493,7 @@ public void KEYON2() //KEYON2: a += (byte)work.pg.channelNumber; PSGOUT(0x28, a);//KEY-ON + work.pg.useKeyOn = true; if (work.pg.reverbFlg) {