07-18-2013, 10:34 PM | #21 |
no
Join Date: Jan 2004
Age: 33
Posts: 1,850
|
Re: .sm to .dwi converter
haha, it's not quite done yet. it will work if you have lua installed on your pc, but i really want to make this a standalone executable.
going to edit the op with what i have so far in terms of code from now on and my future direction. Last edited by Fission; 07-18-2013 at 10:47 PM.. |
07-18-2013, 10:42 PM | #22 | |
Rhythm game specialist.
|
Re: .sm to .dwi converter
Quote:
|
|
07-18-2013, 11:20 PM | #23 |
r.i.p. tiny hippo
|
Re: .sm to .dwi converter
This is excellent. The .dwi format has never made sense to me. Keep it up 8)
|
07-19-2013, 06:29 AM | #24 |
FFR Player
Join Date: Apr 2013
Age: 32
Posts: 385
|
Re: .sm to .dwi converter
Awesome! I was actually thinking about making one myself.
__________________
https://soundcloud.com/zaevod/the-glimpse |
07-19-2013, 01:16 PM | #25 | |
quit
Join Date: Apr 2005
Location: anywhere but here
Posts: 938
|
Re: .sm to .dwi converter
Quote:
I added the following lines to my script: ("..." is where all the old scripty stuff goes) Code:
Dir.glob("**").each do |folder| next if folder =~ /.*\..{1,2}[^\)]$/ Dir.chdir(folder) ... Dir.chdir("..") end Here's the new executable: http://www.mediafire.com/download/kk.../batchdwi2.zip Extra notes: It only searches one directory down. The "next if" line is so the script skips any file with any two- or three-character extension without skipping anything ending with ")" (as all files in the batch should; it won't confuse a file with stepartist "asdfk.as" as not being a directory.) Without this line, the script would break when it tries to enter "batchdwi.exe". I don't know how to make the executable show a pop-up if it catches something that FFR doesn't support in a file, but that should be something the stepartist should check before sending the file in. ... And I don't know how to search directories and files and stuff in Lua, but here's an explanation of what I did in Ruby in case it helps: Code:
filearray = Dir.glob("*.{sm,ds,ssc}") simfile = open(filearray[0]).read() dwifile = File.new("#{filearray[0].sub(/\..+/, "")}.dwi", 'w') Last edited by Silvuh; 07-26-2013 at 03:53 PM.. |
|
07-19-2013, 01:55 PM | #26 |
FFR Player
Join Date: Dec 2008
Age: 33
Posts: 6,205
|
Re: .sm to .dwi converter
if I remember VB, I'd convert this to a standalone but the only thing I'm working with is powershell lol
can you package powershell scripts?
__________________
|
07-19-2013, 02:05 PM | #27 | ||
no
Join Date: Jan 2004
Age: 33
Posts: 1,850
|
Re: .sm to .dwi converter
Quote:
Quote:
lua doesn't offer as extensive of a file io library as ruby because it is designed to only include what is maximally portable. luafilesystem isn't quite as portable as the base io libraries, so that's why it isn't included in the standard lua libraries. it will offer all of the functionality i need, though. |
||
07-19-2013, 05:32 PM | #28 |
no
Join Date: Jan 2004
Age: 33
Posts: 1,850
|
Re: .sm to .dwi converter
updated op. removed some silly unnecessary code and cleaned up some of the structure. going to work on compiling luafilesystem into a c library in the near future.
Last edited by Fission; 08-4-2013 at 05:41 AM.. |
08-4-2013, 05:41 AM | #29 |
no
Join Date: Jan 2004
Age: 33
Posts: 1,850
|
Re: .sm to .dwi converter
updated op with new version of the script. recursive searching and converting should work now. going to work on getting a standalone executable out now.
|
08-4-2013, 07:57 AM | #30 |
Confirmed Heartbreaker
Join Date: Jul 2012
Age: 35
Posts: 5,858
|
Re: .sm to .dwi converter
i'll be waiting for that .exe
__________________
|
08-4-2013, 02:44 PM | #31 |
no
Join Date: Jan 2004
Age: 33
Posts: 1,850
|
Re: .sm to .dwi converter
updated op with standalone executable. i haven't ran this through a very extensive battery of tests, but please let me know right away if it doesn't convert a file with no holds, mines, etc. properly.
Last edited by Fission; 08-4-2013 at 02:46 PM.. |
08-4-2013, 04:03 PM | #32 |
no
Join Date: Jan 2004
Age: 33
Posts: 1,850
|
Re: .sm to .dwi converter
discovered a bug thanks to tosh
"—" in filenames will cause the converter to crash on certain language locales. i suspect there are more characters that will cause this behavior. i will look for a solution later. |
08-5-2013, 01:21 AM | #33 |
FFR Player
Join Date: Dec 2008
Age: 33
Posts: 6,205
|
Re: .sm to .dwi converter
I can't think of why that would cause a crash... is that a standard ascii character?
__________________
|
08-5-2013, 01:38 AM | #34 |
no
Join Date: Jan 2004
Age: 33
Posts: 1,850
|
Re: .sm to .dwi converter
you raise a good point. it is a standard ascii character, so i'm confused as to why it's even an issue if that's the case.
maybe all of the appropriate windows updates aren't applied? not sure right now. will think on it some more. |
08-5-2013, 04:57 PM | #35 |
FFR Player
Join Date: Dec 2008
Age: 33
Posts: 6,205
|
Re: .sm to .dwi converter
edit: https://en.wikipedia.org/wiki/Extended_ASCII
tosh, try converting an sm file with any character above 127 on this table http://www.ascii-code.com/
__________________
Last edited by Choofers; 08-5-2013 at 05:06 PM.. |
08-9-2013, 02:20 AM | #36 | |
O Derby, Where Art Thou?
Join Date: Jul 2003
Location: Virginia
Age: 32
Posts: 1,011
|
Re: .sm to .dwi converter
Quote:
I've only tried a few, but most of them didn't work. Some of the ones that worked were †, ‡, and ‰. I'm running on a Japanese locale, so I'm kinda surprised ¥ didn't work. |
|
08-9-2013, 11:06 AM | #37 |
no
Join Date: Jan 2004
Age: 33
Posts: 1,850
|
Re: .sm to .dwi converter
i am not 100% certain, but i think i discovered the cause of this.
lua doesn't support UTF by default. on a japanese locale, for instance, the characters you are having trouble with aren't in the ascii set of characters, so they need to use UTF. i found a fix for this, and will work on it tonight. |
08-19-2013, 10:17 PM | #38 |
D7 Elite Keymasher
Join Date: Jun 2012
Location: Ontario, Canada
Posts: 2,337
|
Re: .sm to .dwi converter
yeah sorry for putting it in the batch thread
so when i put it in the same folder and run, the converter opens and closes in an instant but there's no output. edit: nvm i found why it didn't show. my sm installation is in program files, and output is in the compatibility files section. it has to be run in administrator mode for output to be in the song folder. |
08-19-2013, 10:20 PM | #39 |
no
Join Date: Jan 2004
Age: 33
Posts: 1,850
|
Re: .sm to .dwi converter
phew. glad you figured it out :D.
i'll add a note about that to the OP in case anybody else runs into that pitfall. thanks for discovering that. guess that's something else i should investigate; i don't think i'll be able to find a work-around for that though. Last edited by Fission; 08-19-2013 at 10:31 PM.. |
08-26-2013, 12:03 PM | #40 |
no
Join Date: Jan 2004
Age: 33
Posts: 1,850
|
Re: .sm to .dwi converter
i'm planning on completely writing the entire script using the penlight lua libraries. in particular, most of the .sm file parsing will be done in the method described in http://stevedonovan.github.io/Penlig...guration_Files. i have spent a lot of time writing my own file parsing when most of the work was already done for me, so i'm just going to use it.
this is going to allow me to convert between .dwi and .sm formats a lot easier so i can write a converter that goes the other direction (.dwi -> .sm) and will allow the converter to be configurable with a configuration file. also, i created a gist for this script that i'll update the op with when i'm at home so i can give real-time updates as to what i'm doing. Last edited by Fission; 08-26-2013 at 12:06 PM.. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|