Skip to content

Commit 79f1377

Browse files
committed
add the ability to deal with tag 'rest'
1 parent 4de4cd1 commit 79f1377

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

nathansununiversity_02.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ var compile = function (expr) {
99
(function endTime(time, expr, ref) {
1010
// your code here
1111
(function(expr) {
12-
if (expr.tag === 'note') {
12+
if (expr.tag === 'note' || expr.tag === 'rest') {
1313
expr.start = time || ref;
1414
result.push(expr);
1515

@@ -35,8 +35,11 @@ var melody_mus =
3535
{ tag: 'seq',
3636
left:
3737
{ tag: 'seq',
38-
left: { tag: 'note', pitch: 'a4', dur: 250 },
39-
right: { tag: 'note', pitch: 'b4', dur: 250 }
38+
left: { tag: 'par',
39+
left: { tag: 'rest', dur: 200 },
40+
right: { tag: 'note', pitch: 'b4', dur: 250 }
41+
},
42+
right: { tag: 'rest', dur: 250 }
4043
},
4144
right:
4245
{ tag: 'seq',

0 commit comments

Comments
 (0)