Skip to content

Instantly share code, notes, and snippets.

@neogeek
Created November 2, 2019 15:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save neogeek/1a8b0b4642a6837f9eb67b1379e2c740 to your computer and use it in GitHub Desktop.
Save neogeek/1a8b0b4642a6837f9eb67b1379e2c740 to your computer and use it in GitHub Desktop.
{
"dependencies": {
"jp.keijiro.midi-jack": "https://github.com/keijiro/MidiJack.git#upm",
...
}
}
using MidiJack;
using UnityEngine;
public class MidiInputController : MonoBehaviour
{
private void HandleMidiKnob(MidiChannel channel, int knobnumber, float knobvalue)
{
Debug.Log($"{channel}, {knobnumber}, {knobvalue}");
}
private void OnEnable()
{
MidiMaster.knobDelegate += HandleMidiKnob;
}
private void OnDisable()
{
MidiMaster.knobDelegate -= HandleMidiKnob;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment