rism-digital / verovio

🎵 Music notation engraving library for MEI with MusicXML and Humdrum support and various toolkits (JavaScript, Python)
https://www.verovio.org
GNU Lesser General Public License v3.0
687 stars 185 forks source link

[Python] can't access options #3810

Closed Daniel63656 closed 1 month ago

Daniel63656 commented 1 month ago

Using python, accessing or printing options dict crashes the kernel for notebooks and prints nothing in scripts.

import verovio

tk = verovio.toolkit()
print(tk.getOptions())
lpugin commented 1 month ago

You need to provide more information since this is normally working:


(.venv) laurent@gromit doc % python3 -m pip install verovio
Collecting verovio
  Using cached verovio-4.3.1-cp312-cp312-macosx_11_0_arm64.whl.metadata (9.0 kB)
Using cached verovio-4.3.1-cp312-cp312-macosx_11_0_arm64.whl (6.6 MB)
Installing collected packages: verovio
Successfully installed verovio-4.3.1
(.venv) laurent@gromit doc % python3
Python 3.12.6 (main, Sep  6 2024, 19:03:47) [Clang 15.0.0 (clang-1500.3.9.4)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import verovio
>>> tk = verovio.toolkit()
>>> print(tk.getOptions())
{'adjustPageHeight': False, 'adjustPageWidth': False, 'appXPathQuery': [], 'barLineSeparation': 0.8, 'barLineWidth': 0.3, 'beamFrenchStyle': False, 'beamMaxSlope': 10, 'beamMixedPreserve': False, 'beamMixedStemMin': 3.5, 'bottomMarginArtic': 0.75, 'bottomMarginHarm': 1.0, 'bottomMarginHeader': 2.0, 'bottomMarginOctave': 1.0, 'bracketThickness': 1.0, 'breaks': 'auto', 'breaksNoWidow': False, 'breaksSmartSb': 0.66, 'choiceXPathQuery': [], 'condense': 'auto', 'condenseFirstPage': False, 'condenseNotLastSystem': False, 'condenseTempoPages': False, 'dashedBarLineDashLength': 1.14, 'dashedBarLineGapLength': 1.14, 'defaultBottomMargin': 0.5, 'defaultLeftMargin': 0.0, 'defaultRightMargin': 0.0, 'defaultTopMargin': 0.5, 'dynamDist': 1.0, 'dynamSingleGlyphs': False, 'engravingDefaults': {}, 'evenNoteSpacing': False, 'expand': '', 'extenderLineMinSpace': 1.5, 'fingeringScale': 0.75, 'font': 'Leipzig', 'fontAddCustom': [], 'fontFallback': 'Leipzig', 'fontLoadAll': False, 'footer': 'auto', 'graceFactor': 0.75, 'graceRhythmAlign': False, 'graceRightAlign': False, 'hairpinSize': 3.0, 'hairpinThickness': 0.2, 'handwrittenFont': ['Petaluma'], 'harmDist': 1.0, 'header': 'auto', 'humType': False, 'incip': False, 'justificationBraceGroup': 1.0, 'justificationBracketGroup': 1.0, 'justificationMaxVertical': 0.3, 'justificationStaff': 1.0, 'justificationSystem': 1.0, 'justifyVertically': False, 'landscape': False, 'ledgerLineExtension': 0.54, 'ledgerLineThickness': 0.25, 'leftMarginAccid': 1.0, 'leftMarginBarLine': 0.0, 'leftMarginBeatRpt': 2.0, 'leftMarginChord': 1.0, 'leftMarginClef': 1.0, 'leftMarginKeySig': 1.0, 'leftMarginLeftBarLine': 1.0, 'leftMarginMRest': 0.0, 'leftMarginMRpt2': 0.0, 'leftMarginMensur': 1.0, 'leftMarginMeterSig': 1.0, 'leftMarginMultiRest': 0.0, 'leftMarginMultiRpt': 0.0, 'leftMarginNote': 1.0, 'leftMarginRest': 1.0, 'leftMarginRightBarLine': 1.0, 'leftMarginTabDurSym': 1.0, 'ligatureAsBracket': False, 'loadSelectedMdivOnly': False, 'lyricElision': 'regular', 'lyricLineThickness': 0.25, 'lyricNoStartHyphen': False, 'lyricSize': 4.5, 'lyricTopMinMargin': 2.0, 'lyricVerseCollapse': False, 'lyricWordSpace': 1.2, 'mdivAll': False, 'mdivXPathQuery': '', 'measureMinWidth': 15, 'mensuralToMeasure': False, 'midiNoCue': False, 'midiTempoAdjustment': 1.0, 'minLastJustification': 0.8, 'mmOutput': False, 'mnumInterval': 0, 'moveScoreDefinitionToStaff': False, 'multiRestStyle': 'auto', 'multiRestThickness': 2.0, 'neumeAsNote': False, 'noJustification': False, 'octaveAlternativeSymbols': False, 'octaveLineThickness': 0.2, 'octaveNoSpanningParentheses': False, 'openControlEvents': False, 'outputFormatRaw': False, 'outputIndent': 3, 'outputIndentTab': False, 'outputSmuflXmlEntities': False, 'pageHeight': 2970, 'pageMarginBottom': 50, 'pageMarginLeft': 50, 'pageMarginRight': 50, 'pageMarginTop': 50, 'pageWidth': 2100, 'pedalLineThickness': 0.2, 'pedalStyle': 'auto', 'preserveAnalyticalMarkup': False, 'removeIds': False, 'repeatBarLineDotSeparation': 0.36, 'repeatEndingLineThickness': 0.15, 'rightMarginAccid': 0.5, 'rightMarginBarLine': 0.0, 'rightMarginBeatRpt': 0.0, 'rightMarginChord': 0.0, 'rightMarginClef': 1.0, 'rightMarginKeySig': 1.0, 'rightMarginLeftBarLine': 1.0, 'rightMarginMRest': 0.0, 'rightMarginMRpt2': 0.0, 'rightMarginMensur': 1.0, 'rightMarginMeterSig': 1.0, 'rightMarginMultiRest': 0.0, 'rightMarginMultiRpt': 0.0, 'rightMarginNote': 0.0, 'rightMarginRest': 0.0, 'rightMarginRightBarLine': 0.0, 'rightMarginTabDurSym': 0.0, 'scale': 100, 'scaleToPageSize': False, 'setLocale': False, 'showRuntime': False, 'shrinkToFit': False, 'slurCurveFactor': 1.0, 'slurEndpointFlexibility': 0.0, 'slurEndpointThickness': 0.1, 'slurMargin': 1.0, 'slurMaxSlope': 60, 'slurMidpointThickness': 0.6, 'slurSymmetry': 0.0, 'smuflTextFont': 'embedded', 'spacingBraceGroup': 12, 'spacingBracketGroup': 12, 'spacingDurDetection': False, 'spacingLinear': 0.25, 'spacingNonLinear': 0.6, 'spacingStaff': 12, 'spacingSystem': 4, 'staccatoCenter': False, 'staffLineWidth': 0.15, 'stemWidth': 0.2, 'subBracketThickness': 0.2, 'substXPathQuery': [], 'svgAdditionalAttribute': [], 'svgBoundingBoxes': False, 'svgCss': '', 'svgFormatRaw': False, 'svgHtml5': False, 'svgRemoveXlink': False, 'svgViewBox': False, 'systemDivider': 'auto', 'systemMaxPerPage': 0, 'textEnclosureThickness': 0.2, 'thickBarlineThickness': 1.0, 'tieEndpointThickness': 0.1, 'tieMidpointThickness': 0.5, 'tieMinLength': 2.0, 'topMarginArtic': 0.75, 'topMarginHarm': 1.0, 'topMarginPgFooter': 2.0, 'transpose': '', 'transposeMdiv': {}, 'transposeSelectedOnly': False, 'transposeToSoundingPitch': False, 'tupletAngledOnBeams': False, 'tupletBracketThickness': 0.2, 'tupletNumHead': False, 'unit': 9.0, 'useBraceGlyph': False, 'useFacsimile': False, 'usePgFooterForAll': False, 'usePgHeaderForAll': False, 'xmlIdChecksum': False, 'xmlIdSeed': 0}
>>> 
Daniel63656 commented 1 month ago

Hm maybe this is somehow related to #3809 then?

I am running this in VScode in a jupyter notebook (although running in .py also fails. No print, no error or stack trace, just program does not execute after tk.getOptions()).

verovio 4.3.1 pypi_0 pypi

Maybe the jupyter log helps

Visual Studio Code (1.93.1, undefined, desktop)
Jupyter Extension Version: 2024.8.1.
Python Extension Version: 2024.14.1.
Pylance Extension Version: 2024.9.2.
Platform: win32 (x64).
Temp Storage folder ~\AppData\Roaming\Code\User\globalStorage\ms-toolsai.jupyter\version-2024.8.1
Workspace folder ~\OMR, Home = c:\Users\Daniel
09:54:47.569 [info] Starting Kernel (Python Path: ~\anaconda3\envs\musicml\python.exe, Conda, 3.11.5) for '~\OMR\z.ipynb' (disableUI=true)
09:54:52.397 [info] Process Execution: ~\anaconda3\envs\musicml\python.exe -c "import ipykernel; print(ipykernel.__version__); print("5dc3a68c-e34e-4080-9c3e-2a532b2ccb4d"); print(ipykernel.__file__)"
09:54:52.405 [info] Process Execution: ~\anaconda3\envs\musicml\python.exe c:\Users\~\.vscode\extensions\ms-toolsai.jupyter-2024.8.1-win32-x64\pythonFiles\vscode_datascience_helpers\kernel_interrupt_daemon.py --ppid 12176
    > cwd: ~\.vscode\extensions\ms-toolsai.jupyter-2024.8.1-win32-x64\pythonFiles\vscode_datascience_helpers
09:54:52.414 [info] Process Execution: ~\anaconda3\envs\musicml\python.exe -m pip list
09:54:52.581 [info] Process Execution: ~\anaconda3\envs\musicml\python.exe -m ipykernel_launcher --f=c:\Users\~\AppData\Roaming\jupyter\runtime\kernel-v35971740f75bcd342d1d179448dcc0ea1aa84525f.json
    > cwd: ~\OMR
09:54:54.320 [info] Kernel successfully started
09:55:08.388 [info] Process Execution: ~\anaconda3\envs\musicml\python.exe c:\Users\~\.vscode\extensions\ms-toolsai.jupyter-2024.8.1-win32-x64\pythonFiles\printJupyterDataDir.py
10:08:13.507 [error] Disposing session as kernel process died ExitCode: 3221225477, Reason: [Warning] MusicXML import: Dangling ending tag skipped
[Error] Parameter value 590 for 'spacingSystem' out of bounds; default is 4, minimum 0, and maximum 48
[Warning] MusicXML import: Dangling ending tag skipped
[Error] Parameter value 590 for 'spacingSystem' out of bounds; default is 4, minimum 0, and maximum 48
[Warning] MusicXML import: Dangling ending tag skipped
[Warning] MusicXML import: Dangling ending tag skipped
[Warning] MusicXML import: Dangling ending tag skipped
[Error] Parameter value 590 for 'spacingSystem' out of bounds; default is 4, minimum 0, and maximum 48
[Warning] MusicXML import: Dangling ending tag skipped
[Error] Parameter value 590 for 'spacingSystem' out of bounds; default is 4, minimum 0, and maximum 48
ahankinson commented 1 month ago

Your MusicXML file is not properly coded. Edit the file to remove the 590 in spacingsystem and see if that fixes it.

obviously Verovio shouldn’t crash though.

rettinghaus commented 1 month ago

Please share the input file for debugging.

Daniel63656 commented 1 month ago

I don't see any "spacingsysstem" entry. Unfortunately Github doesn't allow to attach the musicxml file directly

Click to view MusicXML example data ```xml Bella Ciao - Piano MuseScore 3.3.4 2020-04-19 http://musescore.com/user/9429701/scores/4992158 1.76 10 1683.78 1190.55 56.6929 56.6929 56.6929 113.386 56.6929 56.6929 56.6929 113.386 Piano Piano 1 1 78.7402 0 21.00 0.00 195.00 65.00 2 1 2 G 2 F 4 1 1 eighth 1 quarter 120 1 B 3 1 1 eighth up 1 begin E 4 1 1 eighth up 1 continue F 1 4 1 1 eighth up 1 end 4 4 5 half 2 heavy-light E minor G 4 1 1 eighth up 1 begin E 4 1 1 eighth up 1 end E 4 2 1 quarter up 1 1 1 eighth 1 B 3 1 1 eighth up 1 begin E 4 1 1 eighth up 1 continue F 1 4 1 1 eighth up 1 end 8 E 2 1 5 eighth up 2 begin E 3 1 5 eighth up 2 continue G 3 1 5 eighth up 2 B 1 1 5 eighth up 2 continue E 3 1 5 eighth up 2 end G 3 1 5 eighth up 2 E 2 1 5 eighth up 2 begin E 3 1 5 eighth up 2 continue G 3 1 5 eighth up 2 B 1 1 5 eighth up 2 continue E 3 1 5 eighth up 2 end G 3 1 5 eighth up 2 G 4 1 1 eighth up 1 begin E 4 1 1 eighth up 1 end E 4 2 1 quarter up 1 1 1 eighth 1 B 3 1 1 eighth up 1 begin E 4 1 1 eighth up 1 continue F 1 4 1 1 eighth up 1 end 8 E 2 1 5 eighth up 2 begin E 3 1 5 eighth up 2 continue G 3 1 5 eighth up 2 B 1 1 5 eighth up 2 continue E 3 1 5 eighth up 2 end G 3 1 5 eighth up 2 E 2 1 5 eighth up 2 begin E 3 1 5 eighth up 2 continue G 3 1 5 eighth up 2 B 1 1 5 eighth up 2 continue E 3 1 5 eighth up 2 end G 3 1 5 eighth up 2 E 4 2 1 quarter up 1 G 4 2 1 quarter up 1 F 1 4 1 1 eighth up 1 begin E 4 1 1 eighth up 1 end D major D 4 2 1 quarter up 1 G 4 2 1 quarter up 1 F 1 4 1 1 eighth up 1 begin E 4 1 1 eighth up 1 end 8 E 2 1 5 eighth up 2 begin E 3 1 5 eighth up 2 continue G 3 1 5 eighth up 2 B 1 1 5 eighth up 2 continue E 3 1 5 eighth up 2 end G 3 1 5 eighth up 2 D 2 1 5 eighth up 2 begin D 3 1 5 eighth up 2 continue F 1 3 1 5 eighth up 2 D 2 1 5 eighth up 2 continue D 3 1 5 eighth up 2 end F 1 3 1 5 eighth up 2 C major-seventh C 4 2 1 quarter up 1 E 4 2 1 quarter up 1 B 4 2 1 quarter up 1 C 4 2 1 quarter up 1 E 4 2 1 quarter up 1 B 4 2 1 quarter up 1 B major B 3 2 1 quarter up 1 D 1 4 2 1 quarter sharp up 1 B 4 2 1 quarter up 1 F 1 4 1 1 eighth up 1 begin A 4 1 1 eighth up 1 G 4 1 1 eighth up 1 end B 4 1 1 eighth up 1 8 C 2 1 5 eighth up 2 begin C 3 1 5 eighth up 2 continue E 3 1 5 eighth up 2 C 2 1 5 eighth up 2 continue C 3 1 5 eighth up 2 end E 3 1 5 eighth up 2 B 1 1 5 eighth up 2 begin B 2 1 5 eighth up 2 continue D 1 3 1 5 eighth sharp up 2 B 1 1 5 eighth up 2 continue B 2 1 5 eighth up 2 end D 1 3 1 5 eighth up 2 21.00 0.00 130.92 65.00 A minor E 4 1 1 eighth up 1 begin C 5 1 1 eighth up 1 E 4 1 1 eighth up 1 end C 5 1 1 eighth up 1 E 4 2 1 quarter up 1 C 5 2 1 quarter up 1 1 1 eighth 1 G 4 1 1 eighth up 1 begin C 5 1 1 eighth up 1 E 5 1 1 eighth up 1 F 1 4 1 1 eighth up 1 continue B 4 1 1 eighth up 1 D 5 1 1 eighth up 1 E 4 1 1 eighth up 1 end A 4 1 1 eighth up 1 C 5 1 1 eighth up 1 8 A 1 1 5 eighth up 2 begin C 3 1 5 eighth up 2 continue E 3 1 5 eighth up 2 E 2 1 5 eighth up 2 continue C 3 1 5 eighth up 2 end E 3 1 5 eighth up 2 A 1 1 5 eighth up 2 begin C 3 1 5 eighth up 2 continue E 3 1 5 eighth up 2 C 2 1 5 eighth up 2 continue C 3 1 5 eighth up 2 end E 3 1 5 eighth up 2 E minor F 1 4 1 1 eighth up 1 begin C 5 1 1 eighth up 1 E 5 1 1 eighth up 1 E 4 1 1 eighth up 1 end B 4 1 1 eighth up 1 D 5 1 1 eighth up 1 E 4 2 1 quarter up 1 B 4 2 1 quarter up 1 D 5 2 1 quarter up 1 2 1 quarter 1 F 1 4 1 1 eighth up 1 begin A 4 1 1 eighth up 1 E 4 1 1 eighth up 1 end G 4 1 1 eighth up 1 8 E 2 1 5 eighth up 2 begin E 3 1 5 eighth up 2 continue G 3 1 5 eighth up 2 B 1 1 5 eighth up 2 continue E 3 1 5 eighth up 2 end G 3 1 5 eighth up 2 E 2 1 5 eighth up 2 begin E 3 1 5 eighth up 2 continue G 3 1 5 eighth up 2 B 1 1 5 eighth up 2 continue E 3 1 5 eighth up 2 end G 3 1 5 eighth up 2 B dominant D 1 4 2 1 quarter sharp up 1 F 1 4 2 1 quarter up 1 F 1 4 2 1 quarter up 1 B 4 2 1 quarter up 1 D 1 4 2 1 quarter up 1 F 1 4 2 1 quarter up 1 E 4 2 1 quarter up 1 G 4 2 1 quarter up 1 8 F 1 2 1 5 eighth up 2 begin B 2 1 5 eighth up 2 continue D 1 3 1 5 eighth sharp up 2 A 3 1 5 eighth up 2 B 1 1 5 eighth up 2 continue B 2 1 5 eighth up 2 end D 1 3 1 5 eighth up 2 A 3 1 5 eighth up 2 F 1 2 1 5 eighth up 2 begin B 2 1 5 eighth up 2 continue D 1 3 1 5 eighth up 2 A 3 1 5 eighth up 2 B 1 1 5 eighth up 2 continue B 2 1 5 eighth up 2 end D 1 3 1 5 eighth up 2 A 3 1 5 eighth up 2 E minor B 3 4 1 half up 1 E 4 4 1 half up 1 1 1 eighth 1 B 3 1 1 eighth up 1 begin E 4 1 1 eighth up 1 continue F 1 4 1 1 eighth up 1 end 8 E 2 1 5 eighth up 2 begin E 3 1 5 eighth up 2 continue G 3 1 5 eighth up 2 B 1 1 5 eighth up 2 continue E 3 1 5 eighth up 2 end G 3 1 5 eighth up 2 E 2 1 5 eighth up 2 begin E 3 1 5 eighth up 2 continue G 3 1 5 eighth up 2 B 1 1 5 eighth up 2 continue E 3 1 5 eighth up 2 end G 3 1 5 eighth up 2 light-heavy 21.00 0.00 130.92 65.00 B 3 6 1 half up 1 E 4 6 1 half up 1 B 4 2 1 quarter down 1 E 5 2 1 quarter down 1 8 E 2 1 5 eighth up 2 begin E 3 1 5 eighth up 2 continue G 3 1 5 eighth up 2 B 1 1 5 eighth up 2 continue E 3 1 5 eighth up 2 end G 3 1 5 eighth up 2 E 2 1 5 eighth up 2 begin E 3 1 5 eighth up 2 continue G 3 1 5 eighth up 2 B 1 1 5 eighth up 2 continue E 3 1 5 eighth up 2 end G 3 1 5 eighth up 2 light-light 21.00 0.00 130.92 65.00 -4 F minor C 5 4 1 half down 1 F 5 4 1 half down 1 1 1 eighth 1 C 4 1 1 eighth up 1 begin F 4 1 1 eighth up 1 continue G 4 1 1 eighth up 1 end 8 F 2 1 5 eighth up 2 begin F 3 1 5 eighth up 2 continue A -1 3 1 5 eighth up 2 C 2 1 5 eighth up 2 continue F 3 1 5 eighth up 2 end A -1 3 1 5 eighth up 2 F 2 1 5 eighth up 2 begin F 3 1 5 eighth up 2 continue A -1 3 1 5 eighth up 2 C 2 1 5 eighth up 2 continue F 3 1 5 eighth up 2 end A -1 3 1 5 eighth up 2 heavy-light A -1 4 1 1 eighth up 1 begin F 4 1 1 eighth up 1 end F 4 2 1 quarter up 1 1 1 eighth 1 C 4 1 1 eighth up 1 begin F 4 1 1 eighth up 1 continue G 4 1 1 eighth up 1 end 8 F 2 1 5 eighth up 2 begin F 3 1 5 eighth up 2 continue A -1 3 1 5 eighth up 2 C 2 1 5 eighth up 2 continue F 3 1 5 eighth up 2 end A -1 3 1 5 eighth up 2 F 2 1 5 eighth up 2 begin F 3 1 5 eighth up 2 continue A -1 3 1 5 eighth up 2 C 2 1 5 eighth up 2 continue F 3 1 5 eighth up 2 end A -1 3 1 5 eighth up 2 A -1 4 1 1 eighth up 1 begin F 4 1 1 eighth up 1 end F 4 2 1 quarter up 1 1 1 eighth 1 C 4 1 1 eighth up 1 begin F 4 1 1 eighth up 1 continue G 4 1 1 eighth up 1 end 8 F 2 1 5 eighth up 2 begin F 3 1 5 eighth up 2 continue A -1 3 1 5 eighth up 2 C 2 1 5 eighth up 2 continue F 3 1 5 eighth up 2 end A -1 3 1 5 eighth up 2 F 2 1 5 eighth up 2 begin F 3 1 5 eighth up 2 continue A -1 3 1 5 eighth up 2 C 2 1 5 eighth up 2 continue F 3 1 5 eighth up 2 end A -1 3 1 5 eighth up 2 F 4 2 1 quarter up 1 A -1 4 2 1 quarter up 1 G 4 1 1 eighth up 1 begin F 4 1 1 eighth up 1 end E -1 major E -1 4 2 1 quarter up 1 A -1 4 2 1 quarter up 1 G 4 1 1 eighth up 1 begin F 4 1 1 eighth up 1 end 8 F 2 1 5 eighth up 2 begin F 3 1 5 eighth up 2 continue A -1 3 1 5 eighth up 2 C 2 1 5 eighth up 2 continue F 3 1 5 eighth up 2 end A -1 3 1 5 eighth up 2 E -1 2 1 5 eighth up 2 begin E -1 3 1 5 eighth up 2 continue G 3 1 5 eighth up 2 E -1 2 1 5 eighth up 2 continue E -1 3 1 5 eighth up 2 end G 3 1 5 eighth up 2 21.00 -0.00 130.92 65.00 D -1 major-seventh D -1 4 2 1 quarter up 1 F 4 2 1 quarter up 1 C 5 2 1 quarter up 1 D -1 4 2 1 quarter up 1 F 4 2 1 quarter up 1 C 5 2 1 quarter up 1 C major C 4 2 1 quarter up 1 E 4 2 1 quarter natural up 1 C 5 2 1 quarter up 1 G 4 1 1 eighth up 1 begin B -1 4 1 1 eighth up 1 A -1 4 1 1 eighth up 1 end C 5 1 1 eighth up 1 8 D -1 2 1 5 eighth up 2 begin D -1 3 1 5 eighth up 2 continue F 3 1 5 eighth up 2 D -1 2 1 5 eighth up 2 continue D -1 3 1 5 eighth up 2 end F 3 1 5 eighth up 2 C 2 1 5 eighth up 2 begin C 3 1 5 eighth up 2 continue E 3 1 5 eighth natural up 2 C 2 1 5 eighth up 2 continue C 3 1 5 eighth up 2 end E 3 1 5 eighth up 2 B -1 minor F 4 1 1 eighth up 1 begin D -1 5 1 1 eighth up 1 F 4 1 1 eighth up 1 end D -1 5 1 1 eighth up 1 F 4 2 1 quarter up 1 D -1 5 2 1 quarter up 1 1 1 eighth 1 A -1 4 1 1 eighth down 1 begin D -1 5 1 1 eighth down 1 F 5 1 1 eighth down 1 G 4 1 1 eighth down 1 continue C 5 1 1 eighth down 1 E -1 5 1 1 eighth down 1 F 4 1 1 eighth down 1 end B -1 4 1 1 eighth down 1 D -1 5 1 1 eighth down 1 8 B -1 1 1 5 eighth up 2 begin D -1 3 1 5 eighth up 2 continue F 3 1 5 eighth up 2 F 2 1 5 eighth up 2 continue D -1 3 1 5 eighth up 2 end F 3 1 5 eighth up 2 B -1 1 1 5 eighth up 2 begin D -1 3 1 5 eighth up 2 continue F 3 1 5 eighth up 2 D -1 2 1 5 eighth up 2 continue D -1 3 1 5 eighth up 2 end F 3 1 5 eighth up 2 F minor G 4 1 1 eighth down 1 begin D -1 5 1 1 eighth down 1 F 5 1 1 eighth down 1 F 4 1 1 eighth down 1 end C 5 1 1 eighth down 1 E -1 5 1 1 eighth down 1 F 4 2 1 quarter down 1 C 5 2 1 quarter down 1 E -1 5 2 1 quarter down 1 2 1 quarter 1 G 4 1 1 eighth up 1 begin B -1 4 1 1 eighth up 1 F 4 1 1 eighth up 1 end A -1 4 1 1 eighth up 1 8 F 2 1 5 eighth up 2 begin F 3 1 5 eighth up 2 continue A -1 3 1 5 eighth up 2 C 2 1 5 eighth up 2 continue F 3 1 5 eighth up 2 end A -1 3 1 5 eighth up 2 F 2 1 5 eighth up 2 begin F 3 1 5 eighth up 2 continue A -1 3 1 5 eighth up 2 C 2 1 5 eighth up 2 continue F 3 1 5 eighth up 2 end A -1 3 1 5 eighth up 2 C dominant E 4 2 1 quarter natural up 1 G 4 2 1 quarter up 1 G 4 2 1 quarter up 1 C 5 2 1 quarter up 1 E 4 2 1 quarter up 1 G 4 2 1 quarter up 1 F 4 2 1 quarter up 1 A -1 4 2 1 quarter up 1 8 G 2 1 5 eighth up 2 begin C 3 1 5 eighth up 2 continue E 3 1 5 eighth natural up 2 B -1 3 1 5 eighth up 2 C 2 1 5 eighth up 2 continue C 3 1 5 eighth up 2 end E 3 1 5 eighth up 2 B -1 3 1 5 eighth up 2 G 2 1 5 eighth up 2 begin C 3 1 5 eighth up 2 continue E 3 1 5 eighth up 2 B -1 3 1 5 eighth up 2 C 2 1 5 eighth up 2 continue C 3 1 5 eighth up 2 end E 3 1 5 eighth up 2 B -1 3 1 5 eighth up 2 21.00 0.00 70.00 65.00 F minor C 4 4 1 half up 1 F 4 4 1 half up 1 1 1 eighth 1 C 4 1 1 eighth up 1 begin F 4 1 1 eighth up 1 continue G 4 1 1 eighth up 1 end 8 F 2 1 5 eighth up 2 begin F 3 1 5 eighth up 2 continue A -1 3 1 5 eighth up 2 C 2 1 5 eighth up 2 continue F 3 1 5 eighth up 2 end A -1 3 1 5 eighth up 2 F 2 1 5 eighth up 2 begin F 3 1 5 eighth up 2 continue A -1 3 1 5 eighth up 2 C 2 1 5 eighth up 2 continue F 3 1 5 eighth up 2 end A -1 3 1 5 eighth up 2 light-heavy C 4 6 1 half up 1 F 4 6 1 half up 1 C 5 2 1 quarter down 1 F 5 2 1 quarter down 1 8 F 2 1 5 eighth up 2 begin F 3 1 5 eighth up 2 continue A -1 3 1 5 eighth up 2 C 2 1 5 eighth up 2 continue F 3 1 5 eighth up 2 end A -1 3 1 5 eighth up 2 F 2 1 5 eighth up 2 begin F 3 1 5 eighth up 2 continue A -1 3 1 5 eighth up 2 C 2 1 5 eighth up 2 continue F 3 1 5 eighth up 2 end A -1 3 1 5 eighth up 2 C 4 8 1 whole 1 F 4 8 1 whole 1 8 F 2 8 5 whole 2 F 3 8 5 whole 2 light-light ```
lpugin commented 1 month ago

The 590 is an option your are setting. Maybe you want to double check you installation and the options you are passing?

lpugin commented 1 month ago

You file renders properly for me with Python version 4.3.1. - with some [Warning] MusicXML import: Dangling ending tag skipped, though.

image

Something looks wrong in your installation and / or options. Please double check or narrow it down.

Daniel63656 commented 1 month ago

Yes I can also render the file. This issue is unrelated to the file. It happens just when printing options as described in the original post. I don't set any options manually.

import verovio

tk = verovio.toolkit()
print(tk.getOptions())
lpugin commented 1 month ago

Does it work with another file? And does it work if you remove the bad dangling ending tags? Can you share the notebook?

If this is just this file you need to narrow it down to which part of it crashes Verovio. As long as nobody else can reproduce your error it will be difficult to help you, or if needed to fix Verovio.

lpugin commented 1 month ago

How can it crash on the MusicXML file since the lines you show are not loading it??

Daniel63656 commented 1 month ago

I don't know, the error is produced just by the three lines I provided. No musicxml is loaded. The first log I posted included also loading musicxml but the error happens independently from any file (without loading anything)

lpugin commented 1 month ago

No musicxml is loaded but it is shown in the log?? Sounds like magic to me...

Daniel63656 commented 1 month ago

The log specifically for the 3 lines of code report an undefined exception.

09:19:00.910 [error] Error in execution (get message for cell) Error: The kernel 'musicml (Python 3.11.5)' died. Click [here](https://aka.ms/vscodeJupyterKernelCrash) for more info. View Jupyter [log](command:jupyter.viewOutput) for further details.
    > Kernel Id = .jvsc74a57bd0bdb182ff9b7792a4228eb77fcd2cfc338c387f018ed9552ebce02b4ca194ac53.c:\Users\~\anaconda3\envs\musicml\python.exe.c:\Users\~\anaconda3\envs\musicml\python.exe.-m#ipykernel_launcher
    > Interpreter Id = ~\anaconda3\envs\musicml\python.exe
    > at Function.verifyKernelState (c:\Users\~\.vscode\extensions\ms-toolsai.jupyter-2024.8.1-win32-x64\dist\extension.node.js:304:79709)
    > originalException = undefined
lpugin commented 1 month ago

VSCode

Version: 1.94.1
Commit: e10f2369d0d9614a452462f2e01cdc4aa9486296
Date: 2024-10-05T05:44:32.189Z
Electron: 30.5.1
ElectronBuildId: 10262041
Chromium: 124.0.6367.243
Node.js: 20.16.0
V8: 12.4.254.20-electron.0
OS: Darwin arm64 24.0.0

Python 3.10.5 Verovio 4.3.1

image

Python 3.11.6

image

ahankinson commented 1 month ago

It looks like Jupyter is the thing that is crashing. It may be some interaction with Verovio and Jupyter, but it’s not being directly run in vscode (I think?)

ahankinson commented 1 month ago

Also it’s running through Anaconda, which is another layer of difference than “bare” Python

lpugin commented 1 month ago

Yes, we clearly do not have enough information to do anything about this.

Daniel63656 commented 1 month ago

What can I provide then? For me it doesn't work in notebook (run in VsCode) and not as script

ahankinson commented 1 month ago

You could try running your notebook somewhere else, just to see.

It seems to work OK in Google Colab (hosted Jupyter):

image

If you do the exact same thing on your system, do you get an error?

lpugin commented 1 month ago

Something must be screwed up in your installation. Which operating system are you working on? Which version of Python? How do you install it? What is your script? Just saying that it crashes in not helpful.

lpugin commented 1 month ago

Just tried on anaconda.cloud and it works there too (anaconda-2024.02-py310)

image

Reopen the issue if you have some information under which circumstances it crashes, these being not just your machine.

Daniel63656 commented 1 month ago
tk.getVersion()
>>>'4.3.1[undefined]'

maybe it has something to do with this undefined? For you it lists something. I just install with pip install verovio in a python env.

lpugin commented 1 month ago

This means that either you modified Verovio locally, or that the wheel had to be built because the combination of OS, architecture and Python version is not available in PyPi. Whichever, the result of your build process is corrupted. Such crashes happen typically when the program running is dynamically linked to a version of the library that do not correspond to the version expected.

It is not impossible that there is a problem in Verovio even though this looks more like something messed up in your set up. If you think there is a problem in Verovio you need to come up with a detailed step-by-step way for somebody else to reproduce the error. That needs to include telling which OS your work on and which version of Python you use.

Daniel63656 commented 1 month ago

Yes I suspect there is something wrong with the build. I am on Windows 10, Version 22H2 (Build 19045.4894) I installed verovio in a python 3.11.5 environment (using conda) with $ pip install verovio I never downloaded verovio locally and modified it. I also tried purging the cache and reinstalling it

$ pip cache dir
$ pip cache purge
$ pip install verovio

The error persists. This must be something with the distribution of verovio for this OS/python version.

Edit: I also tried in a new env and it works there (despite printing the same strange version of '4.3.1[undefined]'. Can another package "interfere" with verovio? Maybe because this is now 3.11.10?

$ conda create -n verovio_test python=3.11
$ conda activate verovio_test
$ pip install verovio

Don't know what caused the error but it works now at least đź‘Ť