Пример #1
0
        public override MidiMessage HandleInput(MidiMessage msg, MidiRouter router)
        {
            if (msg.MessageType == MidiMessageType.NoteOn) {
                //note ON

            #warning workround!
                System.Threading.Thread.Sleep (50);
                if (Value == true) {
            #warning Default is NoteOff!
                    msg.MessageType = MidiMessageType.NoteOn;
                    msg.NoteVelocity = 0;

                    //workaround
                    //msg = this.InitControl ();
                }

            } else {
                //note OFF
                msg = null;
            }

            /*if(msg != null)
                Console.WriteLine (">: " + msg);
                */

            return msg;
        }
Пример #2
0
 public override MidiMessage HandleOutput(MidiMessage msg, MidiRouter router)
 {
     //Green (Orange = + 36)
     msg.NoteNumber = this.NoteNumber;
     msg.MessageType = MidiMessageType.NoteOn;
     msg.NoteVelocity = 127;
     return msg;
 }
Пример #3
0
 void Flash(MidiRouter router)
 {
     router.TransmitMidiData (router.Endpoint2, new MidiMessage (MidiMessageType.NoteOn, 14, 59, 127));
     router.TransmitMidiData (router.Endpoint1, new MidiMessage (MidiMessageType.NoteOn, 14, NoteNumber + 72, 127)); // color
     System.Threading.Thread.Sleep (50);
     router.TransmitMidiData (router.Endpoint2, new MidiMessage (MidiMessageType.NoteOff, 14, 59, 0));
     router.TransmitMidiData (router.Endpoint1, new MidiMessage (MidiMessageType.NoteOn, 14, NoteNumber + 36, 127)); // color
     System.Threading.Thread.Sleep (50);
 }
Пример #4
0
 public override MidiMessage HandleInput(MidiMessage msg, MidiRouter router)
 {
     System.Threading.Thread.Sleep (200);
     if (msg.NoteVelocity == 1) {
         //right
         msg.NoteNumber += this.IncRange;
         msg.NoteVelocity = 127;
     }
     return msg;
 }
Пример #5
0
        public override MidiMessage HandleInput(MidiMessage msg, MidiRouter router)
        {
            if(msg.MessageType == MidiMessageType.NoteOn)
                if (!worker.IsBusy)
                    worker.RunWorkerAsync (router);

            if (msg.MessageType == MidiMessageType.NoteOff)
                running = false;

            return null;
        }
Пример #6
0
        public override MidiMessage HandleOutput(MidiMessage msg, MidiRouter router)
        {
            if (msg.MessageType == MidiMessageType.NoteOn) {
                this.Value = true;

                //Green (Orange = + 36 RED = + 72)
                msg.NoteNumber = this.NoteNumber + 72;
                msg.MessageType = MidiMessageType.NoteOn;
                msg.NoteVelocity = 127;

            } else {
                this.Value = false;

                //Red
                msg.MessageType = MidiMessageType.NoteOn;
                msg.NoteNumber = this.NoteNumber + 36;
                msg.NoteVelocity = 127;
            }
            return msg;
        }
Пример #7
0
        public MidiModulator()
        {
            router = new MidiRouter ();
            router.MidiDataReceivedInput1 += HandleMidiDataReceivedInput1;
            router.MidiDataReceivedInput2 += HandleMidiDataReceivedInput2;

            //Connect Hardware XONE:k2
            router.SetMidiDevice (1,
                router.InputPort1,
                "XONE");

            //Connect ICA Driver
            router.SetMidiDevice (2,
                router.InputPort2,
                "MidiModLoop");

            controls = new List<ControlObject> ();
            controls.AddRange (Xone.GetXoneK2Controls ());

            MappingMod = false;

            InitControls ();
            Console.WriteLine ("modulator finished");
        }
Пример #8
0
 public override MidiMessage HandleInput(MidiMessage msg, MidiRouter router)
 {
     return msg;
 }