Closed Thysbelon closed 1 year ago
Good question; before digging into your code, I'll just mention that I did a quick and dirty modification to game-music-emu to output the NES sound in stereo: https://github.com/mmontag/chip-player-js/commit/839b9c27aa994b21e987a11c0ab5c6f9db5a5a67
Simply put: the two 2A03 square channels are hard panned Left and Right.
That should be easy to undo, but if you want to make the stereo/mono switchable at runtime, you would have to do some further modifications.
You could always do a mixdown in Javascript to keep things simple. (Add both NSF channels to both output channels. Or create a mono Audio Node?)
Thank you, that helps a lot!
I admire your project. I wanted to use your code to embed a small "play NSF chiptune" button on my blog. I have successfully compiled your fork of game_music_emu with emscripten,
emcmake cmake ../ -DUSE_GME_AY=0 -DUSE_GME_GBS=0 -DUSE_GME_GYM=0 -DUSE_GME_HES=0 -DUSE_GME_KSS=0 -DUSE_GME_SAP=0 -DUSE_GME_SPC=0 -DUSE_GME_VGM=0 -DENABLE_UBSAN=OFF -DBUILD_SHARED_LIBS=OFF
(After editing your CMakeList to include ym2413, and editing gme.cpp to comment out all emu types except NSF and NSFe) and have written a few c and javascript helper functions. I want to be able to passtrue
orfalse
into my javascript helper function to render the song in stereo or mono. I have no issue playing back NSF music in stereo, but I cannot get it to switch to mono. Thegme_set_effects
function described in gme.h looks like it should play the song in mono if I passNULL
into it, but it has no effect.Here is my c code:
Here is my Javascript:
Thank you.