soundvision/UnityProject/Assets/Scripts/PdConnection/MidiLogger.cs

27 lines
652 B
C#
Raw Normal View History

2019-10-26 20:45:33 +00:00
using UnityEngine;
namespace cylvester
{
public class MidiLogger : MonoBehaviour
{
[SerializeField] private bool logAll;
[SerializeField] private bool logFiltered;
[SerializeField, Range(128, 255)] private int filterStatusByte = 128;
public void OnMidiMessageReceived(MidiMessage mes)
{
2019-10-27 10:21:33 +00:00
2019-10-26 20:45:33 +00:00
if(logAll)
Debug.Log("MIDI Received: " + mes);
if(logFiltered)
{
if (mes.Status == filterStatusByte)
{
Debug.Log("Filtered MIDI Received: " + mes);
}
}
}
}
}