                                          ;; SensorManager/SENSOR_DELAY_UI
                                          SensorManager/SENSOR_DELAY_GAME))
                    listener))]
-    [(create "rotate" Sensor/TYPE_ROTATION_VECTOR rotate-stack)
-     (create "acc" Sensor/TYPE_LINEAR_ACCELERATION acc-stack)
+    [(create "acc" Sensor/TYPE_ACCELEROMETER acc-stack)
+     (create "rotate" Sensor/TYPE_ROTATION_VECTOR rotate-stack)
      ]))
 
 (def sensorManager (atom nil))

;;
;; {PMOsc.ar(440 * In.ar(rotateBus).poll.abs, 10 * In.ar(accBus).abs, 3)}.play(soundGroup)
;;)

(set-error-handler! acc-stack err-handler-fn)
(set-error-handler! rotate-stack err-handler-fn)

(defn create-listeners [interval sensorManager host port]
  (let [create (fn [id sensor-type stack]
                 (let [listener (reify SensorEventListener
                                  (onAccuracyChanged [this sensor value] ())
                                  (onSensorChanged [this event]
                                    (apply #'replace-mean stack (seq (list (. event values))))))]
                   (send-every "Data" interval host port)
                   (.. sensorManager
                       (registerListener listener
                                         (.getDefaultSensor sensorManager sensor-type)
