Limit OSC values to +/- 3.1

there were crashes in CSoiund otherwise
parent f448401a
......@@ -3,7 +3,7 @@ defmodule Grains.Mixfile do
def project do
[app: :grains,
version: "0.0.101",
version: "0.0.102",
elixir: "~> 1.2",
elixirc_paths: elixirc_paths(Mix.env),
compilers: [:phoenix, :gettext] ++ Mix.compilers,
......
......@@ -302,7 +302,11 @@ Master.prototype.send_osc = function() {
} else {
v = this.velocity.array();
}
if (v[0] < -3.1) v[0] = -3.1;
if (v[0] > 3.1) v[0] = 3.1;
if (v[1] < -3.1) v[1] = -3.1;
if (v[1] > 3.1) v[1] = 3.1;
//let v = this.position.array();
var message = new OSC.Message('/webosc/gyro/' + this.type, v[0], v[1], this.agitation, this.volume );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment