Comments (6)
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.
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.
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.
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.
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.
Latest dev version supports progress events.
from midi.js.
Related Issues (20)
- very long notes are truncated HOT 2
- pitch bending in webaudio HOT 2
- How can i send a note to specific stereo channel? HOT 1
- tracks
- Audio Mobile App : MIDI.js or Native ? HOT 2
- k
- Is it impossible to pause when using noteon noteoff instead of player HOT 3
- How to disable sound in Player.js?
- There is no sound when I am playing my own midi file HOT 2
- Question, Piano Layout HOT 1
- Midi files with multi channels doesn't work using MIDI.Player.Loadfile HOT 3
- How to play file.mid HOT 4
- can i use midi.js to create a online piano and guitar? HOT 1
- Color piano not found in chrome web store HOT 2
- Playing midi file with the wrong tempo HOT 1
- ReferenceError: Base64Binary is not defined HOT 1
- Current Position / Event Listener
- Loading all GM instruments for midi file HOT 25
- Slow start of playing HOT 3
- Bug: MIDI events not being fired HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from midi.js.