Skip to content

Commit d2e0ab8

Browse files
committed
- 6.4.0.0 Added VST3 version VST plugin.
1 parent e82e16b commit d2e0ab8

File tree

79 files changed

+18122
-3204
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+18122
-3204
lines changed

.gitignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,3 +200,19 @@ bin
200200
/src/VSIF/VGMPlay_Genesis/cfg
201201
/src/VSIF/VGMPlay_NES_VRC6/.vscode
202202
/src/VSIF/VGMPlay_PCE/.vscode
203+
/src/VST3/MAmidiMEmo/Builds/VisualStudio2022/.vs/MAmidiMEmo
204+
/src/VST3/MAmidiMEmo/Builds/VisualStudio2022/x64
205+
/src/VST3/MAmidiMEmo/Builds/VisualStudio2022/Debug
206+
/src/VST3/MAmidiMEmo/Builds/VisualStudio2022/MAmidiMEmo_SharedCode.vcxproj.filters
207+
/src/VST3/MAmidiMEmo/Builds/VisualStudio2022/MAmidiMemo_SharedCode.vcxproj.user
208+
/src/VST3/MAmidiMEmo/Builds/VisualStudio2022/MAmidiMEmo_StandalonePlugin.vcxproj.filters
209+
/src/VST3/MAmidiMEmo/Builds/VisualStudio2022/MAmidiMEmo_StandalonePlugin.vcxproj.user
210+
/src/VST3/MAmidiMEmo/Builds/VisualStudio2022/MAmidiMEmo_VST3.vcxproj.filters
211+
/src/VST3/MAmidiMEmo/Builds/VisualStudio2022/MAmidiMemo_VST3.vcxproj.user
212+
/src/VST3/MAmidiMEmo/Builds/VisualStudio2022/MAmidiMEmo_VST3ManifestHelper.vcxproj.filters
213+
/src/VST3/MAmidiMEmo/Builds/VisualStudio2022/MAmidiMemo_VST3ManifestHelper.vcxproj.user
214+
/src/VST3/MAmidiMEmo/Builds/VisualStudio2022/NewProject_SharedCode.vcxproj.filters
215+
/src/VST3/MAmidiMEmo/Builds/VisualStudio2022/NewProject_StandalonePlugin.vcxproj.filters
216+
/src/VST3/MAmidiMEmo/Builds/VisualStudio2022/NewProject_StandalonePlugin.vcxproj.user
217+
/src/VST3/MAmidiMEmo/Builds/VisualStudio2022/NewProject_VST3.vcxproj.filters
218+
/src/VST3/MAmidiMEmo/Builds/VisualStudio2022/NewProject_VST3ManifestHelper.vcxproj.filters

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
MAmidiMEmo 6.3.1.0 Itoken (c)2019, 2025 / GPL-2.0
1+
MAmidiMEmo 6.4.0.0 Itoken (c)2019, 2025 / GPL-2.0
22

33
*** What is the MAmidiMEmo? ***
44

@@ -278,7 +278,8 @@ e.g.) YM2151 has 8ch FM sounds, so you can play 8 chords on MIDI 1ch or sharing
278278
[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=SNQ9JE3JAQMNQ)
279279

280280
*** Changes
281-
- 6.3.1.0 When selecting a file in Timbre Manager, we've changed it so you can test play the first sound in the list.
281+
- 6.4.0.0 Added VST3 version VST plugin.
282+
- 6.3.1.0 When selecting a file in Timbre Manager, you can test play the first sound in the list.
282283
- 6.3.0.0 Added MIDI Controller Dialog. You can open the dialog from the Tool menu.
283284
- 6.2.3.0 Added ModulationOverride, PanOverride, PitchOverride properties to MIDI Driver Settings of Timre property.
284285
- 6.2.2.0 Supported "SPC700_for_MeSX" for MAmidiMemo
Lines changed: 301 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,301 @@
1+
using FTD2XX_NET;
2+
using System;
3+
using System.Collections.Generic;
4+
using System.Diagnostics;
5+
using System.IO.Ports;
6+
using System.Linq;
7+
using System.Runtime.InteropServices;
8+
using System.Security.Cryptography;
9+
using System.Text;
10+
using System.Threading;
11+
using System.Threading.Tasks;
12+
using static System.Windows.Forms.VisualStyles.VisualStyleElement.ProgressBar;
13+
14+
namespace zanac.VGMPlayer
15+
{
16+
public class PortWriterMsxPi : PortWriter
17+
{
18+
private int lastSccType = -1;
19+
private int lastSccSlot = -1;
20+
21+
private int lastOpllType = -1;
22+
private int lastOpllSlot = -1;
23+
24+
private int lastOpmType = -1;
25+
private int lastOpmSlot = -1;
26+
27+
private byte lastDataType = 0xff;
28+
private byte lastWriteAddress;
29+
30+
/// <summary>
31+
///
32+
/// </summary>
33+
/// <param name="serialPort"></param>
34+
public PortWriterMsxPi(SerialPort serialPort) : base(serialPort)
35+
{
36+
}
37+
38+
/// <summary>
39+
///
40+
/// </summary>
41+
/// <param name="ftdiPort"></param>
42+
public PortWriterMsxPi(FTDI ftdiPort, PortId portNo) : base(ftdiPort, portNo)
43+
{
44+
}
45+
46+
/// <summary>
47+
///
48+
/// </summary>
49+
public override void Abort()
50+
{
51+
lastOpllType = -1;
52+
lastOpllSlot = -1;
53+
54+
lastSccType = -1;
55+
lastSccSlot = -1;
56+
57+
lastOpmType = -1;
58+
lastOpmSlot = -1;
59+
60+
lastDataType = 0xff;
61+
lastWriteAddress = 0;
62+
63+
base.Abort();
64+
}
65+
66+
/// <summary>
67+
///
68+
/// </summary>
69+
/// <param name="type"></param>
70+
/// <param name="address"></param>
71+
/// <param name="data"></param>
72+
/// <param name="wait"></param>
73+
public override void Write(PortWriteData[] data)
74+
{
75+
List<byte> ds = new List<byte>();
76+
foreach (var dt in data)
77+
{
78+
if (dt.Type == 0x17 && dt.Address == 0x07)
79+
//https://hra1129.github.io/system/psg_reg7.html
80+
dt.Data = (byte)((dt.Data & 0x3f) | 0x80);
81+
if (lastDataType == dt.Type && dt.Wait < 0)
82+
{
83+
//dummy wait
84+
for (int i = 0; i < -dt.Wait; i++)
85+
ds.Add(0x1F);
86+
}
87+
switch (dt.Type)
88+
{
89+
case 0x1F:
90+
//dummy wait
91+
ds.Add(dt.Type);
92+
break;
93+
case 2:
94+
if (lastOpllType != dt.Address || lastOpllSlot != dt.Data)
95+
{
96+
byte[] sd = new byte[] {
97+
dt.Type,
98+
dt.Address,
99+
dt.Data,
100+
};
101+
ds.AddRange(sd);
102+
103+
lastOpllType = dt.Address;
104+
lastOpllSlot = dt.Data;
105+
106+
lastSccType = -1;
107+
lastSccSlot = -1;
108+
}
109+
break;
110+
case 3:
111+
if (lastSccType != dt.Address || lastSccSlot != dt.Data)
112+
{
113+
lastSccType = dt.Address;
114+
lastSccSlot = dt.Data;
115+
116+
byte[] sd = new byte[] {
117+
dt.Type,
118+
dt.Address,
119+
dt.Data,
120+
};
121+
ds.AddRange(sd);
122+
123+
lastSccType = dt.Address;
124+
lastSccSlot = dt.Data;
125+
126+
lastOpllType = -1;
127+
lastOpllSlot = -1;
128+
}
129+
break;
130+
case 0x18: // NEOTRON SLOT
131+
if (lastSccType != dt.Address || lastSccSlot != dt.Data)
132+
{
133+
lastSccType = dt.Address;
134+
lastSccSlot = dt.Data;
135+
136+
byte[] sd = new byte[] {
137+
dt.Type,
138+
dt.Address,
139+
dt.Data,
140+
};
141+
ds.AddRange(sd);
142+
143+
lastSccType = dt.Address;
144+
lastSccSlot = dt.Data;
145+
146+
lastOpllType = -1;
147+
lastOpllSlot = -1;
148+
}
149+
break;
150+
case 0xd:
151+
if (lastOpmType != dt.Address || lastOpmSlot != dt.Data)
152+
{
153+
lastOpmType = dt.Address;
154+
lastOpmSlot = dt.Data;
155+
byte[] sd = new byte[] {
156+
dt.Type,
157+
dt.Address,
158+
dt.Data,
159+
};
160+
ds.AddRange(sd);
161+
}
162+
break;
163+
default:
164+
{
165+
if ((dt.Type == 0xa || dt.Type == 0xb) && lastWriteAddress == 0xf && //YM8950 ADPCM write
166+
lastDataType == dt.Type && (ushort)dt.Address == ((ushort)lastWriteAddress))
167+
{
168+
byte[] sd = new byte[] {
169+
0x00,
170+
dt.Data,
171+
};
172+
ds.AddRange(sd);
173+
}
174+
else if (dt.Type == 0x11 && lastWriteAddress == 0x8 && //OPNA ADPCM write
175+
lastDataType == dt.Type && (ushort)dt.Address == ((ushort)lastWriteAddress))
176+
{
177+
byte[] sd = new byte[] {
178+
0x00,
179+
dt.Data,
180+
};
181+
ds.AddRange(sd);
182+
}
183+
else if (dt.Type == 0x13) //OPNA Pseudo DAC write
184+
{
185+
byte[] sd = new byte[] {
186+
dt.Type,
187+
dt.Data,
188+
};
189+
ds.AddRange(sd);
190+
}
191+
else if (dt.Type == 0x14) //OPN2 DAC write
192+
{
193+
byte[] sd = new byte[] {
194+
dt.Type,
195+
dt.Data,
196+
};
197+
ds.AddRange(sd);
198+
}
199+
else if (dt.Type == 0x15) //tR DAC write
200+
{
201+
byte[] sd = new byte[] {
202+
dt.Type,
203+
dt.Data,
204+
};
205+
ds.AddRange(sd);
206+
}
207+
else if (dt.Type == 0x16) //OPNA DAC write
208+
{
209+
byte[] sd = new byte[] {
210+
dt.Type,
211+
dt.Data,
212+
};
213+
ds.AddRange(sd);
214+
}
215+
else if ((dt.Type == 1 || dt.Type == 0xc || //OPLL
216+
//dt.Type == 4 || dt.Type == 5 || //SCC
217+
dt.Type == 0xa || dt.Type == 0xb || //OPL3
218+
dt.Type == 0xe || //OPM BUSY WAIT
219+
dt.Type == 0x10 || dt.Type == 0x11 || //OPN2 or OPNA
220+
dt.Type == 0x12 || //OPN
221+
dt.Type == 0x1A || dt.Type == 0x1B //OPNB
222+
)
223+
&& lastDataType == dt.Type && (ushort)dt.Address == ((ushort)lastWriteAddress + 1))
224+
{
225+
//連続書き込み
226+
byte[] sd = new byte[] {
227+
0,
228+
dt.Data,
229+
};
230+
ds.AddRange(sd);
231+
}
232+
else if ((dt.Type == 0x1e //SAA1099, ...
233+
)
234+
&& lastDataType == dt.Type && (ushort)dt.Address == ((ushort)lastWriteAddress))
235+
{
236+
//連続書き込み
237+
byte[] sd = new byte[] {
238+
0,
239+
dt.Data,
240+
};
241+
ds.AddRange(sd);
242+
}
243+
else if (dt.Type >= 0x20)
244+
{
245+
byte[] sd = new byte[] {
246+
(byte)(dt.Type - 0x20),
247+
dt.Address,
248+
dt.Data,
249+
};
250+
ds.AddRange(sd);
251+
}
252+
else
253+
{
254+
byte[] sd = new byte[] {
255+
dt.Type,
256+
dt.Address,
257+
dt.Data,
258+
};
259+
ds.AddRange(sd);
260+
}
261+
lastDataType = dt.Type;
262+
lastWriteAddress = dt.Address;
263+
break;
264+
}
265+
}
266+
}
267+
sendData(ds.ToArray());
268+
}
269+
270+
/// <summary>
271+
///
272+
/// </summary>
273+
/// <param name="data"></param>
274+
/// <param name="wait"></param>
275+
public override void RawWrite(byte[] data, int[] wait)
276+
{
277+
sendData(data);
278+
}
279+
280+
private void sendData(byte[] sendData)
281+
{
282+
lock (LockObject)
283+
{
284+
try
285+
{
286+
SerialPort?.Write(sendData, 0, sendData.Length);
287+
}
288+
catch (Exception ex)
289+
{
290+
SerialPort.Close();
291+
if (ex.GetType() == typeof(Exception))
292+
throw;
293+
else if (ex.GetType() == typeof(SystemException))
294+
throw;
295+
}
296+
}
297+
}
298+
299+
}
300+
301+
}

src/VSIF/VGMPlayer/Settings.cs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
namespace zanac.VGMPlayer.Properties {
2+
3+
4+
// このクラスでは設定クラスでの特定のイベントを処理することができます:
5+
// SettingChanging イベントは、設定値が変更される前に発生します。
6+
// PropertyChanged イベントは、設定値が変更された後に発生します。
7+
// SettingsLoaded イベントは、設定値が読み込まれた後に発生します。
8+
// SettingsSaving イベントは、設定値が保存される前に発生します。
9+
internal sealed partial class Settings {
10+
11+
public Settings() {
12+
// // 設定の保存と変更のイベント ハンドラーを追加するには、以下の行のコメントを解除します:
13+
//
14+
// this.SettingChanging += this.SettingChangingEventHandler;
15+
//
16+
// this.SettingsSaving += this.SettingsSavingEventHandler;
17+
//
18+
}
19+
20+
private void SettingChangingEventHandler(object sender, System.Configuration.SettingChangingEventArgs e) {
21+
// SettingChangingEvent イベントを処理するコードをここに追加してください。
22+
}
23+
24+
private void SettingsSavingEventHandler(object sender, System.ComponentModel.CancelEventArgs e) {
25+
// SettingsSaving イベントを処理するコードをここに追加してください。
26+
}
27+
}
28+
}

0 commit comments

Comments
 (0)