client/annotviz/app/js/doubleroll.js
changeset 145 a8052f8ab19c
parent 131 0bb70072a56f
child 146 192d7d7f7bb4
equal deleted inserted replaced
144:1762372184ae 145:a8052f8ab19c
    16     orientation: 'horizontal',
    16     orientation: 'horizontal',
    17     logger: undefined,
    17     logger: undefined,
    18     sceneWidth: 1024,
    18     sceneWidth: 1024,
    19     pianorolls : [
    19     pianorolls : [
    20       {
    20       {
    21         height: 435,
    21         height: 384,
    22         timeWidth: 10,
    22         timeWidth: 10,
    23         lineInterval: 5000,
    23         lineInterval: 5000,
    24         noteHeight: undefined
    24         noteHeight: undefined,
       
    25         range: {
       
    26     		bottom: 60,
       
    27     		top: 70,
       
    28         },
    25       },
    29       },
    26       {
    30       {
    27         height: 645,
    31         height: 384,
    28         timeWidth: 60,
    32         timeWidth: 60,
    29         lineInterval: 5000,
    33         lineInterval: 5000,
    30         noteHeight: undefined
    34         noteHeight: undefined,
       
    35         range:{
       
    36     		bottom: 0,
       
    37     		top: 128,
       
    38         },
    31       },
    39       },
    32     ],
    40     ],
    33     framerate: 25,
    41     framerate: 25,
    34     offsetMusic: false,
    42     offsetMusic: false,
    35     sceneBgColor: 0xFFFFFF,
    43     sceneBgColor: 0xFFFFFF,
    96     };
   104     };
    97 
   105 
    98     var yInit = opts.yInit || 0;
   106     var yInit = opts.yInit || 0;
    99     var linesDown = true;
   107     var linesDown = true;
   100     _(opts.pianorolls).forEach(function(prDef, i) {
   108     _(opts.pianorolls).forEach(function(prDef, i) {
   101         var prNoteHeight = noteHeight || prDef.noteHeight || prDef.height / 128;
   109         var prNoteHeight = noteHeight || prDef.noteHeight || prDef.height / (prDef.top - prDef.bottom);
   102         var prTimeWidth = prDef.timeWidth || timeWidth;
   110         var prTimeWidth = prDef.timeWidth || timeWidth;
   103         pianorollList.push(new PianoRoll(_({
   111         pianorollList.push(new PianoRoll(_({
   104             yInit: yInit,
   112             yInit: yInit,
   105             height: prDef.height,
   113             height: prDef.height,
   106             linesDown: linesDown,
   114             linesDown: linesDown,
   107             pixelsPerSecond: Math.floor(sceneWidth / prTimeWidth),
   115             pixelsPerSecond: Math.floor(sceneWidth / prTimeWidth),
   108             noteHeight: prNoteHeight,
   116             noteHeight: prNoteHeight,
   109             lineInterval: prDef.lineInterval
   117             lineInterval: prDef.lineInterval,
       
   118             range: prDef.range,
   110         }).defaults(pianorollOptions).value()));
   119         }).defaults(pianorollOptions).value()));
   111         yInit += prDef.height;
   120         yInit += prDef.height;
   112         linesDown = !linesDown;
   121         linesDown = !linesDown;
   113 
   122 
   114         if(i<(opts.pianorolls.length-1)) {
   123         if(i<(opts.pianorolls.length-1)) {