--- a/client/annotviz/app/js/pianoroll.js Fri Apr 17 15:20:46 2015 +0200
+++ b/client/annotviz/app/js/pianoroll.js Fri Apr 17 15:32:19 2015 +0200
@@ -43,7 +43,7 @@
this.dynamicRange = options.dynamicRange;
this.initRange = options.range;
this.range = options.range;
-
+
var started = false;
@@ -84,7 +84,8 @@
this.addNoteRaw = function(data) {
var note = data.content[3];
var velocity = data.content[4];
- var ts = (data.content[0] - NTP_EPOCH_DELTA)*1000;
+ //var ts = (data.content[0] - NTP_EPOCH_DELTA)*1000;
+ var ts = Date.parse(data.ts_server);
var channel = data.content[2];
var sessionTs = data.content[1];
@@ -143,7 +144,7 @@
}
var y = Math.floor(((this.range.top-this.range.bottom)-(note-this.range.bottom)+0.5) * (this.noteHeight) - (this.noteHeight/2));
var color = this.getColor(channel);
-
+
var alpha = (noteVelocity / 128);
graphics = this.getNoteRect(note, x, y, color, alpha, width, this.noteHeight);
@@ -158,7 +159,7 @@
}
}
};
-
+
//rescale scene in case a note out of range is added or a note out of the range is removed
this.rescaleScene = function(newScale){
var _this = this;
@@ -175,8 +176,8 @@
if (newScale){
this.range = newScale;
}else{
- this.range.top = top;
- this.range.bottom = bottom;
+ this.range.top = top;
+ this.range.bottom = bottom;
}
this.noteHeight = this.height / (this.range.top - this.range.bottom + 1);
childrenToUpdate.forEach(function(child) {