1

I'm trying to render a very simple chord like so:

chord

I tried to do

score.notes('(C#5/q B4 A4 G#4)')

as demonstrated here: https://jsfiddle.net/gcrb86fk/38/

But I get IncompleteVoice: Voice does not have enough notes in the console. Is there any easy way to do this straightforward use case? Or another js library?

Dara Java
  • 2,410
  • 3
  • 27
  • 52

2 Answers2

1

'(C#5/q B4 A4 G#4)' This is defining one chord that is one quarter note in length.

'C#5/q, B4, A4, G#4' One solution is to expand the chord into 4 individual quarter notes.

'(C#5 B4 A4 G#4)/q, B4, A4, G#4' Another solution is to add 3 more quarter notes to the voice.

EDIT:

'(C#5 B4 A4 G#4)/1' One chord and one chord alone.

Tom
  • 1,311
  • 10
  • 18
  • Thanks, but I need it as a chord and a chord alone – Dara Java Dec 18 '18 at 01:35
  • 1
    @DaraJava Updated with a single chord solution. If you need it to not be a whole note you need to change the signature. – Tom Dec 18 '18 at 01:52
  • Haha thank you again, but I still need it to be any one of a whole note, half note, quarter, etc. I just don't see a way to do this! – Dara Java Dec 18 '18 at 11:02
  • And I mean without the time signature being visible. I think I will go about it a hacky way, just put 3 dummy notes there and crop the resulting div – Dara Java Dec 18 '18 at 14:17
  • https://github.com/0xfe/vexflow/wiki/The-VexFlow-Tutorial I think this has some examples of what you are looking for. The measure right about `Step 3: All About Modifiers` is a good example. I think anyways. We are moving beyond what I know of this program! Hope this helps. – Tom Dec 18 '18 at 15:06
  • I'm facing a similar issue at https://stackoverflow.com/q/56614387/958373 and wonder if the code is wrong or the notes are wrong. – Stephane Jun 18 '19 at 10:31
1

You need to fill the whole measure, which means you need to make it last four quarters long (one whole note). This is done using "w" for Whole Note.

score.voice(score.notes('(C4 E4 G4 Bb4)/w')),
bsheps
  • 1,438
  • 1
  • 15
  • 26
Tim Poulin
  • 11
  • 1