public LORSceneCarol(IEnumerable <string> args)
        {
            hours.AddRange("5:00 pm", "9:00 pm");

            reindeer.Value   = true;
            airSnowman.Value = true;
            airR2D2.Value    = true;
            airSanta.Value   = true;
            packages.Value   = true;

            hours
            .ControlsMasterPower(packages)
            .ControlsMasterPower(airSnowman)
            .ControlsMasterPower(airR2D2)
            .ControlsMasterPower(airSanta)
            .ControlsMasterPower(reindeer);


            lorImport.LoadFromFile(@"..\..\..\Test Files\David Foster - Carol of the Bells.lms");

            lorImport.MapDeviceRGB("E - 1", "D# - 2", "D - 3", lightNote1);
            lorImport.MapDeviceRGB("C# - 4", "C - 5", "B - 6", lightNote2);
            lorImport.MapDeviceRGB("A# - 7", "A - 8", "G# - 9", lightNote3);
            lorImport.MapDeviceRGB("G - 10", "F# - 11", "F - 12", lightNote4);
            lorImport.MapDeviceRGB("E - 13", "D# - 14", "D - 15", lightNote5);
            lorImport.MapDeviceRGB("C# - 16", "C - 1", "B - 2", lightNote6);
            lorImport.MapDeviceRGB("A# - 3", "A - 4", "G# - 5", lightNote7);
            lorImport.MapDeviceRGB("G - 6", "F# - 7", "F - 8", lightNote8);
            lorImport.MapDeviceRGB("E - 9", "D# - 10", "D - 11", lightNote9);
            lorImport.MapDeviceRGB("C# - 12", "C - 13", "B - 14", lightNote10);
            lorImport.MapDevice("A# - 15", lightNote11);
            lorImport.MapDevice("A - 16", lightNote12);

            lorImport.MapDevice("Sky 1", lightNet1);
            lorImport.MapDevice("Sky 2", lightNet2);
            lorImport.MapDevice("Sky 3", lightNet3);
            lorImport.MapDevice("Sky 4", lightNet4);
            lorImport.MapDevice("Sky 5", lightNet5);

            lorImport.MapDevice("Sky 1", lightNet6);
            lorImport.MapDevice("Sky 2", lightNet7);
            lorImport.MapDevice("Sky 3", lightNet8);
            lorImport.MapDevice("Sky 4", lightNet9);
            lorImport.MapDevice("Sky 5", lightNet10);

            lorImport.MapDevice("Rooftop", snowmanKaggen);

            lorImport.MapDevice("Star1", lightStar1);
            lorImport.MapDevice("Star2", lightStar2);
            lorImport.MapDevice("Star3", lightStar3);
            lorImport.MapDevice("Star extra", lightStarExtra);

            lightREdge.OutputBrightness.Subscribe(x =>
            {
                pixelsRoofEdge.SetBrightness(x, null);
            });
            lightREdge.OutputColor.Subscribe(x =>
            {
                pixelsRoofEdge.SetAllOnlyColor(x);
            });

            lightBottom.OutputBrightness.Subscribe(x =>
            {
//                    pixelsVideo.SetBrightness(x, null);
            });
            lightBottom.OutputColor.Subscribe(x =>
            {
//                    pixelsVideo.SetAllOnlyColor(x);
            });

            lorImport.MapDeviceRGBW("R-Edge R", "R-Edge G", "R-Edge B", "R-Edge W", lightREdge);
            lorImport.MapDeviceRGBW("R-Bottom", "G-Bottom", "B-Bottom", "W-Bottom", lightBottom);
            lorImport.MapDeviceRGBW("Garage R", "Garage G", "Garage B", "Garage W", lightGarage);
            lorImport.MapDeviceRGBW("Rwindo R", "Rwindo G", "Rwindo B", "Rwindo W", lightRWindow);
            lorImport.MapDeviceRGBW("Cwindo R", "Cwindo G", "Cwindo B", "Cwindo W", lightCWindow);
            lorImport.MapDeviceRGBW("Lwindo R", "Lwindo G", "Lwindo B", "Lwindo W", lightLWindow);
            lorImport.MapDeviceRGBW("Ft door R", "Ft door G", "Ft door B", "FT door W", lightFrontDoor);
            lorImport.MapDeviceRGBW("Bush - red", "Bush - green", "Bush - blue", "Bush - white", lightBush);

            lorImport.MapDevice("Tree - A", lightSnowman);
            lorImport.MapDevice("Tree - B", lightSanta);

            lorImport.MapDevice("Spoke 1a", lightHat1);
            lorImport.MapDevice("Spoke 2a", lightHat2);
            lorImport.MapDevice("Spoke 3a", lightHat3);
            lorImport.MapDevice("Spoke  4a", lightHat4);
            lorImport.MapDevice("Spoke 5a", lightR2D2);
            //            lorImport.MapDevice("Spoke 6a", lightTest1);

            // lorImport.MapDevice("Spoke 7a", light);
            // lorImport.MapDevice("Spoke 8a", light);
            // lorImport.MapDevice("Spoke 9a", light);
            // lorImport.MapDevice("Spoike 10a", light);
            // lorImport.MapDevice("Spoke  11a", light);
            // lorImport.MapDevice("Spoke  12a", light);
            // lorImport.MapDevice("Spoke  13a", light);
            // lorImport.MapDevice("Spoke  14a", light);
            // lorImport.MapDevice("Spoke  15a", light);
            // lorImport.MapDevice("Spoke  16a", light);
            // lorImport.MapDevice("Pillar L8", light);
            // lorImport.MapDevice("Pillar L7", light);
            // lorImport.MapDevice("Pillar L6", light);
            // lorImport.MapDevice("Pillar L5", light);
            // lorImport.MapDevice("Pillar L4", light);
            // lorImport.MapDevice("Pillar L3", light);
            // lorImport.MapDevice("Pillar L2", light);
            // lorImport.MapDevice("Pillar L1", light);
            // lorImport.MapDevice("Pillar R8", light);
            // lorImport.MapDevice("Pillar R7", light);
            // lorImport.MapDevice("Pillar R6", light);
            // lorImport.MapDevice("Pillar R5", light);
            // lorImport.MapDevice("Pillar R4", light);
            // lorImport.MapDevice("Pillar R3", light);
            // lorImport.MapDevice("Pillar R2", light);
            // lorImport.MapDevice("Pillar R1", light);
            // lorImport.MapDevice("8  MiniTree 1r", light);
            // lorImport.MapDevice("8  MiniTree 2r", light);
            // lorImport.MapDevice("8  MiniTree 3r", light);
            // lorImport.MapDevice("8  MiniTree 4r", light);
            // lorImport.MapDevice("8  MiniTree 5r", light);
            // lorImport.MapDevice("8  MiniTree 6r", light);
            // lorImport.MapDevice("8  MiniTree 7r", light);
            // lorImport.MapDevice("8  MiniTree 8r", light);
            // lorImport.MapDevice("8  MiniTree 9r", light);
            // lorImport.MapDevice("8  MiniTree 10r", light);
            // lorImport.MapDevice("8  MiniTree 11r", light);
            // lorImport.MapDevice("8  MiniTree 12r", light);
            // lorImport.MapDevice("8  MiniTree 13r", light);
            // lorImport.MapDevice("8  MiniTree 14r", light);
            // lorImport.MapDevice("8  MiniTree 15r", light);
            // lorImport.MapDevice("8  MiniTree 16r", light);
            // lorImport.MapDevice("MiniTree 1g", light);
            // lorImport.MapDevice("MiniTree 2g", light);
            // lorImport.MapDevice("MiniTree 3g", light);
            // lorImport.MapDevice("MiniTree 4g", light);
            // lorImport.MapDevice("MiniTree 5g", light);
            // lorImport.MapDevice("MiniTree 6g", light);
            // lorImport.MapDevice("MiniTree 7g", light);
            // lorImport.MapDevice("MiniTree 8g", light);
            // lorImport.MapDevice("MiniTree 9g", light);
            // lorImport.MapDevice("MiniTree 10g", light);
            // lorImport.MapDevice("MiniTree 11g", light);
            // lorImport.MapDevice("MiniTree 12g", light);
            // lorImport.MapDevice("MiniTree 13g", light);
            // lorImport.MapDevice("MiniTree 14g", light);
            // lorImport.MapDevice("MiniTree 15g", light);
            // lorImport.MapDevice("MiniTree 16g", light);
            // lorImport.MapDevice("Hray B1", light);
            // lorImport.MapDevice("Hray B2", light);
            // lorImport.MapDevice("Hray B3", light);
            // lorImport.MapDevice("Hray B4", light);
            // lorImport.MapDevice("Hray B5", light);
            // lorImport.MapDevice("Hray B6", light);
            // lorImport.MapDevice("Hray B7", light);
            // lorImport.MapDevice("Hray B8", light);
            // lorImport.MapDevice("Hray R1", light);
            // lorImport.MapDevice("Hray R2", light);
            // lorImport.MapDevice("Hray R3", light);
            // lorImport.MapDevice("Hray R4", light);
            // lorImport.MapDevice("Hray R5", light);
            // lorImport.MapDevice("Hray R6", light);
            // lorImport.MapDevice("Hray R7", light);
            // lorImport.MapDevice("Hray R8", light);
            // lorImport.MapDevice("Vray 1", light);
            // lorImport.MapDevice("Vray 2", light);
            // lorImport.MapDevice("Vray 3", light);
            // lorImport.MapDevice("Vray 4", light);
            // lorImport.MapDevice("Vray 5", light);
            // lorImport.MapDevice("Vray 6", light);
            // lorImport.MapDevice("Vray 7", light);
            // lorImport.MapDevice("Vray 8", light);
            // lorImport.MapDevice("Vray 9", light);
            // lorImport.MapDevice("Vray 10", light);
            // lorImport.MapDevice("Vray 11", light);
            // lorImport.MapDevice("Vray 12", light);
            // lorImport.MapDevice("Vray 13", light);
            // lorImport.MapDevice("Vray 14", light);
            // lorImport.MapDevice("Vray 15", light);
            // lorImport.MapDevice("Vray 16", light);
            // lorImport.MapDevice("Vray 17", light);
            // lorImport.MapDevice("Vray 18", light);
            // lorImport.MapDevice("Vray 19", light);
            // lorImport.MapDevice("Vray 20", light);
            // lorImport.MapDevice("Vray 21", light);
            // lorImport.MapDevice("Vray 22", light);
            // lorImport.MapDevice("Vray 23", light);
            // lorImport.MapDevice("Vray 24", light);
            // lorImport.MapDevice("Vray 25", light);
            // lorImport.MapDevice("Vray 26", light);
            // lorImport.MapDevice("Vray 27", light);
            // lorImport.MapDevice("Vray 28", light);
            // lorImport.MapDevice("Vray 29", light);
            // lorImport.MapDevice("Vray 30", light);
            // lorImport.MapDevice("Vray 31", light);
            // lorImport.MapDevice("Vray 32", light);
            // lorImport.MapDevice("Arch 1-1", light);
            // lorImport.MapDevice("Arch 1-2", light);
            // lorImport.MapDevice("Arch 1-3", light);
            // lorImport.MapDevice("Arch 1-4", light);
            // lorImport.MapDevice("Arch 1-5", light);
            // lorImport.MapDevice("Arch 1-6", light);
            // lorImport.MapDevice("Arch 1-7", light);
            // lorImport.MapDevice("Arch 1-8", light);
            // lorImport.MapDevice("Arch 2-1", light);
            // lorImport.MapDevice("Arch 2-2", light);
            // lorImport.MapDevice("Arch 2-3", light);
            // lorImport.MapDevice("Arch 2-4", light);
            // lorImport.MapDevice("Arch 2-5", light);
            // lorImport.MapDevice("Arch 2-6", light);
            // lorImport.MapDevice("Arch 2-7", light);
            // lorImport.MapDevice("Arch 2-8", light);
            // lorImport.MapDevice("Arch 3-1", light);
            // lorImport.MapDevice("Arch 3-2", light);
            // lorImport.MapDevice("Arch 3-3", light);
            // lorImport.MapDevice("Arch 3-4", light);
            // lorImport.MapDevice("Arch 3-5", light);
            // lorImport.MapDevice("Arch 3-6", light);
            // lorImport.MapDevice("Arch 3-7", light);
            // lorImport.MapDevice("Arch 3-8", light);
            // lorImport.MapDevice("Arch 4-1", light);
            // lorImport.MapDevice("Arch 4-2", light);
            // lorImport.MapDevice("Arch 4-3", light);
            // lorImport.MapDevice("Arch 4-4", light);
            // lorImport.MapDevice("Arch 4-5", light);
            // lorImport.MapDevice("Arch 4-6", light);
            // lorImport.MapDevice("Arch 4-7", light);
            // lorImport.MapDevice("Arch 4-8", light);


            lorImport.Prepare();
//            lorImport.Dump();


            waveSource = CodecFactory.Instance.GetCodec(@"C:\Projects\Other\ChristmasSounds\trk\09 Carol of the Bells (Instrumental).wav");

            soundOut.Initialize(waveSource);

            acnOutput.Connect(new Physical.PixelRope(pixelsRoofEdge, 0, 50), 4, 1);
            acnOutput.Connect(new Physical.PixelRope(pixelsRoofEdge, 50, 100), 5, 1);
            acnOutput.Connect(new Physical.PixelRope(pixelsVideo, 0, 200), 1, 1);

            acnOutput.Connect(new Physical.GenericDimmer(lightStarExtra, 50), SacnUniverseDMX);

            acnOutput.Connect(new Physical.GenericDimmer(reindeer, 10), SacnUniverseDMX);
            acnOutput.Connect(new Physical.GenericDimmer(airSnowman, 11), SacnUniverseDMX);
            acnOutput.Connect(new Physical.GenericDimmer(airSanta, 12), SacnUniverseDMX);
            acnOutput.Connect(new Physical.GenericDimmer(airR2D2, 13), SacnUniverseDMX);

            acnOutput.Connect(new Physical.SmallRGBStrobe(lightBottom, 1), SacnUniverseDMX);
            acnOutput.Connect(new Physical.RGBStrobe(lightNote1, 60), SacnUniverseDMX);
            acnOutput.Connect(new Physical.RGBStrobe(lightNote2, 80), SacnUniverseDMX);
            acnOutput.Connect(new Physical.RGBStrobe(lightNote6, 40), SacnUniverseDMX);
            acnOutput.Connect(new Physical.RGBStrobe(lightNote10, 70), SacnUniverseDMX);
            acnOutput.Connect(new Physical.GenericDimmer(lightHat1, 1), SacnUniverseRenard2);
            acnOutput.Connect(new Physical.GenericDimmer(lightHat2, 2), SacnUniverseRenard2);
            acnOutput.Connect(new Physical.GenericDimmer(lightHat3, 3), SacnUniverseRenard2);
            acnOutput.Connect(new Physical.GenericDimmer(lightHat4, 4), SacnUniverseRenard2);

            acnOutput.Connect(new Physical.GenericDimmer(lightNet4, 5), SacnUniverseRenard2);
            acnOutput.Connect(new Physical.GenericDimmer(lightNet3, 6), SacnUniverseRenard2);
            acnOutput.Connect(new Physical.GenericDimmer(lightNet1, 7), SacnUniverseRenard2);
            acnOutput.Connect(new Physical.GenericDimmer(lightNet2, 8), SacnUniverseRenard2);
            acnOutput.Connect(new Physical.GenericDimmer(lightNet5, 4), SacnUniverseRenard1);
            acnOutput.Connect(new Physical.GenericDimmer(lightNet6, 5), SacnUniverseRenard1);
            acnOutput.Connect(new Physical.GenericDimmer(lightNet7, 6), SacnUniverseRenard1);
            acnOutput.Connect(new Physical.GenericDimmer(lightNet8, 7), SacnUniverseRenard1);
            acnOutput.Connect(new Physical.GenericDimmer(lightNet9, 8), SacnUniverseRenard1);
            acnOutput.Connect(new Physical.GenericDimmer(lightNet10, 9), SacnUniverseRenard1);
            acnOutput.Connect(new Physical.GenericDimmer(lightRWindow, 10), SacnUniverseRenard1);     // Metal reindeers

            acnOutput.Connect(new Physical.AmericanDJStrobe(lightGarage, 5), SacnUniverseDMX);

            acnOutput.Connect(new Physical.GenericDimmer(lightSanta, 1), SacnUniverseArduino);
            acnOutput.Connect(new Physical.GenericDimmer(lightSnowman, 2), SacnUniverseArduino);
            acnOutput.Connect(new Physical.GenericDimmer(snowmanKaggen, 2), SacnUniverseRenard1);


            this.lorImport.Progress.Subscribe(x =>
            {
                long soundPos = waveSource.GetMilliseconds(waveSource.Position);

                this.log.Verbose("Sound pos: {0:N0}   Timeline pos: {1:N0}   Diff: {2:N0} ms",
                                 soundPos, x, soundPos - x);
            });
        }
示例#2
0
        public XmasScene2(IEnumerable <string> args, System.Collections.Specialized.NameValueCollection settings)
        {
            hours = new OperatingHours("Hours");
            if (!args.Contains("TEST"))
            {
                hours.AddRange("5:00 pm", "10:00 pm");
                hours.AddRange("5:00 am", "7:00 am");
            }

            lightNetRight     = new Dimmer("Net Right");
            lightGarlandRight = new Dimmer("Garland Right");
            lightHatsRight    = new Dimmer("Hats Right");
            lightTreesRight   = new Dimmer("Trees Right");
            lightReindeers    = new Dimmer("Reindeers");
            lightIcicles      = new Dimmer("Icicles");
            lightNetLeft      = new Dimmer("Net Left");
            lightTree         = new Dimmer("Tree");
            lightGarlandLeft  = new Dimmer("Garland Left");
            lightUnused1      = new Dimmer("Unused 1");
            lightUnused2      = new Dimmer("Unused 2");
            lightJesus        = new StrobeColorDimmer("Jesus");
            lightCeiling1     = new StrobeColorDimmer("Ceiling 1");
            lightCeiling2     = new StrobeColorDimmer("Ceiling 2");
            lightCeiling3     = new StrobeColorDimmer("Ceiling 3");
            lightVader        = new StrobeColorDimmer("Vader");
            buttonLightRed    = new Switch("Button Red");
            buttonLightBlue   = new Switch("Button Blue");
            elLightsaber      = new Switch("Lightsaber");
            elJesus           = new Switch("Jesus Halo");
            bigReindeer       = new Switch("Big Reindeer");

            buttonBlue          = new DigitalInput("Button Blue");
            buttonRed           = new DigitalInput("Button Red");
            buttonStartReindeer = new DigitalInput("Start Reindeer");

            timeline       = new Controller.Timeline <string>(1);
            stateMachine   = new Controller.EnumStateMachine <States>("Main");
            candyCane      = new Controller.Sequence("Candy Cane");
            starwarsCane   = new Controller.Sequence("Starwars Cane");
            backgroundLoop = new Controller.Sequence("Background");
            musicSeq       = new Controller.Sequence("Christmas Canon");
            buttonSeq      = new Controller.Sequence("Buttons");
            fatherSeq      = new Controller.Sequence("Father");
            breathSeq      = new Controller.Sequence("Breath");
            laserSeq       = new Controller.Sequence("Laser");

            allPixels = new VirtualPixel1D(100);

            pulsatingEffect1 = new Effect.Pulsating(S(2), 0.3, 1.0, false);
            pulsatingEffect2 = new Effect.Pulsating(S(2), 0.3, 1.0, false);

            popOutPiano     = new Effect.PopOut(S(0.4));
            popOutDrums     = new Effect.PopOut(S(0.4));
            popOutDrumsFast = new Effect.PopOut(S(0.3));
            popOutChord     = new Effect.PopOut(S(0.4));
            popOutSolo      = new Effect.PopOut(S(0.3));
            popOutSolo2     = new Effect.PopOut(S(0.2));
            popOutChoir     = new Effect.PopOut(S(1.0));
            popOutVoice     = new Effect.PopOut(S(1.0));
            popOutVocal2    = new Effect.PopOut(S(2.0));
            popOutVocalLong = new Effect.PopOut(S(5.0));
            popOutEnd       = new Effect.PopOut(S(5.0));

            popOutPiano
            .AddDevice(lightIcicles);

            popOutDrums
            .AddDevice(lightReindeers)
            .AddDevice(lightHatsRight);

            popOutDrumsFast
            .AddDevice(lightCeiling1)
            .AddDevice(allPixels);

            popOutChord
            .AddDevice(lightTree)
            .AddDevice(lightCeiling2)
            .AddDevice(lightCeiling3);

            popOutSolo
            .AddDevice(lightNetLeft)
            .AddDevice(lightNetRight)
            .AddDevice(lightCeiling1)
            .AddDevice(lightCeiling3)
            .SetPriority(2);

            popOutSolo2
            .AddDevice(lightCeiling1)
            .AddDevice(lightCeiling3)
            .SetPriority(2);

            popOutChoir
            .AddDevice(lightGarlandRight)
            .AddDevice(lightTreesRight)
            .AddDevice(lightCeiling1);

            popOutVoice
            .AddDevice(lightGarlandLeft)
            .AddDevice(lightCeiling3);

            popOutVocal2
            .AddDevice(lightReindeers)
            .AddDevice(allPixels)
            .SetPriority(10);

            popOutVocalLong
            .AddDevice(lightNetRight)
            .AddDevice(lightGarlandRight)
            .AddDevice(lightHatsRight)
            .SetPriority(10);

            popOutEnd
            .AddDevice(lightIcicles)
            .AddDevice(lightReindeers)
            .AddDevice(lightHatsRight)
            .AddDevice(lightCeiling1)
            .AddDevice(lightCeiling2)
            .AddDevice(lightCeiling3)
            .AddDevice(lightGarlandRight)
            .AddDevice(lightGarlandLeft)
            .AddDevice(lightTreesRight)
            .AddDevice(lightNetRight)
            .AddDevice(lightNetLeft)
            .AddDevice(allPixels)
            .SetPriority(100);


            timeline.AddMs(0, "INIT");
            timeline.PopulateFromCSV("Christmas Canon Rock All Labels.csv");
            int state    = 0;
            int halfSolo = 0;

            timeline.TimelineTrigger += (sender, e) =>
            {
                switch (e.Step)
                {
                case 62:
                    // First drum
                    state = 1;
                    allPixels.TurnOff();
                    break;

                case 69:
                    state = 2;
                    lightCeiling2.SetOnlyColor(Color.Green);
                    lightCeiling3.SetOnlyColor(Color.Blue);
                    break;

                case 136:
                    // First solo
                    state = 3;
                    allPixels.TurnOff();
                    lightCeiling2.SetOnlyColor(Color.White);
                    lightCeiling3.SetOnlyColor(Color.Red);
                    break;

                case 265:
                    // First choir
                    allPixels.TurnOff();
                    state = 4;
                    break;

                case 396:
                    // Vocal 2
                    state = 5;
                    allPixels.SetAllOnlyColor(Color.Blue);
                    break;

                case 497:
                    // Second solo
                    state = 6;
                    allPixels.TurnOff();
                    lightCeiling2.SetOnlyColor(Color.White);
                    lightCeiling3.SetOnlyColor(Color.Red);
                    break;

                case 561:
                    // End second solo
                    state = 7;
                    allPixels.TurnOff();
                    break;

                case 585:
                    // End third solo
                    state = 8;
                    allPixels.TurnOff();
                    break;

                case 721:
                    // End third solo
                    state = 9;
                    allPixels.TurnOff();
                    break;
                }

                switch (e.Code)
                {
                case "INIT":
                    state    = 0;
                    halfSolo = 0;
                    lightCeiling1.SetColor(Color.White, 0);
                    lightCeiling2.SetColor(Color.Blue, 0);
                    lightCeiling3.SetColor(Color.Red, 0);
                    break;

                case "N1":
                    popOutPiano.Pop(0.4);
                    if (state == 0)
                    {
                        allPixels.Inject(Color.Red, 0.5);
                    }
                    break;

                case "N2":
                    popOutPiano.Pop(0.6);
                    if (state == 0)
                    {
                        allPixels.Inject(Color.White, 0.5);
                    }
                    break;

                case "N3":
                    popOutPiano.Pop(0.8);
                    if (state == 0)
                    {
                        allPixels.Inject(Color.Blue, 0.5);
                    }
                    break;

                case "N4":
                    popOutPiano.Pop(1.0);
                    if (state == 0)
                    {
                        allPixels.Inject(Color.Black, 0.0);
                    }
                    break;

                case "Base":
                    popOutDrums.Pop(1.0);
                    if (state < 3)
                    {
                        allPixels.SetAllOnlyColor(Color.Purple);
                        popOutDrumsFast.Pop(1.0);
                    }
                    break;

                case "Cymbal":
                    popOutDrums.Pop(1.0);
                    if (state < 3)
                    {
                        allPixels.SetAllOnlyColor(Color.Green);
                        popOutDrumsFast.Pop(1.0);
                    }
                    break;

                case "Chord":
                    popOutChord.Pop(1.0);
                    break;

                case "Solo":
                    popOutSolo.Pop(1.0);
                    if ((halfSolo++ % 2) == 0)
                    {
                        popOutSolo2.Pop(0.8);
                    }
                    if (state == 3 || state == 6 || state == 8)
                    {
                        Color pixCol = Color.Black;
                        switch (e.Step % 4)
                        {
                        case 0:
                            pixCol = Color.Red;
                            break;

                        case 1:
                            pixCol = Color.Yellow;
                            break;

                        case 2:
                            pixCol = Color.Blue;
                            break;

                        case 3:
                            pixCol = Color.Pink;
                            break;
                        }
                        allPixels.Inject(pixCol, 1.0);
                    }
                    break;

                case "Choir":
                    popOutChoir.Pop(1.0);
                    break;

                case "Voice":
                    popOutVoice.Pop(1.0);
                    break;

                case "Vocal2":
                    popOutVocal2.Pop(1.0);
                    break;

                case "Long":
                    popOutVocalLong.Pop(1.0);
                    break;

                case "LongUp":
                    // TODO
                    break;

                case "Down":
                    // TODO
                    break;

                case "End":
                    EverythingOff();
                    popOutEnd.Pop(1.0);
                    break;

                default:
                    this.log.Information("Unhandled code: " + e.Code);
                    break;
                }
            };

            audioPlayer = new Physical.NetworkAudioPlayer(
                settings["NetworkAudioPlayerIP"],
                int.Parse(settings["NetworkAudioPlayerPort"]));
        }
        private void ConfigureMusic1()
        {
            popOut1Piano     = new Effect.PopOut(S(0.4));
            popOut1Drums     = new Effect.PopOut(S(0.4));
            popOut1DrumsFast = new Effect.PopOut(S(0.3));
            popOut1Chord     = new Effect.PopOut(S(0.4));
            popOut1Solo      = new Effect.PopOut(S(0.3));
            popOut1Solo2     = new Effect.PopOut(S(0.2));
            popOut1Choir     = new Effect.PopOut(S(1.0));
            popOut1Voice     = new Effect.PopOut(S(1.0));
            popOut1Vocal2    = new Effect.PopOut(S(2.0));
            popOut1VocalLong = new Effect.PopOut(S(5.0));
            popOut1End       = new Effect.PopOut(S(5.0));

            popOut1Piano
            .AddDevice(lightString1)
            .AddDevice(lightString2)
            .AddDevice(lightTreeUp)
            .AddDevice(lightStar);

            popOut1Drums
            .AddDevice(lightDeerLarge);

            popOut1DrumsFast
            .AddDevice(lightDeerSmall)
            .AddDevice(lightGarland1)
            .AddDevice(lightGarland2)
            .AddDevice(lightGarland3)
            .AddDevice(lightGarland4)
            .AddDevice(allPixels);

            popOut1Chord
            .AddDevice(lightTopperSmall)
            .AddDevice(lightTopperLarge);
            //.AddDevice(lightTree)
            //.AddDevice(lightCeiling2)
            //.AddDevice(lightCeiling3);

            popOut1Solo
            .AddDevice(lightNet1)
            .AddDevice(lightNet2)
            //.AddDevice(lightCeiling1)
            //.AddDevice(lightCeiling3)
            .SetPriority(2);

            popOut1Solo2
            .AddDevice(lightTreeUp)
            //.AddDevice(lightCeiling1)
            //.AddDevice(lightCeiling3)
            .SetPriority(2);

            popOut1Choir
            .AddDevice(lightGarland1)
            .AddDevice(lightSnow1)
            .AddDevice(lightTopperLarge)
            .AddDevice(lightTopperSmall);
            //.AddDevice(lightCeiling1);

            popOut1Voice
            .AddDevice(lightGarland1)
            .AddDevice(lightGarland2)
            .AddDevice(lightSnow2);
            //.AddDevice(lightCeiling3);

            popOut1Vocal2
            //.AddDevice(lightReindeers)
            .AddDevice(allPixels)
            .SetPriority(10);

            popOut1VocalLong
            .AddDevice(lightSnow1)
            .AddDevice(lightSnow2)
            .AddDevice(lightGarland1)
            .AddDevice(lightGarland2)
            .AddDevice(lightGarland3)
            .AddDevice(lightGarland4)
            //.AddDevice(lightNetRight)
            //.AddDevice(lightGarlandRight)
            //.AddDevice(lightHatsRight)
            .SetPriority(10);

            popOut1End
            .AddDevice(lightStar)
            .AddDevice(lightHat1)
            .AddDevice(lightHat2)
            .AddDevice(lightHat3)
            .AddDevice(lightHat4)
            .AddDevice(lightSnow1)
            .AddDevice(lightSnow2)
            .AddDevice(lightStairs1)
            .AddDevice(lightStairs2)
            .AddDevice(lightGarland1)
            .AddDevice(lightGarland2)
            .AddDevice(lightGarland3)
            .AddDevice(lightGarland4)
            .AddDevice(lightString1)
            .AddDevice(lightString2)
            .AddDevice(lightXmasTree)
            .AddDevice(lightDeerLarge)
            .AddDevice(lightDeerSmall)
            .AddDevice(lightTreeUp)
            .AddDevice(lightTopperSmall)
            .AddDevice(lightTopperLarge)
            .AddDevice(lightNet1)
            .AddDevice(lightNet2)
            .AddDevice(allPixels)
            .SetPriority(100);

            timeline1.AddMs(0, "INIT");
            timeline1.PopulateFromCSV("Christmas Canon Rock All Labels.csv");
            int state    = 0;
            int halfSolo = 0;

            timeline1.TimelineTrigger += (sender, e) =>
            {
                switch (e.Step)
                {
                case 62:
                    // First drum
                    state = 1;
                    allPixels.TurnOff();
                    break;

                case 69:
                    state = 2;
                    //lightCeiling2.SetOnlyColor(Color.Green);
                    //lightCeiling3.SetOnlyColor(Color.Blue);
                    break;

                case 136:
                    // First solo
                    state = 3;
                    allPixels.TurnOff();
                    //lightCeiling2.SetOnlyColor(Color.White);
                    //lightCeiling3.SetOnlyColor(Color.Red);
                    break;

                case 265:
                    // First choir
                    allPixels.TurnOff();
                    state = 4;
                    break;

                case 396:
                    // Vocal 2
                    state = 5;
                    allPixels.SetAllOnlyColor(Color.Blue);
                    break;

                case 497:
                    // Second solo
                    state = 6;
                    allPixels.TurnOff();
                    //lightCeiling2.SetOnlyColor(Color.White);
                    //lightCeiling3.SetOnlyColor(Color.Red);
                    break;

                case 561:
                    // End second solo
                    state = 7;
                    allPixels.TurnOff();
                    break;

                case 585:
                    // End third solo
                    state = 8;
                    allPixels.TurnOff();
                    break;

                case 721:
                    // End third solo
                    state = 9;
                    allPixels.TurnOff();
                    break;
                }

                switch (e.Code)
                {
                case "INIT":
                    state    = 0;
                    halfSolo = 0;
                    //lightCeiling1.SetColor(Color.White, 0);
                    //lightCeiling2.SetColor(Color.Blue, 0);
                    //lightCeiling3.SetColor(Color.Red, 0);
                    break;

                case "N1":
                    hatLightState.NextState();
                    popOut1Piano.Pop(0.4);
                    if (state == 0)
                    {
                        allPixels.Inject(Color.Red, 0.5);
                    }
                    break;

                case "N2":
                    hatLightState.NextState();
                    popOut1Piano.Pop(0.6);
                    if (state == 0)
                    {
                        allPixels.Inject(Color.White, 0.5);
                    }
                    break;

                case "N3":
                    hatLightState.NextState();
                    popOut1Piano.Pop(0.8);
                    if (state == 0)
                    {
                        allPixels.Inject(Color.Blue, 0.5);
                    }
                    break;

                case "N4":
                    hatLightState.NextState();
                    popOut1Piano.Pop(1.0);
                    if (state == 0)
                    {
                        allPixels.Inject(Color.Black, 0.0);
                    }
                    break;

                case "Base":
                    popOut1Drums.Pop(1.0);
                    if (state < 3)
                    {
                        allPixels.SetAllOnlyColor(Color.Purple);
                        popOut1DrumsFast.Pop(1.0);
                    }
                    break;

                case "Cymbal":
                    popOut1Drums.Pop(1.0);
                    if (state < 3)
                    {
                        allPixels.SetAllOnlyColor(Color.Green);
                        popOut1DrumsFast.Pop(1.0);
                    }
                    break;

                case "Chord":
                    popOut1Chord.Pop(1.0);
                    break;

                case "Solo":
                    popOut1Solo.Pop(1.0);
                    if ((halfSolo++ % 2) == 0)
                    {
                        popOut1Solo2.Pop(0.8);
                    }
                    if (state == 3 || state == 6 || state == 8)
                    {
                        Color pixCol = Color.Black;
                        switch (e.Step % 4)
                        {
                        case 0:
                            pixCol = Color.Red;
                            break;

                        case 1:
                            pixCol = Color.Yellow;
                            break;

                        case 2:
                            pixCol = Color.Blue;
                            break;

                        case 3:
                            pixCol = Color.Pink;
                            break;
                        }
                        allPixels.Inject(pixCol, 1.0);
                    }
                    break;

                case "Choir":
                    popOut1Choir.Pop(1.0);
                    break;

                case "Voice":
                    popOut1Voice.Pop(1.0);
                    break;

                case "Vocal2":
                    popOut1Vocal2.Pop(1.0);
                    break;

                case "Long":
                    popOut1VocalLong.Pop(1.0);
                    break;

                case "LongUp":
                    // TODO
                    break;

                case "Down":
                    // TODO
                    break;

                case "End":
                    AllLightsOff();
                    popOut1End.Pop(1.0);
                    break;

                default:
                    this.log.Information("Unhandled code: " + e.Code);
                    break;
                }
            };
        }
示例#4
0
        public override void Start()
        {
            testSeq
            .WhenExecuted
            .SetUp(() => allPixels.TurnOff())
            .Execute(instance =>
            {
                allPixels.SetAllOnlyColor(Color.Orange);
                allPixels.RunEffect(new Effect2.Pulse(0.0, 1.0), S(2.0))
                .SetIterations(2)
                .Wait();
                allPixels.StopEffect();
            })
            .TearDown(() =>
            {
                allPixels.TurnOff();

                Exec.Execute(candyCane);
            });


            candyCane
            .WhenExecuted
            .SetUp(() => allPixels.TurnOff())
            .Execute(instance =>
            {
                const int spacing = 4;

                while (true)
                {
                    for (int i = 0; i < spacing; i++)
                    {
                        allPixels.Inject((i % spacing) == 0 ? Color.Red : Color.White, 0.5);

                        instance.WaitFor(S(0.30), true);
                    }
                }
            })
            .TearDown(() =>
            {
                allPixels.TurnOff();
            });


            laserSeq
            .WhenExecuted
            .SetUp(() =>
            {
                allPixels.TurnOff();
            })
            .Execute(instance =>
            {
                var cb = new ColorBrightness[6];
                cb[0]  = new ColorBrightness(Color.Black, 1.0);
                cb[1]  = new ColorBrightness(Color.Red, 1.0);
                cb[2]  = new ColorBrightness(Color.Orange, 1.0);
                cb[3]  = new ColorBrightness(Color.Yellow, 1.0);
                cb[4]  = new ColorBrightness(Color.Blue, 1.0);
                cb[5]  = new ColorBrightness(Color.White, 1.0);

                for (int i = -6; i < allPixels.Pixels; i++)
                {
                    allPixels.SetColors(i, cb);
                    System.Threading.Thread.Sleep(25);
                }

                instance.WaitFor(S(1));
            })
            .TearDown(() =>
            {
                allPixels.TurnOff();

                Exec.Execute(candyCane);
            });


            // Test Button
            buttonTest.ActiveChanged += (sender, e) =>
            {
                if (!e.NewState)
                {
                    return;
                }

                Exec.Cancel(candyCane);

                allPixels.RunEffect(new Effect2.Fader(1.0, 0.0), S(2.0)).Wait();
                allPixels.SetAllOnlyColor(Color.Purple);
                allPixels.RunEffect(new Effect2.Fader(0.0, 1.0), S(2.0)).Wait();
                allPixels.RunEffect(new Effect2.Fader(1.0, 0.0), S(2.0)).Wait();

                allPixels.SetAllOnlyColor(Color.Orange);
                allPixels.RunEffect(new Effect2.Fader(0.0, 1.0), S(2.0)).Wait();

                allPixels.RunEffect(new Effect2.Fader(1.0, 0.0), S(2.0)).Wait();

                Exec.Execute(candyCane);
            };
        }