Problems with Famitone
Moderator: Moderators
-
andreasswf
- Posts: 17
- Joined: Thu Dec 03, 2015 3:44 am
- Location: Sweden
Problems with Famitone
Hi there! This is my first post in this forum. I have just started trying to learn to program in assembly and I would like to add a simple background music into my game.
I have composed a song in famitracker and exported it as a .txt. On the readme file of famitone it says to run text2data.exe and it would create a .asm of my music.
When I try to launch text2data.exe a cmd window pops up and dissapears in the blink of an eye and no files are created. What am I doing wrong?
I just want to add code to my project to make my short music play and loop constantly. Simple as that.
Please help me!
I have composed a song in famitracker and exported it as a .txt. On the readme file of famitone it says to run text2data.exe and it would create a .asm of my music.
When I try to launch text2data.exe a cmd window pops up and dissapears in the blink of an eye and no files are created. What am I doing wrong?
I just want to add code to my project to make my short music play and loop constantly. Simple as that.
Please help me!
- Attachments
-
- source.zip
- (166.31 KiB) Downloaded 125 times
Re: Problems with Famitone
More than likely you aren't providing any file names on the command line.andreasswf wrote:When I try to launch text2data.exe a cmd window pops up and dissapears in the blink of an eye and no files are created. What am I doing wrong?
How do I shot Command Prompt?
- GradualGames
- Posts: 1106
- Joined: Sun Nov 09, 2008 9:18 pm
- Location: Pennsylvania, USA
- Contact:
Re: Problems with Famitone
It's good advice to learn how to use the commandline, but for simple tools that require only a single file name as an argument, you might be able to drag your txt file to the exe. Depending on the utility, it'll drop your asm file either in the directory of the file you converted, or in the directory of the exe itself. (those are two common cases anyway)
-
andreasswf
- Posts: 17
- Joined: Thu Dec 03, 2015 3:44 am
- Location: Sweden
Re: Problems with Famitone
I cant write anything on the command line because cmd shuts down as I open it. I've tried draggin the .txt onto text2data.exe but that doesnt do jack :/
Re: Problems with Famitone
You mean that if you open an actual command prompt window, it closes automatically?
i.e. start, run, cmd, enter either doesn't give you a window, or it just closes immediately once it has opened? (Note that these instructions are not the same as double clicking an exe.) That's... potentially a larger a problem. But context (the fact that you've used NESASM to build a rom) suggests nothing should prevent you from using text2data. In fact double clicking NESASM3 will have the exact same result as double clicking text2data. That's why you have background.bat created.
You could try making a .bat for text2data. As a test, create a new .txt file in the same folder as text2data.exe. In the txt file, type
and save it as "test.bat".
Double click it. What happens?
Edit: More things. Is there any reason you're using famitone and not famitone2? You can get famitone2 from here if there's not a specific reason you're using regular famitone. I was only able to get famitone's text2data to work (using a different song) with an old version of famitracker (0.3.6), and your file cannot be opened with it as it was created in a newer version of famitracker. The .txt output format seems to have changed, and the plugin gives unhandled exceptions when used with the latest famitracker on my computer.
Regardless of that, you're using the effects column when you shouldn't be. That is that your V62 and V01 effects on the first row, and all similar things throughout the song aren't in the famitone standard. After removing all of those effect and reexporting the text I was able to successfully get a music.asm file from it using famitone2's text2data. You can even click and drag, but that only works if there's no errors. Learning command prompt or using a .bat allows you to see the errors so you can fix them. For instance, when you give your music.txt to famitone2's exporter, it says this:
Edit2: Obviously removing all the effects greatly changes how the song sounds. The idea with famitone(2) is to use the instruments and not the effects columns. For instance, your instrument 00 could have the Duty/Noise box checked, with a sequence that sets Duty to one. Then V01 in your Pulse 1 column could be removed. But this will also affect your noise channel, since that also uses instrument 00, so you need to make a new instrument without this change and set your noise channel notes to this instrument. Your vibratos will need to be recreated with pitch envelopes, etc.
i.e. start, run, cmd, enter either doesn't give you a window, or it just closes immediately once it has opened? (Note that these instructions are not the same as double clicking an exe.) That's... potentially a larger a problem. But context (the fact that you've used NESASM to build a rom) suggests nothing should prevent you from using text2data. In fact double clicking NESASM3 will have the exact same result as double clicking text2data. That's why you have background.bat created.
You could try making a .bat for text2data. As a test, create a new .txt file in the same folder as text2data.exe. In the txt file, type
Code: Select all
text2data
PAUSEDouble click it. What happens?
Edit: More things. Is there any reason you're using famitone and not famitone2? You can get famitone2 from here if there's not a specific reason you're using regular famitone. I was only able to get famitone's text2data to work (using a different song) with an old version of famitracker (0.3.6), and your file cannot be opened with it as it was created in a newer version of famitracker. The .txt output format seems to have changed, and the plugin gives unhandled exceptions when used with the latest famitracker on my computer.
Regardless of that, you're using the effects column when you shouldn't be. That is that your V62 and V01 effects on the first row, and all similar things throughout the song aren't in the famitone standard. After removing all of those effect and reexporting the text I was able to successfully get a music.asm file from it using famitone2's text2data. You can even click and drag, but that only works if there's no errors. Learning command prompt or using a .bat allows you to see the errors so you can fix them. For instance, when you give your music.txt to famitone2's exporter, it says this:
Code: Select all
Output format: NESASM, all songs in single file
Input format: FamiTracker export
4Parsing error (song:01 pos:00 row:00 chn 0): Unsupported effect-
andreasswf
- Posts: 17
- Joined: Thu Dec 03, 2015 3:44 am
- Location: Sweden
Re: Problems with Famitone
Okay, so I should download an older version of famitracker and a newer version of famitone? And remove all my effects on my song? Too bad effects can't be used on famitone... Will make a pretty dull song when I choose to load one of my more complex songs...
Re: Problems with Famitone
Famitone2 's text2data converter should work with the 2 most current versions of famitracker...as long as you remove unsupported effects. (I think the 'older version' was specific to Famitone 1).
I think you can simulate a volume column by writing additional volume envelopes that peak at 8 or 4 (for example) rather than f. Maybe.
What effects do you need? (just curious because we have been talking about music code lately).
I think you can simulate a volume column by writing additional volume envelopes that peak at 8 or 4 (for example) rather than f. Maybe.
What effects do you need? (just curious because we have been talking about music code lately).
nesdoug.com -- blog/tutorial on programming for the NES
-
andreasswf
- Posts: 17
- Joined: Thu Dec 03, 2015 3:44 am
- Location: Sweden
Re: Problems with Famitone
I would like to say thank you for the tip in creating a bat file with a simple command, which made me understand that in the readme file of famitone2 where it says (text2data music.txt) it means that i should type that in a.txt and save it as a .bat.Kasumi wrote:You mean that if you open an actual command prompt window, it closes automatically?
i.e. start, run, cmd, enter either doesn't give you a window, or it just closes immediately once it has opened? (Note that these instructions are not the same as double clicking an exe.) That's... potentially a larger a problem. But context (the fact that you've used NESASM to build a rom) suggests nothing should prevent you from using text2data. In fact double clicking NESASM3 will have the exact same result as double clicking text2data. That's why you have background.bat created.
You could try making a .bat for text2data. As a test, create a new .txt file in the same folder as text2data.exe. In the txt file, type
and save it as "test.bat".Code: Select all
text2data PAUSE
Double click it. What happens?
Edit: More things. Is there any reason you're using famitone and not famitone2? You can get famitone2 from here if there's not a specific reason you're using regular famitone. I was only able to get famitone's text2data to work (using a different song) with an old version of famitracker (0.3.6), and your file cannot be opened with it as it was created in a newer version of famitracker. The .txt output format seems to have changed, and the plugin gives unhandled exceptions when used with the latest famitracker on my computer.
Regardless of that, you're using the effects column when you shouldn't be. That is that your V62 and V01 effects on the first row, and all similar things throughout the song aren't in the famitone standard. After removing all of those effect and reexporting the text I was able to successfully get a music.asm file from it using famitone2's text2data. You can even click and drag, but that only works if there's no errors. Learning command prompt or using a .bat allows you to see the errors so you can fix them. For instance, when you give your music.txt to famitone2's exporter, it says this:Edit2: Obviously removing all the effects greatly changes how the song sounds. The idea with famitone(2) is to use the instruments and not the effects columns. For instance, your instrument 00 could have the Duty/Noise box checked, with a sequence that sets Duty to one. Then V01 in your Pulse 1 column could be removed. But this will also affect your noise channel, since that also uses instrument 00, so you need to make a new instrument without this change and set your noise channel notes to this instrument. Your vibratos will need to be recreated with pitch envelopes, etc.Code: Select all
Output format: NESASM, all songs in single file Input format: FamiTracker export 4Parsing error (song:01 pos:00 row:00 chn 0): Unsupported effect
I now have a music.asm with my music code in it! Now I'm going to work out how to make it into my background.asm (my game code) and make the music load and play in the rom!
Dougeff, well 4xx makes vibrato, which is nice, and sometimes i use the 0xx for some nice chords to accompany melody
Re: Problems with Famitone
Edit: no arp effects
Last edited by dougeff on Fri Dec 04, 2015 4:12 pm, edited 1 time in total.
nesdoug.com -- blog/tutorial on programming for the NES
-
andreasswf
- Posts: 17
- Joined: Thu Dec 03, 2015 3:44 am
- Location: Sweden
Re: Problems with Famitone
Okay, cool =) Now I'm just going to figure out how to get this into my main code/ my main .asm which is background.asm. It says in the readme to include music.asm and famitone.asm. When i type .include "music.asm" i get no problems, but when i also do .include "famitone.asm" it shows up compile errors UNDEFINED SYMBOL IN OPERAND FIELD :/
- Attachments
-
- source.zip
- (200.41 KiB) Downloaded 97 times
Re: Problems with Famitone
Actually, I misread the readme....
Arpeggio sequences are supported.
Arpeggio effects are not. (0xx won't work).
Arpeggio sequences are supported.
Arpeggio effects are not. (0xx won't work).
nesdoug.com -- blog/tutorial on programming for the NES
Re: Problems with Famitone
Yeah, you have to 'uncomment' some of the variable definitions to get it to work. Let me see if I have a working file to show you...UNDEFINED SYMBOL IN OPERAND FIELD
nesdoug.com -- blog/tutorial on programming for the NES
Re: Problems with Famitone
OK, I only spent a few minutes on this, (and I use asm6), but this is essentially how you get the music to work.
uncomment all the variables at the top of famitone2.asm...(remove the semicolons), like this...
Then at the startup code insert this...
Sorry (edit) you're using NESASM, it should look like this...
Somewhere below the code include your song data with the label "Song:".
And somewhere in the infinite loop, to be done once per v-blank (perhaps in the NMI code, since your code goes like this Forever: JMP Forever...do this...
Hope that helps.
Also, I got a pitch sequence to work like a vibrato...
5 3 0 -3 -5 -5 -3 0 3 5 5 3 0 -3 -5 -5 -3 0 3 5 5 3 0 -3 -5 -5 -3 0 3 5 5 3 0 -3 -5 -5 -3 0 3 5 5 3 0 -3 -5 -5 -3 0 3 5
It could use some adjustment to make it sound a little better.
uncomment all the variables at the top of famitone2.asm...(remove the semicolons), like this...
Code: Select all
FT_BASE_ADR = $0300
FT_TEMP = $00
FT_DPCM_OFF = $c000
FT_SFX_STREAMS = 4
FT_DPCM_ENABLE = 0 ;if no samples
FT_SFX_ENABLE = 0 ;if no sfx
FT_THREAD = 1
FT_PAL_SUPPORT = 1
FT_NTSC_SUPPORT = 1Then at the startup code insert this...
Code: Select all
lda #1 ;not 0 for NTSC
ldx #<Song ;low
ldy #>Song ;high
jsr FamiToneInit
lda #0
jsr FamiToneMusicPlayCode: Select all
LDX #low(Song)
LDY #high(Song)And somewhere in the infinite loop, to be done once per v-blank (perhaps in the NMI code, since your code goes like this Forever: JMP Forever...do this...
Code: Select all
jsr FamiToneUpdateAlso, I got a pitch sequence to work like a vibrato...
5 3 0 -3 -5 -5 -3 0 3 5 5 3 0 -3 -5 -5 -3 0 3 5 5 3 0 -3 -5 -5 -3 0 3 5 5 3 0 -3 -5 -5 -3 0 3 5 5 3 0 -3 -5 -5 -3 0 3 5
It could use some adjustment to make it sound a little better.
Last edited by dougeff on Mon Dec 14, 2015 1:27 pm, edited 1 time in total.
nesdoug.com -- blog/tutorial on programming for the NES
Re: Problems with Famitone
For completeness, that's not exactly what it means. It's just one way to do it. What a .bat does is send things one line at a time to command prompt.andreasswf wrote:I would like to say thank you for the tip in creating a bat file with a simple command, which made me understand that in the readme file of famitone2 where it says (text2data music.txt) it means that i should type that in a.txt and save it as a .bat.
If you open command prompt and type the things, you get the same result.

Tepples' link explains this in more detail.
-
andreasswf
- Posts: 17
- Joined: Thu Dec 03, 2015 3:44 am
- Location: Sweden
Re: Problems with Famitone
Thank you for putting the time to make me understand what to do.. I am making progress for suredougeff wrote:OK, I only spent a few minutes on this, (and I use asm6), but this is essentially how you get the music to work.
uncomment all the variables at the top of famitone2.asm...(remove the semicolons), like this...
Code: Select all
FT_BASE_ADR = $0300 FT_TEMP = $00 FT_DPCM_OFF = $c000 FT_SFX_STREAMS = 4 FT_DPCM_ENABLE FT_SFX_ENABLE FT_THREAD FT_PAL_SUPPORT FT_NTSC_SUPPORT
Then at the startup code insert this...
Sorry (edit) you're using NESASM, it should look like this...Code: Select all
lda #1 ;not 0 for NTSC ldx #<Song ;low ldy #>Song ;high jsr FamiToneInit lda #0 jsr FamiToneMusicPlay
Somewhere below the code include your song data with the label "Song:".Code: Select all
LDX #low(Song) LDY #high(Song)
And somewhere in the infinite loop, to be done once per v-blank (perhaps in the NMI code, since your code goes like this Forever: JMP Forever...do this...
Hope that helps.Code: Select all
jsr FamiToneUpdate
Also, I got a pitch sequence to work like a vibrato...
5 3 0 -3 -5 -5 -3 0 3 5 5 3 0 -3 -5 -5 -3 0 3 5 5 3 0 -3 -5 -5 -3 0 3 5 5 3 0 -3 -5 -5 -3 0 3 5 5 3 0 -3 -5 -5 -3 0 3 5
It could use some adjustment to make it sound a little better.
When you said "Somewhere below the code include your song data with the label "Song:"."
How would i type this? Not like .include "music.asm"? (I've named my music data .asm "music.asm"
and on
Code: Select all
LDX #low(Song)
LDY #high(Song)Code: Select all
LDX #low(music)
LDY #high(music)