client/annotviz/app/js/doubleroll.js
changeset 145 a8052f8ab19c
parent 131 0bb70072a56f
child 146 192d7d7f7bb4
--- a/client/annotviz/app/js/doubleroll.js	Mon Jan 26 01:36:56 2015 +0100
+++ b/client/annotviz/app/js/doubleroll.js	Fri Apr 10 16:45:34 2015 +0200
@@ -18,16 +18,24 @@
     sceneWidth: 1024,
     pianorolls : [
       {
-        height: 435,
+        height: 384,
         timeWidth: 10,
         lineInterval: 5000,
-        noteHeight: undefined
+        noteHeight: undefined,
+        range: {
+    		bottom: 60,
+    		top: 70,
+        },
       },
       {
-        height: 645,
+        height: 384,
         timeWidth: 60,
         lineInterval: 5000,
-        noteHeight: undefined
+        noteHeight: undefined,
+        range:{
+    		bottom: 0,
+    		top: 128,
+        },
       },
     ],
     framerate: 25,
@@ -98,7 +106,7 @@
     var yInit = opts.yInit || 0;
     var linesDown = true;
     _(opts.pianorolls).forEach(function(prDef, i) {
-        var prNoteHeight = noteHeight || prDef.noteHeight || prDef.height / 128;
+        var prNoteHeight = noteHeight || prDef.noteHeight || prDef.height / (prDef.top - prDef.bottom);
         var prTimeWidth = prDef.timeWidth || timeWidth;
         pianorollList.push(new PianoRoll(_({
             yInit: yInit,
@@ -106,7 +114,8 @@
             linesDown: linesDown,
             pixelsPerSecond: Math.floor(sceneWidth / prTimeWidth),
             noteHeight: prNoteHeight,
-            lineInterval: prDef.lineInterval
+            lineInterval: prDef.lineInterval,
+            range: prDef.range,
         }).defaults(pianorollOptions).value()));
         yInit += prDef.height;
         linesDown = !linesDown;