Giter VIP home page Giter VIP logo

librescore / webmscore Goto Github PK

View Code? Open in Web Editor NEW

This project forked from musescore/musescore

125.0 125.0 11.0 724.12 MB

MuseScore's core library (libmscore) in WebAssembly! Read mscz data, and generate audio/MIDI/MusicXML/SVG/PNG/PDF sheets right in browsers.

Home Page: https://www.npmjs.com/package/webmscore/

License: Other

Makefile 0.01% Shell 1.00% CMake 1.55% C++ 66.27% C 2.19% CSS 0.02% HTML 0.21% NSIS 0.02% QMake 0.01% QML 6.33% CartoCSS 20.74% Python 0.22% LilyPond 0.01% Batchfile 0.12% Perl 0.02% Objective-C++ 0.07% Dockerfile 0.01% Roff 0.07% JavaScript 1.12% TypeScript 0.02%
librescore midi mscz musescore musicxml sheet-music webassembly webaudio

webmscore's Introduction

webmscore's People

Contributors

alexpavlov96 avatar anatoly-os avatar andreituicu avatar antoniobl avatar asattely avatar bartlomiejlewandowski avatar cbjeukendrup avatar dmitrio95 avatar eism avatar harmoniker1 avatar hemantantony avatar igevorse avatar igorkorsukov avatar isaacweiss avatar jojo-schmitz avatar jpirie avatar jthistle avatar lasconic avatar lvinken avatar marcsabatella avatar mattmcclinch avatar mgavioli avatar mike-spa avatar njvdberg avatar romanpudashkin avatar shoogle avatar trig-ger avatar vpereverzev avatar wschweer avatar xmader avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

webmscore's Issues

Make release failed

make release
Make release
mkdir: build.release: File exists
CMake Deprecation Warning at CMakeLists.txt:20 (cmake_policy):
  The OLD behavior for policy CMP0045 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.


CMake Deprecation Warning at CMakeLists.txt:25 (cmake_policy):
  The OLD behavior for policy CMP0046 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.


CMake Deprecation Warning at CMakeLists.txt:36 (cmake_policy):
  The OLD behavior for policy CMP0071 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.


-- MUSESCORE_REVISION:
-- MSCORE_UNSTABLE FALSE
-- MSCORE_RELEASE_CHANNEL stable
-- MUSESCORE_VERSION_FULL 3.6.0
-- VERSION 3.6.0
CMake Deprecation Warning at thirdparty/brotli/CMakeLists.txt:5 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


CMake Warning (dev) at /usr/local/Cellar/cmake/3.19.0/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:426 (message):
  The package name passed to `find_package_handle_standard_args` (PkgConfig)
  does not match the name of the calling package (HarfBuzz).  This can lead
  to problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.19.0/share/cmake-3.19/Modules/FindPkgConfig.cmake:67 (find_package_handle_standard_args)
  thirdparty/freetype/builds/cmake/FindHarfBuzz.cmake:35 (include)
  thirdparty/freetype/CMakeLists.txt:212 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at /usr/local/Cellar/cmake/3.19.0/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:426 (message):
  The package name passed to `find_package_handle_standard_args` (harfbuzz)
  does not match the name of the calling package (HarfBuzz).  This can lead
  to problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  thirdparty/freetype/builds/cmake/FindHarfBuzz.cmake:67 (find_package_handle_standard_args)
  thirdparty/freetype/CMakeLists.txt:212 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at /usr/local/Cellar/cmake/3.19.0/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:426 (message):
  The package name passed to `find_package_handle_standard_args` (PkgConfig)
  does not match the name of the calling package (BrotliDec).  This can lead
  to problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.19.0/share/cmake-3.19/Modules/FindPkgConfig.cmake:67 (find_package_handle_standard_args)
  thirdparty/freetype/builds/cmake/FindBrotliDec.cmake:22 (include)
  thirdparty/freetype/CMakeLists.txt:236 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at /usr/local/Cellar/cmake/3.19.0/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:426 (message):
  The package name passed to `find_package_handle_standard_args` (brotlidec)
  does not match the name of the calling package (BrotliDec).  This can lead
  to problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  thirdparty/freetype/builds/cmake/FindBrotliDec.cmake:43 (find_package_handle_standard_args)
  thirdparty/freetype/CMakeLists.txt:236 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring done
CMake Error: install(EXPORT "freetype-targets" ...) includes target "freetype" which requires target "brotlidec" that is not in any export set.
CMake Warning (dev):
  Policy CMP0042 is not set: MACOSX_RPATH is enabled by default.  Run "cmake
  --help-policy CMP0042" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

  MACOSX_RPATH is not specified for the following targets:

   brotlicommon
   brotlidec
   brotlienc

This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev):
  Policy CMP0068 is not set: RPATH settings on macOS do not affect
  install_name.  Run "cmake --help-policy CMP0068" for policy details.  Use
  the cmake_policy command to set the policy and suppress this warning.

  For compatibility with older versions of CMake, the install_name fields for
  the following targets are still affected by RPATH settings:

   brotlicommon
   brotlidec
   brotlienc

This warning is for project developers.  Use -Wno-dev to suppress it.

-- Generating done
CMake Generate step failed.  Build files cannot be regenerated correctly.
xcodebuild: error: 'mscore.xcodeproj' does not exist.
xcodebuild: error: 'mscore.xcodeproj' does not exist.
make: *** [release] Error 66

Build error

Trying to build for use with nodejs.

When I get to the npm run build step, I get the error:

Unable to find Qt (cmd: qmake)

  Please make sure Qt is installed and available in your PATH environment
  variable.

I thought this line installed qt:

aqt install-qt linux desktop ${Qt5_VER} wasm_32 --outputdir ${AQT_PREFIX} --archives qtbase

Please advise, thanks!

Complete the documentation about the use of a JavaScript Bundler

I am trying to use webmscore in Angular 12 with WebPack 5.50.0.

It would be nice to complete the documentation with a working example to use webmscore with WebPack.

Without extra configuration, using WebMscore.load from ES6 import produce ReferenceError:

import WebMscore from 'webmscore';

async test() {
    await WebMscore.ready;
    const score = await WebMscore.load('mscx', data);
}

Uncaught ReferenceError: Path_to_my_project_node_modules_angular_devkit_build_angular_node_modules_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0_ is not defined

Only works on node 16, doesn't work versions above

Thank you bazilions for the amazing library!

For anyone facing similar issue: Webscore.ready throws error below for any node versions above 16, like 18.x.x or 20.x.x.

`node:internal/deps/undici/undici:11372
Error.captureStackTrace(err, this);
^

TypeError: Failed to parse URL from /Volumes/Zamazingo/repos/musescore-mscxs/node_modules/webmscore/webmscore.lib.wasm
at Object.fetch (node:internal/deps/undici/undici:11372:11) {
[cause]: TypeError: Invalid URL
at new URL (node:internal/url:775:36)
at new _Request (node:internal/deps/undici/undici:5055:25)
at fetch2 (node:internal/deps/undici/undici:9195:25)
at Object.fetch (node:internal/deps/undici/undici:11370:18)
at fetch (node:internal/process/pre_execution:282:25)
at instantiateAsync (/Volumes/Zamazingo/repos/musescore-mscxs/node_modules/webmscore/webmscore.nodejs.cjs:63:70039)
at createWasm (/Volumes/Zamazingo/repos/musescore-mscxs/node_modules/webmscore/webmscore.nodejs.cjs:63:70648)
at /Volumes/Zamazingo/repos/musescore-mscxs/node_modules/webmscore/webmscore.nodejs.cjs:63:212265
at Object. (/Volumes/Zamazingo/repos/musescore-mscxs/node_modules/webmscore/webmscore.nodejs.cjs:96:23)
at Module._compile (node:internal/modules/cjs/loader:1241:14) {
code: 'ERR_INVALID_URL',
input: '/Volumes/Zamazingo/repos/musescore-mscxs/node_modules/webmscore/webmscore.lib.wasm'
}
}

Node.js v20.8.1`

converting midi to xml fails

I'm getting FileError: WebMscore: FILE_UNKNOWN_TYPE when attempting to ingest a .mid file and output a .musicxml.

Here's my code to reproduce:

let file = fs.readFileSync(filePath, null); // note : besides null, which yields a buffer, I've tried 'binary' and 'utf-8'

function generateAudioViaWebMScore(file) {
	WebMscore.ready.then(async () => {
		const score = await WebMscore.load('mid', file, [], true);
		fs.writeFileSync(`converted.musicxml`, await score.saveXml());
		score.destroy();
	});
}

Is this by design/my error/a bug?

Thanks for any suggestions!

Render MSCX file with MSS styles?

It appears that in Musescore4, the score info (.mscx) and style info (.mss) are separate files now. The .mscz format combines both of these, along with other metadata, into a "zipped" binary file format. I can see that the load function here allows me to render either a .mscx or .mscz file (or musicxml, etc). The .mscx file ends up being largely unstyled with no apparent way to manipulate the style/layout. The .mscz file rendering works as expected, but isn't ideal for the purposes of the app I'm trying to develop since I'd like to be able to transform the XML info client-side and re-render it on the fly.

So my question is... is it possible to load an uncompressed .mscx or .musicxml file and apply a .mss style file to it (as an argument of some sort) before rendering? I don't know enough about the inner workings of Musescore to know if that's possible or not.

Unmapped drum note *number*

I was trying to load this file and webmscore just spams me with unmapped drum note 75 with different numbers.
When I load a soundfont file and try to use saveAudio to save that to a .wav file, some drum notes are missing in the output file.
Any way to fix that?

Possible to load .sfz soundfont instead of .sf3?

WebMScore is great!

I can successfully load my own, local .sf2 or .sf3 files, however:

Trying to load an .sfz soundfont throws error 15424120. (And error.message is simply 'undefined'.)

The reason I need the .sfz is that I need to be able to edit the .sfz file textually and programatically without an intervening Soundfont generator.

Is there a way to use .sfz's? Do I need to specify Zerberus (the Musescore .sfz player)? Do I need a different file structure? Please see below.

My environment is node js, with the following test case and file structure:

File Structure

Project Folder
    app.js
    testScore.mscz
    mySFZ.sfz
    samples
           one.wav
           two.wav
           etc.wav

Test Case (Works with .sf3 , errors with .sfz)

const WebMscore = require('webmscore');
const fs = require('fs');

// free example scores available at https://musescore.com/openscore/scores
const name = 'testScore.mscz';
const exportedPrefix = 'exported';
const filedata = fs.readFileSync(`./${name}`);

WebMscore.ready.then(async () => {
    const score = await WebMscore.load('mscz', filedata, [], false);
    await score.setSoundFont(fs.readFileSync('./mySFZ.sfz'));
    try { fs.writeFileSync(`./${exportedPrefix}.mp3`, await score.saveAudio('mp3')); } 
    catch (err) { console.log(err) } 
    score.destroy();

});

Export video of score possible?

Can WebMScore export a video of the score, like MuseScore?

I did not see video as an export option in the source code, but I wasn't sure if I was missing something.

bus error in bulk processing

Thank you for the amazing library!

When trying to convert many mscz files in one process to midi, I always get error below:

[1] 67030 bus error node script.js

and the process terminates.

I am using the snippet from readme.md as below, iterating through an array of file[]:

const msczdata = fs.readFileSync(file);
const score = await WebMscore.load("mscz", msczdata, [], false);
const midi = await score.saveMidi();
fs.writeFileSync(midi_path, midi);
score.destroy();

When script is run for 10 files, no bus error is thrown. When script is run with thousands of files, it always throws.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.