Пример #1
0
        public static TouchStrip GetTouchStrip()
        {
            TouchStrip t = _TouchStrip.touchStrip.Clone();

            t.position = MidiMaster.GetBend();
            return(t);
        }
Пример #2
0
        public TouchStrip Clone()
        {
            TouchStrip t = new TouchStrip();

            t.touched  = this.touched;
            t.position = this.position;
            t.number   = this.number;
            t.message  = this.message;
            t.name     = this.name;
            return(t);
        }
Пример #3
0
        static void NoteOn(MidiChannel channel, int note, float velocity)
        {
            Pads.All.ForEach(pad =>
            {
                if (note != pad.number)
                {
                    return;
                }
                Pad p      = pad.Clone();
                p.pressure = velocity;
                if (padPressedDelegate != null)
                {
                    padPressedDelegate(p, velocity);
                }
            });

            RotaryEncoders.All.ForEach(encoder =>
            {
                if (note != encoder.touch.number)
                {
                    return;
                }
                RotaryEncoder e = encoder.Clone();
                e.touch.touched = true;
                if (encoderTouchedDelegate != null)
                {
                    encoderTouchedDelegate(e);
                }
            });

            if (note == _TouchStrip.touchStrip.number)
            {
                TouchStrip t = _TouchStrip.touchStrip.Clone();
                if (velocity == 1.0f)
                {
                    t.touched = true;
                    if (touchStripTouchedDelegate != null)
                    {
                        touchStripTouchedDelegate(t);
                    }
                }
                else if (velocity == 0.0f)
                {
                    t.touched = false;
                    if (touchStripReleasedDelegate != null)
                    {
                        touchStripReleasedDelegate(t);
                    }
                }
            }
        }