Code Monkey home page Code Monkey logo

musicxml-player's Introduction

MusicXML Player

Build

A TypeScript component that loads and plays MusicXML files in the browser using Web Audio and Web MIDI.

Getting started

npm install
npm run build
npm test

Running the demo

This is a demo showcasing MusicXML rendering, MIDI conversion, Web Audio and Web MIDI playback. It is an enhanced replica of the earlier demo where the above functionality was hard-coded into the HTML app. By contrast, in this demo, the playback and rendering functionalities are all encapsulated in the present module, with only the demo UI coded in demo.mjs.

Theory of operation

This component synchronizes rendering and playback of MusicXML documents. Rendering is done using existing Web-based music engraving libraries such as OpenSheetMusicDisplay or Verovio. Playback uses standard MIDI files that are expected to correspond to the given MusicXML, and sends the MIDI events to either a Web MIDI output, or to a Web Audio synthesizer.

The crucial part of this functionality is to synchronize the measures and beats in the MusicXML file with the events of the MIDI file. In a nutshell, the player expects the provider of the MIDI file (an implementation of IMidiConverter) to supply a "timemap", which associates each measure in the MusicXML file to a timestamp at which this measure occurs. In the case of repeats and jumps, the same measure will be referenced several times in the timemap.

To produce such MIDI files and timemaps from a MusicXML score, the player utilizes the companion tool musicxml-mma. The demo above automatically installs and runs musicxml-mma in the background.

musicxml-player's People

Contributors

infojunkie avatar

Watchers

 avatar

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.