예제 #1
0
 MIDIConfig FindConfigForReceiver(MIDIReceiver receiver)
 {
     if (receiver != null)
       {
      foreach (MIDIConfig c in MIDIConfigs)
      {
         if (c.MIDIReceiver == receiver)
            return c;
      }
       }
       return null;
 }
예제 #2
0
 void OnMIDIReceiverNoteOn(object sender, MIDIReceiver.MIDIReceiverEventArgs e)
 {
     MIDIConfig c = FindConfigForReceiver(e.Receiver);
       if (c != null)
       {
      c.LastNoteOnEvent = e;
      //Debug.Log("NOTE ON " + e.MidiNote + " for Group: " + c.Group.ToString() + " Beat: " + e.NoteBeat + " curBeat: " + BeatClock.Instance.elapsedBeats + " curSecs: " + BeatClock.Instance.elapsedSecs);
      if (OnNoteOn != null)
      {
         OnNoteOn(this, new EightNightsMIDIEventArgs(e.MidiNote, e.NoteBeat, e.DurationBeats, e.Velocity, c.Group));
      }
       }
 }
예제 #3
0
 public MIDIReceiverEventArgs(MIDIReceiver r, int midiNote, float beat, float durationBeats, float velocity)
 {
     Receiver = r; MidiNote = midiNote; NoteBeat = beat; DurationBeats = durationBeats; Velocity = velocity;
 }