Ejemplo n.º 1
0
            public Subscription(string address, x32server s)
            {
                server     = s;
                OSCaddress = PadString(address);

                renewTimer          = new Timer(secTillResub * 1000);
                renewTimer.Elapsed += new ElapsedEventHandler(Renew);
                renewTimer.Start();
                Console.WriteLine("Timer started");
            }
Ejemplo n.º 2
0
        public static void Main()
        {
            /* When initializing an x32server, you can choose to specify
             * a DeviceType as X32 or XAir. The X32 listens to OSC commands
             * on port 10023 whereas the XAir listens on 10024. This enum
             * is set to automate that distinction in simple language.
             *
             * If no DeviceType is set, the server defaults to X32 (port 10023). */

            x32server server = new x32server("192.168.2.109", DeviceType.X32);

            // Moves faders 9-16 up and down repeatedly

            /*
             * float faderLevel = 1f;
             *
             *          for (int times = 0; times < 30; times++) {
             *                  server.Send ("/ch/09/mix/fader", faderLevel);
             *                  server.Send ("/ch/10/mix/fader", faderLevel);
             *                  server.Send ("/ch/11/mix/fader", faderLevel);
             *                  server.Send ("/ch/12/mix/fader", faderLevel);
             *                  server.Send ("/ch/13/mix/fader", faderLevel);
             *                  server.Send ("/ch/14/mix/fader", faderLevel);
             *                  server.Send ("/ch/15/mix/fader", faderLevel);
             *                  server.Send ("/ch/16/mix/fader", faderLevel);
             *
             *                  if (faderLevel == 1f)
             *                          faderLevel = 0f;
             *                  else
             *                          faderLevel = 1f;
             *
             *                  System.Threading.Thread.Sleep (100); // Sleep for a time so as to not overload the X32 with requests, and to allow the faders to physically travel
             *          }
             *
             */

            // Zeroes out all track sends for a particular set of mixes

            string addressBuffer = "";
            string mix           = "";

            for (int mixTrack = 1; mixTrack < 12; mixTrack++)
            {
                mix = mixTrack.ToString("00");

                for (int channel = 1; channel < 33; channel++)
                {
                    addressBuffer = String.Format("/ch/{0}/mix/{1}/level", channel.ToString("00"), mix);
                    server.Send(addressBuffer, .75f);
                    System.Threading.Thread.Sleep(1);
                }
            }
            //Console.ReadLine();
        }