Stemless notes

216 views
Skip to first unread message

cortez

unread,
Oct 25, 2015, 4:37:18 PM10/25/15
to vexflow
Hi,

Is it possible to have stemless notes in VexFlow?
For example, something that would be approproate for rendering plainchant. The test page for noteheads seems to indicate that this is indeed possible, but how would I achieve it?

Many thanks,
C

Mohit Muthanna Cheppudira

unread,
Oct 25, 2015, 7:00:35 PM10/25/15
to vexflow
Take a look at tests/notehead_tests.js to see how to render just the heads.

Mohit.

--
--
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]

cortez

unread,
Oct 26, 2015, 8:55:28 AM10/26/15
to vexflow, mo...@muthanna.com
Thanks Mohit. Looking at stavenote.js, it says that a StaveNote consists of "one or more `NoteHeads`, an optional stem, and an optional flag." Is there no way to have a StaveNote itself without a stem?

Thanks

cortez

unread,
Oct 26, 2015, 2:11:31 PM10/26/15
to vexflow, mo...@muthanna.com
Furthermore, testing with just a notehead seems to show that ledger lines are not drawn, and it also seems impossible to create chords (which is something I need). So I guess I'll have to hack the StaveNote code to get these features.

cortez

unread,
Oct 28, 2015, 2:31:17 PM10/28/15
to vexflow, mo...@muthanna.com
The only way I've managed to do it is to set Vex.Flow.durationToGlyph.duration_codes[4].common.stem (in tabels.js) to false. Since I only ever want stemless filled notes, for now that seems an acceptable workaround, though I'll have to get something less 'hackish' for production.

C

Mohit Muthanna Cheppudira

unread,
Oct 28, 2015, 2:37:00 PM10/28/15
to cortez, vexflow
Yeah, I'm not sure that there's a clean way to do that right now.
Message has been deleted

Mohit Muthanna Cheppudira

unread,
Dec 5, 2021, 6:42:37 AM12/5/21
to vexflow, Ron Yeh, Rodrigo Vilar
The table and accessor names were rationalized in VF 4. +Ron Yeh +Rodrigo Vilar would know what that should map to today.

On Sat, Dec 4, 2021 at 5:46 AM SmallHollow <esa.on...@gmail.com> wrote:
Bringing up this old topic after trying VexFlow 4 beta and noting that cortez's hack does not work anymore... 

Is there a new or cleaner method to use stemless filled notes in VF 4?


Ron Yeh

unread,
Dec 5, 2021, 3:21:16 PM12/5/21
to vexflow
Hi, if this is an important use case, we can (maybe) look into providing an official way to do stemless heads in the next release. Can you (or @cortez) describe what these note heads should look like, and when we would want to use them?

One use case I can see is for tutorial scores for absolute beginners.
Would the note heads look like whole notes, but take up a quarter note duration?
Would the note heads be filled in with an arbitrary color (like red = C, orange = D, ...)? 
Are the note heads stroked black like a whole note, but then internally filled with a color? Or is the entire shape a solid color blob?

Let us know what you think these stemless notes should like. We can figure out if there will be an official solution in a future release, or if we can find the current way to achieve cortez's hack.

Thanks,
Ron

Rodrigo Vilar

unread,
Dec 6, 2021, 4:41:59 PM12/6/21
to vexflow
Hi, was the topic resolved? The message seems to be deleted. +cortez is there something that we should add to the API documentation?

SmallHollow

unread,
Dec 25, 2021, 4:56:38 AM12/25/21
to vexflow
Hi everyone! I'm the one who created the message on Dec 4 but I deleted it almost immediately because I found a solution soon after posting my message. I'm sorry, I should have posted the solution here but I simply did the following which did the trick:

staveNote.setStem(new Stem());

I'm not sure how hackish this is but it worked so I decided not to bother the board anymore :-)

However, to answer Ron's question about the purpose of the stemless notation:

I'm using stemless noteheads very often to indicate only pitches but no durations. They look like standard black note heads, simply without the stems. I tried to look for an example online and found this image on LilyPond mailing list which looks like what I'm also doing (sometimes with the box notation and arrow too):


-Esa

Reply all
Reply to author
Forward
0 new messages