Re: Is there a way to clear or replace the stave on a new render?

249 views
Skip to first unread message

Mohit Muthanna Cheppudira

unread,
May 25, 2016, 1:24:34 PM5/25/16
to vexflow
You can call vextab.reset() and artist.reset() before calling parse/render again.

On Wed, May 25, 2016 at 8:02 AM, Richard Downing <rvdo...@gmail.com> wrote:
If I do a new artist.render(renderer); I get a new tabstave on the page.  Is there a way to replace the one that it already there or to clear the signature and notes from the existing stave and reuse it?  I want to replace the existing signature and chord shown with a new signature and chord. 

--
--
You received this message because you are subscribed to the Google
Groups "vexflow" group.
To post to this group, send email to vex...@googlegroups.com
To unsubscribe from this group, send email to
vexflow+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/vexflow?hl=en

---
You received this message because you are subscribed to the Google Groups "vexflow" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vexflow+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



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

Richard Downing

unread,
May 26, 2016, 12:43:29 PM5/26/16
to vexflow, mo...@muthanna.com
It seems to work the same with or without the resets:

    function render(string) {
try {
// vextab.reset();
// artist.reset();
vextab.parse(string);
artist.render(renderer);
} catch (e) {
console.log(e);
$("#error").html(e.message.replace(/[\n]/g, '<br/>'));
}
      } 
Reply all
Reply to author
Forward
0 new messages