Пример #1
0
 public void MicroInitialButtonLights(MidiDevice device)
 {
     //-W2PA Channel, Value, Status, ControlID, message bytes - but apparently it only pays attention to the string, others can all be zero
     device.SendMsg(0x00, 0x00, 0x00, 0x00, "901701");  //-W2PA L-Play/Pause button
     device.SendMsg(0x00, 0x00, 0x00, 0x00, "901801");  //-W2PA L-CUE button
     device.SendMsg(0x00, 0x00, 0x00, 0x00, "902701");  //-W2PA R-Play/Pause button
     device.SendMsg(0x00, 0x00, 0x00, 0x00, "902801");  //-W2PA R-CUE button
 }
Пример #2
0
        void OnMidiInput(MidiDevice Device, int DeviceIdx, int ControlId, int Data, int Status, int Voice, int Channel)
        {
            Device.latestControlID = ControlId;  //-W2PA used when making PL-1 LEDs respond to control action
            try
            {
                ControllerBinding ctrlBinding;
                if (bindings.TryGetValue(DeviceIdx, out ctrlBinding))
                {
                    MidMessageHandler handlers;
                    CmdState          state = CmdState.NoChange;

                    if (ctrlBinding.CmdBindings.TryGetValue(ControlId, out handlers))
                    {
                        if (handlers != null)
                        {
                            lock (midi_handler_lock)
                            {
                                if (handlers.CmdHandler != null)
                                {
                                    handlers.CmdHandler(Data, Device);
                                    if (Data <= 0)
                                    {
                                        state = CmdState.Off;
                                    }
                                    else
                                    {
                                        state = CmdState.On;
                                    }
                                }
                                else if (handlers.ToggleCmdHandler != null)
                                {
                                    state = handlers.ToggleCmdHandler(Data, Device);
                                }

                                if (state == CmdState.On && handlers.MidiOutCmdDown != null)
                                {
                                    Device.SendMsg(Channel, 0x7F, Status, ControlId, handlers.MidiOutCmdDown);
                                }
                                if (state == CmdState.Off && handlers.MidiOutCmdUp != null)
                                {
                                    Device.SendMsg(Channel, 0x00, Status, ControlId, handlers.MidiOutCmdUp);
                                }
                                if (handlers.MidiOutCmdSetValue != null)
                                {
                                    Device.SendMsg(Channel, Data, Status, ControlId, handlers.MidiOutCmdSetValue);
                                }
                            }
                        }
                    }
                }
            }
            catch { }
        }
Пример #3
0
        public void PL1InitialButtonLights(MidiDevice device)
        {
            //-W2PA Channel, Value, Status, ControlID, message bytes - but apparently it only pays attention to the string, others can all be zero
            device.SendMsg(0x01, 0x01, 0x90, 0x22, "902201");  //-W2PA CUE button
            device.SendMsg(0x01, 0x01, 0x90, 0x23, "902301");  //-W2PA play/pause button
            device.SendMsg(0x01, 0x01, 0x90, 0x26, "902601");  //-W2PA - button
            device.SendMsg(0x01, 0x01, 0x90, 0x27, "902701");  //-W2PA + button
            device.SendMsg(0x01, 0x00, 0x90, 0x24, "902400");  //-W2PA Rew button
            device.SendMsg(0x01, 0x00, 0x90, 0x25, "902500");  //-W2PA FF button
            device.SendMsg(0x01, 0x01, 0x90, 0x20, "902001");  //-W2PA SYNC button
            device.SendMsg(0x01, 0x01, 0x90, 0x21, "902101");  //-W2PA TAP button
            device.SendMsg(0x01, 0x01, 0x90, 0x1B, "901B01");  //-W2PA SCRATCH button
            device.SendMsg(0x01, 0x01, 0x90, 0x10, "901001");  //-W2PA 1 button
            device.SendMsg(0x01, 0x01, 0x90, 0x11, "901101");  //-W2PA 2 button
            device.SendMsg(0x01, 0x01, 0x90, 0x12, "901201");  //-W2PA 3 button
            device.SendMsg(0x01, 0x01, 0x90, 0x13, "901301");  //-W2PA 4 button
            device.SendMsg(0x01, 0x01, 0x90, 0x14, "901401");  //-W2PA 5 button
            device.SendMsg(0x01, 0x01, 0x90, 0x15, "901501");  //-W2PA 6 button
            device.SendMsg(0x01, 0x01, 0x90, 0x16, "901601");  //-W2PA 7 button
            device.SendMsg(0x01, 0x01, 0x90, 0x17, "901701");  //-W2PA 8 button
            device.SendMsg(0x01, 0x01, 0x90, 0x18, "901801");  //-W2PA LOAD button
            device.SendMsg(0x00, 0x00, 0x00, 0x00, "901900");  //-W2PA LOCK button
            //device.SendMsg(0x00, 0x00, 0x00, 0x00, "901A01");  //-W2PA DECK button - doesn't seem to work

            //-W2PA A silly but useful routine during startup to search for Behringer LED codes while in debug mode. Play with initial values and limits.
            //-W2PA Comment out the above set of light settings first.
            //int dev = 10;
            //int val = 0;
            //int stbyte = 176;
            //string dB;
            //string vB;
            //string stBs;
            //string m2s;
            //while (stbyte <= 0xFF)
            //{
            //    stBs = stbyte.ToString("X2");
            //    while (dev <= 0xFF)
            //    {
            //        dB = dev.ToString("X2");
            //        while (val <= 0x10)
            //        {
            //            vB = val.ToString("X2");
            //            m2s = stBs + dB + vB;
            //            device.SendMsg(0x01, 0x01, 0x90, dev, m2s);
            //            //Thread.Sleep(1);
            //            val++;
            //        }
            //        dev++;
            //        val = 0;
            //    }
            //    stbyte++;
            //    dev = 10;
            //}

            return;
        }