loadSoundFont doesn't work
See original GitHub issueYour environment
- Version used: 0.9.5-243
- Platform used: JavaScript
- Rendering engine used: SVG
- Browser Name and Version: Firefox
- Operating System and version (desktop or mobile): Arch Linux desktop
Expected Results
The function loadSoundFont
should load the specified soundfont.
Observed Results
If a soundfont is specified when creating a new instance of alphatab, it will be loaded properly. But when an instance is created without a soundfont and one is loaded later with loadSoundFont
, nothing happens. Setting the player
setting to true
and calling updateSettings
doesn’t change anything either.
Steps to Reproduce (for bugs)
Create a page with the following code:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>alphaTab test app</title>
</head>
<body>
<div id="alphatab"></div>
<script src="alphatab-0.9.5-243.js"></script>
<script src="script.js"></script>
</body>
</html>
(function()
{
const settings = {
// player: 'default.sf2',
layout: 'horizontal',
cursor: true,
logging: 'warning',
};
let alphatab = new alphaTab.platform.javaScript.AlphaTabApi(document.getElementById('alphatab'), settings);
alphatab.addSoundFontLoad(function(e)
{
console.log(`Loading soundfont... (${(e.loaded / e.total) * 100}%)`);
});
alphatab.addReadyForPlayback(function()
{
console.log('Player ready for playback');
alphatab.play();
});
alphatab.tex('1.1 1.2 1.3 1.4');
alphatab.settings.player = true;
alphatab.updateSettings();
alphatab.loadSoundFont('default.sf2');
})();
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Soundfont Not Working - LMMS • Forums
I tried to put Orpheus' Soundfont that is 1,19 GB, but by a unknow reason when i load the sf2 file, nothing happens...
Read more >Can't Load Soundfonts - MuseScore
I try to load sound fonts specifically sf3 files in musescore 3. However, whenever I try uploading a file it doesn't work, I...
Read more >DirectWave problem (I can't open .sf2 soundfont) : r/FL_Studio
DirectWave Player can only load DirectWave presets, a doesnt let you import your own samples. To import soundfonts, you'll need to upgrade ...
Read more >SF2 Files Won't Load in DW | Forum
Whenever I drag a SF2 file into the channel rack, it loads DirectWave but doesn't load the SoundFont. I included a screen capture...
Read more >AUSampler fails to load sound font when r… - Apple Community
I use it quite a lot. When the AUSampler window is open, click on the active name at the top and select Save...
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 FreeTop 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
Top GitHub Comments
With the changes I added following sample with enabling/disabling the player dynamically works. Everything gets properly initialized and destroyed on request.
Jup, true. The reference docs are still quite new and not covering all details in 100% and the example in this case is not really correct.
Thanks for the insight. in such cases it definitly makes sense to dynamically enable-disable the player. I will quickly check, maybe I can still provide it by today.