question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MIDI.Player.loadFile not working,

See original GitHub issue

MIDI.noteOn and MIDI.noteOff are working, but in the same onsuccess function, the MIDI.Player.loadFile does nothing. I’m on Chrome 51.0

I am passing the file name of the midi file directly to loadFile. Is that correct?

MIDI.loadPlugin({ soundfontUrl: “soundfont/”, instrument: “acoustic_grand_piano”, onsuccess: function() { var delay = 0; // play one note every quarter second var note = 50; // the MIDI note var velocity = 127; // how hard the note hits // play the note MIDI.setVolume(0, 127); MIDI.noteOn(0, note, velocity, delay); MIDI.noteOff(0, note, delay + 0.75);

                MIDI.Player.loadFile("mysong.mid");
                MIDI.Player.start();
            }

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:18

github_iconTop GitHub Comments

1reaction
hmoffattcommented, Jul 20, 2016

On 20/07/16 11:36, gkfrog wrote:

well 0 makes it work. The tempo is a bit slow, but I have notes!

The default example code overrides the tempo (dumb). Set MIDI.Player.BPM = 0 before loading your file.

0reactions
gkfrogcommented, Jul 21, 2016

This is an exceptional program you’ve put together. Exactly what I needed! I am impressed.

Thanks.

Gary

On Wed, Jul 20, 2016 at 3:37 PM, Gary Harber gkharber@gmail.com wrote:

ok got it.

On Wed, Jul 20, 2016 at 10:17 AM, Gary Harber gkharber@gmail.com wrote:

what’s with the first note missing?

On Wed, Jul 20, 2016 at 4:36 AM, Théo Crevon notifications@github.com wrote:

So in my case, the problem was that I did not properly import the inc/jasmid/*.js files Cheers

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mudcube/MIDI.js/issues/186#issuecomment-233913824, or mute the thread https://github.com/notifications/unsubscribe-auth/ATk1POE0l7M6zTaMHS48Tnkq84SIWLloks5qXfobgaJpZM4JPPkW .

Read more comments on GitHub >

github_iconTop Results From Across the Web

Javascript MIDI File player [closed] - Stack Overflow
It event allows interacting with MIDI hardware devices! Loading a file is as simple as: MIDI.Player.loadFile("file.mid", callback);. Playing a file is even ...
Read more >
Developers - MIDI.Player.loadFile not working, - - Bountysource
MIDI.noteOn and MIDI.noteOff are working, but in the same onsuccess function, the MIDI.Player.loadFile does nothing. I'm on Chrome 51.0.
Read more >
midi-player-js - npm
MidiPlayerJS is a JavaScript library which reads standard MIDI files and emits JSON events in real time. This player does not generate any...
Read more >
MIDI.js - Sequencing in Javascript.
Player.start(); // start the MIDI track (you can put this in the loadFile callback) MIDI.Player.resume(); // resume the MIDI track from pause ...
Read more >
Midi-player-js NPM - npm.io
MidiPlayerJS is a JavaScript library which reads standard MIDI files and emits JSON events in real time. This player does not generate any...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found