- try sending and receiving midi

master
Simon G 5 years ago
parent 2e8984bb34
commit 0654c3a05e
  1. 15
      Lib.Audio/Device.cs

@ -7,6 +7,8 @@ using Lib.Audio.Factories;
using Lib.Audio.Interfaces;
using Lib.Midi.Factories;
using Lib.Midi.Interfaces;
using Lib.Midi.Messages;
using Lib.Midi.Messages.Interfaces;
namespace Lib.Audio
{
@ -30,10 +32,21 @@ namespace Lib.Audio
public List<IChannel> Channels { get; }
public void StartCommunication() => _midiCommunication.Open();
public void StartCommunication()
{
_midiCommunication.Open();
// _midiCommunication.Send(new PitchWheelChangeMessage(5000, 1, 600));
_midiCommunication.Send(new ControlChangeMessage(0, 1, 127));
}
private void OnMidiCommunicationMessageReceived(object? sender, IMidiMessage message)
{
int i = 0;
if (message is PitchWheelChangeMessage)
{
i = 1;
_midiCommunication.Send(message);
}
}
private void OnMidiCommunicationErrorReceived(object? sender, IMidiMessage message)

Loading…
Cancel
Save