New grizzly mappings
[SugarCubes.git] / _Grizzly.pde
index f376fab8cd7d5c8a9048129d297d042c6267b981..51de8f3501b2120c5a554569457cf612c2208c4c 100644 (file)
@@ -8,27 +8,30 @@
  *
  *        EXPERTS ONLY!!              EXPERTS ONLY!!
  *
- * If you are an artist, you may ignore this file! It just sets
- * up the framework to run the patterns. Should not need modification
- * for general animation work.
+ * If you are an artist, you may ignore this file! It contains
+ * the code to drive grizzly board outputs.
  */
 
 GrizzlyOutput[] buildGrizzlies() throws SocketException, UnknownHostException {
   return new GrizzlyOutput[] {
-    new GrizzlyOutput(lx, "192.168.88.100", 6, 5, 6, 7, 7, 8, 1, 2, 4, 3, 11, 10, 9, 9, 12, 13),
-    new GrizzlyOutput(lx, "192.168.88.101", 25, 23, 24, 43, 45, 44, 1, 1, 1, 1, 1, 41, 42, 21, 20, 22),
-    new GrizzlyOutput(lx, "192.168.88.104", 26, 28, 27, 19, 18, 17, 1, 1, 18, 19, 15, 16, 14, 29, 30, 31),
-    new GrizzlyOutput(lx, "192.168.88.105", 1, 1, 1, 39, 38, 40, 34, 35, 33, 32, 37, 37, 1, 1, 1, 1),
+    new GrizzlyOutput(lx, "192.168.88.100",  0,  0,  0, 39, 38, 40,  0, 37, 35,  0, 21, 20, 22,  0, 33, 32 ),
+    new GrizzlyOutput(lx, "192.168.88.104",  0, 13, 12,  0,  1,  2,  6,  5,  7,  0,  0,  4,  3,  9, 10, 11 ),
+    new GrizzlyOutput(lx, "192.168.88.105", 42, 41,  0, 43, 45, 44,  0,  0,  0,  0,  0,  0,  0, 24, 23, 25 ),
+    new GrizzlyOutput(lx, "192.168.88.107",  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0 ),
   };
 }
 
+/**
+ * Grizzly Output, sends packets to one grizzly board with a fixed IP and a number
+ * of channels.
+ */
 class GrizzlyOutput extends LXDatagramOutput {
 
   public final String ipAddress;
   
   private int frameNumber = 0;
   
-  GrizzlyOutput(LX lx, String ipAddress, int ... cubeIndices) throws UnknownHostException, SocketException {
+  public GrizzlyOutput(LX lx, String ipAddress, int ... cubeIndices) throws UnknownHostException, SocketException {
     super(lx);
     this.ipAddress = ipAddress;
     int channelNum = 0;
@@ -51,6 +54,9 @@ class GrizzlyOutput extends LXDatagramOutput {
   }
 }
 
+/**
+ * Datagram to a Grizzlyboard. A simple fixed OSC packet.
+ */
 static class GrizzlyDatagram extends LXDatagram {
   
   private static byte[] oscString(String s) {