News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - tummai

Pages: 1 [2] 3
21
Personal Projects / Re: Project: FF7 NES Upgrade
« on: January 24, 2010, 12:37:44 am »
Yes, it should be possible to add more music.  If I remember correctly we have a pretty large area of empty ROM space in the music bank.  We could use that for extra songs.  And Lindblum found the table that assigns song number to game area, so it should be easy to assign any new songs we add to the different areas in the game.

22
Personal Projects / Re: Project: FF7 NES Upgrade
« on: January 23, 2010, 11:00:56 pm »
In music, an arpeggio is just (in possibly the most simple definition of the term) the notes of a chord that are played separately instead of all at once. The speed doesn't matter.

~DS

That's why I asked for clarification.  I play guitar and my image of an arpeggio is one thing, usually slower than 60 notes a second.  Although I guess if you play a chord with a pick it must technically be an arpeggio too :).  NES music composers usually use "arpeggio" to mean specifically the simulation of chords with pitch envelopes. 

23
Personal Projects / Re: Project: FF7 NES Upgrade
« on: January 23, 2010, 07:29:11 pm »
Final question (before anyone gets too ahead of themselves): arpeggios? FF7’s musical structures have more polyphony going on than you might expect. In the battle theme, there’s a lot of harmony and really neat countermelodies, for example. And when you’ve already lost most of your percussion (and swap out the timpani for the triangle channel), the song loses a lot :\

If by arpeggios you mean note envelopes (playing several notes on a single channel very very fast to simulate a chord), I don't think FF7's sound engine supports them.  I think we're stuck with just three voices.

24
Personal Projects / Re: Project: FF7 NES Upgrade
« on: January 23, 2010, 07:39:22 am »
The #1 request is the Battle Theme.  The game only has about 8 songs coded in, so to replace those we'd need the following:

Battle Theme
Town Theme #1
Town Theme #2
Boss Battle Theme
Overland Walking Theme
Dungeon Theme
Victory Song (when you win a battle)

As far as which Town or Dungeon songs to use, it would really be up to you.  Anything would be better than what is in there now :)  And by no means do I expect any one person to volunteer to do all of them.  If you could knock even one of them out it would be a great help!

Once we have all the default songs replaced, we could think about adding in more of the soundtrack if ROM-space allows.  No need to worry about that now though.

As far as composing goes, the only specific restriction I can think of off the top of my head is no samples (DPCM).  The FF7NES sound engine doesn't support them.

25
Personal Projects / Re: Project: FF7 NES Upgrade
« on: January 22, 2010, 09:27:19 am »
Tummai & Lindblum were getting some great work done on replacing the music, but it currently incomplete.

An airship is a big addition as it would mostly have to be programmed from scratch.

btw, if anybody is proficient with FamiTracker and wants to help this project along, make some NES versions of FF7 songs.  I can take the FamiTracker file and convert it to the FF7 music engine pretty easily.  I'm just not very good at composing with FamiTracker.

26
Personal Projects / Re: Project: FF7 NES Upgrade
« on: December 23, 2009, 07:15:48 pm »
I don't know. I think it would help greatly to have the correct battle music in the game.

For what it's worth, I still have a scratch version of the main battle theme that I was working on way back when.  It's incomplete but maybe someone can take it and finish it.  I'll post the byte block later when I get home from work.

Edit: here it is.  Squares are complete for the whole song.  Triangle is incomplete (and sounds an octave too high).  No drums.

FF7 Battle Theme
Code: [Select]
FF
00 1400
01 1801
02 3C02
03 0E00
FF

00 C9 C9 c9 c9 D0

CC FF C7 FF C4 6B DB 07000000 CD 0300 DE 0A D8 00

01
   6C 02 C9 01    CE 03 27 00    6C 67 6A 6D 6C 6A 6D
   6C 02 C9 01    CE 03 36 00    DF CF 4B 00    6C 02 6A 6A 6A
            CF 02 26 00
   6C 6A 67 6A 67 6A 67

03 54 56 57 59 02 5B 5E    D2 0C    CE 03 52 00    D8 00
01 60 6C 6C    CE 03 62 00    60 62 63 65 63 62 65
   63 6C 6E 6F 71 6F 6E 71 6F 6C 6A 02 6D 01 6D 02 6A
            CF 02 52 00

01 60 6C 6C    CE 03 87 00    60 62 63 65 63 62 65
   63 6C 6E 6F 71 6F 6E 67 6C 6A 6C 6E 6F 6E 6F 71

   C9 73 71 73 71 6F 6C 6E 02 6F 01 68 02 67 6A 6C
01 C9 63 62 02 63 01 65 67 68 02 6A 01 68 02 6A 01 6C 6E 6F
   C9 6F 6A 6C 6E 6C 6A 68 6C 65 67 68 6A 68 6C 68
   C9 02 68 03 67 65 01 65 67 68 6A 6C 6E 6F
   
   C9 6C 02 6F 01 6E 02 71 01 6F 02 73 01 71 02 74 01 73 6F 6C
            CE 02 E7 00
   C9 6A 02 6E 01 6C 02 6F 01 6E 02 71 01 6F 02 73 01 71 6E 6A
            CF 02 E7 00
   D0
   
CC FF C7 FF C4 6B DB 07000000 CD 0301 DE 0A D8 00
01
   67 02 C9 01    CE 03 2B 01    6C 67 6A 6D 6C 6A 6D
   67 02 C9 01    CE 03 3A 01    DF CF 4F 01    C9 02 67 65 65
            CF 02 2A 01
   6C 6A 67 6A 67 6A 67

03 54 56 57 59 02 5B 5E 03 5C 59 5B 5E 02 60 63 03 68 65 68 6A 04 6C
01 5B 67 67    CE 03 6D 01    60 62 63 65 63 62 65
   63 6C 6E 6F 71 6F 6E 71 6F 6C 6A 02 6D 01 6D 02 6A
            CF 02 56 01
           
01 5B 67 67    CE 03 92 01    60 62 63 65 63 62 65
   63 6C 6E 6F 71 6F 6E 67 6C 6A 6C 6E 6F 6E 6F 71
   
   C9 73 71 73 71 6F 6C 6E 02 6F 01 68 02 67 6A 6C
01 C9 60 5E 02 60 01 62 63 65 02 67 01 65 02 67 01 67 6A 6C
   C9 6F 6A 6C 6E 6C 6A 68 6C 65 67 68 6A 68 6C 68
   C9 02 60 03 5E 5C 01 60 63 65 67 68 6A 6C
   
0E 60 02 60 0E 5C 02 5C 0E 5E 02 5E
01 C9 67 02 6C 01 6A 02 6E 01 6C 02 6F 01 6E 02 6F 01 6E 6F 6C
   c9 68 02 6C 01 6A 02 6E 01 6C 02 73 01 6E 02 71 01 6F 6F 6C
   C9 65 02 6A 01 6C 02 6C 01 6A 02 6E 01 6C 02 73 01 6E 6B 65
D0   

CC FF C7 FF C4 6E DB 07000000 DE 0A D8 00

03 6C 01 6C 02 C9 6C 01 C9 03 6C 02 6C 6A
01 73 02 78 01 73 02 C9 73 C9 73 71 71
03 73 01 73 02 C9 73 01 C9 03 73 02 73 74
03 73 01 73 02 C9 73 01 C9 73 02 71 71 71

03 73 01 73 02 C9 73 01 C9 03 73 02 C9 71
03 6C 01 6F 02 C9 6F 01 C9 03 6F 02 6F 02 6E
03 6C 01 6C 02 C9 6C 01 C9 03 6C 04 6C
00 C9 C9
d0

Paste into 0x1B8DD to preview it as the intro song. 

27
Personal Projects / Re: nonme345's Translation Projects
« on: September 05, 2009, 10:22:30 am »
Next up, a DTE routine on Famicom Detective Club!

Sweet.  I'm happy to see you have DTE figured out now :)  Once you get it setup in FDC I'll start on the script revision.  Good work!

28
The only compression is on the level data.  I didn't compress CHR cause it just seemed not worth doing.  There are only around 3 banks currently allocated for CHR stuff, and there's a fair chunk of space.  Level data is spread across 4 banks.

Cool.  That's a nice perk of having so much space :).  BTW, what do you have in the other 9 banks?  I'd assume one has the sound engine.  Then the fixed bank will have all-purpose code.  Does your enemy data take up more than one bank?

29
The rom is 256 kb.  I still have 80 or so kb to work with too.  :)

Regarding rom distribution, I'm planning to just make the roms to my older games be freeware by the end of this year.  This game will probably follow suit later on.

Whoa.  I knew you were doing UOROM, but I didn't expect you to fill it up!  The game must be huge!  Is your CHR compressed too?   

It's getting really exciting now that you are close to the end.  Keep up the good work :)  Crossing my fingers for a 5th video with the intro cutscene in it.

Quote
The guy who makes the games actually binds me by contract saying not to give out rom copies.  Kinda silly-sounding, but that's the way he does it.  This way we both get paid.

btw, just curious, but does your artist get a cut or is he a volunteer?

30
Personal Projects / Re: Project: FF7 NES Upgrade
« on: March 27, 2009, 09:21:10 am »
awesome man!  You're kicking ass.  Not to mention that you already kicked some major ass by translating this into English and speeding up the gameplay.  good work!

I've been working a little bit on the music stuff.  Here's my current version of the chocobo song, based on the "Cinco de Chocobo" version from the original game.  Tell me what you think:

Code: [Select]
FF
00 0E00
01 8E00
02 D200
03 0016
FF

CC DA  C7 FF  C4 6B  DB 07000000  DE 08  CD 0302 D8 00

02 69 01 C9 69 66 62 5F 69 66 62
02 66 01 C9 62 02 C9 66 64
   62 01 C9 64 62 60 02 62 60
   62 01 C9 66 69 6B 04 6C
CE 02 20 00
 
02 6B 01 C9 6B 67 64 61 64 67 6B
02 69 01 C9 03 6E 04 69
DF CE 78 00
02 67 01 C9 67 64 61 5D 61 64 67
02 66 01 C9 03 67 02 69 66
CE 02 49 00
02 64 01 C9 66 64 62 64 66 67 66
03 64 01 66 67 69 02 6B 67 68
D0

CC FE C7 FF C4 08 DB 07000000 CD 0301 DE 08 D8 00

01 C9 60 02 C9 60 5F 5D CE 08 A0 00

01 C9 62 02 C9 62 64 5F
01 C9 62 02 C9 62 66 62
CE 03 AC 00
01 C9 60 02 C9 60 C9 60
01 C9 61 02 C9 61 C9 60 61
D0

CC FE C7 FF C4 6E DB 07001E78 DE 08 D8 00

02 62 01 C9 03 62 02 5D 60
CE 08 E1 00

67 01 C9 03 67 02 69 6B
62 01 C9 03 62 02 66 69
CE 03 EE 00
02 60 01 C9 03 60 02 67 66
02 69 01 C9 03 69 02 5F 60 61
D0

Now I'm working on the main battle song.  Hopefully I can produce something good. 

Btw, there was a little bug in the last music development patch.  Here's a new one that fixes a bug related to the BCBD branching:
http://www.mediafire.com/?sharekey=db15991d3853f45abda4076e811714c8e04e75f6e8ebb871

31
Personal Projects / Re: Project: FF7 NES Upgrade
« on: March 24, 2009, 05:23:16 pm »
I figured out how to load a song when mounting/dismounting a chocobo, but in the meantime it'll be the battle fanfare.

I've noticed the music engine patch messes up the music and sound effects.  I understand that you changed the entire scale, but among other things it sounds weird when lightning attacks now sound like birds chirping (Chidori™ (千鳥)???)

When I open a MIDI I pick the best Melody channel as Sq1, Harmony/Accompaniment as Sq2, Bass/"Atmospheric" as Tri, and Percussion as Noise, remove the other channels or move certain notes to the main channels.  Each channel will only hold one note at a time, but MIDI can hold more, so you have to remove all overlaps. 


It's possible that one or more of the "unused" opcodes that I overwrote were actually used afterall.  Either that or the sound effects expect the notes to stop in the 6th octave and are getting messed up when they continue beyond.  I'll try to see if I can track down what went wrong and fix it.   Thanks for telling me.

I'll try to finish up the Chocobo song too :)

EDIT: Fixed.  The sound effects weren't getting truncated.  Now they are :).  Thanks a lot!  Let me know if you run into any more bugs with the sound development patch.  I'm still working on the Chocobo Theme.

Sound Patch #3 (Does everything the other two patches do, plus fixes the SFX bug): http://www.mediafire.com/?sharekey=db15991d3853f45abda4076e811714c8e04e75f6e8ebb871

32
Personal Projects / Re: Project: FF7 NES Upgrade
« on: March 24, 2009, 09:03:12 am »
BTW, if anyone is out there is good at using FamiTracker and wants to help out, feel free to make NSFs and send them my way and I can convert them to FF7's sound format.  I'd do it directly from the Playstation or MIDI versions, but I'm not good at picking the best 8-bit instruments to use for different song parts, and it's a nightmare switching them all around by hand.  If I had a completed 8-bit song, to where I knew which parts were on triangle, which were on the squares, etc, I imagine I could pump songs out pretty quickly. 

Anybody wanna try just one song at least? :)

33
Personal Projects / Re: Project: FF7 NES Upgrade
« on: March 20, 2009, 10:00:20 am »
Thanks.  No, I haven't made any tools or a music editor or anything like that.  I wouldn't even know where to begin trying to make something like that.  Sounds like a great idea though! :)

34
ROM Hacking Discussion / Re: FF7 NES Chinese Translation
« on: March 19, 2009, 09:36:34 am »
Awesome!  The speed patch is a great improvement.  Good job.

Speeding up scroll walking sounds like it would be really hard to pull off, so I won't cross my fingers on that one :)

35
Personal Projects / Re: Project: FF7 NES Upgrade
« on: March 19, 2009, 09:32:04 am »
I added another opcode, so there's another patch.  This patch does everything the previous patch did, plus the new pitch shift opcode.  You can download it here: http://www.mediafire.com/?sharekey=db15991d3853f45abda4076e811714c8e04e75f6e8ebb871

Setting the Pitch Shift

There is an existing opcode D8 that will set the pitch shift.  The pitch shift is added to the note value to get a final note value.  For example, if you have a note 4C (an A), and your pitch shift is set to 01, the sound engine will do a 4C+01, giving you 4D (a B). 

The D8 opcode takes one operand (the pitch shift value) and is usually found in channel headers.  Most channels set it to 00, meaning no change in pitch.  It's not a terribly useful opcode.

Adjusting the Pitch Shift

Adjusting the pitch shift on the fly however is very useful.  So I made a new opcode to allow you to add or subtract from the pitch shift value.

The new opcode is D2.  It takes one operand, which is added to the pitch shift.  How is this useful?  Let's look at the first chord arpeggio of the classic FF intro song.  It's a major/9 arpeggio that spans five octaves.  It goes something like this:

(Octave 1)A B C# E (Oc2)A B C# E  (Oc3)A B C# E (Oc4)A B C# E (Oc5)A (Oc4)E C# B A (Oc3)E C# B A (Oc2)E C# B A (Oc1)E C# B.

If we were to write it out manually for the FF7 sound engine, we'd get something like this:

Code: [Select]
01 4C 4E 4F 53 58 5A 5C 5F 64 66 68 6B 70 72 74 77 7C 77 74 72 70 6B 68 66 64 5F 5C 5A 58 53 4F 4E
That's 33 bytes.  And this is only one chord.  The FF intro song has a few more, so we'd exceed 100 bytes just for one channel!

Luckily, with the new D2 opcode, we can take advantage of the arpeggio pattern and turn the above data into something like this:

Code: [Select]
01
4C 4E 4F 53 D2 0C CE 04 21 00
4C 47 44 42 D2 F4 CE 04 2B 00

That's 21 bytes, or 2/3 the size!

Let's look at what is happening:

1) First we play the phrase 4C 4E 4F 53.
2) Then we encounter the D2 opcode, which tells the sound engine to adjust the pitch by #$0C.  #$0C is hex for 12.  There are 12 notes on the music scale, so adding 12 to the pitch will raise it an octave.
3) After the D2 opcode, we encounter the CE opcode, which is our loop opcode.  It sends us back to the beginning.
4) We find our phrase again 4C 4E 4F 53, but this time #$0C will be added to them, effectively turning them into 58 5A 5C 5F.
5) We encounter D2 0C again.  This will add #$0C AGAIN (it stacks), so now our pitch adjustment is +#$18, or two octaves higher.
6) Loop again (+#$24), and again (+#$30) for a total of 4 times.  At the end of our loop we will be 4 octaves higher than we started.

7) Next we get to the descending phrase: 4C 47 44 42.  But remember, we are still four octaves higher, so these will actually turn into 7C 77 74 72 for the first playthrough.
8 ) We encounter the D2 opcode.  This time we add #$F4 to our pitch adjustment.  WTF?  #$F4?  Yes.  Adding #$F4 is actually like subtracting #$0C.  Since #$FF is the highest number on an 8-bit machine, the addition will loop around to #$00 and then count up and fall #$0C short of the previous value.  We throw away the carry.  Maybe this table will help make it clear:

00  00   adding 00 is the same as subtracting 00
FF -01   adding FF is the same as subtracting 01
FE -02   adding FE is the same as subtracting 02, etc
FD -03
FC -04
FB -05
FA -06
F9 -07
F8 -08
F7 -09
F6 -0A
F5 -0B
F4 -0C
etc...

So again, adding #$F4 to our pitch adjustment is essentially subtracting #$0C, which will lower the octave.
9) We loop to the beginning of the descending phrase and repeat 4 times.

Look at this data.  It is four chords arpeggiated (A/9, F#m/9, D/9, E/9):

Code: [Select]
;note length
01

;A/9 Chord
4C 4E 50 53 D2 0C CE 04 21 00
4C 47 44 42 D2 F4 CE 04 2B 00

;F#m/9 chord.  I put the D2 F4 in a different place. See explanation below.
49 4B 4C 50 D2 0C CE 04 32 00
D2 F4 55 50 4C 4B CE 04 3C 00

;D/9 chord
51 53 55 58 D2 0C CE 04 46 00
51 4C 49 47 D2 F4 CE 04 50 00

;E/9 chord
D2 02 CF 02 46 00

;song loop
D0

That's 68 bytes.  Without opcodes, this same phrase would be 130 bytes.  That's almost 50% savings!

The A/9 chord should look familiar, since we already stepped through it above.

Next is the F#m/9 chord.  Same concept, different notes.

After the F#m/9 chord, we have the D/9 chord.  It looks very similar to the A/9 chord.

Finally, for the E/9 chord, we pitch shift up a step (D2 02) and use the CF loop opcode to replay the D/9 chord, but this time shifted up a step (to E).  Doing this saves us 14 bytes.  Pretty nice!  Notice that we use the CF loop here, not CE.  This is because we have a CE loop nested inside our bigger CF loop.

Normally we'd want to zero our pitch shift out and put a D2 FE after our E/9 chord to cancel out the D2 02, but since we are at the end of the channel data we don't have to.  The D0 song loop opcode rereads the header, and our header will have a D8 00 in it.  I introduced the D8 opcode at the beginning of this post.  It sets the pitch shift.  The channel header's D8 00 will reset our pitch shift to 0 for us!  Sweet!

Prelude

Here is data for the FF intro song (but in the key of C).  I used the triangle channel as the main instrument for its soft sound, and I used the delay effect trick again.  Please look at the song header, as I have the channels in a nonstandard order (square1 and noise both point to the dead rests at the end).  You can paste this data in at 0x1B8DD and hear it as the new intro song.  It could still use some work, but I think it's an improvement over the crappy 1-chord version in the Chinese original. :) And about half the size too!

Code: [Select]
FF
00 9D00
01 8100
02 0E00
03 9D00
FF

CC C8 C7 FF C4 6B DB 07000000 DE 0A D8 0C

01
4F 51 53 56 D2 0C CE 04 1E 00
4F 4A 47 45 D2 F4 CE 04 28 00
4C 4E 4F 53 D2 0C CE 04 32 00
4C 47 43 42 D2 F4 CE 04 3C 00 CF 02 1E 00
4C 4F 54 56 D2 0C CE 04 4A 00
D2 F4 58 56 54 4F CE 04 54 00
D2 02 CF 02 4A 00
D2 FE
4B 4F 52 56 D2 0C CE 04 66 00
4B 4A 46 43 D2 F4 CE 04 70 00
D2 02 CF 02 66 00
D0

CC FE C7 FF C4 04 DB 07000000 CD 0301 DE 0A D8 00

DF CE 1D 00 02 C9 CE 02 93 00

00 C9 C9 D0

Patch

If you missed it above, here is the patch: http://www.mediafire.com/?sharekey=db15991d3853f45abda4076e811714c8e04e75f6e8ebb871

And if you missed the little lesson on looping/branching, you can read that post here.

36
Personal Projects / Re: Project: FF7 NES Upgrade
« on: March 18, 2009, 04:27:39 am »
I made a little patch that should help out with people writing new songs.  It:

1) extends the note table to a full 8 octaves.  So instead of note values going from #$40-#$7F, they now go from #$40-#$9D.
2) tuned all of the notes.  They should no longer be flat (though some precision is lost at the highest octave)
3) added a new opcode (DF) that allows for musical branching.  This new opcode works with the loop opcodes (CE and CF), which I'll explain how to use below.

here is the file: http://www.mediafire.com/?sharekey=db15991d3853f45abda4076e811714c8e04e75f6e8ebb871

How to loop

There are two opcodes for looping, CE and CF.  They both work exactly the same way, but they each have their own loop counter so you can nest them.  Here's how they work:

Let's say you have a set of notes you want to repeat:

02 6A 5E 6A 5E 6B 5F 6B 5F

To do so, you stick one of the loop opcodes on the end, followed by three operands: CE/CF [num] [lo offset] [hi offset].

[num] is how many times to play the phrase, including the first playthrough.
[lo offset] and [hi offset] tell where the beginning of the repeating musical phrase is, relative to the first byte of the song's header (the first FF).  This is kinda a pain in the ass because you have to count bytes every time.  For simplicity, let's pretend our little repeating phrase is at the beginning of our Square 1 data:

Code: [Select]
FF 00 0E 00 01 ?? ?? 02 ?? ?? 03 ?? ?? FF
;song header.  We only care about square1 for our example

CC C8 C7 FF C4 6B DB 07 00 00 00 DE 05 CD 03 02 D8 00
;square1 header

02 6A 5E 6A 5E 6B 5F 6B 5F
;our phrase that we want to loop

CE 08 20 00
;our loop opcode.

This will play our phrase 8 times.  the "20 00" tells us that the start of our looping phrase is at songheader+#$0020 (you can count to check).

This saves us a lot of space.  If we didn't use the loop opcode, we would have the following data instead:

Code: [Select]
FF 00 0E 00 01 ?? ?? 02 ?? ?? 03 ?? ?? FF
CC C8 C7 FF C4 6B DB 07 00 00 00 DE 05 CD 03 02 D8 00
02 6A 5E 6A 5E 6B 5F 6B 5F
02 6A 5E 6A 5E 6B 5F 6B 5F
02 6A 5E 6A 5E 6B 5F 6B 5F
02 6A 5E 6A 5E 6B 5F 6B 5F
02 6A 5E 6A 5E 6B 5F 6B 5F
02 6A 5E 6A 5E 6B 5F 6B 5F
02 6A 5E 6A 5E 6B 5F 6B 5F
02 6A 5E 6A 5E 6B 5F 6B 5F

After the loop opcode, you can put more music data like normal.  After all repeats are done, it will continue on to whatever data you have after the loop opcode.

Branching Opcode

Ok, it's nice to loop, but what if we have a song structured like this:

A
A
B C
B D


The Chocobo song has this structure.  Hum it to yourself.  You can see that it repeats the first phrase (A) twice, and then changes to a new phrase (B) which has two different endings (C and D).

Our loop opcodes can take care of playing A twice in a row, but there is no support for something like BCBD.  We'd have to write out B manually two times, which wastes space.  So I wrote a new opcode (DF) in that will allow you to branch on the last iteration of a loop.

The format is:  [B Phrase] DF ?? ?? ?? [C Phrase] CE ?? ?? ?? [D Phrase].   The question marks denote operands.  The CE opcode is the loop one I explained above, so you should be able to fill in those question marks.  The DF is new, so here goes:

DF [which loop] [lo offset] [hi offset]

[which loop] should be either CE or CF.  Whichever loop opcode you use after your [C Phrase] should be the one you use here.
[lo offset] and [hi offset] tell the location of [D Phrase], relative to the first FF in the song's header.  Let's look at an example.  Here is the chocobo melody:

Code: [Select]
FF 00 0E 00 01 ?? ?? 02 ?? ?? 03 ?? ?? FF
;song header. We only care about square1 for now

CC C8 C7 FF C4 6B DB 07 00 00 00 DE 05 CD 03 02 D8 00
;square 1 header

02 6A C9 67 63 60 6A 67 63 67 C9 63 C9 06 67 02 65 01 63 C9 63 65 02
63 61 05 63 01 C9 02 61 01 63 C9 63 68 02 6A 6C 06 6D 02 C9 CE 02 20 00
;this is our [A Phrase].  Notice the CE loop opcode at the end that tells this to play twice.
 
6C C9 68 65 62 65 68 6C 6A C9 6F C9 06 6A DF CE 7B 00
;this is our [B Phrase] with the new DF opcode.
;It will be used in conjunction with the CE loop, and it tells us that our [D Phrase]
;is located at songheader+#$007B

02 6A 68 C9 65 62 5E 62 65 68 01 67 C9 67 68 02 67 65 06 67 02 C9 CE 02 4F 00
;this is our [C Phrase].
;At the end we have our loop opcode CE, which points us to the
;beginning of [B Phrase] (songheader+#$004F)
 
02 67 01 65 C9 65 67 02 65 63 06 65 02 63 01 65 C9 65 67 02 68 6A 04 6C 6E D0
;this is our [D Phrase].
;On the last repeat of [B Phrase], the DF opcode will send us here instead of to [C Phrase]

Chocobo Song
Here is some Chocobo Song data.  The bassline sucks and there's no percussion, but it will play.  Copy and paste it into 0x1B8DD and it will play as the intro song so you can listen.

Try to find all the loop and branch opcodes and see if you can understand what they're doing.  Can you figure out the sneaky trick I used to get the delay effect on the square2 channel?

Code: [Select]
FF 00 0E 00 01 95 00 02 B1 00 03 EC 00 FF

CC C8 C7 FF C4 6B DB 07 00 00 00 DE 05 CD 03 02 D8 00
02 6A C9 67 63 60 6A 67 63 67 C9 63 C9 06 67 02 65 01 63 C9 63 65 02 63 61
05 63 01 C9 02 61 01 63 C9 63 68 02 6A 6C 06 6D 02 C9 CE 02 20 00
6C C9 68 65 62 65 68 6C 6A C9 6F C9 06 6A DF CE 7B 00
02 6A 68 C9 65 62 5E 62 65 68 01 67 C9 67 68 02 67 65 06 67 02 C9 CE 02 4F 00
02 67 01 65 C9 65 67 02 65 63 06 65 02 63 01 65 C9 65 67 02 68 6A 04 6C 6E D0

CC FE C7 FF C4 08 DB 07 00 00 00 CD 03 03 DE 05 D8 00
DF CE 20 00 01 C9 CE 02 A7 00

CC FE C7 FF C4 6E DB 07 00 1E 78 DE 05 D8 00
02 63 5E 63 5E CE 10 C0 00
02 65 60 65 60 68 62 68 62 63 5E 63 5E 63 5E 63 5E CE 03 C9 00
02 65 60 65 60 65 60 65 60 CE 02 DE 00 D0

CC FE C7 FF C4 4A CD 45 00 D8 00 DE 00
C9 D0

The Patch

And just in case you missed it at the top, here is the patch: http://www.mediafire.com/?sharekey=db15991d3853f45abda4076e811714c8e04e75f6e8ebb871

37
Personal Projects / Re: Project: FF7 NES Upgrade
« on: March 06, 2009, 09:32:17 am »
Cool, I'm definitely gonna play with those opcodes later, see if I can balance those channels and get the best volume envelope.  I wonder if there's another one for instrument. 

Changing the duty cycle is a lot like changing instruments.  Pop in different values as the 2nd operand to opcode CD and you'll notice right away the difference in tone for your square wave.  Actually, I don't even know what duty cycle means, that's just what those bits are called in the NES sound docs I've looked at. :)

I'll keep digging at the other opcodes, but it may take some time.  This sound engine is pretty complicated for something that only plays 8 songs.

Quote
I played around with the regions.  Big difference.  I live in NTSC, but Nanjing is in PAL, but regardless I don't know which the game's supposed to be.  I'm probably going to trust that 0x40 is A, because I think I saw another document also have it that way.  I write down my notes by what sounds best in a MIDI editor, then run a script to parse my notes into a hex string. 

The ROM is for NTSC I think.  If it were PAL, the period value for the low A would be something like $760, not $7FF.  BTW, these NES note tables by Celius on nesdev are nice little references to have around: http://nesdev.parodius.com/bbs/viewtopic.php?t=3728&start=0

38
Personal Projects / Re: Project: FF7 NES Upgrade
« on: March 06, 2009, 02:00:18 am »
Here is some opcode information for the Square channels.  I'm not 100% on them, but since there are some people working on songs already, I thought I should throw them out there for experimentation.  Let me know if I have anything wrong (let me know if I'm right too :) ).  Again, this is just for the Square channels.

C4: takes one operand.  The right side (0-F) is used as the base volume (pre-envelope) for the channel.  Not sure about the left side yet.

CD: takes two operands.  The first operand can be a value 0-9 and selects the volume envelope.  The second operand can be a value 0-3 and selects the duty cycle for your square wave (but backwards.  3 sets the duty cycle to #%00xxxxxx, and 0 sets it to #%11xxxxxx).

Below are the volume envelopes.  These envelopes are applied to each note, so for fast notes they will likely be very subtle to the ear.  The maximum volume in these envelopes is the base volume set in opcode C4.  Please experiment with them:

1: Slow fadedown
2: low to high quick, then fade down (might sound like a pluck?)
3: fade down to half volume, then fade back up
4: fade up from half volume, then fade back down to half
5: fade down fast two times
6: down a little, up a little, then down to 0
7: down a lot, up a little, then down to 0
8: constant low volume, then rises to high, finally drops to half volume
9: fade down to half volume fast two times, then fade from half volume down.

I don't have #0 down in my notes.  I must have overlooked it.  I think it's not like the others though.  I'll have to look it over again later and do an update.

39
Personal Projects / Re: Project: FF7 NES Upgrade
« on: March 06, 2009, 12:20:39 am »
My new table is *almost* like that, except I have 0x40 start at G# instead of A.  I'm still confused, it doesn't seem like I could be fooled by a half step so easily. 

Is it just me, or does FCEUX's sound seem a little flatter than Nestopia, or is that just because it's slower (yes, I set the speed to 100%)?

All of the period values for the tones that the game uses are a little flat, so that might be why your table is a half-step down, since the first note is actually somewhere in between a G# and an A.  Traditionally though the highest period value possible (#$7FF) is considered an A.

As for the emulators, I have no idea.   PAL vs. NTSC makes a difference.   Are you running both emulators in NTSC mode?

40
Personal Projects / Re: Project: FF7 NES Upgrade
« on: March 05, 2009, 08:51:02 pm »
I have sequenced (short versions of):
TitleSizeQuality
Ahead On Our Way233Good
Those Chosen by The Planet319Painful
Chocobo Theme214Decent
Main Theme in progress...

//I've noticed that in my document the bytes don't match up with the right notes.  I must've accidentally stepped on the equation while working on the document. 

G :D :D D NEWS: I miscalc'd before, I think I was looking at the wrong ROM bank.  We've got over 8,700 bytes of free space!  We can fit 20 more songs easy!  On the down side I should head backwards to rework my dinky loops into fuller songs. 

Awesome.  That's good news!  Hopefully we don't have to do any crazy bankswitching at all!  BTW, I've traced through a little ways and found the note tables.  This should help you sequencing the songs.  The note table actually has a big error too, so three notes in octave 2 are completely wrong.  To fix this, please change the following bytes in the ROM:

1ADBB: from 04 to 03
1ADBC: from 04 to 03
1ADBD: from 04 to 03

Note Table:
Acceptable values: #$40-#$80.  Note that NES octaves start at A, not C.

Octave 1
40: A
41: A#
42: B
43: C
44: C#
45: D
46: D#
47: E
48: F
49: F#
4A: G
4B: G#

Octave 2:
4C: A
4D: A#
4E: B
4F: C
50: C#
51: D
52: D#
53: E
54: F
55: F#
56: G
57: G#

Octave 3:
58: A
59: A#
5A: B
5B: C
5C: C#
5D: D
5E: D#
5F: E
60: F
61: F#
62: G
63: G#

Octave 4:
64: A
65: A#
66: B
67: C
68: C#
69: D
6A: D#
6B: E
6C: F
6D: F#
6E: G
6F: G#

Octave 5
70: A
71: A#
72: B
73: C
74: C#
75: D
76: D#
77: E
78: F
79: F#
7A: G
7B: G#

Octave 6
7C: A
7D: A#
7E: B
7F: C
80: C#

Pages: 1 [2] 3