Git Product home page Git Product logo

Comments (6)

mudcube avatar mudcube commented on July 17, 2024

Hi (just scanning over the code now), the problem is that when USE_XHR is turned on that it's expecting a JSON object, and it's getting a JS file. So, either the code could be rewritten to use JS dynamical script include, or to convert the soundfont into JSON.

To get JS to work (instead of recompiling the soundfonts into JSON) replace this:

    MIDI.Soundfont[instrumentId] = JSON.parse(response.responseText);

With this:

    var script = document.createElement("script");
    script.language = "javascript";
    script.type = "text/javascript";
    script.text = response.responseText;
    document.body.appendChild(script);

Inside the MIDI/LoadPlugin.js file, there's two places to replace that, so might as well make into a helper function. And then maybe add in USE_XHR_JS option, so the JSON still works. Feel free to submit changes :)

from midi.js.

detky avatar detky commented on July 17, 2024

Hallo Michael,
I got it working but i have a very strange collateral effect:
my page (http://www.easychords.eu/BeatsEditor.aspx) uses 2 instruments, bass and (a modified) synth_drum, loaded as following:
...
} else if (midiMode == 'DrumsBass') {
sampleInstrument = "D";
MIDI.loadPlugin({
soundfontUrl: "audio/soundfont_FluidR3_GM/",
instruments: ["synth_drum","electric_bass_pick"],
soundManagerUrl: "js/SoundManager2/soundmanager2-nodebug-jsmin.js",
callback: function() {
MIDI.programChange(2, 118); //1 Drums
MIDI.programChange(3, 34); //Bass
CheckIniTialization();
}
});
}
...

only running on firefox, if call: MIDI.noteOn(2, 21, velocity, delay) sounds a Bass instead of a drum, and It happens just with some notes.
The only way to get the drum sounds running including the file Loader.js is using just one instrument.
Did you saw something like that before? there is any logic that could produce a channel switch?

regards,

from midi.js.

mudcube avatar mudcube commented on July 17, 2024

Your app looks great, I'm enjoying the quality of encoded media--deep bass!

I don't have the free time to take a look into this. MIDI.js was made primarily for Color Piano to work, so I did not do much testing with multiple instruments. I know others have fixed this since in their own implementations, but unfortunately, they did not share their code back. I imagine it'd take me a few hours to get working. If you want to hire me, send me an email at [email protected]

from midi.js.

detky avatar detky commented on July 17, 2024

Hallo Michael,
thanks anyway! I would hire you if i could, but unfortunately i cant :(
I've left the the changes related to this Topic because i found a deeper Problem that is driving me crazy, but i'll continue when i get a way to get multiple instruments working. I'll create another issue now, with a clear example, maybe someone have a good idea. After I'll finish this and post the changes

Regards

from midi.js.

mudcube avatar mudcube commented on July 17, 2024

I may be getting some client work soon surrounding this, and will be able to push changes to the MIDI.js project—I'll keep you in the loop on developments on this. Yeah, feel free to create a new issue, it's always helps to hear back from dev's who've done their own testing.

from midi.js.

mudcube avatar mudcube commented on July 17, 2024

Latest dev version supports progress events.

from midi.js.

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.