Vexflow: Error when add TextNote to stave

Created on 28 Feb 2014  路  8Comments  路  Source: 0xfe/vexflow

I try add Text to Stave but get an error. I don't know what is function to draw Text to Stave. Here is my code:

var text = new Vex.Flow.TextNote({ glyph: "tr", duration: "q" }).setLine(5).setJustification(1);  
text.setContext(ctx).setStave(stave).draw();

Thanks so much!

question

All 8 comments

Here's an example: http://jsfiddle.net/g9ujK/12/

On Fri, Feb 28, 2014 at 4:15 AM, ntdai2007 [email protected] wrote:

I try add Text to Stave but get an error. I don't know what is function to
draw Text to Stave. Here is my code:

var text = new Vex.Flow.TextNote({ glyph: "tr", duration: "q" }).setLine(5).setJustification(1);
text.setContext(ctx).setStave(stave).draw();

Thanks so much!

Reply to this email directly or view it on GitHubhttps://github.com/0xfe/vexflow/issues/161
.

Mohit Muthanna [mohit (at) muthanna (uhuh) com]

Thank you so much!

Excuse me! How can I set position for it. I need it locate at the end of stave or on whatever notes music. How can I do that?
Thanks.

The duration in the voice is the position, if you want it move it half way in a 4/4 measure put a half note GhostNote in front of it.

Thanks you. So these is no orther way to solve this problem except GhostNote?

Not really. And any other way doesn't really make sense. You have to realize that dynamics occur in time, and do not necessarily coincide directly with a note. So by specifying duration, you have accurate formatting that scales with the stave size; as opposed to a flat offset value, which would no longer be useful if a stave changed size.

One option to stay within the text voice would be to add an empty string
("") TextNote with the duration set to the amount of space you require.

On Sun, Mar 2, 2014 at 11:22 PM, Silverwolf90 [email protected]:

Not really. And any other way doesn't really make sense. You have to
realize that dynamics occur in time, and do not necessarily coincide
directly with a note. So by specifying duration, you have accurate
formatting that scales with the stave size; as opposed to a flat offset
value, which would no longer be useful if a stave changed size.

Reply to this email directly or view it on GitHubhttps://github.com/0xfe/vexflow/issues/161#issuecomment-36480752
.

Mohit Muthanna [mohit (at) muthanna (uhuh) com]

Thanks @Silverwolf90 & @0xfe !

Was this page helpful?
0 / 5 - 0 ratings

Related issues

devboell picture devboell  路  6Comments

gciluffo picture gciluffo  路  4Comments

FlyMantou picture FlyMantou  路  3Comments

jkopyto picture jkopyto  路  5Comments

sug1no picture sug1no  路  6Comments