unofficial famitone 4 is done

Discuss NSF files, FamiTracker, MML tools, or anything else related to NES music.

Moderator: Moderators

User avatar
dougeff
Posts: 3078
Joined: Fri May 08, 2015 7:17 pm

unofficial famitone 4 is done

Post by dougeff »

I had this 99% done for a few months, but was getting a bug with the nesasm3 version. Turns out that copy pasting from asm6 code to nesasm3 is dangerous. Had to do a byte by byte comparison of the output.

This little guy. lda (FT_TEMP_PTR),y
turns into lda FT_TEMP_PTR,y
and needed to be lda [FT_TEMP_PTR],y

Anyway.
Added effects 1xx,2xx,4xx. Vibrato speed is permanently set to 8. Vibrato depth is limited from 0-A. Only 1 fx column per channel. You can do 1xx(2xx) and 4xx on the same note, but the fx must be on different lines in the famitracker file.
(as with my version 3.2, also has volume column and all notes supported)


https://github.com/nesdoug/famitone4.1

(source included)
Let me know if there are any bugs.

(note)
This music engine was used in Flappy Jack (fx really only noticable on the end song ... well you can hear vibrato on the title song too), and an unfinished project that I shelved, and will be used on the upcoming Full Quiet.
Last edited by dougeff on Tue Sep 18, 2018 6:41 am, edited 1 time in total.
nesdoug.com -- blog/tutorial on programming for the NES
User avatar
Banshaku
Posts: 2417
Joined: Tue Jun 24, 2008 8:38 pm
Location: Japan
Contact:

Re: unofficial famitone 4 is done

Post by Banshaku »

I'm getting interested in this version of famitone :)

What I would like to know is, how do I figure out if a song is compatible or not and how do I convert it for this engine? I have some old songs that are not made by me but doesn't work with the current version. I didn't have time yet to analyze which effect are missing but will do once required.

Now that this engine exist, I may be inclined to start checking earlier for research purpose.
User avatar
dougeff
Posts: 3078
Joined: Fri May 08, 2015 7:17 pm

Re: unofficial famitone 4 is done

Post by dougeff »

how do I figure out if a song is compatible or not
From famitracker, do a text export. Then drop that in the same folder as text2vol4.exe. From the command line, type "text2vol4 [filename of text]". It will give an error message, if unsupported fx are used.

Requires a famitracker file. It will not process any other kind (like nsf).
nesdoug.com -- blog/tutorial on programming for the NES
User avatar
FrankenGraphics
Formerly WheelInventor
Posts: 2064
Joined: Thu Apr 14, 2016 2:55 am
Location: Gothenburg, Sweden
Contact:

Re: unofficial famitone 4 is done

Post by FrankenGraphics »

Thanks for doing this, dougeff. :beer: It looks like very useful. Also good to have a broader selection of drivers.
User avatar
dougeff
Posts: 3078
Joined: Fri May 08, 2015 7:17 pm

Re: unofficial famitone 4 is done

Post by dougeff »

I believe there is a bug, possibly in every version of famitone, but I haven't looked.

If you put more than 1 D00 effect in the same frame (you won't be able to see it in famitracker, since the higher D00 will shift everything up, hiding the lower ones), it will calculate the end of the frame wrong. (possibly the lower one overwriting the upper one when text2data parses it).

Sadly, many Bothans died to bring us this information. :(

I don't have the time to work on this issue right now, but I thought you would like a bug warning.


***
I forgot to mention, in any of my documents, that I added a command line switch.
-allin

to prevent it from removing unused instruments. This allows you to process 1 song at a time, and cut and paste them back together later, and the instruments still match.
nesdoug.com -- blog/tutorial on programming for the NES
User avatar
dougeff
Posts: 3078
Joined: Fri May 08, 2015 7:17 pm

Re: unofficial famitone 4 is done

Post by dougeff »

And another bug, if you put a Bxx effect on the same frame, below a D00 effect. In famitracker, you won't see the Bxx (the D00 will hide everything below it), but text2data WILL see the Bxx effect hidden under it, and make that the loop point.

And a 3rd bug, related to the Bxx effect, that I don't understand. (I am getting wrong instrument at the loop point, but only if Bxx effect is there).

I never touched the Dxx or Bxx effects, and I didn't write the source code, so I'm not sure how to fix these.
nesdoug.com -- blog/tutorial on programming for the NES
User avatar
dougeff
Posts: 3078
Joined: Fri May 08, 2015 7:17 pm

Re: unofficial famitone 4 is done

Post by dougeff »

Nevermind the last one. I think I fixed it.

line 1103
if (chn<4) insloop[chn] = ins;

just copies the last instrument from the last pattern and saves it to insert to the loop point. Which is wrong. ie. when we loop back the loop point, we don't want to overwrite the instrument THERE with an instrument at the end of the song.

Now I have it look for the first instrument in pattern at the loop start (pos == song_original.order_loop) && (ch->instrument >= 0), and save that, once, to insloop[chn].

Need to test it some more, and plan to try to fix some more bugs before resubmitting for use.
nesdoug.com -- blog/tutorial on programming for the NES
User avatar
dougeff
Posts: 3078
Joined: Fri May 08, 2015 7:17 pm

Re: unofficial famitone 4 is done

Post by dougeff »

I think I've fixed the "multiple D00" bugs (which, by the way, only triggered if the 2 D00 effects were on different rows on different channels). Need to test more.

I might add a command line switch to ignore unsupported effects, rather than fail to process altogether.

I'm working on a large project with lots of unsupported effects, and every time I'm sent an updated file I have to go line by line in the text export and remove unsupported effects.

It might be faster just to write it into the source code to ignore them.

..

Should I call the switch "-force" or "-ignore"? Or perhaps "Wno" or "Woff"? .. EDIT, went with "-Wno"
nesdoug.com -- blog/tutorial on programming for the NES
User avatar
Sumez
Posts: 919
Joined: Thu Sep 15, 2016 6:29 am
Location: Denmark (PAL)

Re: unofficial famitone 4 is done

Post by Sumez »

Haven't read the thread in details, but I hope it's ok for me to ask these questions - at least to get the info out there (I could research most of it myself)

1. What exactly do the supported effects do?
2. What happened to Famitone 3? Was that also an unofficial release by you?
3. How does performance and storage (of tracks) compare to Famitone 2?
4. Does the converter (text2vol4/text2data?) support converting files that use unsupported effects? It would be really nice to have the option of simply ignoring them, but with a warning that it will be ignored during conversion. It's a feature I really missed in Famitone2.
User avatar
dougeff
Posts: 3078
Joined: Fri May 08, 2015 7:17 pm

Re: unofficial famitone 4 is done

Post by dougeff »

Famitone 3 added volume column and all notes.

Famitone 4 added 1xx,2xx,4xx effects. That's pitch rise, pitch fall, and vibrato.

I just put all the bug fixes and new switches in all 3 versions of famitone. 2,3, and 4, and will post them on github soon.

There is a loss of efficiency. At least 25% bigger files. More if you heavily use the volume column. I estimated the efficiency difference in the usage.txt files.

And, yes. One of the switches tells the program to ignore unsupported effects and process the song anyway.
nesdoug.com -- blog/tutorial on programming for the NES
User avatar
Sumez
Posts: 919
Joined: Thu Sep 15, 2016 6:29 am
Location: Denmark (PAL)

Re: unofficial famitone 4 is done

Post by Sumez »

What can I say, you're a hero.
User avatar
dougeff
Posts: 3078
Joined: Fri May 08, 2015 7:17 pm

Re: unofficial famitone 4 is done

Post by dougeff »

nesdoug.com -- blog/tutorial on programming for the NES
User avatar
Banshaku
Posts: 2417
Joined: Tue Jun 24, 2008 8:38 pm
Location: Japan
Contact:

Re: unofficial famitone 4 is done

Post by Banshaku »

Will be interested in famitone 4 for my real project, that's for sure. Using a combo of famitracker/famitone is memory intensive but for now it's more than enough.

Good work :D
User avatar
dougeff
Posts: 3078
Joined: Fri May 08, 2015 7:17 pm

Re: unofficial famitone 4 is done

Post by dougeff »

Thanks. I'm glad I could make a useful contribution to the nesdev community.
nesdoug.com -- blog/tutorial on programming for the NES
Trirosmos
Posts: 50
Joined: Mon Aug 01, 2016 4:01 am
Location: Brinstar, Zebes
Contact:

Re: unofficial famitone 4 is done

Post by Trirosmos »

Hey!

I was trying to build a simple ROM to test this out. However, the playback doesn't seem to match what I intended.
Specifically, seems like noise arpeggio sequences and volume column sequences on both noise and pulse channels sound kinda weird.

Maybe I'm missing something obvious here, but any help is appreciated :lol:
I am assuming it is possible to use volume envelopes and the volume column at the same time, right?
Attachments
play_song.nes
(64.02 KiB) Downloaded 712 times
Song.ftm
(6.77 KiB) Downloaded 718 times
Post Reply