Fix the definition of class Note in VexFlow.

- The Note constructor should accept either zero argument or one argument.
This commit is contained in:
nearbydelta
2017-07-07 06:40:13 +09:00
parent ae6459f44a
commit 03d228ff8e
2 changed files with 10 additions and 6 deletions
+3 -3
View File
@@ -1,4 +1,4 @@
// Type definitions for VexFlow v1.2.83
// Type definitions for VexFlow v1.2.84
// Project: http://vexflow.com
// Definitions by: Roman Quiring <https://github.com/rquiring>
// Sebastian Haas <https://github.com/sebastianhaas/>
@@ -618,8 +618,8 @@ declare namespace Vex {
getTickMultiplier() : Fraction;
applyTickMultiplier(numerator : number, denominator : number) : void;
setDuration(duration : Fraction) : void;
constructor(note_struct : {type? : string, dots? : number, duration : string});
constructor(note_struct? : {type? : string, dots? : number, duration : string});
getPlayNote() : any;
setPlayNote(note : any) : Note;
isRest() : boolean;
+7 -3
View File
@@ -34,16 +34,20 @@ notes1[2].addModifier(0, new Vex.Flow.GraceNoteGroup([gracenote], true).beamNote
// Color the chord
notes1[3].setStyle({fillStyle: "blue", strokeStyle: "blue"});
// Add a bar
var tickable1: Vex.Flow.Note[] = notes1;
tickable1.push(new Vex.Flow.BarNote());
// Create a voice in 4/4 and add notes
var voice1 = new Vex.Flow.Voice({
num_beats: 4,
beat_value: 4,
resolution: Vex.Flow.RESOLUTION
}).addTickables(notes1);
}).addTickables(tickable1);
// Create a second voice with just one whole note
var voice2 = new Vex.Flow.Voice(Vex.Flow.TIME4_4).
addTickables([new Vex.Flow.StaveNote({keys: ["c/4"], duration: "w"})]);
addTickables([new Vex.Flow.StaveNote({keys: ["c/4"], duration: "w"}), new Vex.Flow.BarNote()]);
// Format and justify the notes to 550 pixels
var formatter = new Vex.Flow.Formatter().
@@ -85,4 +89,4 @@ var notes = [
];
// Format ad draw the notes
Vex.Flow.Formatter.FormatAndDraw(ctx, tabstave, notes);
Vex.Flow.Formatter.FormatAndDraw(ctx, tabstave, notes);