From 633c125d519a0ae08c9ac8cf96fcad4c562f08e1 Mon Sep 17 00:00:00 2001 From: Sebastian Wiedenroth Date: Sun, 2 Sep 2012 14:59:49 +0200 Subject: [PATCH] tuning --- anim.js | 5 +++-- dmx.js | 16 ++++++++++++++++ drivers/enttec-usb-dmx-pro.js | 2 +- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/anim.js b/anim.js index 96b13e6..237eeaa 100644 --- a/anim.js +++ b/anim.js @@ -1,11 +1,12 @@ var ease = require('./easing.js').ease -var resolution = 30; +var resolution = 25; exports.Anim = function(universe) { this.universe = universe; this.fx_stack = []; this.add = function(to, duration, options) { - var options = options || {}; + var options = options || {}; + var duration = duration || resolution; options['easing'] = options['easing'] || 'linear'; this.fx_stack.push({'to': to, 'duration': duration, 'options': options}); return this; diff --git a/dmx.js b/dmx.js index ab1cda5..301cced 100644 --- a/dmx.js +++ b/dmx.js @@ -17,4 +17,20 @@ var x = new A(universe) .add({1: 255}, 200) .add({1: 0}, 100) .add({1: 255}, 100) + .add({1: 0}) + .delay(50) + .add({1: 255}) + .delay(50) + .add({1: 0}) + .delay(50) + .add({1: 255}) + .delay(50) + .add({1: 0}) + .delay(50) + .add({1: 255}) + .delay(50) + .add({1: 0}) + .run(done); +var y = new A(universe) + .add({9: 255}, 10000) .run(done); \ No newline at end of file diff --git a/drivers/enttec-usb-dmx-pro.js b/drivers/enttec-usb-dmx-pro.js index 4031066..ad28456 100644 --- a/drivers/enttec-usb-dmx-pro.js +++ b/drivers/enttec-usb-dmx-pro.js @@ -49,7 +49,7 @@ exports.init = function(dev_id) { setInterval(function() { send_universe(dev, universe); - }, 30); + }, 25); return this; }