public bool SendEvent(Event ev)
        {
            if (ev.Type == EventType.Parameter)
            {
                SetParam((int)ev.EventIndex, (double)ev.Data);
                return true;
            }

            return false;
        }
Пример #2
0
 public void SendEvent(Event ev)
 {
     if (ev.Type == EventType.Parameter)
         SetParameter(ev.EventIndex, (double)ev.Data);
 }
Пример #3
0
        public bool SendEvent(Event ev)
        {
            if (ev.Type == EventType.Parameter)
            {
                SetParam((int)ev.EventIndex, (double)ev.Data);
                return true;
            }
            if (ev.Type == EventType.Midi)
            {
                ProcessMidi((byte[])ev.Data);
                return true;
            }
            if (ev.Type == EventType.GuiEvent)
            {
            }

            return false;
        }
Пример #4
0
        public void SendEvent(Event ev)
        {
            if (ev.Type == EventType.Parameter)
            {
                Controller.SetParameter(ModuleBinding.Filter1, ParameterBinding.Cutoff, (double)ev.Data);
            }
            else if(ev.Type == EventType.Midi)
            {
                var data = (byte[])ev.Data;
                if (data[0] == 0x80)
                {
                    Controller.NoteOff(data[1]);
                }
                else if (data[0] == 0x90)
                {
                    if (data[2] == 0)
                        Controller.NoteOff(data[1]);
                    else
                        Controller.NoteOn(data[1], data[2] / 127.0);
                }
                else if (data[0] == 0xE0)
                {
                    int val = (data[2] << 7) + data[1];

                    //int max = 0x3FFF;
                    int center = 0x2000;

                    double pitch = (val - center) / (double)0x2000;
                    Controller.SetPitchWheel(pitch);
                }
            }
        }
        public bool SendEvent(Event ev)
        {
            if (ev.Type == EventType.Parameter)
            {
                SetParameter(ev.EventIndex, (double)ev.Data);
                return true;
            }
            else if (ev.Type == EventType.Midi)
            {
                var data = (byte[])ev.Data;
                if (data[0] == 0x80)
                {
                    Container.RemoveNote(data[1]);
                    return true;
                }
                else if (data[0] == 0x90)
                {
                    if (data[2] == 0)
                        Container.RemoveNote(data[1]);
                    else
                    {
                        Container.AddNote(data[1], data[2]);
                    }
                    return true;
                }
            }

            return false;
        }
Пример #6
0
 public bool SendEvent(Event ev)
 {
     if (ev.Type == EventType.Midi)
     {
         controller.ProcessMidi(ev.Data as byte[]);
         return true;
     }
     return false;
 }