예제 #1
0
 public override void Apply()
 {
     MidiDriver.KnobDelegate action = (MidiChannel ch, int knob, float val) =>
     {
         if ((ch == channel || channel == MidiChannel.All) && knob == knobNumber)
         {
             onKnob.Invoke(val);
         }
     };
     info = new MidiCcEventInfo()
     {
         knobName   = knobName,
         channel    = channel,
         knobNumber = knobNumber,
         methods    = Enumerable.Range(0, onKnob.GetPersistentEventCount())
                      .Select(idx => onKnob.GetPersistentTarget(idx).ToString() + "." + onKnob.GetPersistentMethodName(idx))
                      .ToArray()
     };
     MidiController.AddCcAction(action, info);
 }
예제 #2
0
 public static void AddCcAction(MidiDriver.KnobDelegate knobAction, MidiCcEventInfo info)
 {
     MidiMaster.knobDelegate += knobAction;
     Instance.eventList.Add(info);
     Instance.eventList.OrderBy(b => b.channel.ToString() + b.knobNumber).ToList();
 }