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

Author Topic: spc2it [Convert SPC into Impulse Tracker format]  (Read 12834 times)

uyjulian

  • Jr. Member
  • **
  • Posts: 33
    • View Profile
Re: Uyjulian's SPC to IT Convert Project
« Reply #40 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?)

Chpexo

  • Hero Member
  • *****
  • Posts: 731
    • View Profile
.
« Reply #41 on: May 14, 2015, 08:13:58 pm »
.
« Last Edit: January 01, 2016, 09:51:14 am by Chpexo »

uyjulian

  • Jr. Member
  • **
  • Posts: 33
    • View Profile
Re: Uyjulian's SPC to IT Convert Project
« Reply #42 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.

uyjulian

  • Jr. Member
  • **
  • Posts: 33
    • View Profile
Re: Uyjulian's SPC to IT Convert Project
« Reply #43 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.


DaVince

  • Jr. Member
  • **
  • Posts: 6
    • View Profile
Re: Uyjulian's SPC to IT Convert Project
« Reply #44 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! :)
Tingle's balloon trip of love is finally translated! Go check it out!

uyjulian

  • Jr. Member
  • **
  • Posts: 33
    • View Profile
Re: Uyjulian's SPC to IT Convert Project
« Reply #45 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.

azidahaka

  • Full Member
  • ***
  • Posts: 169
    • View Profile
Re: Uyjulian's SPC to IT Convert Project
« Reply #46 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...

uyjulian

  • Jr. Member
  • **
  • Posts: 33
    • View Profile
Re: Uyjulian's SPC to IT Convert Project
« Reply #47 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.

azidahaka

  • Full Member
  • ***
  • Posts: 169
    • View Profile
Re: Uyjulian's SPC to IT Convert Project
« Reply #48 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

uyjulian

  • Jr. Member
  • **
  • Posts: 33
    • View Profile
Re: Uyjulian's SPC to IT Convert Project
« Reply #49 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.

Chpexo

  • Hero Member
  • *****
  • Posts: 731
    • View Profile
.
« Reply #50 on: October 03, 2015, 08:37:58 pm »
.
« Last Edit: January 01, 2016, 12:12:59 pm by Chpexo »

uyjulian

  • Jr. Member
  • **
  • Posts: 33
    • View Profile
Re: Uyjulian's SPC to IT Convert Project
« Reply #51 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.

Chpexo

  • Hero Member
  • *****
  • Posts: 731
    • View Profile
.
« Reply #52 on: October 03, 2015, 10:50:47 pm »
.
« Last Edit: January 01, 2016, 12:12:42 pm by Chpexo »

MathOnNapkins

  • Forum Moderator
  • Hero Member
  • *****
  • Posts: 629
  • Who ya gonna call
    • View Profile
    • Arc-Nova - Rohmackin' and Chiptunin'
Re: Uyjulian's SPC to IT Converter Project
« Reply #53 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.

uyjulian

  • Jr. Member
  • **
  • Posts: 33
    • View Profile
Re: Uyjulian's SPC to IT Converter Project
« Reply #54 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
« Last Edit: October 05, 2015, 12:06:54 pm by uyjulian »

uyjulian

  • Jr. Member
  • **
  • Posts: 33
    • View Profile
Re: spc2it [Convert SPC into Impulse Tracker format]
« Reply #55 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...

uyjulian

  • Jr. Member
  • **
  • Posts: 33
    • View Profile
Re: spc2it [Convert SPC into Impulse Tracker format]
« Reply #56 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)
« Last Edit: July 15, 2016, 02:29:37 pm by uyjulian »

TheLoneSurvivor

  • Jr. Member
  • **
  • Posts: 12
  • back from the dead
    • View Profile
Re: spc2it [Convert SPC into Impulse Tracker format]
« Reply #57 on: July 20, 2016, 11:31:29 am »
Does this work with all SPC "drivers", or N-SPC only?
Doom SNES Hacker.

uyjulian

  • Jr. Member
  • **
  • Posts: 33
    • View Profile
Re: spc2it [Convert SPC into Impulse Tracker format]
« Reply #58 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.

uyjulian

  • Jr. Member
  • **
  • Posts: 33
    • View Profile
Re: spc2it [Convert SPC into Impulse Tracker format]
« Reply #59 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.