Skip to content

Commit

Permalink
STBL485 2024/11/16 2nd
Browse files Browse the repository at this point in the history
  PianoRoll:Zoom出来るようにした。
  PianoRoll:ポイントしたところの音程を表示するようにした。
  PianoRoll:ノート通過中の音程を表示するようにした。
  • Loading branch information
kumatan committed Nov 16, 2024
1 parent 0c3c929 commit 3474e04
Show file tree
Hide file tree
Showing 8 changed files with 204 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGE.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
�X�V����
STBL485 2024/11/16 2nd
PianoRoll:Zoom�o����悤�ɂ����B
PianoRoll:�|�C���g�����Ƃ���̉�����\������悤�ɂ����B
PianoRoll:�m�[�g�ʉߒ��̉�����\������悤�ɂ����B

STBL484 2024/11/16
�R�A:�e�탉�C�u�����X�V
PianoRoll:��~��ԂōX�ɒ�~���s���Ɖ�ʂ��N���A�����悤�ɋ@�\�lj�
Expand Down
Binary file not shown.
28 changes: 28 additions & 0 deletions MDPlayer/MDPlayer_InstKit/00inst.nsh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ File ".\mdplayer\MDPlayerx64.exe"
File ".\mdplayer\MDPlayerx64.runtimeconfig.json"
File ".\mdplayer\MDSound.dll"
File ".\mdplayer\MGSDRV.COM"
File ".\mdplayer\Microsoft.Bcl.AsyncInterfaces.dll"
File ".\mdplayer\Microsoft.Bcl.AsyncInterfaces.xml"
File ".\mdplayer\Microsoft.Extensions.Configuration.Abstractions.dll"
File ".\mdplayer\Microsoft.Extensions.Configuration.dll"
File ".\mdplayer\Microsoft.Extensions.Configuration.FileExtensions.dll"
Expand Down Expand Up @@ -44,12 +46,33 @@ File ".\mdplayer\removeZoneIdent.bat"
File ".\mdplayer\SampleImageResource.zip"
File ".\mdplayer\scci2.dll"
File ".\mdplayer\scci2config.exe"
File ".\mdplayer\System.Buffers.dll"
File ".\mdplayer\System.Buffers.xml"
File ".\mdplayer\System.IO.Pipelines.dll"
File ".\mdplayer\System.IO.Pipelines.xml"
File ".\mdplayer\System.Memory.dll"
File ".\mdplayer\System.Memory.xml"
File ".\mdplayer\System.Numerics.Vectors.dll"
File ".\mdplayer\System.Numerics.Vectors.xml"
File ".\mdplayer\System.Runtime.CompilerServices.Unsafe.dll"
File ".\mdplayer\System.Runtime.CompilerServices.Unsafe.xml"
File ".\mdplayer\System.Text.Encodings.Web.dll"
File ".\mdplayer\System.Text.Encodings.Web.xml"
File ".\mdplayer\System.Text.Json.dll"
File ".\mdplayer\System.Text.Json.xml"
File ".\mdplayer\System.Threading.Tasks.Extensions.dll"
File ".\mdplayer\System.Threading.Tasks.Extensions.xml"
File ".\mdplayer\System.ValueTuple.dll"
File ".\mdplayer\System.ValueTuple.xml"
File ".\mdplayer\Z80dotNet.dll"
SetOutPath "$INSTDIR\FileAssociationTool"
File ".\mdplayer\FileAssociationTool\FileAssociationTool.deps.json"
File ".\mdplayer\FileAssociationTool\FileAssociationTool.dll"
File ".\mdplayer\FileAssociationTool\FileAssociationTool.exe"
File ".\mdplayer\FileAssociationTool\FileAssociationTool.runtimeconfig.json"
File ".\mdplayer\FileAssociationTool\System.IO.Pipelines.dll"
File ".\mdplayer\FileAssociationTool\System.Text.Encodings.Web.dll"
File ".\mdplayer\FileAssociationTool\System.Text.Json.dll"
SetOutPath "$INSTDIR\ja"
File ".\mdplayer\ja\MDPlayerx64.resources.dll"
SetOutPath "$INSTDIR\lang"
Expand Down Expand Up @@ -84,6 +107,11 @@ File ".\mdplayer\licenses\List.txt"
SetOutPath "$INSTDIR\net6.0-windows"
SetOutPath "$INSTDIR\plugin"
SetOutPath "$INSTDIR\FileAssociationTool\ico"
SetOutPath "$INSTDIR\FileAssociationTool\runtimes"
SetOutPath "$INSTDIR\FileAssociationTool\runtimes\browser"
SetOutPath "$INSTDIR\FileAssociationTool\runtimes\browser\lib"
SetOutPath "$INSTDIR\FileAssociationTool\runtimes\browser\lib\net8.0"
File ".\mdplayer\FileAssociationTool\runtimes\browser\lib\net8.0\System.Text.Encodings.Web.dll"
SetOutPath "$INSTDIR\licenses\fmgen"
File ".\mdplayer\licenses\fmgen\readme.txt"
SetOutPath "$INSTDIR\licenses\mame"
Expand Down
28 changes: 28 additions & 0 deletions MDPlayer/MDPlayer_InstKit/01uninst.nsh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ Delete "$INSTDIR\MDPlayerx64.exe"
Delete "$INSTDIR\MDPlayerx64.runtimeconfig.json"
Delete "$INSTDIR\MDSound.dll"
Delete "$INSTDIR\MGSDRV.COM"
Delete "$INSTDIR\Microsoft.Bcl.AsyncInterfaces.dll"
Delete "$INSTDIR\Microsoft.Bcl.AsyncInterfaces.xml"
Delete "$INSTDIR\Microsoft.Extensions.Configuration.Abstractions.dll"
Delete "$INSTDIR\Microsoft.Extensions.Configuration.dll"
Delete "$INSTDIR\Microsoft.Extensions.Configuration.FileExtensions.dll"
Expand Down Expand Up @@ -43,11 +45,32 @@ Delete "$INSTDIR\removeZoneIdent.bat"
Delete "$INSTDIR\SampleImageResource.zip"
Delete "$INSTDIR\scci2.dll"
Delete "$INSTDIR\scci2config.exe"
Delete "$INSTDIR\System.Buffers.dll"
Delete "$INSTDIR\System.Buffers.xml"
Delete "$INSTDIR\System.IO.Pipelines.dll"
Delete "$INSTDIR\System.IO.Pipelines.xml"
Delete "$INSTDIR\System.Memory.dll"
Delete "$INSTDIR\System.Memory.xml"
Delete "$INSTDIR\System.Numerics.Vectors.dll"
Delete "$INSTDIR\System.Numerics.Vectors.xml"
Delete "$INSTDIR\System.Runtime.CompilerServices.Unsafe.dll"
Delete "$INSTDIR\System.Runtime.CompilerServices.Unsafe.xml"
Delete "$INSTDIR\System.Text.Encodings.Web.dll"
Delete "$INSTDIR\System.Text.Encodings.Web.xml"
Delete "$INSTDIR\System.Text.Json.dll"
Delete "$INSTDIR\System.Text.Json.xml"
Delete "$INSTDIR\System.Threading.Tasks.Extensions.dll"
Delete "$INSTDIR\System.Threading.Tasks.Extensions.xml"
Delete "$INSTDIR\System.ValueTuple.dll"
Delete "$INSTDIR\System.ValueTuple.xml"
Delete "$INSTDIR\Z80dotNet.dll"
Delete "$INSTDIR\FileAssociationTool\FileAssociationTool.deps.json"
Delete "$INSTDIR\FileAssociationTool\FileAssociationTool.dll"
Delete "$INSTDIR\FileAssociationTool\FileAssociationTool.exe"
Delete "$INSTDIR\FileAssociationTool\FileAssociationTool.runtimeconfig.json"
Delete "$INSTDIR\FileAssociationTool\System.IO.Pipelines.dll"
Delete "$INSTDIR\FileAssociationTool\System.Text.Encodings.Web.dll"
Delete "$INSTDIR\FileAssociationTool\System.Text.Json.dll"
Delete "$INSTDIR\ja\MDPlayerx64.resources.dll"
Delete "$INSTDIR\lang\MoonDriverDotNETmessage.ja-JP.txt"
Delete "$INSTDIR\lang\MoonDriverDotNETmessage.txt"
Expand Down Expand Up @@ -75,6 +98,7 @@ Delete "$INSTDIR\lib\RealChipCtlWrap64.pdb"
Delete "$INSTDIR\lib\Z80dotNet.dll"
Delete "$INSTDIR\licenses\GPL.txt"
Delete "$INSTDIR\licenses\List.txt"
Delete "$INSTDIR\FileAssociationTool\runtimes\browser\lib\net8.0\System.Text.Encodings.Web.dll"
Delete "$INSTDIR\licenses\fmgen\readme.txt"
Delete "$INSTDIR\licenses\mame\mame_license.txt"
Delete "$INSTDIR\licenses\MGSDRV\MGSDR320.TXT"
Expand Down Expand Up @@ -112,6 +136,10 @@ Delete "$INSTDIR\plugin\driver\PMDDotNETDriver.dll"
Delete "$INSTDIR\plugin\driver\PMDDotNETmessage.ja-JP.txt"
Delete "$INSTDIR\plugin\driver\PMDDotNETmessage.txt"
RMDir "$INSTDIR\FileAssociationTool\ico"
RMDir "$INSTDIR\FileAssociationTool\runtimes\browser\lib\net8.0"
RMDir "$INSTDIR\FileAssociationTool\runtimes\browser\lib"
RMDir "$INSTDIR\FileAssociationTool\runtimes\browser"
RMDir "$INSTDIR\FileAssociationTool\runtimes"
RMDir "$INSTDIR\FileAssociationTool"
RMDir "$INSTDIR\ja"
RMDir "$INSTDIR\lang"
Expand Down
2 changes: 1 addition & 1 deletion MDPlayer/MDPlayer_InstKit/02info.nsh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
!define NAME "MDPlayer"
!define VERSION "STBL483"
!define VERSION "STBL484"
!define PUBLISHER "Kumata"
!define PACKAGE "${NAME} ${VERSION}"
73 changes: 71 additions & 2 deletions MDPlayer/MDPlayerx64/form/SYS/frmMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ private void frmMain_Load(object sender, EventArgs e)
if (setting.location.OMixer) openMixer();
if (setting.location.OpenYm2612MIDI) openMIDIKeyboard();
if (setting.location.OpenVisWave) OpenFormVisWave();
if (setting.location.OpenPianoRoll) OpenFormPianoRoll();
if (setting.location.OpenPianoRoll) openPianoRoll();

for (int chipID = 0; chipID < 2; chipID++)
{
Expand Down Expand Up @@ -1129,6 +1129,12 @@ private void changeZoom()
openMixer();
}

if (frmPianoRoll != null && !frmPianoRoll.isClosed)
{
openPianoRoll();
openPianoRoll();
}

}

private void frmMain_Shown(object sender, EventArgs e)
Expand Down Expand Up @@ -4614,7 +4620,7 @@ private void OpenFormPianoRoll()
return;
}

frmPianoRoll = new frmPianoRoll(this);
frmPianoRoll = new frmPianoRoll(this, setting.other.Zoom);

if (setting.location.PosPianoRoll == System.Drawing.Point.Empty)
{
Expand Down Expand Up @@ -5009,6 +5015,69 @@ private void openMixer()
oldParam.mixer = new MDChipParams.Mixer();
}

private void openPianoRoll()
{
if (frmPianoRoll != null && !frmPianoRoll.isClosed)
{
try
{
frmPianoRoll.Close();
frmPianoRoll.Dispose();
}
catch
{
}
finally
{
frmPianoRoll = null;
}
return;
}

if (frmPianoRoll != null)
{
try
{
frmPianoRoll.Close();
frmPianoRoll.Dispose();
}
catch
{
}
finally
{
frmPianoRoll = null;
}
}

frmPianoRoll = new frmPianoRoll(this, setting.other.Zoom);
if (setting.location.PosPianoRoll == System.Drawing.Point.Empty)
{
frmPianoRoll.x = this.Location.X + 328;
frmPianoRoll.y = this.Location.Y;
}
else
{
frmPianoRoll.x = setting.location.PosPianoRoll.X;
frmPianoRoll.y = setting.location.PosPianoRoll.Y;
}

Screen s = Screen.FromControl(frmPianoRoll);
Rectangle rc = new(frmPianoRoll.Location, frmPianoRoll.Size);
if (s.WorkingArea.Contains(rc))
{
frmPianoRoll.Location = rc.Location;
frmPianoRoll.Size = rc.Size;
}
else
{
frmPianoRoll.Location = new System.Drawing.Point(100, 100);
}

frmPianoRoll.Show();
frmPianoRoll.update();
}



private void pbScreen_DragEnter(object sender, DragEventArgs e)
Expand Down
1 change: 1 addition & 0 deletions MDPlayer/MDPlayerx64/form/SYS/frmPianoRoll.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

71 changes: 70 additions & 1 deletion MDPlayer/MDPlayerx64/form/SYS/frmPianoRoll.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ public partial class frmPianoRoll : frmBase
public bool isClosed = false;
public int x = -1;
public int y = -1;
private int frameSizeW = 0;
private int frameSizeH = 0;
private const int WIDTH = 1024;
private const int HEIGHT = 384;

private FrameBuffer frameBuffer = new FrameBuffer();
private int zoom = 1;
Expand All @@ -35,14 +39,18 @@ public partial class frmPianoRoll : frmBase
private int playLine = (int)FREQ;//1秒(44100Hz)
private double mul = 1 / FREQ * 200.0;
private int[] kn = new int[] { 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1 };
private int[] line = new int[8 * 12 + 1];
private bool[] lineK = new bool[8 * 12 + 1];

public frmPianoRoll(frmMain frm)
public frmPianoRoll(frmMain frm, int zoom)
{
parent = frm;
pianoRollMng = Audio.pianoRollMng;
this.zoom = zoom;

InitializeComponent();
frameBuffer.Add(pbScreen, img, null, zoom);
update();
}

private void frmPianoRoll_Shown(object sender, EventArgs e)
Expand Down Expand Up @@ -73,6 +81,23 @@ protected override bool ShowWithoutActivation
private void frmPianoRoll_Load(object sender, EventArgs e)
{
this.Location = new Point(x, y);
frameSizeW = this.Width - this.ClientSize.Width;
frameSizeH = this.Height - this.ClientSize.Height;

changeZoom();
}

public void changeZoom()
{
this.MaximumSize = new Size(frameSizeW + WIDTH * zoom, frameSizeH + HEIGHT * zoom);
this.MinimumSize = new Size(frameSizeW + WIDTH * zoom, frameSizeH + HEIGHT * zoom);
this.Size = new Size(frameSizeW + WIDTH * zoom, frameSizeH + HEIGHT * zoom);
frmPianoRoll_Resize(null, null);
}

private void frmPianoRoll_Resize(object sender, EventArgs e)
{

}

public void screenChangeParams()
Expand Down Expand Up @@ -145,6 +170,7 @@ public void screenDrawParams()
n.color[j] = n.noteColor2[j];
n.trgColor[j] = n.noteColor2[j];
}
if (n.key >= 0 && n.key < lineK.Length) lineK[n.key] = true;
}
else
{
Expand All @@ -168,6 +194,49 @@ public void screenDrawParams()
1,
img.Height,
0xd0, 0xd0, 0xd0);



for (int j = 0; j < 8 * 12; j++)
{
if (!lineK[j]) continue;
DrawBuff.drawFont4(frameBuffer, x - ((j & 1) != 0 ? (4 * 4 * 2-4) : (4 * 4 * 1)), j * noteHeight - 2, 1, Tables.kbn[(95 - j) % 12] + Tables.kbo[(95 - j) / 12]);
lineK[j] = false;

}


//// ポイントしたところにノート表示
int maxl = 0x03;
for (int j = 0; j < 8 * 12; j++)
{
for (int i = 0; i < line[j]; i++)
{
byte c = (byte)(Math.Max((line[j] == maxl ? 0xff : 0xff) - i * 2, 0));
frameBuffer.drawFillBox(
x + i+1,
j * noteHeight,
1,
noteHeight,
0, (byte)(c*0.9), c);
}
line[j] -= line[j] > 0 ? 1 : 0;
}

Point sp = Cursor.Position;
Point cp = PointToClient(sp);
int mx = cp.X/zoom;
int my = cp.Y/zoom/noteHeight*noteHeight;

if (my >= 0 && my < 8*12*noteHeight)
{
line[my / noteHeight] = maxl;
int n = 95 - my / noteHeight;
if (n >= 0) DrawBuff.drawFont8(frameBuffer, x - 8 * 4, my-2, 0, Tables.kbn[n % 12] + Tables.kbo[n / 12]);
}
////


}


Expand Down

0 comments on commit 3474e04

Please sign in to comment.