Famicom-music on VIC-20
Famicom-music on VIC-20
Just found this on Reddit r/vic20 and it was too good not to crosspost here:
https://www.reddit.com/r/vic20/comments ... mitracker/
https://www.reddit.com/r/vic20/comments ... converted/
This Megaman 2-music sure is catchy. Sounds better in NTSC I think.
https://www.reddit.com/r/vic20/comments ... mitracker/
https://www.reddit.com/r/vic20/comments ... converted/
This Megaman 2-music sure is catchy. Sounds better in NTSC I think.
Re: Famicom-music on VIC-20
very promising and loud !
Valid rule today as earlier: 1 Byte = 8 Bits
-._/classes instead of masses\_.-
-._/classes instead of masses\_.-
- ThePhotoChemist
- Vic 20 Newbie
- Posts: 14
- Joined: Sat Mar 13, 2021 9:11 am
- Website: http://www.jonhilty.com
- Location: Grand Rapids, MI
Re: Famicom-music on VIC-20
Hey everyone! I'm glad you like the project so far. I was lucky enough to snag a VIC-20 off of Craigslist last year for dirt cheap, and I've really enjoyed learning about and working with Commodore computers. This started as an afternoon side-project while I work on a machine to laser cut music box punch tape, and I ended up going down a huge rabbit hole, and learning assembly along the way!
The github for the python script I'm writing to convert Famitracker .txt exports to VIC PRGs can be found here:
https://github.com/ThePhotoChemist/Fami2Vic
Big warning, it's very much a WIP project and isn't really intuitive to use yet...
I've recompiled the Ecstasy of Gold PRG for PAL and NTSC systems, as well as another song I've been working on. I didn't recompile the Megaman 2 song yet, since I seem to have created a bug where it plays a bunch of extra notes now for whatever reason, and I don't have time to hunt it down today
Both files still need an 8K (or higher) expansion. My original goal was to try and shoot for being able to run on unexpanded systems, but some of these songs seem to simply have too many notes, and I'm out of ideas on how to reduce size further.
Here's the video of the new PRG, the "Death Egg Robo" theme from Sonic 2.
https://www.youtube.com/watch?v=LZuVxmvGZtY
Ultimately I would like to start converting entire soundtracks to games and releasing them as D64s, probably starting with Castlevania. Most vanilla NES songs I've thrown at it so far sound pretty good. Newer arrangements using expansion chips are a lot more challenging, but I have some ideas on how to implement support.
I have one quick question, for whoever might be able to answer... What can I look at in memory to determine whether the system is PAL or NTSC? I had a cursory glance yesterday, but I wasn't able to find too much. Once I figure that out, it should be really simple to have a PRG that can support both systems.
The github for the python script I'm writing to convert Famitracker .txt exports to VIC PRGs can be found here:
https://github.com/ThePhotoChemist/Fami2Vic
Big warning, it's very much a WIP project and isn't really intuitive to use yet...
I've recompiled the Ecstasy of Gold PRG for PAL and NTSC systems, as well as another song I've been working on. I didn't recompile the Megaman 2 song yet, since I seem to have created a bug where it plays a bunch of extra notes now for whatever reason, and I don't have time to hunt it down today

Both files still need an 8K (or higher) expansion. My original goal was to try and shoot for being able to run on unexpanded systems, but some of these songs seem to simply have too many notes, and I'm out of ideas on how to reduce size further.
Here's the video of the new PRG, the "Death Egg Robo" theme from Sonic 2.
https://www.youtube.com/watch?v=LZuVxmvGZtY
Ultimately I would like to start converting entire soundtracks to games and releasing them as D64s, probably starting with Castlevania. Most vanilla NES songs I've thrown at it so far sound pretty good. Newer arrangements using expansion chips are a lot more challenging, but I have some ideas on how to implement support.
I have one quick question, for whoever might be able to answer... What can I look at in memory to determine whether the system is PAL or NTSC? I had a cursory glance yesterday, but I wasn't able to find too much. Once I figure that out, it should be really simple to have a PRG that can support both systems.
- Attachments
-
- Gold.zip
- (5.24 KiB) Downloaded 230 times
-
- DeathEgg.zip
- (3.87 KiB) Downloaded 223 times
Re: Famicom-music on VIC-20
Welcome to Denial!ThePhotoChemist wrote: ↑Sun Mar 14, 2021 11:36 amI have one quick question, for whoever might be able to answer... What can I look at in memory to determine whether the system is PAL or NTSC? I had a cursory glance yesterday, but I wasn't able to find too much. Once I figure that out, it should be really simple to have a PRG that can support both systems.
That would be address 60900 ($ede4) in KERNAL-ROM. This will contain 12 on PAL and 5 on NTSC. This is the setup-table for the VIC-chip for register $9000 and on NTSC this is 5 since it has less cycles per rasterline than PAL.
Re: Famicom-music on VIC-20
Impressive! 

Re: Famicom-music on VIC-20
Just to point out, for PAL the value 12 is decimal ($0C hexadecimal)
Mega-Cart: the cartridge you plug in once and for all.
- ThePhotoChemist
- Vic 20 Newbie
- Posts: 14
- Joined: Sat Mar 13, 2021 9:11 am
- Website: http://www.jonhilty.com
- Location: Grand Rapids, MI
Re: Famicom-music on VIC-20
Thanks! This did the trick. I haven't had time to clean up the rest of the code on the Wily PRG just yet, but now the PRG will autodetect the system and pull the tone values from a different table, depending on whether it's NTSC and PAL. It'll load a different tempo too. That should have my bases covered now, I think!tokra wrote: ↑Sun Mar 14, 2021 11:48 amWelcome to Denial!ThePhotoChemist wrote: ↑Sun Mar 14, 2021 11:36 amI have one quick question, for whoever might be able to answer... What can I look at in memory to determine whether the system is PAL or NTSC? I had a cursory glance yesterday, but I wasn't able to find too much. Once I figure that out, it should be really simple to have a PRG that can support both systems.
That would be address 60900 ($ede4) in KERNAL-ROM. This will contain 12 on PAL and 5 on NTSC. This is the setup-table for the VIC-chip for register $9000 and on NTSC this is 5 since it has less cycles per rasterline than PAL.
Much appreciated! Luckily, my brain still defaults to decimal instead of hex, so this wasn't a problem

Re: Famicom-music on VIC-20
Very Impressive. Not used to hearing such polished tunes on the Vic.
btw, I see they have a new 'tracker' in the pipline over on the TRSE project that outputs Vic-20 code amongst others. Maybe worth considering a version of your script to output into that format for use in games and demos etc.
btw, I see they have a new 'tracker' in the pipline over on the TRSE project that outputs Vic-20 code amongst others. Maybe worth considering a version of your script to output into that format for use in games and demos etc.
- ThePhotoChemist
- Vic 20 Newbie
- Posts: 14
- Joined: Sat Mar 13, 2021 9:11 am
- Website: http://www.jonhilty.com
- Location: Grand Rapids, MI
Re: Famicom-music on VIC-20
Interesting! I'll check it out and see what I can do.beamrider wrote: ↑Wed Mar 17, 2021 10:46 am Very Impressive. Not used to hearing such polished tunes on the Vic.
btw, I see they have a new 'tracker' in the pipline over on the TRSE project that outputs Vic-20 code amongst others. Maybe worth considering a version of your script to output into that format for use in games and demos etc.
Here's an updated version of Wily's Castle from Megaman, which should now be compatible with both NTSC and PAL systems.
- Attachments
-
- WilysCastle.zip
- (2.32 KiB) Downloaded 323 times
- Gorf
- Vic 20 Dabbler
- Posts: 92
- Joined: Tue Feb 09, 2016 6:55 pm
- Website: http://home.macintosh.garden/~europa/
- Location: United States
- Occupation: Eccentric Musician
Re: Famicom-music on VIC-20
This is epic! Will be fun to play around with this when I get time. I'm a particular fan of Kirby's Adventure and Gradius, so I'll be excited to see how they sound on the VIC. 

She/Her
SoundCloud: https://soundcloud.com/user-385492180
YouTube: https://www.youtube.com/channel/UC3uSQ5 ... AJkFHzReqw
SoundCloud: https://soundcloud.com/user-385492180
YouTube: https://www.youtube.com/channel/UC3uSQ5 ... AJkFHzReqw
- ThePhotoChemist
- Vic 20 Newbie
- Posts: 14
- Joined: Sat Mar 13, 2021 9:11 am
- Website: http://www.jonhilty.com
- Location: Grand Rapids, MI
Re: Famicom-music on VIC-20
Thanks!
Just for fun I ran the only song I recognized from that game through the script. It's kinda... shrill. This one is weird, since it actually uses the triangle voice as a part of the melody, whereas most of these songs use it for the bassline. There are offsets in the script to shift the output data up/down octaves, but pushing it much lower made it sound kind of weird, just a bit too low.
Right now you sort of have to play around with those offsets, and shift things around until things sound right. Each channel is limited to about six octaves (B0 - B5), but you can kind of manually get around that sometimes for a larger range, since each of the VIC's square wave oscillators are also offset by one octave from each other. Ideally, the patterns with higher notes from the triangle channel (S1 in the VIC) could be manually swapped with Square1 or Square2 in Famitracker or Famistudio first for a better sound.
https://www.youtube.com/watch?v=fCY0WBFvTsA
Also for some reason any time I even think about updating the code, the noise track breaks ¯\_(ツ)_/¯ Oh well
Re: Famicom-music on VIC-20
wow, talking about classic famicon titles and musics... what about mb and smb saga?
Mega-Cart: the cartridge you plug in once and for all.
- ThePhotoChemist
- Vic 20 Newbie
- Posts: 14
- Joined: Sat Mar 13, 2021 9:11 am
- Website: http://www.jonhilty.com
- Location: Grand Rapids, MI
Re: Famicom-music on VIC-20
Here's some Mario for you!
https://www.youtube.com/watch?v=hObMuc5bbKw
https://www.youtube.com/watch?v=Z8REr1Z4uIE
Also, here's another one I thought was really neat. Moonlight Sonata Mvt. 3, arranged by Chips n' Cellos.
https://www.youtube.com/watch?v=OEYOvSHw5oA
I made some improvements to the script. Since the VIC's oscillators are offset each by an octave, you also have to apply an offset to the Famitracker data to get them all in line with each other. Before, if the tone array underflowed (e.g. the offset was too much and it tried to select a negative element), the script would exit with a warning. Now, it just mutes any notes outside of the range. This makes more complex songs that use a large range like the Moonlight Sonata possible. Some of the very low notes get cut off, but it's hard to notice unless you're really listening for it.
Repeated notes tend to blur together sometimes. This is because some of these NES songs didn't actually use a "stop note", but instead would lower and raise the volume. This is especially apparent in the Mario Athletic theme. I'm thinking, if the script detects a big jump up in volume, it might add a pause for a few frames, just to separate the notes a bit.
I'd say my work on the Castlevania soundtrack is about 75% done now!
- Attachments
-
- Mario1.zip
- (1.96 KiB) Downloaded 222 times
-
- MOON3.zip
- (3.53 KiB) Downloaded 290 times
-
- ATHLETIC.zip
- (1.96 KiB) Downloaded 276 times
Re: Famicom-music on VIC-20
Many thanks, I've just tested your music on my real PAL Vic-20, Mario is Fantastic, I've also compared it with the nes version and is really impressive, very good job!
Mega-Cart: the cartridge you plug in once and for all.