Play different instruments in a flexible way
See original GitHub issueI’d like to play several midi-files after one another, like sort of a playlist. According to the midi-file I’d like to get all its instruments to play. Sofar I only achieve that like this:
var player;
var instruments;
window.onload = function () {
MIDI.loadPlugin({
soundfontUrl: './soundfont/',
onsuccess: function () {
player = MIDI.Player;
player.timeWrap = 1;
player.loadFile('test.mid', function () {
instruments = player.getFileInstruments();
for (var i = 0; i < instruments.length; i++) {
MIDI.programChange(i, MIDI.GM.byName[instruments[i]].number);
}
player.start();
});
}
});
};
However they either seem to play on the wrong channel or somehow the wrong soundfont is assigned. So for example, the clarinet plays the piano’s melody. I couldn’t figure out how to solve that problem.
I’d be really happy about some advice or ideas 😃
Issue Analytics
- State:
- Created 6 years ago
- Comments:7
Top Results From Across the Web
Flexible Instrumentation Series - Alfred Music
As seen in the video below, Alfred/Belwin FLEX options provide opportunities for making music with like-instrument or mixed-instrument ensembles. Most grade .5– ...
Read more >What is the most flexible musical instrument in terms of all ...
And thank you for asking, my opinions are handpan played along with (in no particular order) didgeridoo, cello, harp, flute, double bass, voice,...
Read more >Flexatone - Wikipedia
The flexatone or fleximetal is a modern percussion instrument (an indirectly struck idiophone) consisting of a small flexible metal sheet suspended in a ......
Read more >How to learn multiple Instruments (Benefits and Practice ...
... during the Lockdown I want to share my experience of learning multiple instruments with you. ... Your browser can't play this video....
Read more >String Ensemble Flexible Instrumentation | Sheet music at JW ...
These 25 trios can be played with any combination of string instruments. Ideal for classroom, recital, or festival use with difficulty ranges from...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

On 26/11/17 21:37, Owwwl9 wrote:
Don’t do this, it’s completely wrong. getFileInstruments just gives you a list of instruments that are used in the file, so that you can load the appropriate sound fonts.
The MIDI file itself will set the program (instrument) on the appropriate channel. There is no need for you to make any calls to MIDI.programChange yourself.
Same problem. Has anyone found a solution? Or any example of
MIDI.jsplaying MIDI files with the correct instruments apart from piano?The commented-out line is probably not the only bug, as discussed in issue #268