Build and API optimizations | problems with FADPCM

Hi everybody.

Would you have some advice on the optimization on a particular little project I just did? http://chiptunegenerator.com/
I would like it to turn the best possible, even on mobile phones. The priority here doesn’t seem to be RAM (the bank is a few Mo in PCM) nor real-time execution, it rather seems to be CPU load (almost every 16-th notes is randomized among a pool in a multi-instrument, for each “instrument”, which is pretty heavy).
What seems to be an OK setting is :

  • build stereo PCM decompressed 24 kHz
  • 4 buffers of 4096 samples
  • mixer sample rate matches system sample rate (but I don’t fully understand if it has consequences if it’s different than the sample rate of the build settings)
  • update application should be below 100ms to work correctly (which seems to by inline with 16th notes)
  • I also reencoded my assets in 16-bit (there were in 32-bit float initially), it doesn’t seem to have changed anything though

Did I miss a setting that could enhance performance on low devices? At the moment, it’s OK on my phone, but the first bar is always choppy. Interestingly, after a stop, the next play is fine. I tried to let a few seconds before the first note in the event, it doesn’t change anything to it, the event doesn’t “pre-load” very well.

Moreover, I also tried to build in FADPCM, but it seems buggy! The pitch is lowered by something like a quarter-tone, and the timings seem to be shifted accordingly (there’s a “rush” at the end of each bar, before each jump). The problem occurs in local with a web server, or online, on my PC and on my phone.

Edit : I found that using the WASM build was a life changer. It now works very well on my mobile phone, event the first seconds.

WASM is definitely significantly faster, did you just use tthe fmod asm.js build previous ‘as is’? (or was the js generated from our .bc using the method described in the docs).

It always depends on how many voices are playing and if there are effects (I can hear reverb), a heavy fmod studio project will take some toll in HTML5, especially with asm.js.

Previously, I was using default files included in the exemples folder (which seems to be fastcomp/asm.js). Now I use upstream/wasm. I haven’t build the files myself, I think it’s beyond my skills. Do you think I would benefit from doing that?

You haven’t answered, concerning FADPCM issues.