Building a Vexflow Notation Editor. Any Method for Deleting Staves, Key Sigs or Time Sigs?

648 views
Skip to first unread message

Myles English

unread,
Feb 15, 2015, 3:44:16 PM2/15/15
to vex...@googlegroups.com
I'm working on a notation editor that uses VexFlow.  I'm several days in and have most basic functionality in.  One thing I'm finding is that adding anything is usually pretty simple, but removing it isn't, especially when it comes to glyphs as they're all grouped together for each stave.  Each glyph has a code like "v18" or "v44" which I can latch onto and remove on click of a button, but there are also methods created in the glyphs object when adding any glyphs including time sigs, clefs and key sigs that are impossible to identify and remove independently as they aren't unique in any way.  It's easy enough to remove all the glyphs by just clearing the contents of the glyphs, but that's far from ideal.

I'm thinking of possibly pushing properties to each glyph when a time sig, key sig or clef is created so that I can delete time sigs, key sigs and clefs independently.

Am I missing anything in the API for deletion?  If I'm not, it sure would be something nice to add to the API.



Gregory Ristow

unread,
Mar 7, 2015, 4:33:44 PM3/7/15
to vex...@googlegroups.com
VexFlow is built with a canvas painting approach in mind -- which is to say, when you need to delete something, the way to do it is to clear the canvas and re-render everything else again.  My approach to handling this is to keep the various VexFlow musical objects in memory, but create & add them to new staves/voices at re-rendering.  (Think 2d video-game rendering models here, and use VexFlow as your rendering engine.)

Myles English

unread,
Mar 7, 2015, 4:40:07 PM3/7/15
to vex...@googlegroups.com

Yeah, that's the approach I took after much head scratching.  I haven't built any games before so they're not techniques i'm used to. Although   I'm getting pretty familiar now.

--
--
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 a topic in the Google Groups "vexflow" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vexflow/C9qHTmHDbgc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vexflow+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Myles English

unread,
Jun 28, 2015, 6:46:37 PM6/28/15
to vex...@googlegroups.com
I left this project on the back burner for a while, but got back to it a few days ago.  I ended up re-writing a lot of it to work basically like a 2d game.  You can have a look here: http://webmonkeydd.com/vexflow-notation-editor.html

I decided to go open source as well and started a Git repo here: https://github.com/Bijingus/vexflow-notation-editor

joseph ni

unread,
Jul 12, 2015, 1:48:42 AM7/12/15
to vex...@googlegroups.com
looks pretty cool and I like how you use the mouse to write notes
I'd suggest rendering a shadow note so the user can see where the next note will be placed

Myles English

unread,
Jul 12, 2015, 3:39:04 PM7/12/15
to vex...@googlegroups.com
Yeah, the shadow note is a good idea.  I'm thinking of maybe changing things a bit though so notes aren't only added at the end of the previous notes, but can be added in between as well.
Reply all
Reply to author
Forward
0 new messages