Romhacking.net

Romhacking => ROM Hacking Discussion => Topic started by: Dwedit on January 15, 2010, 11:03:08 pm

Title: SPC to MOD converters? (also Modifying OpenSPC)
Post by: Dwedit on January 15, 2010, 11:03:08 pm
Besides OpenSPC, are there any SPC to MOD converters?

Edit:
I finally managed to build OpenSPC.  (hint: delete the included "allegro.h" file from the source code)
I modfied the program to support fractional update rates, so it can generate better IT files.
Title: Re: SPC to MOD converters? (also Modifying OpenSPC)
Post by: Azkadellia on January 16, 2010, 01:31:06 am
Besides OpenSPC, are there any SPC to MOD converters?

Besides the old SNEmul, nope. (but then again, the mod ripper completely sucked. :P)

Quote
Edit:
I finally managed to build OpenSPC.  (hint: delete the included "allegro.h" file from the source code)
I modfied the program to support fractional update rates, so it can generate better IT files.

This is completely epic. Is it still command line, or did you give it a pretty GUI?
I loved OpenSPC completely for this reason. Too bad the SNeSe core is fail. You could use blargg's APU core if you wanted to. Relevant link. (http://www.slack.net/~ant/libs/audio.html#snes_spc)
Title: Re: SPC to MOD converters? (also Modifying OpenSPC)
Post by: JCE3000GT on January 17, 2010, 01:35:55 pm
Besides OpenSPC, are there any SPC to MOD converters?

Edit:
I finally managed to build OpenSPC.  (hint: delete the included "allegro.h" file from the source code)
I modfied the program to support fractional update rates, so it can generate better IT files.

I'm interested in a better build of the program if you make one.   ;D
Title: Re: SPC to MOD converters? (also Modifying OpenSPC)
Post by: Dwedit on January 18, 2010, 12:43:22 am
Well, it does accept fractional polling rates, but you still have to play the song, then precisely calculate what that fractional polling rate should be.

Example: The title theme from Super Mario World.
You need to precisely measure the length of a section of the song.  For instance, a loop of the whole song is 38.677458 seconds.
A measure of the song is 3.215750s.  So the loop is 12 bars long.

Then you arbitrarily decide how many IT rows you want in a frame.  Let's pick 256.
Do some division.  256/3.2231215 = 79.4261091.
That would be your desired update rate.

But then you find that if you add .003 to the update rate, it might align better to the IT file grid.

Anyway, the whole IT dumping thing is a mess and is done the wrong way.  It really should just everything with the timestamp at which it happens, then process that information to determine recurring ADSR volume envelopes, frequency sweeps, and other characteristics of the instruments, then determine the real rate they are applied on the grid.  Right now it's just using the "Okay, .01 seconds passed, have the channels changed?" algorithm.  It has issues with notes being misaligned, or volume or frequency changes immediately before the new note event.
Title: Re: SPC to MOD converters? (also Modifying OpenSPC)
Post by: Azkadellia on January 18, 2010, 12:56:47 am
Yeah, Butcha didn't know much about the Impulse Tracker format apparently. If you want it, I have an incomplete format spec written by the author of Impulse Tracker himself. It should give you an idea of how it's setup.
Title: Re: SPC to MOD converters? (also Modifying OpenSPC)
Post by: Jandazekon on June 23, 2010, 05:14:09 pm
OpenSpc the old version, does not work under x64 windows xp.
The image file C:\emu\openspc\OPENSPC.EXE is valid, but is for a machine type other than the current machine.

Please make it work in x64 windows xp.
I really want to test this app.
Title: Re: SPC to MOD converters? (also Modifying OpenSPC)
Post by: Dwedit on June 24, 2010, 12:33:32 pm
Use Dosbox.
Title: Re: SPC to MOD converters? (also Modifying OpenSPC)
Post by: Jandazekon on June 25, 2010, 04:17:47 am
Use Dosbox.
i have tested it and it is not easy as a regular emulator, i can't use it.
Title: Re: SPC to MOD converters? (also Modifying OpenSPC)
Post by: Hamtaro126 on June 25, 2010, 04:52:52 pm
Use Dosbox.
i have tested it and it is not easy as a regular emulator, i can't use it.

(A tiny bit off topic, but useful!)

To Jandazekon,
I am going to say a definate yes to what Dwedit said, I also say:
Dosbox is easier, Just need to get used to it!
If you want help, Study up and Get a book or two for use with DOS
Title: Re: SPC to MOD converters? (also Modifying OpenSPC)
Post by: Dwedit on October 21, 2011, 01:39:59 am
Bump, someone emailed me asking for my modified build of openspc.  Here it is:
http://www.dwedit.org/dwedit_board/attachment.php?item=348
Title: Re: SPC to MOD converters? (also Modifying OpenSPC)
Post by: Christopho on January 07, 2013, 04:45:32 pm
Hi,
Sorry to answer an old thread, but I just found out your modified version of openspc.
And it's totally amazing.
I am not using .it musics for my games right now because their quality was not good enough after a conversion with openspc. Some instruments are just missing, all samples sound weird compared to the original musics… So I play directly spc files (with blargg's audio libraries) but it's quite expensive for the CPU (even with fast_dsp).

After your changes, we obtain the exact same instruments and samples as the original .spc musics.
Well, actually, there is still a slight problem: the frequency of each sample and the global frequency of the file is slightly too high. But I can fix them manually with OpenMPT. (That problem was already present before your changes.)
I guess it's because the .spc format which is played with a rate of 32000 Hz, whereas OpenSPC assumes it's 32768 Hz. When I reduce the global frequency and the frequency of each sample from a factor of 32000/32768, the result is just perfect.

Thanks to your work, I will now use .it music files. And I can even easily modify them and add some effects at runtime, having fun with libmodplug.

Any chance you make the code public? Your openspc should definitely replace the old one.
Title: Re: SPC to MOD converters? (also Modifying OpenSPC)
Post by: Christopho on August 18, 2013, 05:45:31 am
In case someone is interested, Dwedit sent me the source code and I published it here: https://github.com/christopho/openspc_precise
Enojy!
Title: Re: SPC to MOD converters? (also Modifying OpenSPC)
Post by: MathOnNapkins on October 05, 2015, 10:36:15 am
Moderator's note: This thread had the tail end of it split off into another thread. It can be found here (http://www.romhacking.net/forum/index.php/topic,20492.0.html).