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)) { |