Commit 18b71adf authored by Jens-Christian Fischer's avatar Jens-Christian Fischer
Browse files

Working version 0.1

parent 72f15e5f
......@@ -20,7 +20,7 @@ defmodule Grains.Beat do
defp tick(millisec), do: Process.send_after(self(), :tick, millisec)
def handle_cast({:set_bpm, bpm}, state) do
def handle_cast({:set_bpm, bpm}, _state) do
{:noreply, round(@minute / bpm) }
end
......@@ -30,6 +30,7 @@ defmodule Grains.Beat do
def handle_info(:tick, state) do
send_clock()
Grengine.Conductor.perform()
|> send_values
......@@ -38,11 +39,16 @@ defmodule Grains.Beat do
{:noreply, state}
end
def handle_info(_, state), do: {:noreply, state}
def send_clock do
Grains.Endpoint.broadcast("osc", "clock", %{})
end
def send_values(values) do
Logger.info "sending performance values"
Grains.Endpoint.broadcast("osc", "performance", values)
Grains.Endpoint.broadcast("osc", "slider", values)
end
def handle_info(_, state), do: {:noreply, state}
end
......@@ -64,7 +64,7 @@ let OrientationPanel = {
send_value(values) {
let scaled = values.map(function(i) {
return parseInt(i * 127);
return i; // parseInt(i * 127);
});
if (!_.isEqual(scaled, this.old_values)) {
// console.log(scaled);
......
<h1>Grain <%= @grain %></h1>
<p>Orientation</p>
<div id="sliderPanel" class="interfacePanel"></div>
<div id="orientationPanel" class="interfacePanel"></div>
Supports Markdown
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