Romhacking.net

Romhacking => ROM Hacking Discussion => Topic started by: uyjulian on December 30, 2014, 06:32:07 pm

Title: spc2it [Convert SPC into Impulse Tracker format]
Post by: uyjulian on December 30, 2014, 06:32:07 pm
spc2it is a program that allows you to convert spc into Impulse Tracker format.

The source code can be found at https://github.com/uyjulian/spc2it

Binary releases can be found at https://github.com/uyjulian/spc2it/releases

The moonscript branch is at https://github.com/uyjulian/spc2it/tree/moonscript
No instructions yet, I'm still working on it.
Title: Re: Uyjulian's SPC to IT Converter Project
Post by: DaVince on January 12, 2015, 12:08:37 am
This is awesome. I was recently reminded of the OpenSPC tool, and remembered how useful it was to pretty much perfectly rip the audio samples (with their loop points!) and use them in my favourite music tracker (which also works with .it files). Thank you so much for bringing this to modern systems. I'm very happy I can run this on my Linux system, even if it's not perfect and notes are dropped. :)

That said, besides the known bugs, I think there is still room for improvement for the sample dumping! The samples themselves are dumped perfectly, but it's dumping them as regular samples rather than instruments. If you dump them as instruments, you get the power of adding effects to the samples, which allows for emulation of the SPC's echo and reverb effects.

Quote
There's a limit of 200 patterns in IT file format, anybody here suggest a better format?
Well, the newest tracker-type format I can think of is .mptm, and that's actually more or less just like the .it format except extended as far as I'm aware. One possibly beneficial improvement is that it allows for multiple pattern sequences (basically meaning more than 200 patterns). Might be worth looking into.

I also have a question, or rather, a point of discussion:
How come it polls the SPC file a whole bunch of times per second and creates soooo many rows at a super high tempo that don't seem to fit in an accurate, regular timing in the .it file? In this one file I noticed that one beat takes 17 rows, which is already an odd number. Then the next beat after it takes 18 rows, and then the one after THAT is 17 rows again, all while 16 rows would have made a lot more sense because you get a perfectly steady rhythm on beats that are all equal length (and preferably a power of 2). I guess it has something to do with rounding, but does it really have to round things so inconsistently? Is there anything that can be done to fix this, like figuring out what the bpm and most regular beat/measure distance of the song is before dumping it into the IT? This would also fix any potential "200 patterns is not enough" issues because the song can be accurately fit in less rows.

But anyway! Thanks a ton for this effort. I'd be more than happy myself if just the sample export side of things gets explored for improvement, but that's not all the tool sets out to do, right? ;)
Title: Re: Uyjulian's SPC to IT Convert Project
Post by: uyjulian on January 12, 2015, 01:42:04 am
This is awesome. I was recently reminded of the OpenSPC tool, and remembered how useful it was to pretty much perfectly rip the audio samples (with their loop points!) and use them in my favourite music tracker (which also works with .it files). Thank you so much for bringing this to modern systems. I'm very happy I can run this on my Linux system, even if it's not perfect and notes are dropped. :)

That said, besides the known bugs, I think there is still room for improvement for the sample dumping! The samples themselves are dumped perfectly, but it's dumping them as regular samples rather than instruments. If you dump them as instruments, you get the power of adding effects to the samples, which allows for emulation of the SPC's echo and reverb effects.
Well, the newest tracker-type format I can think of is .mptm, and that's actually more or less just like the .it format except extended as far as I'm aware. One possibly beneficial improvement is that it allows for multiple pattern sequences (basically meaning more than 200 patterns). Might be worth looking into.

I also have a question, or rather, a point of discussion:
How come it polls the SPC file a whole bunch of times per second and creates soooo many rows at a super high tempo that don't seem to fit in an accurate, regular timing in the .it file? In this one file I noticed that one beat takes 17 rows, which is already an odd number. Then the next beat after it takes 18 rows, and then the one after THAT is 17 rows again, all while 16 rows would have made a lot more sense because you get a perfectly steady rhythm on beats that are all equal length (and preferably a power of 2). I guess it has something to do with rounding, but does it really have to round things so inconsistently? Is there anything that can be done to fix this, like figuring out what the bpm and most regular beat/measure distance of the song is before dumping it into the IT? This would also fix any potential "200 patterns is not enough" issues because the song can be accurately fit in less rows.

But anyway! Thanks a ton for this effort. I'd be more than happy myself if just the sample export side of things gets explored for improvement, but that's not all the tool sets out to do, right? ;)

All right, I fixed your bug, however it isn't really with the Impulse Tracker format anymore (I change the row limit to 0xFD (aka 253), and that is the absolute limit!!! The file format can't handle any more orders!!!)
Also, if I was going to fix the row/timing problem, I might as well rewrite the entire IT dumping code, because it's a very ugly code designed for speed and memory saving (DOS ftw!!!!)

Also, Windows binaries for those that want them: https://github.com/uyjulian/spc2it/releases/tag/v0.1
Title: Re: Uyjulian's SPC to IT Convert Project
Post by: azidahaka on January 12, 2015, 04:20:06 am
Does it work on win7 64bit? If so,  :cookie: :)
Title: Re: Uyjulian's SPC to IT Convert Project
Post by: DaVince on January 12, 2015, 07:47:19 am
Thanks. That seemed to work fine even though it's going over the officially defined limit. I kinda figured you'd just force a cutoff and print a warning. :P

And yeah, I figured that any more thorough fixing would require a rewrite...

Edit: by the way, I noticed it outputs 15 channels rather than 16?
Title: Re: Uyjulian's SPC to IT Convert Project
Post by: uyjulian on January 12, 2015, 07:02:36 pm
Thanks. That seemed to work fine even though it's going over the officially defined limit. I kinda figured you'd just force a cutoff and print a warning. :P

And yeah, I figured that any more thorough fixing would require a rewrite...

Edit: by the way, I noticed it outputs 15 channels rather than 16?
Don't the channels start at 0?
Does it work on win7 64bit? If so,  :cookie: :)
Yes, works on windows.
Title: Re: Uyjulian's SPC to IT Convert Project
Post by: azidahaka on January 13, 2015, 02:03:25 am
Don't the channels start at 0?Yes, works on windows.

Thanks i'll look into it :)  :thumbsup:
Title: Re: Uyjulian's SPC to IT Convert Project
Post by: Azkadellia on January 13, 2015, 05:04:58 am
Impulse Tracker files have 64 channels and they start at 1. Also, Jeff has released the source code to Impulse Tracker.
https://bitbucket.org/jthlim/impulsetracker
Title: Re: Uyjulian's SPC to IT Convert Project
Post by: uyjulian on January 13, 2015, 08:17:39 am
Impulse Tracker files have 64 channels and they start at 1. Also, Jeff has released the source code to Impulse Tracker.
https://bitbucket.org/jthlim/impulsetracker
No, the IT documentation (ITTECH.TXT, line 384) says the channels start at 0.
Also, the 15 channels enabled thing was a error on my part. (https://github.com/uyjulian/spc2it/blob/master/it.c#L262)
Also, the source code to Impulse Tracker is written in assembly, but this might help: https://bitbucket.org/jthlim/impulsetracker/src/1e49b00d51921d5aa2edcae105529911a0fbb2a3/IT_MDATA.ASM
Title: Re: Uyjulian's SPC to IT Convert Project
Post by: Azkadellia on January 13, 2015, 08:16:53 pm
Impulse Tracker itself is telling me otherwise:
(http://saeko.arc-nova.org/wp-content/uploads/Screenshot-2015-01-13-20.07.41.png)
But, whatever.
Title: Re: Uyjulian's SPC to IT Convert Project
Post by: uyjulian on January 16, 2015, 05:03:11 am
I won't be checking this topic much anymore, go to #spc2it on freenode or go here: http://webchat.freenode.net/?channels=%23spc2it&uio=d4

All right, I have fixed the channels thing (ITTECH.TXT was wrong!!!!)
16 channels should be used now.

Also, the IT code in spc2it wastes A LOT of space, so it's best if you open the IT file in another tracker (I like schism tracker) and then save it in that tracker. That will save you a lot of space (Example: top-102.it before: 589 KB after: 175 KB about 30% savings!)
Title: Re: Uyjulian's SPC to IT Convert Project
Post by: azidahaka on January 19, 2015, 01:59:59 am
Where can be found last version?

Also as a question, can you place same instruments in same columns when outputting the IT file? OR it's the way it works on the snes?
Title: Re: Uyjulian's SPC to IT Convert Project
Post by: uyjulian on January 20, 2015, 04:32:51 am
Where can be found last version?

Also as a question, can you place same instruments in same columns when outputting the IT file? OR it's the way it works on the snes?

Find stable windows binaries/source code here: https://github.com/uyjulian/spc2it/releases
Or latest source code here: https://github.com/uyjulian/spc2it

Also, I don't understand that last question, you should rephrase that question.

Oh, and I have some exciting news: First note problem fixed! Also, pitch slides are fixed, too. Also fixed the channel problem, now all 16 channels should be used. Also, the length problem should be fixed, so basically I'm back to where OpenSPC was with IT dumping :-)
Title: Re: Uyjulian's SPC to IT Convert Project
Post by: azidahaka on January 20, 2015, 10:21:57 am
ah great i'll download the new version as i get home  :thumbsup:

What i meant is that sometime the same instruments play in 2 or 3 rows, is that the normal way the snes uses or a result of the conversion?
Title: Re: Uyjulian's SPC to IT Convert Project
Post by: uyjulian on January 21, 2015, 05:14:24 am
ah great i'll download the new version as i get home  :thumbsup:

What i meant is that sometime the same instruments play in 2 or 3 rows, is that the normal way the snes uses or a result of the conversion?
It's the result of the conversion, I think the new version will fix some of those problems.

Also, update: pitch sounds correctly now!!!
I couldn't find the error before (because I didn't know what bitshifts did), but I changed the bitshifts I could find in my code into multiply, and I found the error!
https://github.com/uyjulian/spc2it/blob/master/it.c#L181

Orig:
Code: [Select]
pitch = (s32)(*(u16 *)&SPC_DSP[(i << 4) + 0x02]) << 3;Multiply:
Code: [Select]
pitch = (s32)(*(u16 *)&SPC_DSP[(i << 4) + 0x02]) * 8;Fixed:
Code: [Select]
pitch = (s32)(*(u16 *)&SPC_DSP[(i << 4) + 0x02]) * 7.8125;
Title: Re: Uyjulian's SPC to IT Convert Project
Post by: DaVince on January 21, 2015, 10:40:47 am
Thanks for the fixes! The new exported files sound much better now. :)

I noticed that a conversion of "103 Start Of Journey" from Lufia 2 still has a missing start note. However, the SPC itself also sounds as if the recording started a tiny bit after the first note, but the first note IS played in the SPC and not in the IT.
Edit: "102 Rumbling" and a lot of ohters also have their first note cut off, while the SPC sounds ripped properly.

Another edit: is there any chance that you could interpret any "note volume 0" commands as a "note off" command instead? This would make it easier to get an audible "note off" effect when messing with instrument effects.
Title: Re: Uyjulian's SPC to IT Convert Project
Post by: azidahaka on January 21, 2015, 11:05:34 am
It's the result of the conversion, I think the new version will fix some of those problems.

Also, update: pitch sounds correctly now!!!
I couldn't find the error before (because I didn't know what bitshifts did), but I changed the bitshifts I could find in my code into multiply, and I found the error!
https://github.com/uyjulian/spc2it/blob/master/it.c#L181

Orig:
Code: [Select]
pitch = (s32)(*(u16 *)&SPC_DSP[(i << 4) + 0x02]) << 3;Multiply:
Code: [Select]
pitch = (s32)(*(u16 *)&SPC_DSP[(i << 4) + 0x02]) * 8;Fixed:
Code: [Select]
pitch = (s32)(*(u16 *)&SPC_DSP[(i << 4) + 0x02]) * 7.8125;

I'm really grateful for this! I had a project of creating some "High quality" remastered soundtracks using soundfonts and spacial effects... Seems this will make it all way easier! Is Dl link the same as usual?
Title: Re: Uyjulian's SPC to IT Convert Project
Post by: DaVince on January 21, 2015, 11:06:47 am
I'm really grateful for this! I had a project of creating some "High quality" remastered soundtracks using soundfonts and spacial effects... Seems this will make it all way easier! Is Dl link the same as usual?
Quote
Find stable windows binaries/source code here: https://github.com/uyjulian/spc2it/releases
;)

Looking forward ot those remasters, by the way!
Title: Re: Uyjulian's SPC to IT Convert Project
Post by: azidahaka on January 21, 2015, 11:40:48 am
I'll post something when i'll get some good ones like this old one i made ages ago:

https://www.youtube.com/watch?v=iP3bIL4Pmlw is the only sample i uploaded
Title: Re: Uyjulian's SPC to IT Convert Project
Post by: uyjulian on January 21, 2015, 08:45:18 pm
Thanks for the fixes! The new exported files sound much better now. :)

I noticed that a conversion of "103 Start Of Journey" from Lufia 2 still has a missing start note. However, the SPC itself also sounds as if the recording started a tiny bit after the first note, but the first note IS played in the SPC and not in the IT.
Edit: "102 Rumbling" and a lot of ohters also have their first note cut off, while the SPC sounds ripped properly.

Another edit: is there any chance that you could interpret any "note volume 0" commands as a "note off" command instead? This would make it easier to get an audible "note off" effect when messing with instrument effects.

Hmm, I'll check that out and see what's going on.

Also, I'll clean up the IT pattern writing code, then I'll do that.


EDIT: Okay, fix is now up! Turns out I have to turn on the first note manually (since the SPC CPU emulator does not do that, the note is already on in the SPC!)
Title: Re: Uyjulian's SPC to IT Convert Project
Post by: uyjulian on January 31, 2015, 04:51:48 pm
New windows build:

https://github.com/uyjulian/spc2it/releases/tag/v0.3

Includes pitch fix, first note fix, etc.
Title: Re: Uyjulian's SPC to IT Convert Project
Post by: azidahaka on February 02, 2015, 02:01:12 am
When i get home i'll try it  :thumbsup:

Did you include the "multiple instruments" to single row options too?
Title: Re: Uyjulian's SPC to IT Convert Project
Post by: uyjulian on February 02, 2015, 03:03:02 am
When i get home i'll try it  :thumbsup:

Did you include the "multiple instruments" to single row options too?
What do you mean by that?
Title: Re: Uyjulian's SPC to IT Convert Project
Post by: Noelemahc on February 02, 2015, 07:49:23 am
What do you mean by that?
IT and SPC can use one track for multiple instruments. For MIDI, the traditional approach is one track = one MIDI channel (which means one instrument may take up more than one track).

It's an organizational nitpick which OpenSPC ignored: you could end up with, say, lead synth jumping from track 03 to track 04 mid-song, which would make using the MIDI hella uncomfortable as a result if you didn't have MIDI cleaning/optimizing tools like GNMIDI, for example.
Title: Re: Uyjulian's SPC to IT Convert Project
Post by: uyjulian on February 02, 2015, 08:21:58 am
IT and SPC can use one track for multiple instruments. For MIDI, the traditional approach is one track = one MIDI channel (which means one instrument may take up more than one track).

It's an organizational nitpick which OpenSPC ignored: you could end up with, say, lead synth jumping from track 03 to track 04 mid-song, which would make using the MIDI hella uncomfortable as a result if you didn't have MIDI cleaning/optimizing tools like GNMIDI, for example.

Ah, I see. I might do that when I rewrite the entire IT dumping code.
Title: Re: Uyjulian's SPC to IT Convert Project
Post by: azidahaka on February 02, 2015, 08:36:01 am
It would be very useful if you manage to do that :)

I imagine it might be quite hard and i'm not sure if spc actually use more of the same instrument side by side playing... Can be useful to some useless for others, if you get around doing it i suggest making it optional.
Title: Re: Uyjulian's SPC to IT Convert Project
Post by: uyjulian on February 02, 2015, 06:53:56 pm
It would be very useful if you manage to do that :)

I imagine it might be quite hard and i'm not sure if spc actually use more of the same instrument side by side playing... Can be useful to some useless for others, if you get around doing it i suggest making it optional.
If I rewrite the IT dumping code, other changes might come too... such as SPC playing no longer need fix rate.
Title: Re: Uyjulian's SPC to IT Convert Project
Post by: azidahaka on February 04, 2015, 05:52:08 pm
What do you mean by no longer need fix rate?
Title: Re: Uyjulian's SPC to IT Convert Project
Post by: uyjulian on February 04, 2015, 06:19:12 pm
What do you mean by no longer need fix rate?
https://github.com/uyjulian/spc2it/blob/master/emu.h#L18
Title: Re: Uyjulian's SPC to IT Convert Project
Post by: azidahaka on February 11, 2015, 02:18:21 am
Not sure i understand what it implies but i'm rooting for you  :angel:
Title: Re: Uyjulian's SPC to IT Convert Project
Post by: uyjulian on February 11, 2015, 03:28:20 am
Not sure i understand what it implies but i'm rooting for you  :angel:
Thanks!
If you search for that macro in the source code, that's how many cycles before IT gets checked (that's why you get those very fast speeds.)
Title: Re: Uyjulian's SPC to IT Convert Project
Post by: azidahaka on February 11, 2015, 01:07:04 pm
I imagine you aim to vary that? Getting more or less accuracy depending on needs?
Title: Re: Uyjulian's SPC to IT Convert Project
Post by: uyjulian on February 11, 2015, 06:39:27 pm
I imagine you aim to vary that? Getting more or less accuracy depending on needs?
No, you can already do that in the source code (as long as you don't set the update to above 102)
However, I need to get rid of that fixed-cycle thing, let the program calculate what is the best speed for the IT file.
Title: Re: Uyjulian's SPC to IT Convert Project
Post by: azidahaka on February 28, 2015, 03:57:06 pm
Looking forward to some news :)
Title: Re: Uyjulian's SPC to IT Convert Project
Post by: uyjulian on February 28, 2015, 04:06:35 pm
Looking forward to some news :)
Nothing right now... since I have no idea what to do.
Title: Re: Uyjulian's SPC to IT Convert Project
Post by: uyjulian on March 09, 2015, 05:38:49 am
Allright, I pushed a change, there is now a cmake file instead of a makefile, this should make cross-platform building easier
Title: Re: Uyjulian's SPC to IT Convert Project
Post by: azidahaka on March 15, 2015, 01:49:25 pm
Not sure what will change for users?

Any news on the possibility of "cleaning" up the output from instrument spread over different patterns?
Title: Re: Uyjulian's SPC to IT Convert Project
Post by: uyjulian on March 15, 2015, 02:14:33 pm
Not sure what will change for users?

Any news on the possibility of "cleaning" up the output from instrument spread over different patterns?

Right after I rewrite the impulse tracker writing code to be more modular (example: llvm)... soon :-)
Title: Re: Uyjulian's SPC to IT Convert Project
Post by: azidahaka on March 16, 2015, 02:50:55 am
 :crazy:

Good to hear and keep us updated :)
Title: Re: Uyjulian's SPC to IT Convert Project
Post by: uyjulian on March 16, 2015, 11:53:11 am
:crazy:

Good to hear and keep us updated :)
Always check https://github.com/uyjulian/spc2it for updates :-)
Title: Re: Uyjulian's SPC to IT Convert Project
Post by: uyjulian on April 24, 2015, 05:45:21 am
Sorry for the long silence, I've been busy with school.

For a status update, I'm getting rid of the confusing "wrappers" that was from the old OpenSPC code, and that will probably be the last of old OpenSPC code. (remember that pitch bug?)
Title: .
Post by: Chpexo on May 14, 2015, 08:13:58 pm
.
Title: Re: Uyjulian's SPC to IT Convert Project
Post by: uyjulian on May 15, 2015, 04:07:50 am
I've been using spc2it.exe for a little while now and I must say nice job. Because of this program, I can rip samples from games easier. Before I had to rip samples with ssor95, it would rip the larger samples but without the loop points, leaving me to painfully find my own loop point.

Since i like this program a lot, I'd like to point out some bugs. I see that your program cuts the file name off at the first period for the IT file, this leaves OST titles like "069 Dr. Andonuts' Lab.spc" to have the file name "069 Dr.it". This should be an easy fix.

Another problem I'd like to address is the fact that the samples are transposed at a certain note. Where are you getting these note values from? The transposing seems to vary from song to song for the same sample. I would prefer these to be consistent as I am reusing these samples in hacks and archiving them too. I also like to cover the songs in a program called snesgss and I set all my samples to B notes for this reason as stated from the snesgss readme:

These are some little things that I found, I hope to hear some feedback from you!
Yeah, I should fix the period thing. The original OpenSPC used a very ugly hack to replace in the filename the .spc with .it (see: https://github.com/uyjulian/spc2it/blob/master/main.c#L160). Thanks for finding that bug!
See https://github.com/uyjulian/spc2it/blob/master/it.c#L143 to see how pitch is transposed into notes. (remember, .it is an old format so hacks are needed!)
I'll look at snesgss.
Title: Re: Uyjulian's SPC to IT Convert Project
Post by: uyjulian on July 10, 2015, 01:07:29 pm
Okay, so after a long hiatus, I'm back.

It's really hard to maintain the codebase in C. (Manual memory management is a big pain in the áss)
Here's what I'm going to do:

keep the SPC emulation core in C, turn it into a dynamically loaded library
rewrite the SPCDSP -> IT code in Lua

This way, it will be easier to maintain the code, but I'm not sure how many people here are technical-minded enough to know how to run Lua scripts using the standalone LuaJIT application. I hope I won't leave you behind.

Title: Re: Uyjulian's SPC to IT Convert Project
Post by: DaVince on July 11, 2015, 09:53:50 am
Welcome back!

If LuaJIT compiled into a single executable, you could include it with the download, maybe even with a batch file (for Windows builds, obviously). That'd make it easy for anyone wanting to use it and not having/knowing how to use LuaJIT. Then again, this is already a command-line tool, so I think some competence in using the command line is already expected.

Anyway, you going this way does promote further development and improvement on this, which I think is awesome, so... take the route you think is best! :)
Title: Re: Uyjulian's SPC to IT Convert Project
Post by: uyjulian on July 11, 2015, 09:56:09 am
Welcome back!

If LuaJIT compiled into a single executable, you could include it with the download, maybe even with a batch file (for Windows builds, obviously). That'd make it easy for anyone wanting to use it and not having/knowing how to use LuaJIT. Then again, this is already a command-line tool, so I think some competence in using the command line is already expected.

Anyway, you going this way does promote further development and improvement on this, which I think is awesome, so... take the route you think is best! :)

I think it might be possible to merge C libraries into an executable generated by LuaJIT, but I'm not sure about if it's possible to add static libraries after the linking to executable... so I'll go check on that.
Title: Re: Uyjulian's SPC to IT Convert Project
Post by: azidahaka on August 03, 2015, 05:13:26 pm
I forgot about your work for sometime.. damn Real life issues :D

Have you managed to avoid the "same instrument on 100 different rows" issue aka as cleaning up the resulting file?

It was the only thing hindering the use of the software for me...
Title: Re: Uyjulian's SPC to IT Convert Project
Post by: uyjulian on August 03, 2015, 07:52:34 pm
I forgot about your work for sometime.. damn Real life issues :D

Have you managed to avoid the "same instrument on 100 different rows" issue aka as cleaning up the resulting file?

It was the only thing hindering the use of the software for me...

Nope, not yet.

I'm still working on my C->Lua conversion.
Title: Re: Uyjulian's SPC to IT Convert Project
Post by: azidahaka on August 04, 2015, 06:41:31 am
Nope, not yet.

I'm still working on my C->Lua conversion.

C -> Lua? i thought the opposite :D
Title: Re: Uyjulian's SPC to IT Convert Project
Post by: uyjulian on August 04, 2015, 02:22:22 pm
C -> Lua? i thought the opposite :D

Nope.

The reason I'm doing that is so I don't have to deal with malloc/free anymore.

Manual memory management is getting to be a hassle.
Title: .
Post by: Chpexo on October 03, 2015, 08:37:58 pm
.
Title: Re: Uyjulian's SPC to IT Convert Project
Post by: uyjulian on October 03, 2015, 08:46:11 pm
Hey uyjulian. I hope that Lua conversion is going smoothly. I found a bug in your original C version that you might not be aware of. Apparently when compiling the IT file, your program will crash if it has to do more than 240 patterns. Be sure to fix this in the Lua version. I ran into this error when compiling some SPCs from Equinox.

P.S. I changed the topic title to a more relevant one.

Yeah, after I finish my conversion, I'll grab every SPC I can and run my program over all of them to see which ones crash.

Oh, by the way, you need to tell a moderator to change the topic title, try going to the original post and pressing "Report to moderator" with your reasons.
Title: .
Post by: Chpexo on October 03, 2015, 10:50:47 pm
.
Title: Re: Uyjulian's SPC to IT Converter Project
Post by: MathOnNapkins on October 05, 2015, 10:42:12 am
Moderator's Note:
This topic was split off from a different topic that was more general concerning converting SPC files to MOD files. Also serves as a bump because the origin thread is currently higher up.
Title: Re: Uyjulian's SPC to IT Converter Project
Post by: uyjulian on October 05, 2015, 12:00:44 pm
Okey dokey. It sounds right to have your own topic for your own project anyway.

EDIT: Another bug I forgot to mention. Apparently for some SPCS (specifically ones ripped with ZSNES I believe) the first row of notes seem cut off. So it some instrument plays the whole time in a column, you won't hear it play in the IT file.

Yeah, I'm still trying to get a fix for that. I have no idea what causes it, but I think after I convert the code into Lua, I can find the bug easier. Also see: https://github.com/uyjulian/spc2it/issues/3
Title: Re: spc2it [Convert SPC into Impulse Tracker format]
Post by: uyjulian on June 10, 2016, 09:52:57 am
Long time no see!

I'm thinking about using Terra so that I can still compile it, like usual.
This way, Windows users can still use the program while advanced users can poke at the code quite easily.

http://terralang.org/

I've had the various bugs "fixed" in my lua version, but it's a lazy fix and I want to just rewrite the entire way how the program works...
Title: Re: spc2it [Convert SPC into Impulse Tracker format]
Post by: uyjulian on July 13, 2016, 03:20:26 pm
The experimental moonscript branch has been pushed
https://github.com/uyjulian/spc2it/tree/moonscript
No instructions yet, I'm still working on it.

Freenode#spc2it is now no longer invite-only (how did I forget to unset the invite-only flag???)

I'm working on an entirely new way to log DSP events so there will no longer be issues with timing (like first note issue)
Title: Re: spc2it [Convert SPC into Impulse Tracker format]
Post by: TheLoneSurvivor on July 20, 2016, 11:31:29 am
Does this work with all SPC "drivers", or N-SPC only?
Title: Re: spc2it [Convert SPC into Impulse Tracker format]
Post by: uyjulian on July 20, 2016, 12:28:01 pm
Does this work with all SPC "drivers", or N-SPC only?
It works with all SPC drivers.
This program has an internal SPC700 core; it just captures writes to DSP registers and converts them to .it accordingly.
Title: Re: spc2it [Convert SPC into Impulse Tracker format]
Post by: uyjulian on December 16, 2016, 07:08:27 am
http://arstechnica.com/security/2016/12/fedora-and-ubuntu-0days-show-that-hacking-desktop-linux-is-now-a-thing

Please don't put untrusted .spc files in spc2it because I haven't tested it for vulns yet.
Title: Re: spc2it [Convert SPC into Impulse Tracker format]
Post by: Zeikar on December 16, 2016, 07:26:58 am
http://arstechnica.com/security/2016/12/fedora-and-ubuntu-0days-show-that-hacking-desktop-linux-is-now-a-thing

Please don't put untrusted .spc files in spc2it because I haven't tested it for vulns yet.
Please don't talk to yourself it's the first sign of madness, nah jk bro, but seems your comment on arstechnica was overlooked too.
My media player has an SPC plugin, I believe, is there any real benefit to converting to Impulse Tracker? I don't really edit audio in roms or listen to SPCs very often, just curious.
Title: Re: spc2it [Convert SPC into Impulse Tracker format]
Post by: SunGodPortal on December 19, 2016, 10:38:22 pm
My media player has an SPC plugin, I believe, is there any real benefit to converting to Impulse Tracker?

It would be beneficial if you want to edit the song or perhaps if you want to use the same sound samples to write something else. I'd like to try this program because I have some minor changes I want to make to a bunch of songs in a particular game. It would be nice to do the experimenting portion in a tracking program rather than having no way to try these changes out without loading very specific parts of the game each time I want to hear what it would sound like. Unfortunately, I downloaded it and when I clicked on it, it disappeared like one of those DOS programs that requires a command prompt. Maybe it is and does but it's kinda hard to know that with no instructions.
Title: Re: spc2it [Convert SPC into Impulse Tracker format]
Post by: uyjulian on December 19, 2016, 11:06:56 pm
It would be beneficial if you want to edit the song or perhaps if you want to use the same sound samples to write something else. I'd like to try this program because I have some minor changes I want to make to a bunch of songs in a particular game. It would be nice to do the experimenting portion in a tracking program rather than having no way to try these changes out without loading very specific parts of the game each time I want to hear what it would sound like. Unfortunately, I downloaded it and when I clicked on it, it disappeared like one of those DOS programs that requires a command prompt. Maybe it is and does but it's kinda hard to know that with no instructions.
Open the command line
Drag the spc2it.exe into the command line
Press enter for help
Title: Re: spc2it [Convert SPC into Impulse Tracker format]
Post by: SunGodPortal on December 19, 2016, 11:26:55 pm
Awesome. Thanks. Cool program.
Title: Re: spc2it [Convert SPC into Impulse Tracker format]
Post by: uyjulian on January 22, 2018, 11:22:31 pm
Plans for 2018:

Store logged DSP writes while SPC emulation is being done, then process them afterwards after SPC emulation is finished
Port Moonscript changes back to C
Noise emulation (possibly new samples?)
Auto loop detection

Future plans:

SPC emulator for PS(1/2) for native playback on SPU(2) (The SPC and SPU are both made by Sony, but I'm not sure how similar they are)
Soundfont/MIDI extraction
Title: Re: spc2it [Convert SPC into Impulse Tracker format]
Post by: Enjineer on February 02, 2018, 04:25:39 pm
Hi, new user here. I've tried your program, and it works great! However, I'm trying to convert the .it to .mid to allow for editing, and it has an absurdly high tempo when I do so - OpenMPT estimates the BPM to be 1500! Is there a way to fix this?