MIDI Player Web Component

polymer-midi-player

npm Published on webcomponents.org

MIDI Player Web Component

midi-player

Playing MIDI files via Web Audio and Web MIDI

Usage

Install the Web Component

npm install polymer-midi-player --save

HTML

<script src="node_modules/@webcomponents/webcomponentsjs/webcomponents-bundle.js"></script>
<script type="module">
  import 'polymer-midi-player';
</script>
<midi-player src="test.mid" loop=2 autoplay></midi-player>

Attributes

src - MIDI file URL
data - contents of the MIDI file as String; can be used as an alternative to src
autoplay - start playback immediately
loop - the number of repeats, or true for an infinite loop

API

play()
pause()
resume()
stop()

Testing with Polymer

Make sure the Polymer CLI is installed: npm install -g polymer-cli
In the project directory:
run npm install
run polymer serve --open

Non-Polymer version

https://github.com/jazz-soft/JZZ-gui-Player

Install

Link to this version
ImportedReleased 08 April 2019MIT License
Framework Support
Polymer 3.0+
Browser Independent
Install with
npm install polymer-midi-player"@1.0.5"
Run the above npm command in your project folder. If you have any issues installing, please contact the author.
Release notes - Version 1.0.5

Dependencies

  • @polymer/polymer#^3.1.0
  • @webcomponents/webcomponentsjs#^2.1.3
  • jzz#^0.7.3
  • jzz-gui-player#^1.2.3
  • jzz-midi-smf#^1.1.6
  • jzz-synth-tiny#^1.0.9