ImplantServer TimeObject

This object manages beat synchronization with the internal clock, which can be synced against third party software or can have third party software synced against it.

Properties
None. TODO: add tempo

Methods

 * void on(event, callback) - registers a function to be called when the specified event is triggered. The events available for this object are listed in the events section of this page.

Events

 * 1/96 - Raised upon every MIDI tick, which is a common measure of time in MIDI software corresponding to 1/96th of a measure. The number of ticks since playback started is passed as the value property of the event. You will typically want to use the modulo/remainder function (%) to see which tick of a measure you are on.

Example
Here is a simple example of using the top row of the launchpad active area of the current implant by having a yellow light go across once for every measure. Notice how it looks up the current width of the active area so it will work for any sized implant.

// highlight the top row of the launchpad with the current tick implant.time.on('1/96', function(e) {   var tick = e.value % 96;    var x = Math.floor(tick * (implant.pads.width / 96));    for (var i = 0; i < implants.pads.width; i++) {      var color = i == x ? 'yellow' : 'off';      implant.pads.set(x, 0, color);    }  });