| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 | 
							- <!DOCTYPE html>
 
- <html lang="en">
 
- <head>
 
-   <meta charset="UTF-8">
 
-   <meta http-equiv="X-UA-Compatible" content="IE=edge">
 
-   <meta name="viewport" content="width=device-width, initial-scale=1.0">
 
-   <title>Document</title>
 
-   <script src="./opensheetmusicdisplay.min.js"></script>
 
-   <style>
 
-     * {
 
-       margin: 0;
 
-       padding: 0;
 
-     }
 
-     body {
 
-       padding-bottom: 60px;
 
-       height: 600px;
 
-       overflow: hidden;
 
-     }
 
-     .vf-text {
 
-       display: none;
 
-     }
 
-   </style>
 
- </head>
 
- <body>
 
-   <div id="osmdContainer" />
 
-   <script>
 
-     var osmd = new opensheetmusicdisplay.OpenSheetMusicDisplay("osmdContainer");
 
-     osmd.setOptions({
 
-       backend: "svg",
 
-       drawTitle: false,
 
-       drawPartNames: true,
 
-       drawLyricist: false,
 
-       drawComposer: false,
 
-     });
 
-     osmd.setPageFormat('650x884')
 
-     function getSvgPngToSize(osmd) {
 
-       if (osmd) {
 
-         if (osmd.Drawer.Backends.length > 0) {
 
-           var imgList = []
 
-           for (var idx = 0, len = osmd.Drawer.Backends.length; idx < len; idx++) {
 
-             var backend = osmd.Drawer.Backends[idx]
 
-             var state = backend.ctx.state;
 
-             var width = backend.ctx.width / state.scale.x;
 
-             var height = backend.ctx.height / state.scale.y;
 
-             var cont = new XMLSerializer().serializeToString(
 
-               backend.ctx.svg
 
-             )
 
-             imgList.push({
 
-               img: cont,
 
-               width: width,
 
-               height: height,
 
-             })
 
-           }
 
-           return imgList
 
-         }
 
-       } else {
 
-         console.log('没有OSMD')
 
-       }
 
-     }
 
-     function render() {
 
-       osmd.render();
 
-       // console.log(getSvgPngToSize(osmd), 'getSvgPngToSize(osmd)')
 
-       window.parent.postMessage({
 
-         api: 'musicStaffRender',
 
-         loading: false,
 
-         osmdImg: getSvgPngToSize(osmd)
 
-       }, '*');
 
-     }
 
-     function renderXml(xmlUrl, partIndex) {
 
-       osmd
 
-         .load(xmlUrl)
 
-         .then(
 
-           function () {
 
-             for (let i = 0; i < osmd.Sheet.Instruments.length; i++) {
 
-               // console.log(osmd.Sheet.Instruments[i].Name);
 
-               osmd.Sheet.Instruments[i].Visible = i === partIndex;
 
-             }
 
-             osmd.zoom = .5
 
-             render();
 
-           }
 
-         );
 
-     }
 
-     function resetRender(partIndex) {
 
-       for (let i = 0; i < osmd.Sheet.Instruments.length; i++) {
 
-         // console.log(osmd.Sheet.Instruments[i].Name);
 
-         osmd.Sheet.Instruments[i].Visible = i === partIndex;
 
-       }
 
-       render();
 
-     }
 
-   </script>
 
- </body>
 
- </html>
 
 
  |