Possible NSF plugin?

This forum is currently in read-only mode.
From the Asset Store
The I18N (Translation) is a Construct plugin created to translate text in game.
  • I'm a big retrophile (clearly, as the maker of IWBTG and IWBTG:G) who is currently making a game that's trying to have a lot of NES authenticity, down to having my music guy make music in the authentic NSF format. The idea was to take these, export them and then loop them somehow, but the thought arose... that it'd be kinda awesome to just put the NSF in there and play everything authentically. No trying to find perfect loop spots or change it every time a song is updated or converting stuff or whatever while saving a ton on file size. Now, this probably sounds really stupid, partially because it is, but such stupidity has never stopped people who are serious about this kinda stuff.

    So I went looking around and found this, a set of libraries for various video game formats rolled into one. Now, I'm not a "real" programmer, but I'm not above hacking away at the sourcecode of things I barely understand to try and make things I want, so I just wanna do a few things.

    Ask if anyone who's made plugins is interested in taking a swing at this (I'm not the only one interested it!). It seems relatively straight forward (maybe!) and someone experienced might be able to whip together something that would take me weeks of misery to try and kick together.


    Ask that if anyone has any advice when it comes to dealing with audio stuff in Construct. I know R0j0 made Audiere (which is awesome, BTW!) and has some experience with that end of things. If I take a stab at this, I'll be going in really blind

    I also might be seeeeverely underestimating the potential complexity of what I'm doing. It seems to me that I could, theoretically, after trying to figure out what everything does, plug the things in the example player sourcecode into a construct plugin and hope that it works and that I can get something barebones but workable (One thing playing at a time, track select, play, pause and maybe volume). I might be totally out of my league though.

    Any thoughts are appreciated. Now Imma go stare at source code and try and figure out what I'm doing.

  • It would be a tad time consuming making a plugin for this, the library converts the nsf to a wav stream which in turn needs some sound library to play.

    I found this dll that is simpler to get working with python.


    It has "play track"(or subsong in the example)

    and "stop". It doesn't have pause or volume but perhaps it may still be useful.

    The cap with needed files:


  • The Python route seems fascinating and less hair pulling. I haven't messed with Construct's python stuff. Is there any big "gotchas" I should be concerned about? Problems that Python stuff might risk introducing?

    Edit: Checked out the cap. This is awesome. It even plays VRC6 tracks as well (which would be required for my purposes). This is good enough that I might use it as is (Pause and volume would be nice but frankly, I'll live if I have to). But more importantly, this whole setup with the python scripts seems very very workable. I might look for other DLLs and other options to get a few more features, but this is loooovely. Thanks for making my life less hairpulling.

  • In the case of this example, no. You just need to include the py directory with your exported project along with python26.dll and nsf_player.dll otherwise it won't work.


    Glad it was useful.

  • ffff I tried plugging this stuff into my project and I get two python errors...

    File "<string>", line 13344



    SyntaxError:invalid syntax


    Trackeback (most recent call last):

    File "<string>", line 1, in <module>

    NameError: name 'System' is not defined

    It's a big project so it's kinda hard to break the project down and figure out what's causing it. =/

    Any advice would but lovely but at this point I might just have to accept the reasonable solution of converting things into OGGs so don't beat your self up. :P

  • The first error is from object names that start with a digit, which is an error in python. You can fix it by making sure all object names start with a letter. The second error is a cascade from the first.

    Also I fixed a small flaw in the example where it would crash if using a larger nsf file. The loaded file was being freed before the player was done using it. I updated the first link.

  • I read that in another thread and looked for one and couldn't find it, making me assume it was something else. So, I just looked again.

    It was "1up".

    :| durrrrrrrrrrrrrrrrrrrrrrrrr no wonder the class name seemed weird. I feel so dumb now, thanks!

  • impressive work r0j0!

    i'm amazed how little effort that took you, hahaha

    i'm not any good with python, but i saw there was also a SPC dll (which i immediately downloaded) that i'm guessing could also be implemented by a similar method?

    i'll try to keep in mind the python bug when naming objects XD

    btw, could these stuff be integrated into audiere by any chance?

  • No Hyphens either! Pain for me, because I have one in a family and can't figure out how to change family names!

    GME in Audiere would rule, since it supports like, every retro format ever.

  • Here is a utility to remove the hyphens from the family names:


    To use:

    1. Put your cap in the same folder as the utility cap.

    2. Change FileToLoad to reference your cap in the script.

    3. Run the cap and it should create fixed.cap which should be the same as your cap except the hyphens in the family names will now be underscores.


    The use of the spc_player.dll is identical, just load it instead of nsf_player.dll.

    I'm sure it's possible to integrate gme into audiere, but I'd have to investigate it further.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • R0J0, I'm always amazed by the stuff you just pull out of nowhere... are you a wizard?

  • he is one who delves into code sorcery, either that or a jedi

    how about underscores instead of hyphens? can those be used without issue?

    i usually tend to go with underscores altogether

  • "I don't always make awesome stuff, but when I do my name is R0J0."

    Tearin' it up as always, and hi Kayin, haven't seen you around in awhile. How's your project fairing?


  • Project is fairing quite well, though a tad slowly! IWBTG:Gaiden seemed to go over pretty well as a Construct game too. And yeah, I've been "around", but mostly just lurking lately as Construct 1 development has slowed down and C2 is a little bit out of my area of interest.

    Though now I'm kinda active again because I'm trying to make a push to get some little edge cases I'm bumping into out of the way. Nothing that will stop me, but obnoxious little problems regardless. Thanks for the interest, Soldjah, it's good to see you agian.

  • I'd be more interested in an NSFW plugin...

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)