Consuming a lot of ram
See original GitHub issueHi,
Is there another way to load an instrument than :
MIDI.loadResource({
instrument: instrumentid,
onprogress: function (state, percent) {
console.log(state, percent);
},
onsuccess: function () {
console.log("onSuccess : " + instrumentid);
MIDI.programChange(channel, instrumentid);
}
});
Because each time I load an instrument the google tab has an increase of 100Mb of ram. If there is no other way to load them can we unload instruments ?
Issue Analytics
- State:
- Created 5 years ago
- Comments:5
Top Results From Across the Web
How to Figure Out What Is Taking Up So Much RAM
Click "Check Performance Issues" located under System and Security to identify problematic processes that may be taking up a lot of RAM.
Read more >Fix High RAM Memory Usage Issue on Windows 11/10 [10 ...
Disabling programs running from Startup will effectively decrease the system load and saving quite a lot of CPU memory space. Step 1. Press...
Read more >How to Fix High Memory Usage in Windows - Make Tech Easier
All computer memory is connected to the CPU and RAM. ... Likewise, previous Windows installations can consume a lot of extra memory, ...
Read more >What uses a lot of RAM? - Quora
RAM is used to store information that needs to be used quickly. This means that opening many programs, running various processes or accessing...
Read more >Why Is Google Chrome Using So Much RAM? Here's How to ...
But Chrome still uses a lot of RAM. At least, in many cases, it appears to be using more RAM than other browsers....
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

I modified the converter (soundfont_builder.rb) to run sox before encoding in order to strip off the silence. The extra line is
run_command "#{SOX} #{target}.orig.wav #{target} reverse silence 1 0.1 0 pad 0.0001@0 reverse channels 1"I haven’t published my whole modified script anywhere as it has other unrelated changes but you get the idea from the above.
On load it decompresses all the samples back to raw PCM audio. The sound fonts (if generated with the included soundfont builder script) have 3 seconds of stereo audio for 80+ notes… that is where your 100Mb+ per instrument comes from.
I reduced it in my application by trimming silence in the sound fonts so that they are not all 3 seconds. That will help for any instrument sound that decays, like a piano, or drums. It helps for drums especially because some of the notes do not even have a sound - with the original script you have 3 seconds of silence loaded!