Exemplo n.º 1
0
 void Awake()
 {
     if (singleton != null)
     {
         Debug.Log("MIDI OUT MONITOR already in scene.");
         Destroy(this);
         return;
     }
     singleton = this;
     shortMessageEventHandler   = new ShortMessageEventHandler(ShortMessage);
     MidiOut.ShortMessageEvent += shortMessageEventHandler;
     if (noteOn)
     {
         midiEvents.NoteOnEvent += NoteOn;
     }
     if (noteOff)
     {
         midiEvents.NoteOffEvent += NoteOff;
     }
     if (pedalOn)
     {
         midiEvents.PedalOnEvent += PedalOn;
     }
     if (pedalOff)
     {
         midiEvents.PedalOffEvent += PedalOff;
     }
 }
Exemplo n.º 2
0
    void Awake()
    {
        if (singleton != null)
        {
            Debug.LogError("GENERATOR : MidiPlayMakerInput already in scene.");
            Destroy(this);
            return;
        }
        shortMessageEventHandler         = new ShortMessageEventHandler(ShortMessageHelper);
        midiOutHelper.ShortMessageEvent += shortMessageEventHandler;
        singleton = this;

        if (OnInitialized != null)
        {
            OnInitialized(this);
        }
    }