DMMC music engine for NES + 2 square waves
BotB Academy Bulletins
 
 
70758
A few days ago I made a little demo
of a music engine designed to add 2 square waves to the NES sound without any expansion hardware.

It's sort of a compromise between MMC5 and 5B, you get 2 extra squares but no duty control.
It's basically just 2 VRC6 pulses (no saw).

dmmc_beta.zip
(1.17 MB)

Full source code is included, in case you want to see how it was made, or want to try to modify it.

I know SuperNSF basically already can do what this does (and more), but I wanted something that works easily with FamiTracker, and was lightweight and didn't depend on NSF banking, etc. like SuperNSF does. (Basically I made this as something that I could practically use in a real NES game's title screen.)

Feel free to try it out, and let me know what you think.
 
 
70759
Level 23 Chipist
irrlicht project
 
 
 
post #70759 :: 2016.08.10 2:45pm
Awesome, it's always great to see people getting creative with music drivers!

Had a quick look at the source code. My understanding of 65xx is pretty limited, but I think it's possible to add duty control.

Basically, if I understood correctly, at the moment you're doing the following:

1) clear carry, add divider low-bytes
2) add divider hi-bytes + carry
3) if result >0x80, change volume

It could be modified to something like

3) add result + duty
4) sbc result-result
5) & volume
 
 
70760
Level 25 Chipist
rainwarrior
 
 
 
post #70760 :: 2016.08.10 2:53pm :: edit 2016.08.12 11:21am
  
  SketchMan3 liēkd this
Yes, adding duty to the sample loop itself is trivial, but then you need an extra data stream to feed the duty. Doing that doesn't fit in my timing constraints, and revising the overall timing is tedious (cycle-counted code).

I'm not really receptive to "feature requests" here, basically anything I add is going to take away from something I wanted (highest possible samplerate to reduce aliasing, perfect sample timing with no jitter, etc.)

If you want something feature laden, I do recommend SuperNSF. It's pretty cool.

Full source code is in there, though, feel free to mess with it any way you like!

Edit: so in the end I did add duty.
 
 
70761
Level 25 Chipist
rainwarrior
 
 
 
post #70761 :: 2016.08.10 2:54pm :: edit 2016.08.10 3:01pm
edit: I fail at not dubble post
 
 
70762
Level 23 Chipist
irrlicht project
 
 
 
post #70762 :: 2016.08.10 3:20pm
Aye, thanks for clarifying. I suppose the problem is with loading the data, really. For the mixing loop it'd be fine I think, no or nearly no cycles lost because jumping/branching would no longer be necessary. Hmmm... might have a go at it if I get bored some day, but as I said, my 65xx skills aren't exactly great. Big thanks for sharing the source in any case!
 
 
70781
Level 21 Mixist
FamicomForever
 
 
 
post #70781 :: 2016.08.11 1:12pm
  
  anewuser and TMM12 liēkd this
hold on

does this mean that you can submit these as pure 2a03
cause if so this really changes everything
 
 
70788
Level 25 Chipist
rainwarrior
 
 
 
post #70788 :: 2016.08.11 3:40pm
  
  kinkinkijkin, Modus Ponens, anewuser, Xyz and Doxic liēkd this
Well, I think yes, but SuperNSF is in the exact same boat and has been for years.

If you're the only one using it in an NSF battle though, you'll probably look like a goofball.
 
 
70806
Level 23 Chipist
irrlicht project
 
 
 
post #70806 :: 2016.08.12 1:52am
  
  blockblockblock, kinkinkijkin, anewuser, raphaelgoulart, Xaser, pedipanol, b00daw, JINTAKE, Sinc-X and garvalf liēkd this
I think quite the opposite, these drivers should totally be used in NSF battles! I know there was a long disussion about this back when SuperNSF came out, but: People have created quite a few new drivers around here in recent years (for TIA, SN76489, VIC, to name a few), and that's something I'd definately want to see more of in the future. Writing new music drivers is fun, and should be encouraged. And what's more encouraging than having people actually use these drivers? I think the argument of "no, you can't have extra samples/channels/whatever" stems from some nostalgic sentiment of "this is how I remember the sound of chip xyz, and this is how it should be". There are occasions where this is valid. For example on some demoparties the rule is "Classic chip only, no mods", even though the machines in question a perfectly capable of mod playback. Fair enough. But imo at BotB, one of the things is to get the most out of a chip, and "enhanced" drivers are a perfectly valid way to do so, as their capabilities are completely within spec. And it's not like using these drivers is generally easier than, say, using a platform-specific tracker. If you've ever composed stuff with an IT/XM/MOD converter, you know how much pain in the a*** it can be to get stuff to sound right. Though in this case the argument is void since DMMC does use a platform-specific tracker. Well, aaaanyway /rant
 
 
70815
Level 25 Chipist
rainwarrior
 
 
 
post #70815 :: 2016.08.12 11:18am :: edit 2016.08.12 1:08pm
  
  anewuser, irrlicht project, Sinc-X, Doxic, b00daw, Baron Knoxburry and gotoandplay liēkd this
I figured out an easier way to add the duty data stream (packed it in with volume + lookup table). ;)

So... it's now basically just VRC6 pulses with a bit of aliasing. (No saw. Never the saw.)

Edit: also added MMC5 alternative support, cause it was fairly easy.
 
 
70817
Level 28 Chipist
gotoandplay
 
 
 
post #70817 :: 2016.08.12 11:35am
  
  Doxic, Modus Ponens and Baron Knoxburry liēkd this
you saw nothing
 
 
70824
Level 27 Renderist
b00daw
 
 
 
 
post #70824 :: 2016.08.12 3:31pm :: edit 2016.08.12 3:31pm
  
  anewuser, Sinc-X, mootbooxle and Doxic liēkd this
rainwarrior, you need PCM to PWM digidrums now. ;P
 
 
70858
Level 30 Mixist
mootbooxle
 
 
 
post #70858 :: 2016.08.13 10:01am
  
  anewuser and Sinc-X liēkd this
Amazing amazing amazing!
 
 
70865
Level 27 Chipist
Kulor
 
 
 
post #70865 :: 2016.08.13 11:38am
  
  Sinc-X and Dimeback liēkd this
this is baller
 
 
71005
Level 29 Hostist
puke7
 
 
 
post #71005 :: 2016.08.15 1:24am
  
  Modus Ponens, m9m and FamicomForever liēkd this
bumped because i don't want this thread getting buried by my shit posting aka interacting with the community
 
 
71085
Level 11 Mixist
Chromaryu
 
 
post #71085 :: 2016.08.15 6:17pm
bump. yeah yeah. it'S AMAZING!
 
 
71088
Level 30 Mixist
mootbooxle
 
 
 
post #71088 :: 2016.08.15 7:10pm
I almost thought this said DCMC lol
 
 
71089
Level 22 Chipist
SketchMan3
 
 
 
post #71089 :: 2016.08.15 7:14pm :: edit 2016.08.15 7:15pm
  
  anewuser, mootbooxle and null1024 liēkd this
This is so cool, haha!

RIP the saw, tho ;-;

Now if only there was a way to add this engine to the MMC5 and VRC6 for even MORE polyphony...
 
 
71132
Level 30 Chipist
Savestate
 
 
 
post #71132 :: 2016.08.16 8:02pm
  
  pedipanol, b00daw and ViLXDRYAD liēkd this
  
  HertzDevil hæitd this
hertzdevil if u could implement this ....
 
 
71139
Level 19 Chipist
Moose
 
 
 
post #71139 :: 2016.08.17 8:40am
This is cool, but I am a little put off by the fact it takes up too much power for any sort of gameplay to exist. Just me talking, though. Keep up the good work!
 
 
71141
Level 23 Pedagogist
ViLXDRYAD
 
 
 
post #71141 :: 2016.08.17 10:26am
  
  HertzDevil hæitd this
i second what Savestate said, this on his 0CC Famitracker would be a revolutionary feature; not just for being the only tracker who support this BUT also the only tracker where you can make entries for a eventual new botb's ohb format
 
 
71154
Level 27 Renderist
b00daw
 
 
 
 
post #71154 :: 2016.08.17 6:12pm
  
  anewuser liēkd this
What would be neat is the same exact code mirrored over to MMC5 PCM writes with delay (and/or) detune. ;)
 
 
71168
Level 25 Chipist
rainwarrior
 
 
 
post #71168 :: 2016.08.18 12:50am :: edit 2016.08.18 12:51am
  
  anewuser liēkd this
Well, if you wanted to have 8k WRAM you could implement a delay no problem; you don't really need MMC5 PCM you could just add it to the 2A03 PCM for about the same cost.

It'd be equivalent to adding a third channel to the mixing code, though. Probably would drop the samperate to about 11 kHz? I dunno at what point you find the aliasing an unpleasant tradeoff.
 
 
71184
Level 25 Chipist
HertzDevil
 
 
 
post #71184 :: 2016.08.18 7:08pm :: edit 2016.08.18 7:22pm
If you need to use the DPCM channel as an actual synthesizer there is already OFGS
.

It uses IRQ tricks and will only play on VirtuaNSF or NES emulators, so for the purpose of this site they might be rejected because the recommended player does not support them, but on the other hand some people upload MP3 renders for NSF entries anyway.
 
 
71185
Level 25 Chipist
rainwarrior
 
 
 
post #71185 :: 2016.08.18 8:06pm :: edit 2016.08.18 8:09pm
There's many things that do it. I mentioned SuperNSF, OFGS is new to me, there's blargg's DPCM saw
thing as well, and some others if you wanna dig around.

I'm just sharing my thing, that I made for my own purposes (I've got plans), in case anybody finds it interesting.
 
 
74771
Level 27 Renderist
b00daw
 
 
 
 
post #74771 :: 2016.12.06 3:48pm
  
  Modus Ponens liēkd this
Plan on mirroring this tool onto your rainwarrior.ca ? Google already tends to forget it. Not scrobbled enough?
 
 
74795
Level 25 Chipist
rainwarrior
 
 
 
post #74795 :: 2016.12.07 2:30pm :: edit 2016.12.09 3:21pm
Eventually, maybe. I still consider it a beta test for now.

Edit: okay fine I moved the beta to my website.
 
 

LOGIN or REGISTER to add your own comments!