Famicom-music on VIC-20

Discuss anything related to the VIC
User avatar
beamrider
Vic 20 Scientist
Posts: 1452
Joined: Sun Oct 17, 2010 2:28 pm
Location: UK

Re: Famicom-music on VIC-20

Post by beamrider »

Mario is excellent! much better than my attempt.

How about the Gyruss music?
User avatar
nbla000
Salmon Run
Posts: 2582
Joined: Thu Oct 13, 2005 8:58 am
Location: Italy

Re: Famicom-music on VIC-20

Post by nbla000 »

beamrider wrote: Wed Mar 24, 2021 4:12 pm How about the Gyruss music?
YES! YES! YES! Please !!!
Mega-Cart: the cartridge you plug in once and for all.
User avatar
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

Post by ThePhotoChemist »

Alright! Here's the 1st warp theme from Gyruss. I can't say I've played it myself (or even heard of it before TBH), so you can be the judges on whether its faithful or not. Bust out those ram expansions too, because this dude is a WHOPPING 24kb.

I didn't spend much time trying to match the pattern size, so if anyone is unable to play it, I can try a little harder. I'm betting I could get it down to 10-15K if needed.

https://www.youtube.com/watch?v=19O7pbTVV5g

If anyone is curious about the current workflow for making these things:

Software required: Python 2.7, CBM Studio, FamiStudio, Famitracker (optional).

1. Grab whatever song you're looking to convert, either in NSF or FTM (see note at end), and open it in FamiStudio
a) (Optional) NSF import defaults to a pattern length of 256. You may want to play around with reimporting it a few times with different lengths until you are able to match the music's pattern length. This can be skipped if you're lazy, but will result in larger PRG file sizes later.

2. Hit the "Song Cleanup" button and merge identical patterns.

3. Save as a Famitracker Text export (not FamiStudio Text!!)

4. In CBM Studio, make a new VIC-20 ASM project, and copy the contents of "asmPlayer_template.txt" into a new file.

5. Run the Fami2Vic.py script, with the FamiTracker text export as the only input parameter. This will spit out a bunch of info, and dump the note data into a text file called "program_out" in the same directory

6. Copy the contents of "program_out", and paste it at the end of the open project in CBM Studio, where it says "auto generated script data goes here"

7. Edit the display text in the CBM file if you want. If you want the volume to fade out, set the "fadeouttime" value to about 5 or so columns (In FamiStudio) before you want the song to end. Otherwise, set it to 255 and it'll play until it runs out of data.

8. Compile and run it!

Note: You can open an FTM file and export it as text in either Famitracker or FamiStudio. FTM files already are set with the correct pattern lengths and whatnot. However, FTM files contain a lot of "effects" that I mostly haven't implemented yet in the Fami2Vic script. NSF files, on the other hand, have many of the effects compiled out, things like note slides and arpeggios. If a song has a bunch of these effects, it might be better to export it as an NSF first, and then decompile it in FamiStudio.

Note 2: Most songs will work "out of the box" with the settings already set in the script. The NES Square1 channel is shifted down two octaves (-24), and the Square2 and Triangle channels are shifted down 1 octave (-12). If you have a bunch of low notes on Square1 that end up getting muted, you may want to set SwapS2S3=1 in the Fami2Vic.py script, and swap the two Square1 and Square2 note modifiers. Typically, Square1 and Square2 are assigned to the third (S3) and second (S2) voices respectively in the VIC, and doing this will swap their assignments.
Attachments
gyruss.zip
(4.89 KiB) Downloaded 85 times
User avatar
beamrider
Vic 20 Scientist
Posts: 1452
Joined: Sun Oct 17, 2010 2:28 pm
Location: UK

Re: Famicom-music on VIC-20

Post by beamrider »

Thanks - excellent to hear this on the little Vic.

One slight observation - It does sound a little congested in places though.

Could you perhaps tweak it and make it a little more staccato?
User avatar
nbla000
Salmon Run
Posts: 2582
Joined: Thu Oct 13, 2005 8:58 am
Location: Italy

Re: Famicom-music on VIC-20

Post by nbla000 »

ThePhotoChemist wrote: Fri Mar 26, 2021 5:14 pm If anyone is curious about the current workflow for making these things:

Software required: Python 2.7, CBM Studio, FamiStudio, Famitracker (optional).
Many thanks for your info, talking about Gyruss, I remember the arcade cabinet and this music version seems a little bit different, I don't know if is the same of the NES version or a script/adapting question btw very good work as ever, it's incredible how a music alone it's half of a game, Gyruss without this theme is not Gyruss, you cannot play it mute !
Mega-Cart: the cartridge you plug in once and for all.
User avatar
beamrider
Vic 20 Scientist
Posts: 1452
Joined: Sun Oct 17, 2010 2:28 pm
Location: UK

Re: Famicom-music on VIC-20

Post by beamrider »

Yes, this is the Nes version. I actually prefer it to the arcade( the tune and the game play). Level 2 tune is awesome also...
User avatar
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

Post by Gorf »

ThePhotoChemist wrote: Fri Mar 19, 2021 4:47 pm
Gorf wrote: Fri Mar 19, 2021 7:53 am 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. :D
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
Interesting and you're welcome! I do remember that the version of the song on Kirby's Adventure sounds a little out of tune compared to the GameBoy original for some reason, so that may be inherent in the song's data tbh. I do hear a little bit of wow and flutter-like sound, which is interesting to hear from a digital sound source. Thanks for testing it!

Sadly I haven't gotten time to get out my VIC, and I don't really know when I will. I'll be sure to do it ASAP though. :)
User avatar
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

Post by ThePhotoChemist »

Hey everyone!

I had the music finished for this months ago, but I had a problem with the song loader and sort of lost interest. But I had a bit of free time this week, and figured I should share what I made!

https://www.youtube.com/watch?v=zo6R47MOr8o

Attached is the D64. Run "PLAYALL" to play all the files, or load them individually.

I'll detail my problem with the loader, hopefully it's something obvious that I'm missing! Each song uses a small BASIC program that runs the particular song, and then based on two values, determines the next song to load, and what device to load it from.

Code: Select all

10 SYS4880
20 A=PEEK(828) 
25 B=PEEK(829)
40 if A=3 THEN LOAD "cv3",B,1
50 IF A=4 THEN LOAD "cv4",B,1
60 IF A=5 THEN LOAD "cv5",B,1
70 IF A=6 THEN LOAD "cv6",B,1
80 IF A=7 THEN LOAD "cv7",B,1
90 IF A=8 THEN LOAD "cv8",B,1
100 IF A=9 THEN LOAD "cv9",B,1
110 IF A=10 THEN LOAD "cv10",B,1
A is the current song to load, and B is the device number to load it from. This works for the first couple PRGs, however during the transition from CV4 to CV5 causes the BASIC to load incompletely (screenshot attached). Individually loading CV3, CV4 and CV5 from the prompt seems to allow the BASIC to load all the way, without any corruption or anything. CV4 is notably the largest PRG in the collection, so I assume it's causing issues somehow.

Ultimately with this release, I just kept the IF statements down to a single line, and edited each one to move to just load the next PRG. However, I am curious what the problem was, if anyone has any input!
Attachments
badcv4.PNG
castlevania.zip
(14.69 KiB) Downloaded 68 times
Victim_RLSH
Vic 20 Drifter
Posts: 34
Joined: Thu Jul 15, 2021 10:50 pm
Location: Rapid City, SD
Occupation: Machine Shop Lackey

Re: Famicom-music on VIC-20

Post by Victim_RLSH »

That is epic! Any chance of getting some of the music from Solstice? A vic would probably explode attempting that... :P
Works in Progress: Gravity Ball, a breakout variant in assembly for the unexpanded vic-20
User avatar
Noizer
Vic 20 Devotee
Posts: 297
Joined: Tue May 15, 2018 12:00 pm
Location: Europa

Re: Famicom-music on VIC-20

Post by Noizer »

ThePhotoChemist wrote: Sat Aug 07, 2021 11:01 am ...However, I am curious what the problem was, if anyone has any input!
I guess the loader ran out of memory.
Starting at 4609, with Sys 4880 remains 271 bytes free for basic.
In addition the machine code program must be protected, lowering basic room with, for example
Starting with Run 80
80 Poke 52,maxhighmem and Poke56,maxhighmem : clr:Run
BR
Valid rule today as earlier: 1 Byte = 8 Bits
-._/classes instead of masses\_.-
User avatar
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

Post by ThePhotoChemist »

Victim_RLSH wrote: Sat Aug 07, 2021 11:55 am That is epic! Any chance of getting some of the music from Solstice? A vic would probably explode attempting that... :P
https://www.youtube.com/watch?v=k1A85jN5ca0

Man, I don't know what I was expecting (having not played it), but that title theme absolutely SLAPS. I had to tweak the script a bit to pull in some of the higher notes, but it seems like it worked pretty well. You weren't kidding, this songs really throws a lot of notes at the VIC.

I love the way arpeggios sound like this. People often seem to use them subtly, but with the lack of individual channel volume controls here, you end up getting mercilessly blasted by them.

Noizer wrote: Sat Aug 07, 2021 12:18 pm
ThePhotoChemist wrote: Sat Aug 07, 2021 11:01 am ...However, I am curious what the problem was, if anyone has any input!
I guess the loader ran out of memory.
Starting at 4609, with Sys 4880 remains 271 bytes free for basic.
In addition the machine code program must be protected, lowering basic room with, for example
Starting with Run 80
80 Poke 52,maxhighmem and Poke56,maxhighmem : clr:Run
BR
Thanks a lot! I'll read up a bit more on your suggestions here and see what I can do.
Attachments
solstice.zip
(5.8 KiB) Downloaded 73 times
User avatar
nbla000
Salmon Run
Posts: 2582
Joined: Thu Oct 13, 2005 8:58 am
Location: Italy

Re: Famicom-music on VIC-20

Post by nbla000 »

Noizer wrote: Sat Aug 07, 2021 12:18 pm
ThePhotoChemist wrote: Sat Aug 07, 2021 11:01 am ...However, I am curious what the problem was, if anyone has any input!
I guess the loader ran out of memory.
Starting at 4609, with Sys 4880 remains 271 bytes free for basic.
In addition the machine code program must be protected, lowering basic room with, for example
Starting with Run 80
80 Poke 52,maxhighmem and Poke56,maxhighmem : clr:Run
BR
Yes, to avoid problems better to set these locations, I'm quite sure this is the problem, btw just for fun i've used this solution that lowering the basic loader and does not ask for drive prompt on start (use the $ba/#186 location for that) and use just machine code for songs without basic headers:

Code: Select all

0 IFA>0THENSYS4880
1 A=A+1:B=PEEK(186)
2 IFA=10THENEND
3 LOAD"CV"+STR$(A),B,1
You have to rename songs (without basic header) as "CV 1", "CV 2", "CV 3" etc.
Attachments
castlevania_alt.zip
(15.87 KiB) Downloaded 66 times
Mega-Cart: the cartridge you plug in once and for all.
User avatar
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

Post by ThePhotoChemist »

nbla000 wrote: Tue Aug 10, 2021 3:18 am
Noizer wrote: Sat Aug 07, 2021 12:18 pm
ThePhotoChemist wrote: Sat Aug 07, 2021 11:01 am ...However, I am curious what the problem was, if anyone has any input!
I guess the loader ran out of memory.
Starting at 4609, with Sys 4880 remains 271 bytes free for basic.
In addition the machine code program must be protected, lowering basic room with, for example
Starting with Run 80
80 Poke 52,maxhighmem and Poke56,maxhighmem : clr:Run
BR
Yes, to avoid problems better to set these locations, I'm quite sure this is the problem, btw just for fun i've used this solution that lowering the basic loader and does not ask for drive prompt on start (use the $ba/#186 location for that) and use just machine code for songs without basic headers:

Code: Select all

0 IFA>0THENSYS4880
1 A=A+1:B=PEEK(186)
2 IFA=10THENEND
3 LOAD"CV"+STR$(A),B,1
You have to rename songs (without basic header) as "CV 1", "CV 2", "CV 3" etc.
Thanks for this, it's a lot more elegant than what I originally had. I modified this slightly to use for the Metroid OST, and it seems to work well. I'm still storing the "current song" in a register, to allow for skipping forward/backward functionality. I'd be posting the Metroid OST here too today, however I realized that 828 and 829 get overwritten when you use an SD2IEC. I'll have to recompile them all to use some other registers that won't be affected.

In the meantime, here are two new songs!

"U.N. Owen was her?" from Touhou
https://www.youtube.com/watch?v=h0LL12RjMak

and "Bonetrousel" from Undertale
https://www.youtube.com/watch?v=Lv6qXqlDeBc

Both songs should work fine with an 8K RAM expansion.

I've updated the player with new controls:

F - fast-forward through song
R - rewind one pattern
Q - quit song
N - next song (if it's in a playlist, otherwise it just quits)
B - previous song (if it's in a playlist, otherwise it just quits)
+ - increase the number of loops before the song starts to fade out
- - decrease the number of loops before the song starts to fade out
Attachments
bonetrousel8k.zip
(2.25 KiB) Downloaded 59 times
unowen8k.zip
(2.93 KiB) Downloaded 67 times
User avatar
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

Post by ThePhotoChemist »

Here's a conversion of the Metroid soundtrack!
https://www.youtube.com/watch?v=NoTE4nIPX9c
These songs are very simple and small, and should work fine with an 8K RAM expansion.

In the meantime, I've finally updated the GitHub with a lot of pretty big changes. For one, I actually added command line arguments for the fami2vic script! Now for most situations it can be simply ran as:

python fami2vic.py -i <famitracker_export.txt>

I think this project is getting pretty darn close to an official 1.0 release!
Attachments
METROID.zip
(8.85 KiB) Downloaded 64 times
User avatar
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

Post by ThePhotoChemist »

Hey everyone,

Just a quick check-in. It's not bug-free yet, but I added support for "volume cutoffs" for the 3 square voices and noise voice. This is useful if the song is using a lot of repeated notes via decaying volume, without an actual stop-note in between them. The -V or -NC options will now mute the voice if it goes below a certain volume threshold.

The Pokemon Gold/Silver Title Theme is a great example of this in action, as many repeated notes would blur together into one continuous tone, and the snare-rolls wouldn't be possible at all.

https://www.youtube.com/watch?v=-snAn-k5Xog

I was able to use this feature to help make something like the Gyruss theme more staccato, and less lazy sounding.

For those interested, here's the soundtrack to the Silver Surfer NES game. You'll need a 16k or greater RAM expansion for that one.

https://www.youtube.com/watch?v=C4kIU6TNRyc

And lastly, here's "September" by Earth, Wind & Fire, from a 2a03 arrangement by VinylCheese.

https://www.youtube.com/watch?v=zqOfyK0XRV4

This one's a neat little proof-of-concept because I put in a little custom code to try and help out the main melody a bit from getting drowned out by the arpeggios. Whenever the bass voice is idle, it goes and loads in note values from whatever the melody is currently playing. I'll probably have to use a similar approach if/when I decide to add C64 compatibility, by combining the noise and bass channels into one.
Attachments
pokemontitle.zip
(2.78 KiB) Downloaded 50 times
september.zip
(4.75 KiB) Downloaded 55 times
silversurfer16k.zip
(15.01 KiB) Downloaded 66 times
Post Reply