Page 1 of 2

Famitone Update

Posted: Thu Nov 10, 2016 5:12 pm
by dougeff
Here's my first update for famitone2. text2data has been replaced by text2vol.

Changes:
-support for volume column
-support for all notes
(DPCM still needs to be C-1 to D-6)
-included is the source code

(removed link)

Data will be less efficient, filesizes will increase 20-50%. Code will be slightly slower as well.

CAUTION, this is buggy, creates errors when processing more than 1 song.

EDIT - update Jan 2018. Bug fixed version 3.2.
https://github.com/nesdoug/famitone3.3

see also version 4

Re: Famitone Update

Posted: Thu Nov 10, 2016 5:16 pm
by rainwarrior
dougeff wrote:Data will be less efficient, filesizes will increase 20-50%.
Do the file sizes actually increase at all if you don't use the volume column?

Re: Famitone Update

Posted: Thu Nov 10, 2016 5:21 pm
by dougeff
Yes. Shiru had it so that if you had a note, skip one line, and another note, that that gap will go to the low bit of the first note. I removed that efficiency to make room for more notes. Even without a volume column, file sizes are slightly larger.

Re: Famitone Update

Posted: Thu Nov 10, 2016 5:48 pm
by tepples
My music engine has it so that 1, 2, 3, 5, 7, 11, or 15 rows can be skipped without overhead. This means only 25 semitones (two octaves) are reachable at once, but there's also a command to shift this 25-note range up or down arbitrarily during a pattern. I know it'd cost a byte of RAM per track to store the range's base, but I'd bet it could save bytes of ROM all over the place. Worth a try?

Re: Famitone Update

Posted: Fri Nov 11, 2016 9:11 am
by dougeff
I can't think of an easy way to do what you (tepples) are suggesting....without completely rewriting how notes are processed.

Re: Famitone Update

Posted: Mon Nov 14, 2016 6:40 pm
by dougeff
It looks like my next version of famitone will support 1xx, 2xx, and 4xx effects.

I need some input on 2xx. I have it so that the note will end as soon as it (pitch slide down) overflows past x7 ff. That seemed logical to me, and consistent with the 1xx effect. But, I noticed that famitracker instead holds the note at x7 ff, instead of ending the note.

Are there any musicians here who will be annoyed at inconsistency with famitracker?

Re: Famitone Update

Posted: Mon Nov 14, 2016 7:18 pm
by rainwarrior
If the intended input is from Famitracker, why would you intentionally do anything to make it behave differently? What's the advantage of making it do something the user wouldn't expect?

It's one thing to do so if it's for the sake of a more convenient implementation, but simply imposing your own "logic" about how the feature should work doesn't seem productive to me.

Re: Famitone Update

Posted: Wed Nov 16, 2016 5:42 am
by dougeff
I'm basically done. Need to do more testing.

Does anyone have a famitracker song that uses 1xx,2xx, and 4xx effects? Preferably without too many DPCM files. I just want to test on a real song.

(On a side note. I went out of my way to NOT look at the famitracker driver, nor pently, nor any of rainwarrior's code. I didn't want anyone thinking I stole your code. So I didn't).

Re: Famitone Update

Posted: Wed Nov 16, 2016 10:37 am
by koitsu
dougeff wrote:Does anyone have a famitracker song that uses 1xx,2xx, and 4xx effects? Preferably without too many DPCM files. I just want to test on a real song.
There are several that come with Famitracker 0.4.6 that meet this need; see the "Demo songs" folder in the .zip.

If these aren't sufficient, you might Email Jake Kaufman (Virt) and ask him for a few -- stuff off his Fx4 album uses them extensively. (He releases NSFs publicly, but everything is done in Famitracker, so he certainly has the .ftm files laying around). enl_track1.ftm also uses 3xx and 4xx (see pattern 0x0c).

Edit: I also noticed that the classical_9b.ftm (a strange remix of Pachelbel's Canon in D) uses 4xx, so I've attached that.

Re: Famitone Update

Posted: Wed Nov 16, 2016 1:23 pm
by rainwarrior
Attribution for classical_9b.ftm: http://famitracker.com/forum/posts.php?id=2307

The 4xx effect is used really commonly. I'm not sure if 4xx or Vxx is the most popular Famitracker effect. You can probably find it in most FTMs.

1xx and 2xx are a lot less common, because there are more practical alternatives, usually: the targeted slides like 3xx, Qxx, Rxx let you slide to a specific pitch easily, and the hardware slides Ixx, Hxx have the advantage of being logarithmic and they don't pop at power-of-two crossings. It's also very easy to replicate 1xx and 2xx as envelopes, if the feature is unavailable for some reason.

Ixx/Hxx aren't terribly practical for games, but Qxx/Rxx/3xx are all basically just 1xx/2xx with a stopping point, and can be implemented as an extension of them.

Trying to find in my music something that uses the three effects you asked, this one uses 4xx constantly, 2xx a little, and 1xx once: http://rainwarrior.ca/music/TotalTeeGolf.ftm
It uses most other effects too, though (excluding DPCM), so unless you implemented everything it might not be a good demo.

Finding pre-existing music that's restricted to just some particular subset of effects and is also a good demonstration might be difficult. I could host a compo at battle of the bits asking for something specific like that if you wanted.

Re: Famitone Update

Posted: Thu Nov 17, 2016 5:16 am
by dougeff
On my version with no added effects... I'm getting tons of errors if you process more than one song at a time. There's no problems if you process them one at a time, but that is a huge pain.

I'm not sure how to fix this.

text2data does a bunch of things that make this extra difficult. It removes unused envelopes, and reorganizes them. It saves space by using references to other data.

The problem seems to be, my text2vol is inserting junk data into songs. It seems to be bits and pieces of other songs, like old data left in a buffer.

Any way. Don't use this on multiple songs, until I come up with a solution. Sorry.

Re: Famitone Update

Posted: Thu Nov 17, 2016 9:36 am
by dougeff
I've come up with an ugly solution that requires lots of cutting and pasting. Ugly, but it's working. Will do some more testing. Wish I could have come up with a more elegant solution, but I'm not the author of the source code, so I still do lots of head scratching when I stare at the source code.

Re: Famitone Update

Posted: Wed Nov 23, 2016 9:31 am
by dougeff
Download updated...
-forgot to put a few lines in the asm6 version (set default full volume at start of song)
-removed a few extra bytes off end of note table (past what famitracker can output)

Re: Famitone Update

Posted: Sat Nov 26, 2016 6:24 am
by dougeff
I've made a few attempts to debug the problem of garbage data being (sometimes) emitted if multiple songs are processed. I'm not having a lot of luck.

One of my problems is, it's hard to set a breakpoint for a large array, where any point in the array could be the problem... and the program keeps making a new array and renaming, and modifying the length of each chunk...so I can't wrap my head around which point of which song I'm at at any given break.

I'm pretty sure it's parsing the text correctly, but by the time it's sent to song_split pattern length and row position is kind of a mystery.

I suspect the problem is unusual or inconsistent pattern lengths (like song0 has 128 rows per pattern, but song1 has 70 rows per pattern). And the text2data is sort of expecting it to be a power of 2. Maybe.

Any help from someone more experienced debugging C++ would be appreciated.

Re: Famitone Update

Posted: Sun Dec 18, 2016 7:47 am
by schade
Hello !
I'm also working with Famitone and i add some feature you found with the volume and the "every-note support".
I see some problem too.
With the pitch envelope :
It's work completely different with Famitracker : the pitch is added in every loop for example :
pitch : 0 1 2 3 | 4 ("|" is the loop position)
the period offset will be : +0 +1 +3 +6 +10 +14 +18 .... in Famitracker
So i add a new variable in every channel who use the pitch and cumulate the value and the music's composer have to be careful to didn't go out of the frequency's bounds. In the case there is no loop, the converter have to add a zero value at the end of the envelope.

I remake a converter in Java because yours didn't work on Linux (with Wine too, you used a C library specific to Window$, i didn't have the problem with Famitone 2 version) but i have some bug to correct and the change i made to Famitone make the values completely different. But i see an error with the loop position when it's in a repeated value sequence like :
0 0 1 1 1 | 1 1 1 2 2 2
the Famitone loop send to the first value "1" because it's keep the sequence as a block (0*2,1*6,2*3). In fact the repeated value must to be split in two (0*2,1*3,1*3,2*3) and the loop need to go to the second repeat sequence to be correct.

I also make a PAL note's table (because i'm a frog eater ! ;) ):

Code: Select all

_FT2NoteTableLSB:

	.byte $ff,$ff
	;note  C-  C#  D-  D#  E-  F-  F#  G-  G#  A-  A#  B- 	octave
	.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$d1,$60,$f6,$92	;0
	.byte $34,$db,$86,$37,$ec,$a5,$62,$23,$e8,$b0,$7b,$49	;1
	.byte $19,$ed,$c3,$9b,$75,$52,$31,$11,$f3,$d7,$bd,$a4	;2
	.byte $8c,$76,$61,$4d,$3a,$29,$18,$08,$f9,$eb,$de,$d1	;3
	.byte $c6,$ba,$b0,$a6,$9d,$94,$8b,$84,$7c,$75,$6e,$68	;4
	.byte $62,$5d,$57,$52,$4e,$49,$45,$41,$3e,$3a,$37,$34	;5
	.byte $31,$2e,$2b,$29,$26,$24,$22,$20,$1e,$1d,$1b,$19	;6
	.byte $18,$16,$15,$14,$13,$12,$11,$10,$0f,$0e,$0d,$0c	;7
	
_FT2NoteTableMSB:

	.byte $07,$07
	;note  C-  C#  D-  D#  E-  F-  F#  G-  G#  A-  A#  B- 	octave
	.byte $07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$06,$06	;0
	.byte $06,$05,$05,$05,$04,$04,$04,$04,$03,$03,$03,$03	;1
	.byte $03,$02,$02,$02,$02,$02,$02,$02,$01,$01,$01,$01	;2
	.byte $01,$01,$01,$01,$01,$01,$01,$01,$00,$00,$00,$00	;3
	.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00	;4
	.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00	;5
	.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00	;6
	.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00	;7
My friend who make the music is very sad to can't add Duty envelope so i add it and remove duty-strange-thing. (Of course i know this will have an impact on the cycle value but music will be a very important part of the game i work on.)

The version I work on don't function well yet. I have some work to do. I will send it later if you want to read it (but the comments are in french).