Jump To …

pe.js

(function (global) {

var pe = {};

generic positional display or kontrol rate envelopes

pe.env = function (type, p) {
  var distance, 
      that = {};

  if (type == 'ramp') {
    distance = p.end - p.start;
    that.displayCallback = function (r) {
      return distance * r.position + p.start;
    };
  }

  that.p = p;
  return that;
};


if (typeof module != 'undefined' && module.exports) {
  module.exports = pe;
} else {
  global.trurl = global.trurl || {};
  global.trurl.opcodes = global.trurl.opcodes || {};
  global.trurl.opcodes.pe = pe;
}

}(this));