예제 #1
0
        public void Setup()
        {
            IntPtr windowHandle = new WindowInteropHelper(Rack.DMIBox.NetytarMainWindow).Handle;

            Rack.DMIBox.KeyboardModule = new KeyboardModule(windowHandle);

            // MIDI
            Rack.DMIBox.MidiModule = new MidiModuleNAudio(1, 1);
            MidiDeviceFinder midiDeviceFinder = new MidiDeviceFinder(Rack.DMIBox.MidiModule);

            midiDeviceFinder.SetToLastDevice();

            // EYETRACKER
            if (Rack.DMIBox.Eyetracker == Eyetracker.Tobii)
            {
                Rack.DMIBox.TobiiModule = new TobiiModule(GazePointDataMode.Unfiltered);
                Rack.DMIBox.TobiiModule.Start();
                Rack.DMIBox.TobiiModule.HeadPoseBehaviors.Add(new HPBpitchPlay(10, 15, 1.5f, 30f));
                Rack.DMIBox.TobiiModule.HeadPoseBehaviors.Add(new HPBvelocityPlay(8, 12, 2f, 120f, 0.2f));
            }

            if (Rack.DMIBox.Eyetracker == Eyetracker.Eyetribe)
            {
                Rack.DMIBox.EyeTribeModule = new EyeTribeModule();
                Rack.DMIBox.EyeTribeModule.Start();
                Rack.DMIBox.EyeTribeModule.MouseEmulator         = new MouseEmulator(new PointFilterBypass());
                Rack.DMIBox.EyeTribeModule.MouseEmulatorGazeMode = GazeMode.Raw;
            }


            // MISCELLANEOUS
            Rack.DMIBox.SensorReader = new SensorModule("COM", 9600);

            // BEHAVIORS
            Rack.DMIBox.KeyboardModule.KeyboardBehaviors.Add(new KBemulateMouse());
            Rack.DMIBox.KeyboardModule.KeyboardBehaviors.Add(new KBsimulateBlow());
            Rack.DMIBox.KeyboardModule.KeyboardBehaviors.Add(new KBselectScale());

            Rack.DMIBox.TobiiModule.BlinkBehaviors.Add(new EBBselectScale(Rack.DMIBox.NetytarMainWindow));
            Rack.DMIBox.TobiiModule.BlinkBehaviors.Add(new EBBrepeatNote());

            Rack.DMIBox.SensorReader.Behaviors.Add(new SBbreathSensor(20, 28, 1.5f)); // 15 20
            //Rack.DMIBox.SensorReader.Behaviors.Add(new SBaccelerometerTest());
            Rack.DMIBox.SensorReader.Behaviors.Add(new SBreadSerial());


            // SURFACE
            IDimension              dimension       = new DimensionInvert();
            IColorCode              colorCode       = new ColorCodeStandard();
            IButtonsSettings        buttonsSettings = new ButtonsSettingsInvert();
            NetytarSurfaceDrawModes drawMode        = NetytarSurfaceDrawModes.AllLines;

            Rack.DMIBox.AutoScroller   = new AutoScroller(Rack.DMIBox.NetytarMainWindow.scrlNetytar, 0, 100, new PointFilterMAExpDecaying(0.1f)); // OLD was 100, 0.1f
            Rack.DMIBox.NetytarSurface = new NetytarSurface(Rack.DMIBox.NetytarMainWindow.canvasNetytar, dimension, colorCode, buttonsSettings, drawMode);
            Rack.DMIBox.NetytarSurface.DrawButtons();
            Rack.DMIBox.NetytarSurface.Scale = ScalesFactory.Cmaj;
        }
예제 #2
0
        public void Setup()
        {
            // KEYBOARD MODULE
            IntPtr windowHandle = new WindowInteropHelper(R.NDB.MainWindow).Handle;

            R.NDB.KeyboardModule = new KeyboardModule(windowHandle);

            // MIDI
            R.NDB.MidiModule = new MidiModuleNAudio(1, 1);
            MidiDeviceFinder midiDeviceFinder = new MidiDeviceFinder(R.NDB.MidiModule);

            midiDeviceFinder.SetToLastDevice();

            // EYETRACKER
            //if(R.NDB.Eyetracker == EyetrackerModels.Tobii)
            //{
            R.NDB.TobiiModule = new TobiiModule(GazePointDataMode.Unfiltered);
            //Rack.NetychordsDMIBox.TobiiModule.HeadPoseBehaviors.Add(new HPBpitchPlay(10, 15, 1.5f, 30f));
            //Rack.NetychordsDMIBox.TobiiModule.HeadPoseBehaviors.Add(new HPBvelocityPlay(8, 12, 2f, 120f, 0.2f));
            //}

            //if(R.NDB.Eyetracker == EyetrackerModels.EyeTribe)
            //{
            //    R.NDB.EyeTribeModule = new EyeTribeModule();
            //    R.NDB.EyeTribeModule.Start();
            //    R.NDB.EyeTribeModule.MouseEmulator = new MouseEmulator(new PointFilterBypass());
            //    R.NDB.EyeTribeModule.MouseEmulatorGazeMode = GazeMode.Raw;
            //}



            // MODULES
            R.NDB.HeadTrackerModule = new SensorModule(115200);

            // BEHAVIORS
            R.NDB.KeyboardModule.KeyboardBehaviors.Add(new KBplayStop());
            R.NDB.KeyboardModule.KeyboardBehaviors.Add(new KBemulateMouse());
            R.NDB.KeyboardModule.KeyboardBehaviors.Add(new KBstopEmulateMouse());
            R.NDB.KeyboardModule.KeyboardBehaviors.Add(new KBautoScroller());
            R.NDB.KeyboardModule.KeyboardBehaviors.Add(new KBstopAutoScroller());
            R.NDB.KeyboardModule.KeyboardBehaviors.Add(new KBautoStrum());

            R.NDB.HeadTrackerModule.Behaviors.Add(new HSreadSerial());

            //R.NDB.TobiiModule.BlinkBehaviors.Add(new BBDoubleCloseStopChords());
            R.NDB.TobiiModule.BlinkBehaviors.Add(new BBDoubleClosePlayChord());

            //SURFACE
            R.NDB.AutoScroller = new AutoScroller(R.NDB.MainWindow.scrlNetychords, 0, 200, new PointFilterMAExpDecaying(0.1f));

            R.NDB.NetychordsSurface = new NetychordsSurface(R.NDB.MainWindow.canvasNetychords);
            R.NDB.NetychordsSurface.DrawButtons();

            R.NDB.NetychordsSurface.HtFeedbackModule = new HTFeedbackModule(R.NDB.NetychordsSurface.Canvas, HTFeedbackModule.HTFeedbackModes.DeadZone);

            R.NDB.NetychordsSurface.HighLightMode = NetychordsSurfaceHighlightModes.CurrentNote;
        }
예제 #3
0
        public void Setup()
        {
            // KEYBOARD MODULE
            IntPtr windowHandle = new WindowInteropHelper(Rack.NetychordsDMIBox.MainWindow).Handle;

            Rack.NetychordsDMIBox.KeyboardModule = new KeyboardModule(windowHandle);

            // MIDI
            Rack.NetychordsDMIBox.MidiModule = new MidiModuleNAudio(1, 1);
            MidiDeviceFinder midiDeviceFinder = new MidiDeviceFinder(Rack.NetychordsDMIBox.MidiModule);

            midiDeviceFinder.SetToLastDevice();

            // EYETRACKER
            if (Rack.NetychordsDMIBox.Eyetracker == EyetrackerModels.Tobii)
            {
                Rack.NetychordsDMIBox.TobiiModule = new TobiiModule(GazePointDataMode.Unfiltered);
                //Rack.NetychordsDMIBox.TobiiModule.HeadPoseBehaviors.Add(new HPBpitchPlay(10, 15, 1.5f, 30f));
                //Rack.NetychordsDMIBox.TobiiModule.HeadPoseBehaviors.Add(new HPBvelocityPlay(8, 12, 2f, 120f, 0.2f));
            }

            if (Rack.NetychordsDMIBox.Eyetracker == EyetrackerModels.EyeTribe)
            {
                Rack.NetychordsDMIBox.EyeTribeModule = new EyeTribeModule();
                Rack.NetychordsDMIBox.EyeTribeModule.Start();
                Rack.NetychordsDMIBox.EyeTribeModule.MouseEmulator         = new MouseEmulator(new PointFilterBypass());
                Rack.NetychordsDMIBox.EyeTribeModule.MouseEmulatorGazeMode = GazeMode.Raw;
            }

            Rack.NetychordsDMIBox.TobiiModule.BlinkBehaviors.Add(new BBDoubleCloseStopChords());

            // MODULES
            //IntPtr windowHandle = new WindowInteropHelper(Rack.NetychordsDMIBox.TestMainWindow).Handle;
            Rack.NetychordsDMIBox.HeadTrackerModule = new SensorModule(115200);

            // BEHAVIORS
            Rack.NetychordsDMIBox.KeyboardModule.KeyboardBehaviors.Add(new KBplayStop());
            Rack.NetychordsDMIBox.KeyboardModule.KeyboardBehaviors.Add(new KBemulateMouse());
            Rack.NetychordsDMIBox.HeadTrackerModule.Behaviors.Add(new HSreadSerial());

            //SURFACE
            Rack.NetychordsDMIBox.AutoScroller = new AutoScroller(Rack.NetychordsDMIBox.MainWindow.scrlNetychords, 0, 100, new PointFilterMAExpDecaying(0.1f));
            IDimension       dimension       = new DimensionInvert();
            IColorCode       colorCode       = new ColorCodeStandard();
            IButtonsSettings buttonsSettings = new ButtonsSettingsChords();

            NetychordsSurfaceDrawModes drawMode = NetychordsSurfaceDrawModes.NoLines;

            Rack.NetychordsDMIBox.NetychordsSurface = new NetychordsSurface(Rack.NetychordsDMIBox.MainWindow.canvasNetychords, dimension, colorCode, buttonsSettings, drawMode);
            Rack.NetychordsDMIBox.NetychordsSurface.DrawButtons();

            Rack.NetychordsDMIBox.NetychordsSurface.HtFeedbackModule = new HTFeedbackModule(Rack.NetychordsDMIBox.NetychordsSurface.Canvas, HTFeedbackModule.HTFeedbackModes.DeadZone);
        }