All Projects β†’ cifkao β†’ Html Midi Player

cifkao / Html Midi Player

Licence: bsd-2-clause
🎹 Play and display MIDI files on the web

Programming Languages

javascript
184084 projects - #8 most used programming language
typescript
32286 projects

Projects that are alternatives of or similar to Html Midi Player

Skplayer
🎡 A simple & beautiful HTML5 music player
Stars: ✭ 437 (+176.58%)
Mutual labels:  music, player, music-player, audio-player
Swift Radio Pro
Professional Radio Station App for iOS!
Stars: ✭ 2,644 (+1573.42%)
Mutual labels:  music, player, music-player, audio-player
React Cassette Player
Simple ReactJS HTML5 audio player component built with SVG icons from The Noun Project.
Stars: ✭ 93 (-41.14%)
Mutual labels:  music, player, music-player, audio-player
Webaudiofont
Use full GM set of musical instruments to play MIDI and single sounds or effects. Support for reverberation and equaliser. No plugins, no Flash. Pure HTML5 implementation compatible with desktop and mobile browser. See live examples.
Stars: ✭ 600 (+279.75%)
Mutual labels:  music, player, music-player, midi
Sbplayerclient
ζ”―ζŒε…¨ζ ΌεΌηš„macη‰ˆθ§†ι’‘ζ’­ζ”Ύε™¨
Stars: ✭ 110 (-30.38%)
Mutual labels:  music, player, music-player, audio-player
Yesplaymusic
ι«˜ι’œε€Όηš„η¬¬δΈ‰ζ–Ήη½‘ζ˜“δΊ‘ζ’­ζ”Ύε™¨οΌŒζ”―ζŒ Windows / macOS / Linux
Stars: ✭ 12,981 (+8115.82%)
Mutual labels:  music, player, music-player
Strawberry
πŸ“ Strawberry Music Player
Stars: ✭ 972 (+515.19%)
Mutual labels:  music, music-player, audio-player
Kaku
🎧 Kaku is a highly integrated music player supports different online platform like YouTube, SoundCloud, Vimeo and more. Available on Mac, Windows and Linux.
Stars: ✭ 1,028 (+550.63%)
Mutual labels:  music, player, music-player
Audio player flutter
🎧 Apple Music / Tidal Audio Player for Flutter
Stars: ✭ 52 (-67.09%)
Mutual labels:  music, music-player, audio-player
Pandoraplayer
πŸ…ΏοΈ PandoraPlayer is a lightweight music player for iOS, based on AudioKit and completely written in Swift.
Stars: ✭ 1,037 (+556.33%)
Mutual labels:  music, player, music-player
Abcjs
javascript for rendering abc music notation
Stars: ✭ 1,141 (+622.15%)
Mutual labels:  music, music-player, midi
Cog
Cog - A Free and Open Source Audio Player for macOS 10.13+
Stars: ✭ 152 (-3.8%)
Mutual labels:  player, music-player, audio-player
Tauonmusicbox
The Linux desktop music player from the future! πŸŒ†
Stars: ✭ 494 (+212.66%)
Mutual labels:  music, player, music-player
Lofi Player
🎧 A Lofi Player built with HTML, CSS and Javascript using Parcel as Module Bundler https://lakscastro.github.io/lofi-player
Stars: ✭ 38 (-75.95%)
Mutual labels:  music, player, music-player
Romplayer
AudioKit Sample Player (ROM Player) - EXS24, Sound Font, Wave Player
Stars: ✭ 445 (+181.65%)
Mutual labels:  music, player, midi
Vyplayindicator
PlayIndicator inspired by Apple's Music Player.
Stars: ✭ 47 (-70.25%)
Mutual labels:  music, music-player, audio-player
Prodigal
Music Player for Android which looks & feels like classic player
Stars: ✭ 86 (-45.57%)
Mutual labels:  music, player, music-player
Musicplayer
A minimal music player built on electron.
Stars: ✭ 145 (-8.23%)
Mutual labels:  music, player, music-player
Canaree Music Player
Complete music player published in the Play Store. Heavily relies on Dagger, kotlin coroutines and Clean architecture.
Stars: ✭ 371 (+134.81%)
Mutual labels:  music, music-player, audio-player
Playpauseview
Let the play and pause button transition gracefully
Stars: ✭ 383 (+142.41%)
Mutual labels:  music, player, music-player

html-midi-player

npm package Published on webcomponents.org jsDelivr

<midi-player> and <midi-visualizer> HTML elements powered by @magenta/music (Magenta.js), fully stylable and scriptable.

If you use html-midi-player on your website, please consider linking back to the repository.

Getting started

  1. Add the necessary scripts to your page:

    <script src="https://cdn.jsdelivr.net/combine/npm/[email protected],npm/@magenta/[email protected]/es6/core.js,npm/[email protected],npm/[email protected]"></script>
    
  2. Add a player and a visualizer:

    <midi-player
      src="https://magenta.github.io/magenta-js/music/demos/melody.mid"
      sound-font visualizer="#myVisualizer">
    </midi-player>
    <midi-visualizer type="piano-roll" id="myVisualizer"></midi-visualizer>
    

That's it!

Installing from NPM

You can also add the package to your project from NPM, e.g. npm install --save html-midi-player or yarn add html-midi-player. Then you can either:

  • import 'html-midi-player' in your JavaScript code (as an ES Module), or
  • add the node_modules/html-midi-player/dist/midi-player.min.js bundle directly to your page, along with the dependencies (node_modules/tone/build/Tone.js, node_modules/@magenta/music/es6/core.js; note that these need to go before html-midi-player).

In both cases, you should also add the focus-visible polyfill to enable outlines on keyboard focus.

API basics

See also the API reference for both elements: midi-player, midi-visualizer.

src and noteSequence

Both midi-player and midi-visualizer support two different ways of specifying the input file:

  • By setting the src attribute to a MIDI file URL, e.g.:
    <midi-player src="twinkle-twinkle.mid"></midi-player>
    
    player.src = "twinkle-twinkle.mid";
    
  • By assigning a Magenta NoteSequence to the noteSequence property, e.g.:
    player.noteSequence = TWINKLE_TWINKLE;
    

SoundFonts

By default, the player will use a simple oscillator synth. To use a SoundFont, add the sound-font attribute:

<midi-player sound-font></midi-player>  <!-- default SoundFont (same as below) -->
<midi-player sound-font="https://storage.googleapis.com/magentadata/js/soundfonts/sgm_plus"></midi-player>
player.soundFont = null;  // no SoundFont
player.soundFont = '';    // default SoundFont (same as below)
player.soundFont = 'https://storage.googleapis.com/magentadata/js/soundfonts/sgm_plus';

See the Magenta.js docs for a list of available SoundFonts.

Visualizer settings

The visualizer type is specified via the type attribute. Three visualizer types are supported: piano-roll, waterfall and staff.

Each visualizer type has a set of settings that can be specified using the config attribute, e.g.:

visualizer.config = {
  noteHeight: 4,
  pixelsPerTimeStep: 60,
  minPitch: 30
};

The settings are documented in the Magenta.js docs.

Binding visualizers

A player supports binding one or more visualizers to it using the visualizer attribute (a selector) or the addVisualizer method:

<midi-player visualizer="#myVisualizer, #myOtherVisualizer"></midi-player>
player.addVisualizer(document.getElementById('myVisualizer'));
player.addVisualizer(document.getElementById('myOtherVisualizer'));

The visualizer only gets updated while the player is playing, which allows a single visualizer to be bound to multiple players.

Limitations

  • Only one player can play at a time. Starting a player will stop any other player which is currently playing. (#1) This can actually be a benefit in many cases.
  • Seeking only works while playing. (#2) This should get fixed soon (once the next version of Magenta.js is released).
  • Playback position only gets updated on note onsets. This may cause the player to appear stuck.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].