Example #1
0
        static void Main(string[] args)
        {
            var samplesFactory = new SamplesFactory();
            //            var kalimba = samplesFactory.Wawe();
            //            var drum = samplesFactory.GetDrum();
            var guitar = samplesFactory.GetGitare();

            //kalimba.Play(1.0);
            //kalimba.PlayNonStop(1);

            guitar.PlayNonStop();

            //while (true)
            //{
            //    Thread.Sleep(3000);
            //    guitar.Faster();
            //    drum.Play(1);
            //}

            Console.ReadLine();
        }
Example #2
0
        public static void Main()
        {
            var gesturesObserver = new GesturesObserver();
            var samplesFactory = new SamplesFactory();
            var gitare = samplesFactory.GetGitare();
            var plate = samplesFactory.GetGitare();
            var tube = samplesFactory.GetGitare();
            var drum = samplesFactory.GetGitare();
            var metronom = samplesFactory.GetMetronom();

            //gesturesObserver.TrackGesture(GestureType.SwipeLeft, gitare);
            //gesturesObserver.TrackGesture(GestureType.SwipeRight, plate);
            //gesturesObserver.TrackGesture(GestureType.WaveLeft, tube);
            //gesturesObserver.TrackGesture(GestureType.WaveRight, drum);

            metronom.Play();

            while (true)
            {
                Thread.Sleep(100);
            }
        }
Example #3
0
        /// <summary>
        /// Kinect enabled apps should customize which Kinect services it initializes here.
        /// </summary>
        /// <param name="kinectSensorManager"></param>
        /// <param name="sensor"></param>
        private void InitializeKinectServices(KinectSensorManager kinectSensorManager, KinectSensor sensor)
        {
            // Application should enable all streams first.

            // configure the color stream
            kinectSensorManager.ColorFormat = ColorImageFormat.RgbResolution640x480Fps30;

            kinectSensorManager.TransformSmoothParameters =
                new TransformSmoothParameters
                {
                    Smoothing = 0.5f,
                    Correction = 0.5f,
                    Prediction = 0.8f,
                    JitterRadius = 0.05f,
                    MaxDeviationRadius = 0.04f
                };

            // configure the skeleton stream
            sensor.SkeletonFrameReady += OnSkeletonFrameReady;
            kinectSensorManager.SkeletonStreamEnabled = true;

            // initialize the gesture recognizer
            _samplesFactory = new SamplesFactory();
            _metro = _samplesFactory.GetMetronom();
             _metro.PlayNonStop();

            CreateObserver(_samplesFactory);

            kinectSensorManager.KinectSensorEnabled = true;

            if (!kinectSensorManager.KinectSensorAppConflict)
            {
                // addition configuration, as needed
            }
        }
Example #4
0
        private GesturesObserver CreateObserver(SamplesFactory samplesFactory)
        {
            var gesturesObserver = new GesturesObserver();

            gesturesObserver.TrackDiscretGesture(GestureType.HammerLeft, samplesFactory.GetDrumHandLeft());
            gesturesObserver.TrackDiscretGesture(GestureType.HammerRight, samplesFactory.GetDrumHandRight());
            gesturesObserver.TrackDiscretGesture(GestureType.StepLeft, samplesFactory.GetDrumLegLeft());
            gesturesObserver.TrackDiscretGesture(GestureType.StepRight, samplesFactory.GetDrumLegRight());
            gesturesObserver.TrackDiscretGesture(GestureType.Head, samplesFactory.GetDrumHead());
            gesturesObserver.TrackDiscretGesture(GestureType.JoinedHands, samplesFactory.GetGuitarLoop());
            gesturesObserver.TrackDiscretGesture(GestureType.Menu, samplesFactory.GetPianoLoop());

            _settings = new HandUpContiniousGestureSettings();
            gesturesObserver.TrackContinuesGesture(_settings, samplesFactory.Wawe());

            gesturesObserver.GestureSamplePlayed += GestureSamplePlayed;
            return gesturesObserver;
        }