Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,26 @@
*.user
*.userosscache
*.sln.docstates
.rmv/
MidiParser/bin/Debug
MidiParser/bin/Old

# Backups
*.csbak
*.bak

# WIP cs (Not ready for build)
*.cswip

# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs

# Build results
#[Dd]ebug/
[Dd]ebug/
Debug/netcoreapp3.1/
*.dev.json
#[Dd]ebugPublic/
[Rr]elease/
#[Rr]elease/
[Rr]eleases/
x64/
x86/
Expand All @@ -27,6 +39,9 @@ x86/
[Oo]bj/
[Ll]og/

# Shortcuts
#*.lnk

# Visual Studio 2015/2017 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
Expand Down Expand Up @@ -165,7 +180,7 @@ DocProject/Help/Html2
DocProject/Help/html

# Click-Once directory
publish/
# publish/

# Publish Web Output
*.[Pp]ublish.xml
Expand Down
26 changes: 26 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"version": "0.2.0",
"configurations": [
{
// Use IntelliSense to find out which attributes exist for C# debugging
// Use hover for the description of the existing attributes
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/MidiParser/bin/Debug/netcoreapp3.1/MidiParser.dll",
"args": [],
"cwd": "${workspaceFolder}/MidiParser",
// For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
"console": "internalConsole",
"stopAtEntry": false
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach"
}
]
}
17 changes: 17 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"[rocket-mvbasic]": {
"editor.codeLens": false
},
"files.associations": {
"**/.rmv/config/*.json": "jsonc"
},
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/.DS_Store": true,
"**/Thumbs.db": true,
"**/.rmv/catalog/**": true,
"*/_*": false
}
}
41 changes: 41 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/MidiParser/MidiParser.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "publish",
"command": "dotnet",
"type": "process",
"args": [
"publish",
"${workspaceFolder}/MidiParser/MidiParser.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "watch",
"command": "dotnet",
"type": "process",
"args": [
"watch",
"run",
"--project",
"${workspaceFolder}/MidiParser/MidiParser.csproj"
],
"problemMatcher": "$msCompile"
}
]
}
Binary file added MidiParser.exe - Latest.lnk
Binary file not shown.
75 changes: 75 additions & 0 deletions MidiParser/AranaraN.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
using NAudio.Midi;
using System;
using System.Collections.Generic;
using System.Text;

namespace MidiParser
{
class AranaraN
{
private string ahex_note;
public string hex_note {get => ahex_note; private set => ahex_note = value;}
private string ahex_vel;
public string hex_vel {get => ahex_vel; private set => ahex_vel = value;}
private string ahex_ch;
public string hex_ch {get => ahex_ch; private set => ahex_ch = value;}
private string ahex_value;
public string hex_value {get => ahex_value; private set => ahex_value = value;}
private string ahex_time;
public string hex_time {get => ahex_time; private set => ahex_time = value;}
private string ahex_len;
public string hex_len {get => ahex_len; private set => ahex_len = value;}
private string ahex_type;
public string hex_type {get => ahex_type; private set => ahex_type = value;}

public AranaraN (string htype, int hnote, int hvel, int hch, double htime, double hlen, int htpqn)
{
switch (htype){ //Len parameter for function AranaraN used for values for non-note events.
case "TR": //Track
hex_type = "F";
hex_note = ""; //Unused Parameter for Track Headers
hex_vel = "";
hex_ch = "";
hex_value = Convert.ToInt32(hlen).ToString("X") + "|";
hex_time = "";
hex_len = "";
break;

case "TE": //Tempo
hex_type = "E";
hex_note = ""; //Unused Parameter for Tempo Events
hex_vel = "";
hex_ch = "";
hex_value = Convert.ToInt32(hlen).ToString("X") + "|";
hex_time = Convert.ToInt32(Math.Round(htime*htpqn,0)).ToString("X") + "|";
hex_len = "";
break;

case "PC": //Program Change
hex_type = "D";
hex_note = hnote.ToString("X2"); //Patch Value (Conveniently same range as note pitch)
hex_vel = "";
hex_ch = hch.ToString("X");
hex_value = "";
hex_time = Convert.ToInt32(Math.Round(htime*htpqn,0)).ToString("X") + "|";
hex_len = "";
break;

default: //Assume Note
hex_type = "";
hex_note = hnote.ToString("X2");
hex_vel = hvel.ToString("X2");
hex_ch = hch.ToString("X");
hex_value = ""; //Unused Parameter for Notes
hex_time = Convert.ToInt32(Math.Round(htime*htpqn,0)).ToString("X") + "|";
hex_len = Convert.ToInt32(Math.Round(hlen*htpqn,0)).ToString("X") + "|";
break;
}
}

public static double ToSeconds (long time, TempoEvent lastTempoEvent, int ticksPerQuarterNote)
{
return (double)(((double)(time - lastTempoEvent.AbsoluteTime) / ticksPerQuarterNote) * lastTempoEvent.MicrosecondsPerQuarterNote + lastTempoEvent.AbsoluteTime) / 1000000;
}
}
}
8 changes: 3 additions & 5 deletions MidiParser/MidiParser.csproj
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="NAudio" Version="1.10.0" />
<PackageReference Include="NAudio" Version="1.10.0"/>
<Import Include="System.Windows.Forms" />
</ItemGroup>

</Project>
</Project>
32 changes: 0 additions & 32 deletions MidiParser/Note.cs

This file was deleted.

Loading