Closed karend27 closed 3 years ago
This is the source of the error:
diva-view.component.ts:216 Error:
<svg>
attribute viewBox: Expected number, "0 0 undefined undefi…". refreshOverlay @ diva-view.component.ts:216
Notice that the viewbox for the <svg>
image is "0 0 undefined undefined". Where and how this is happening is not obvious.
The cause of the error is related to adding Sc
in the following **mens
score:
The sB
displays correctly (semibreve in B3), but when Sc
is added (breve on C4), some divide-by-zero errors are occurring.
The problem is in verovio, @lpugin, and it seems to be related to a missing glyph based on the location of the error.
Starting with this test Humdrum file:
**mens
*clefC3
sB
*-
I can convert it successfully to MEI with the command-line:
verovio -atmei file.krn
Producing the MEI data:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="https://music-encoding.org/schema/4.0.0/mei-all.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"?>
<?xml-model href="https://music-encoding.org/schema/4.0.0/mei-all.rng" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
<mei xmlns="http://www.music-encoding.org/ns/mei" meiversion="4.0.0">
<meiHead>
<fileDesc>
<titleStmt>
<title />
</titleStmt>
<pubStmt />
</fileDesc>
<encodingDesc>
<appInfo>
<application isodate="2020-10-21T23:07:31" version="3.1.0-dev-98c9147-dirty">
<name>Verovio</name>
<p>Transcoded from Humdrum</p>
</application>
</appInfo>
</encodingDesc>
<workList>
<work>
<title />
</work>
</workList>
</meiHead>
<music>
<body>
<mdiv xml:id="mdiv-0000000903598646">
<score xml:id="score-0000001925575385">
<scoreDef xml:id="scoredef-0000001568086090" midi.bpm="400">
<staffGrp xml:id="staffgrp-0000001173877394">
<staffDef xml:id="staffdef-0000000098410096" n="1" notationtype="mensural.white" lines="5">
<clef xml:id="clef-L2F1" shape="C" line="3" />
</staffDef>
</staffGrp>
</scoreDef>
<section xml:id="section-L1F1">
<staff xml:id="staff-0000000425095969" n="1">
<layer xml:id="layer-L1F1N1" n="1">
<note xml:id="note-L3F1" dur="semibrevis" oct="3" pname="b" />
</layer>
</staff>
</section>
</score>
</mdiv>
</body>
</music>
</mei>
This loads and displays in VHV as well as in the Verovio editor (which I am using to make sure it is not a problem in VHV or in my compiled version of the javascript verovio toolkit):
Now on line 40 of the MEI data, change the @dur="semibrevis"
to @dur="brevis"
. This will cause the divide by 0 error:
Here is the test data using brevis
:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="https://music-encoding.org/schema/4.0.0/mei-all.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"?>
<?xml-model href="https://music-encoding.org/schema/4.0.0/mei-all.rng" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
<mei xmlns="http://www.music-encoding.org/ns/mei" meiversion="4.0.0">
<meiHead>
<fileDesc>
<titleStmt>
<title />
</titleStmt>
<pubStmt />
</fileDesc>
<encodingDesc>
<appInfo>
<application isodate="2020-10-21T23:07:31" version="3.1.0-dev-98c9147-dirty">
<name>Verovio</name>
<p>Transcoded from Humdrum</p>
</application>
</appInfo>
</encodingDesc>
<workList>
<work>
<title />
</work>
</workList>
</meiHead>
<music>
<body>
<mdiv xml:id="mdiv-0000000903598646">
<score xml:id="score-0000001925575385">
<scoreDef xml:id="scoredef-0000001568086090" midi.bpm="400">
<staffGrp xml:id="staffgrp-0000001173877394">
<staffDef xml:id="staffdef-0000000098410096" n="1" notationtype="mensural.white" lines="5">
<clef xml:id="clef-L2F1" shape="C" line="3" />
</staffDef>
</staffGrp>
</scoreDef>
<section xml:id="section-L1F1">
<staff xml:id="staff-0000000425095969" n="1">
<layer xml:id="layer-L1F1N1" n="1">
<note xml:id="note-L3F1" dur="brevis" oct="3" pname="b" />
</layer>
</staff>
</section>
</score>
</mdiv>
</body>
</music>
</mei>
Here is the function stack at the time of the crash:
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
vrv::Glyph::GetBoundingBox(int&, int&, int&, int&) + 4 (glyph.cpp:101)
vrv::Doc::GetGlyphWidth(wchar_t, int, bool) const + 58 (doc.cpp:1356)
vrv::LayerElement::GetDrawingRadius(vrv::Doc*, bool) + 457
vrv::View::DrawMensuralNote(vrv::DeviceContext*, vrv::LayerElement*, vrv::Layer*, vrv::Staff*, vrv::Measure*) + 93
vrv::View::DrawDurationElement(vrv::DeviceContext*, vrv::LayerElement*, vrv::Layer*, vrv::Staff*, vrv::Measure*) + 406
vrv::View::DrawLayerElement(vrv::DeviceContext*, vrv::LayerElement*, vrv::Layer*, vrv::Staff*, vrv::Measure*) + 546
vrv::View::DrawLayerChildren(vrv::DeviceContext*, vrv::Object*, vrv::Layer*, vrv::Staff*, vrv::Measure*) + 114 (view_page.cpp:1447)
vrv::View::DrawLayer(vrv::DeviceContext*, vrv::Layer*, vrv::Staff*, vrv::Measure*) + 165 (view_page.cpp:1268)
vrv::View::DrawStaffChildren(vrv::DeviceContext*, vrv::Object*, vrv::Staff*, vrv::Measure*) + 119 (view_page.cpp:1424)
vrv::View::DrawStaff(vrv::DeviceContext*, vrv::Staff*, vrv::Measure*, vrv::System*) + 434
vrv::View::DrawMeasureChildren(vrv::DeviceContext*, vrv::Object*, vrv::Measure*, vrv::System*) + 119 (view_page.cpp:1397)
vrv::View::DrawMeasure(vrv::DeviceContext*, vrv::Measure*, vrv::System*) + 329 (view_page.cpp:928)
vrv::View::DrawSystemChildren(vrv::DeviceContext*, vrv::Object*, vrv::System*) + 265 (view_page.cpp:1364)
vrv::View::DrawSystem(vrv::DeviceContext*, vrv::System*) + 346 (view_page.cpp:171)
vrv::View::DrawCurrentPage(vrv::DeviceContext*, bool) + 254 (view_page.cpp:91)
vrv::Page::LayOutHorizontally() + 1476
vrv::Doc::ConvertToCastOffMensuralDoc() + 315
vrv::Toolkit::LoadData(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) + 4507 (toolkit.cpp:625)
vrv::Toolkit::LoadFile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) + 447
main + 5583 (main.cpp:426)
This error leading to GetBoundingBox
in glyph.cpp
usually indicates a missing font glyph. Since this is happening on both the command-line, VHV, and the Verovio Editor, the problem is not a font installation issue, but is instead likely to be a missing glyph for the brevis in the develop
branch.
But maybe not: the above example uses white mensural fonts. When I change to black mensural fonts, the same divide by 0 occurs. Here is the black mensuration notation test file:
Transcoded from Humdrum
And strangely, when displaying the breve in CMN, there is no crash:
Transcoded from Humdrum
@karend27 I think I found it and tried to fix it. @craigsapp do you know if the editor uses that latest develop or the latest release?
It is using my humdrum-enabled verovio toolkit that I compile for VHV, which I can recompile if you want me to test the fix.
OK, yes, give a try.
compiling now...
Yes, it is working on the command line:
So I will compile the javascript version.
The new version is now online, so it is likely the problem is now fixed:
It seems fixed. Thank you, @lpugin and @craigsapp! :)
Excellent - sorry for being so slow to see this fix! Thanks @lpugin and @craigsapp! I really appreciate it!!
When I go to the music input screen I get to the point of drawing a box around a staff and can type "c" for the clef, but when I try to enter numbers and letters to enter the pitches nothing happens. I've attached the log file. @martha-thomae has said that it seems to only happen with larger note values - breves, longs, maximas - and that smaller note values are fine. Any ideas @craigsapp or @lpugin ? Thanks!!! editor.measuringpolyphony.org-1600956041242.log