diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a923442 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +/.vs +/MidiTest/obj +/MidiTest/bin diff --git a/MidiTest.sln b/MidiTest.sln new file mode 100644 index 0000000..17931f6 --- /dev/null +++ b/MidiTest.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29519.87 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MidiTest", "MidiTest\MidiTest.csproj", "{97E33DEC-C501-48D2-9B95-88EE74E95F79}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {97E33DEC-C501-48D2-9B95-88EE74E95F79}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {97E33DEC-C501-48D2-9B95-88EE74E95F79}.Debug|Any CPU.Build.0 = Debug|Any CPU + {97E33DEC-C501-48D2-9B95-88EE74E95F79}.Release|Any CPU.ActiveCfg = Release|Any CPU + {97E33DEC-C501-48D2-9B95-88EE74E95F79}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {ED349F40-20F8-4E2B-82C3-4D31BB875F22} + EndGlobalSection +EndGlobal diff --git a/MidiTest/App.xaml b/MidiTest/App.xaml new file mode 100644 index 0000000..170e8b6 --- /dev/null +++ b/MidiTest/App.xaml @@ -0,0 +1,9 @@ + + + + + diff --git a/MidiTest/App.xaml.cs b/MidiTest/App.xaml.cs new file mode 100644 index 0000000..0e6fc53 --- /dev/null +++ b/MidiTest/App.xaml.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Data; +using System.Linq; +using System.Threading.Tasks; +using System.Windows; + +namespace MidiTest { + /// + /// Interaction logic for App.xaml + /// + public partial class App : Application { + } +} diff --git a/MidiTest/MainWindow.xaml b/MidiTest/MainWindow.xaml new file mode 100644 index 0000000..88568a7 --- /dev/null +++ b/MidiTest/MainWindow.xaml @@ -0,0 +1,34 @@ + + + + + diff --git a/MidiTest/MainWindow.xaml.cs b/MidiTest/MainWindow.xaml.cs new file mode 100644 index 0000000..151286f --- /dev/null +++ b/MidiTest/MainWindow.xaml.cs @@ -0,0 +1,36 @@ +using System; +using System.Windows; +using Commons.Music.Midi; + +namespace MidiTest { + /// + /// Interaction logic for MainWindow.xaml + /// + public partial class MainWindow : Window { + public MainWindow() { + this.InitializeComponent(); + this.DetectMidi(); + } + + private void DetectMidi() { + IMidiAccess access = MidiAccessManager.Default; + foreach (IMidiPortDetails item in access.Outputs) { + _ = this.MidiSelector.Items.Add(new Tuple(item.Manufacturer + " - " + item.Name, item.Id)); + } + } + + private void test(Object sender, System.Windows.Input.MouseButtonEventArgs e) { + IMidiOutput outp = MidiAccessManager.Default.OpenOutputAsync(((Tuple)this.MidiSelector.SelectedItem).Item2).Result; + outp.Send(new Byte[] { 144, 81, 45 }, 0, 3, 0); + + outp.Send(new Byte[] { 176, 106, 53 }, 0, 3, 0); + + outp.Send(new Byte[] { 145, 11, 5 }, 0, 3, 0); + + outp.Send(new Byte[] { 144, 12, 21 }, 0, 3, 0); + outp.Send(new Byte[] { 145, 12, 5 }, 0, 3, 0); + + outp.Send(new Byte[] { 146, 88, 81 }, 0, 3, 0); + } + } +} diff --git a/MidiTest/MidiTest.csproj b/MidiTest/MidiTest.csproj new file mode 100644 index 0000000..75c7923 --- /dev/null +++ b/MidiTest/MidiTest.csproj @@ -0,0 +1,13 @@ + + + + WinExe + netcoreapp3.0 + true + + + + + + + \ No newline at end of file diff --git a/MidiTest/MidiTest.csproj.user b/MidiTest/MidiTest.csproj.user new file mode 100644 index 0000000..06ea4fd --- /dev/null +++ b/MidiTest/MidiTest.csproj.user @@ -0,0 +1,14 @@ + + + + + + Designer + + + + + Designer + + + \ No newline at end of file