Skip to content

Commit

Permalink
- added tests for 128th note/rest support
Browse files Browse the repository at this point in the history
  • Loading branch information
Marian Weber authored and Marian Weber committed Jun 25, 2013
1 parent a93db49 commit 27d1c17
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions tests/stavenote_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ Vex.Flow.Test.StaveNote.draw = function(options, contextBuilder) {
var restKey = options.params.restKey;

var ctx = new contextBuilder(options.canvas_sel, 700, 180);
var stave = new Vex.Flow.Stave(10, 30, 650);
var stave = new Vex.Flow.Stave(10, 30, 750);

stave.setContext(ctx);
stave.addClef(clef);
Expand All @@ -426,6 +426,7 @@ Vex.Flow.Test.StaveNote.draw = function(options, contextBuilder) {
{ clef: clef, keys: lowerKeys, duration: "16"},
{ clef: clef, keys: higherKeys, duration: "32"},
{ clef: clef, keys: higherKeys, duration: "64"},
{ clef: clef, keys: higherKeys, duration: "128"},
{ clef: clef, keys: lowerKeys, duration: "w",
stem_direction: -1},
{ clef: clef, keys: lowerKeys, duration: "h",
Expand All @@ -440,6 +441,8 @@ Vex.Flow.Test.StaveNote.draw = function(options, contextBuilder) {
stem_direction: -1},
{ clef: clef, keys: lowerKeys, duration: "64",
stem_direction: -1},
{ clef: clef, keys: lowerKeys, duration: "128",
stem_direction: -1},

{ clef: clef, keys: restKeys, duration: "wr"},
{ clef: clef, keys: restKeys, duration: "hr"},
Expand All @@ -448,6 +451,7 @@ Vex.Flow.Test.StaveNote.draw = function(options, contextBuilder) {
{ clef: clef, keys: restKeys, duration: "16r"},
{ clef: clef, keys: restKeys, duration: "32r"},
{ clef: clef, keys: restKeys, duration: "64r"},
{ clef: clef, keys: restKeys, duration: "128r"},
{ keys: ["x/4"], duration: "h"}
];
expect(notes.length * 2);
Expand All @@ -467,7 +471,7 @@ Vex.Flow.Test.StaveNote.drawBoundingBoxes = function(options, contextBuilder) {
var restKey = options.params.restKey;

var ctx = new contextBuilder(options.canvas_sel, 700, 180);
var stave = new Vex.Flow.Stave(10, 30, 650);
var stave = new Vex.Flow.Stave(10, 30, 750);

stave.setContext(ctx);
stave.addClef(clef);
Expand All @@ -491,6 +495,7 @@ Vex.Flow.Test.StaveNote.drawBoundingBoxes = function(options, contextBuilder) {
{ clef: clef, keys: lowerKeys, duration: "16"},
{ clef: clef, keys: higherKeys, duration: "32"},
{ clef: clef, keys: higherKeys, duration: "64"},
{ clef: clef, keys: higherKeys, duration: "128"},
{ clef: clef, keys: lowerKeys, duration: "w",
stem_direction: -1},
{ clef: clef, keys: lowerKeys, duration: "h",
Expand All @@ -505,6 +510,7 @@ Vex.Flow.Test.StaveNote.drawBoundingBoxes = function(options, contextBuilder) {
stem_direction: -1},
{ clef: clef, keys: lowerKeys, duration: "64",
stem_direction: -1},
{ clef: clef, keys: lowerKeys, duration: "128"},

{ clef: clef, keys: restKeys, duration: "wr"},
{ clef: clef, keys: restKeys, duration: "hr"},
Expand All @@ -513,6 +519,7 @@ Vex.Flow.Test.StaveNote.drawBoundingBoxes = function(options, contextBuilder) {
{ clef: clef, keys: restKeys, duration: "16r"},
{ clef: clef, keys: restKeys, duration: "32r"},
{ clef: clef, keys: restKeys, duration: "64r"},
{ clef: clef, keys: restKeys, duration: "128r"},
{ keys: ["x/4"], duration: "h"}
];
expect(notes.length * 2);
Expand All @@ -529,8 +536,8 @@ Vex.Flow.Test.StaveNote.drawBoundingBoxes = function(options, contextBuilder) {
Vex.Flow.Test.StaveNote.drawBass = function(options, contextBuilder) {
expect(36);
var ctx = new contextBuilder(options.canvas_sel, 600, 280);
var stave = new Vex.Flow.Stave(10, 10, 550);
var stave2 = new Vex.Flow.Stave(10, 150, 550);
var stave = new Vex.Flow.Stave(10, 10, 650);
var stave2 = new Vex.Flow.Stave(10, 150, 650);
stave.setContext(ctx);
stave.addClef('bass');
stave.draw();
Expand Down Expand Up @@ -621,13 +628,15 @@ Vex.Flow.Test.StaveNote.drawHarmonicAndMuted = function(options,
{ keys: ["c/4", "e/4", "a/4"], duration: "16h"},
{ keys: ["c/4", "e/4", "a/4"], duration: "32h"},
{ keys: ["c/4", "e/4", "a/4"], duration: "64h"},
{ keys: ["c/4", "e/4", "a/4"], duration: "128h"},
{ keys: ["c/4", "e/4", "a/4"], duration: "wh", stem_direction: -1},
{ keys: ["c/4", "e/4", "a/4"], duration: "hh", stem_direction: -1},
{ keys: ["c/4", "e/4", "a/4"], duration: "qh", stem_direction: -1},
{ keys: ["c/4", "e/4", "a/4"], duration: "8h", stem_direction: -1},
{ keys: ["c/4", "e/4", "a/4"], duration: "16h", stem_direction: -1},
{ keys: ["c/4", "e/4", "a/4"], duration: "32h", stem_direction: -1},
{ keys: ["c/4", "e/4", "a/4"], duration: "64h", stem_direction: -1},
{ keys: ["c/4", "e/4", "a/4"], duration: "128h", stem_direction: -1},

{ keys: ["c/4", "e/4", "a/4"], duration: "wm"},
{ keys: ["c/4", "e/4", "a/4"], duration: "hm"},
Expand All @@ -636,13 +645,15 @@ Vex.Flow.Test.StaveNote.drawHarmonicAndMuted = function(options,
{ keys: ["c/4", "e/4", "a/4"], duration: "16m"},
{ keys: ["c/4", "e/4", "a/4"], duration: "32m"},
{ keys: ["c/4", "e/4", "a/4"], duration: "64m"},
{ keys: ["c/4", "e/4", "a/4"], duration: "128m"},
{ keys: ["c/4", "e/4", "a/4"], duration: "wm", stem_direction: -1},
{ keys: ["c/4", "e/4", "a/4"], duration: "hm", stem_direction: -1},
{ keys: ["c/4", "e/4", "a/4"], duration: "qm", stem_direction: -1},
{ keys: ["c/4", "e/4", "a/4"], duration: "8m", stem_direction: -1},
{ keys: ["c/4", "e/4", "a/4"], duration: "16m", stem_direction: -1},
{ keys: ["c/4", "e/4", "a/4"], duration: "32m", stem_direction: -1},
{ keys: ["c/4", "e/4", "a/4"], duration: "64m", stem_direction: -1}
{ keys: ["c/4", "e/4", "a/4"], duration: "64m", stem_direction: -1},
{ keys: ["c/4", "e/4", "a/4"], duration: "128m", stem_direction: -1}
];
expect(notes.length * 2);

Expand All @@ -669,7 +680,8 @@ Vex.Flow.Test.StaveNote.drawSlash = function(options, contextBuilder) {
{ keys: ["b/4"], duration: "8s", stem_direction: -1},
{ keys: ["b/4"], duration: "16s", stem_direction: -1},
{ keys: ["b/4"], duration: "32s", stem_direction: -1},
{ keys: ["b/4"], duration: "64s", stem_direction: -1}
{ keys: ["b/4"], duration: "64s", stem_direction: -1},
{ keys: ["b/4"], duration: "128s", stem_direction: -1}
];
expect(notes.length * 2);

Expand Down

0 comments on commit 27d1c17

Please sign in to comment.