Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added rest

Signed-off-by: Mark Biesheuvel <mark.biesheuvel@hotmail.com>
  • Loading branch information...
commit 43a190d0a1f6fc525b17eed12a985bfca1a9b936 1 parent 57d4b13
Mark Biesheuvel authored
Showing with 6 additions and 2 deletions.
  1. +6 −2 lesson2/MUS compiler.js
View
8 lesson2/MUS compiler.js
@@ -19,8 +19,12 @@ var helper = function (time, result, expr) {
var t0 = helper(time, result, expr.left);
var t1 = helper(time, result, expr.right);
// Take maximum of two parrelel pieces
- return Math.max(t0, t1);
- }else{
+ return Math.max(t0, t1);
+
+ }else if(expr.tag=='rest'){
+ return time + expr.dur;
+
+ }else {
expr.start = time;
result.push(expr);
return time + expr.dur;
Please sign in to comment.
Something went wrong with that request. Please try again.