vgmrips

The forum about vgm files
It is currently 2019-08-19, 2:15:58

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 55 posts ]  Go to page Previous  1, 2, 3, 4
Author Message
 Post subject:
PostPosted: 2018-09-17, 16:27:52 
Offline

Joined: 2017-11-21, 16:36:09
Posts: 32
ctr, i am posting here since i have bad timing posting the irc chat, and you didn't see my messages, but i think i have found what i belive is the lfo table (its found between 0x660d144 and 0x660e944).
but its not really a waveform, its more of a linear table, and its doing something similar to a sine operation to the pointer offset.
i have made a bin file rip [url = https://drive.google.com/file/d/1Op3zAt ... sp=sharing]here[/url], and [url = https://drive.google.com/file/d/1Tcbh-o ... sp=sharing]i have made a snapshot of the routine[/url], also i wanted to include a snippet of the assembly code, but i don't know if is trash https://pastebin.com/xK3iMNKw
i have written this "quickly" before my pc gets repaired


Top
 Profile  
 
 Post subject:
PostPosted: 2018-09-17, 21:06:29 

Contributors Contributors
Staff Staff
Reverse engineers Reverse engineers
Offline
User avatar

Joined: 2013-07-17, 23:32:39
Posts: 381
That looks to just be a pitch table. I.E. the values that are written to the sound chip to specify the sound frequency. It's obvious since the highest value is about twice as big as the first value in the table, indicating that it covers an octave. Also there are 6144 16-bit values, divided by 12 that gives exactly 512 'cents' or fractions in a semitone. The LFO vibrato is created by modulating the frequency value (which as you say is a pointer into this table), meaning the sine function or table is somewhere else.

To get lower or higher octaves, the values are just shifted as necessary.


Top
 Profile  
 
 Post subject:
PostPosted: 2018-09-24, 22:03:34 
Offline

Joined: 2017-11-21, 16:36:09
Posts: 32
ctr, i have found a part of the lfo processing code, its after the address 0x0613BA10.
if you have time to investigate more on it someday, and explain me what it does, that would be really cool

EDIT: just found out it was not the right block of code, i have edited the right one now.

and the summary i wrote before was confusing, so there is a new one, from what i have seen.. (for reference, i am using channel 0x09 in song 0x1e, the vibrato depth here is 0xe2, and the lfo speed is 0x76da, converted from the tables).

so, it multiplies the lfo speed for the vibrato depth, to get a value (for semplicity i am going to refer it as lfo_val_per_phase), for finding the minimum lfo value, in register 6, the vibrato depth value is shifted by 16 bits, and it subtracts this to lfo_val_per_phase.

then, in address 0x207913c, i think is stored the current lfo value, and it subtracts the (lfo_val_per_phase) to the current lfo value (current lfo value - lfo_val_per_phase)


Top
 Profile  
 
 Post subject:
PostPosted: 2018-10-12, 11:28:10 
Offline

Joined: 2017-11-21, 16:36:09
Posts: 32
i have managed to make a (bad) transcription of the code starting from 0613BA10, that handles the current lfo value.
Code:
cps3 vibrato code transcribed

starting from 0613BA10
before anything happens, load vibrato rate (register 6) and depth (register 5)
multiply the two for vib_depth_per_rate, and override vibrato rate with it(register 5).
the value contained in address (r14 (the start of channel 10 work area, in this case 2079120) + 0x6e)
gets saved to register 3.
then, if (r3 != r8 (seems to be always 1)), goto 613ba60, else continue to 613ba3c;
shift r6 left by 16 bits regardless

613ba3c: move the current lfo value to r3, move r5 (vib_depth_per_rate) to r2, subtract it to r6 (vibrato rate << 16), and if (r2 >= r3), branch to 613ba50, else, continue to 613ba48.
load the current lfo value (in address r14 + 0x1c) to register 1, then subtract r5 to r1, and goto 0613BA6e:
move the result to the address for current lfo value.

613ba50: move 0xfe to r3, then arithmetically reverse r6 (-r6), and move r6 to the address of the current lfo value, then:
load the value inside (r14 + r0), then (r2 & r3), and save that to r14 + r0.

613ba60: move r6 (vibrato rate << 16) to r3, move the previous lfo value to r2, subtract r5 (vib_depth_per_rate) to r3.
if (r3 >= r2): goto 613ba72, else, move again the previous lfo value to r1, add r5 to r1, move the result to the address for previous lfo value.

613ba72: move 0x6e to r0, move r6 (vibrato rate << 16) to the previous lfo value, move 0x01 to r3, move the value of (r14 + r0) to r2, then (r2 | r3), and move the result to (r14 + r0).

r14 + r0 seems to contain the current lfo state (i.e. rising, falling, ect...)
and r8 may refer to a specific lfo state (maybe rising, as the algorithm that gets branched to when (r3 & r8) is true, produces values bigger than the previous lfo value)

maybe i can make a piece of c code that replicates this.

Edit: there was stuff that was wrong, now i have corrected it (or at least partially)


Top
 Profile  
 
 Post subject:
PostPosted: 2018-12-02, 18:58:26 
Offline

Joined: 2017-11-21, 16:36:09
Posts: 32
so, i got the lfo emulator to run at the rigth tick frequency with different tempos, and to find the start of the function that converts the lfo value into an usable value for the pitch table, but in that bllock of code, it uses a value that is derived from the current note begin played (at channel 0x09 (counting from zero), its located at 0x2079130, 2079132 and 2079134)
but i can't figure out where the block of code that determines that value, my tracefiles do not include it, when i try to make an another one and i cannot trigger songs in the sound test because its slow and locks me out of any input.
i was thinking of putting a watch point on a note in the song's data...

Edit: i think i found it:
to turn the note value into an usable variable, it subtracts the intrument sample's key center, then adds 7, shifth by 2, left, subtracts the value inside (current_channel_offset + 0x56), and adds 0x80, and adds again the value at (0x6788848 + 0x6, the 7th byte in an instrument key split)


Top
 Profile  
 
PostPosted: 2019-05-05, 6:32:54 
Offline

Joined: 2019-05-03, 5:49:33
Posts: 7
Hello friend, I was messing around your midis and the soundfont ripped, but Now I want to ask you if you can let me use your method (and if you could teach me please how to achieve it) of ripping midis and soundfont from cps3, and add it to VGMtrans open source code, because it would be great if we had CPS3 support of every game of cps3 in VGMtrans, maybe we have all the Qsound collection support for VGMtrans (you know, Cps Dash, CPS2, CPS3 thanks to you, Zn-1, Zn-2 and why not? classic YM2151 CPS1 too)


thanks in advance

admin edit: removed fullquote


Top
 Profile  
 
PostPosted: 2019-06-24, 1:30:14 
Offline

Joined: 2017-12-22, 12:25:57
Posts: 2
I'm surprised that it's been over a year since I last posted the Street Fighter III music series topic. If the user Mike77154 can make this to work to help out insertnamehere with the project, I would be in relieved and hoping the series would be done before the year ends. I was also looking forward to see all the Street Fighter III series on the list for us fans to listen to. I still love the bass and the drums and I'm dying to listen to them on the instrumental channels. I'm still not giving up hope since this is the 20th Anniversary of Street Fighter III: 3rd Strike and I know you guys can work together to get the project done in no time. Best of luck.


Top
 Profile  
 
 Post subject:
PostPosted: 2019-06-26, 17:25:06 
Offline

Joined: 2017-11-21, 16:36:09
Posts: 32
DRAGONUNKNOWN, that mike was actually not related with the official vgmtrans page.
there is a user by the name of: Mikelow, but it's not the same


for the time of this reply, i don't have my old pc, i transfered, it doesn't have cps32mid, i need to download from my github

Edit: new version
songs and sf2 updated


Attachments:
cps32midi-master.7z [5.34 MiB]
Downloaded 32 times
Top
 Profile  
 
 Post subject:
PostPosted: 2019-07-16, 3:22:27 
Offline

Joined: 2019-05-03, 5:49:33
Posts: 7
insertnamehere wrote:
DRAGONUNKNOWN, that mike was actually not related with the official vgmtrans page.
there is a user by the name of: Mikelow, but it's not the same


for the time of this reply, i don't have my old pc, i transfered, it doesn't have cps32mid, i need to download from my github

Edit: new version
songs and sf2 updated


Man, really I want to help you, can I join to your project?


Top
 Profile  
 
 Post subject:
PostPosted: 2019-07-19, 20:19:27 
Offline

Joined: 2017-11-21, 16:36:09
Posts: 32
I don't really know.

cps32mid is almost done, but i work on it very slowly after long breaks, and there are 2 issues:
vibrato clashes with, on a number of songs, portamneto;
the mixing is meh (instruments too quiet, incorrect adsr since i don't use the vgmtrans code, etc).

then, after that, i need to dump bin files of instruments, sample data, and sequences of the other 5 games, but i need first to figure out the addresses of all of them.

i can ask you to do that, you grab mame, booth it up with
Attachment:
File comment: this file
automatic debug mode.7z [197 Bytes]
Downloaded 4 times
, and booth up a """"legit"""" copy of these games, and find these using the memory browser (debug->new memory window), but i'm not sure you can do it, so i don't know if i can...
it's boring (so much boring).

i can give you some clues, you may not find them useful, but here:
find one of them, and you have a greater chance of finding the other 2
as all these chunks are 0x4000 bytes big, so in the address search bar, the very start address that you found one of these, an add or subtract 0x4000, or a multiple of it, to navigate throhough these chunks,
and you specifically want to search for the sample data first, it contains information about a sample, the start offset, the end offset, the foint where the loop starts, and key.
it looks like this: https://drive.google.com/file/d/1G3ukPr ... sp=sharing
it's the easiest to see, and also the first chunk of data, so the instruments will be at the start address you find the chunk in + 0x4000, and consequentely the sequences are in that start address of instruments + 0x4000

maybe for the code too, you would need to use the mame debugger to figure out what to do, for resolving one of these issues, wrapping you head around all of that is going to be hard, unless you used it before...

or you can do something else you think can help.

Edit: ask here for any problems/questions you may have


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 55 posts ]  Go to page Previous  1, 2, 3, 4

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
[ Time : 0.177s | 17 Queries | GZIP : On ]