Coder Social home page Coder Social logo

Play MIDI files about soundfont-player HOT 9 OPEN

page200 avatar page200 commented on June 15, 2024 3
Play MIDI files

from soundfont-player.

Comments (9)

mk-pmb avatar mk-pmb commented on June 15, 2024

Thank you for summarizing!

from soundfont-player.

page200 avatar page200 commented on June 15, 2024

To sum up several discussions: The only approach that works well so far (correct instruments, perfect rhythm, can play in the background) is the latest official branch of MIDI.js (named "abcjs"), except for the first seconds of the first time a song is played. That problem is described at mudcube/MIDI.js#268 (comment). Solving that seems like the most promising plan. Feel free to have a look into that.

from soundfont-player.

urobot2011 avatar urobot2011 commented on June 15, 2024

Thanks for your help!

from soundfont-player.

urobot2011 avatar urobot2011 commented on June 15, 2024

But when i click the 'play' button on my Kalimba-sheet-music-writer project the sound is fine (there is a little sound jitter but i don't mind that).
What I'm wondering is if it's possible to know the length of a note in advance before the 'note off' event fires. I didn't get the answer from MidiPlayerJS's official documentation.
Here is a test page for my Kalimba-sheet-music-writer project:
Test Page

from soundfont-player.

page200 avatar page200 commented on June 15, 2024

@urobot2011 Hm, I'd like to play MIDI files without jitter. And regarding note durations, I suspect that some JavaScript MIDI players don't care about matching "Note On" MIDI messages with the respective "Note Off" messages. If you don't want to "reinvent" that matching, then apps that visualize that matching (for example as piano rolls) might serve as inspiration. Tag me at https://github.com/urobot2011/Kalimba-sheet-music-writer/discussions or so if you want me to list them and some of their properties. I don't know whether MidiPlayerJS performs that matching. https://musiclab.chromeexperiments.com/Piano-Roll/ (https://github.com/googlecreativelab/chrome-music-lab/tree/master/pianoroll) uses an interval tree to rewind the song efficiently.

from soundfont-player.

urobot2011 avatar urobot2011 commented on June 15, 2024

@page200 I looked at Color Piano and thought this might be possible with MIDI.JS.
Is this possible with MIDI.JS?

from soundfont-player.

page200 avatar page200 commented on June 15, 2024

@urobot2011 Color Piano uses MIDI.js, but probably an old branch of MIDI.js that doesn't play all instruments correctly. (Color Piano only plays the piano.) As discussed at mudcube/MIDI.js#268, it seems more promosing to fix the first seconds of the new "abcjs" branch than the entire instrument support in the old "master" branch.

from soundfont-player.

urobot2011 avatar urobot2011 commented on June 15, 2024

@page200 my workspace

from soundfont-player.

urobot2011 avatar urobot2011 commented on June 15, 2024

Hmm, I know this is just weird.
But is there any way to fix this?
Or, is it possible with midi.js(adc.js)?

from soundfont-player.

Related Issues (20)

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.