|
Post by moriapainter on Mar 11, 2009 0:59:07 GMT -6
Edited to reflect latest version: Hi, I thought people here might be interested in a program I originally wrote to make it easier to access the text of songs for uploading/downloading/editing by hand. It now has a few other features, including: Export to midi Export to Advanced Mario Sequencer (AMS) format Batch conversion to midi and AMS (exports all files in your playlist) Change instruments (e.g. you can switch all the flowers to cars in a song, or swap dogs and cats) You can download the binary or source code from Sourceforge. It's released under the GNU GPL v3 (open source license which basically means you can use it for free, and even change it, provided you distribute the changed version under the same license; i.e. you can't change it and sell it.) While you no longer need Python to run the script, if you have Python you can download the source file instead of the binary (the source file is smaller). You can download Python for free from www.python.org. It's a great programming language which you can use to edit other people's scripts or even write your own scripts. I'd encourage you to check out the tutorials.) There are currently two branches of Python. If you're using the source version of MPC Assistant, it should work with both version 2.6 and version 3.x. If you have problems let me know. The code gets loaded and saved from a text box on the right of the GUI. You can copy and paste from this editor using the standard shortcuts: in case you don't know them, these are: Ctrl-C: copy Ctrl-V: paste Ctrl-X: cut Ctrl-home, Ctrl-shift-end: select all (or just double click anywhere in the text box) In addition the GUI can export songs as midi files and Advanced Mario Sequencer (AMS) files (this is somewhat experimental ... if you encounter any problems let me know.) The midi files get saved in the 'prefs' folder. It actually generates two of them: one using the original instruments, for playing with the mario soundfont; and another which tries to map the instuments to general midi instruments so they can be played by normal midi players. (If you want to try playing midi files using different soundfonts I suggest you check out the open source soundfont host Synthfont. You can use Synthfont to record midis directly to wave or mp3 files, or just to play them. Their soundfont editor, Viena is also pretty good.) I hope someone finds this useful.
|
|
|
Post by lih on Mar 11, 2009 2:07:23 GMT -6
Export to MIDI?!
I'm going to have some fun with this.
EDIT: It doesn't work because the Tkinter module doesn't exist.
|
|
Cat
Plane
Zoroark fanatic
Posts: 973
|
Post by Cat on Mar 11, 2009 10:23:32 GMT -6
I was actually considering creating something like this, but I wasn't quite sure how to use the MIDI file format.
|
|
|
Post by moriapainter on Mar 11, 2009 18:41:43 GMT -6
EDIT: It doesn't work because the Tkinter module doesn't exist. Ok, it seems this is a Python 3 compatibility issue. I think I've fixed it - try redownloading. If it still doesn't work, let me know... I also added scrollbars to the song list and main text box. I was actually considering creating something like this, but I wasn't quite sure how to use the MIDI file format. I just got the format off the web and used array/struct from the Python library
|
|
|
Post by eataninja on Mar 11, 2009 20:00:56 GMT -6
I'll try this tomorrow. Seems like a good idea
|
|
|
Post by moriapainter on Mar 13, 2009 22:01:37 GMT -6
Version 1.1 is now available for download. New features: Export to Advanced Mario Sequencer (AMS) format Batch conversion to midi and AMS (exports all files in your playlist) I've tested it with Python 2.6 and 3.0 and it works fine with both on my computer.
|
|
|
Post by lih on Mar 13, 2009 22:29:27 GMT -6
It still won't import the Tkinter module. I'm using Python 3.0 FYI
|
|
|
Post by moriapainter on Mar 13, 2009 22:48:08 GMT -6
This is very strange. When I run it from the Python 3.0 IDLE editor (which is what I do when working on it), it works fine. But running it just using Python 3.0 gives an error. I hadn't tried that before because I have both Python versions installed, and double clicking on a file runs it using Python 2.6, which also works.
I'll try work on a fix, but in the meantime, try this: run IDLE (under the Python 3.0 folder of your start menu), open the script, and hit F5 to run it.
|
|
|
Post by lih on Mar 13, 2009 22:48:12 GMT -6
It works when I run it through IDLE!
Thanks ^_^
But the converting functions don't work. This is the error I got
Exception in Tkinter callback Traceback (most recent call last): File "C:\Python30\lib\tkinter\__init__.py", line 1399, in __call__ return self.func(*args) File "C:\Documents and Settings\Pro\My Documents\Stuff\MPC\MPCv2\Prefs\mpcassist.py", line 88, in saveMidi midiConvertCode(code, fname) File "C:\Documents and Settings\Pro\My Documents\Stuff\MPC\MPCv2\Prefs\mpcassist.py", line 511, in bothConvertCode marioConvertCode(code, fname) File "C:\Documents and Settings\Pro\My Documents\Stuff\MPC\MPCv2\Prefs\mpcassist.py", line 505, in marioConvertCode convertCode(code, fname, marioPatches, marioOffsets, zeroSpecialOffsets, '-mario') File "C:\Documents and Settings\Pro\My Documents\Stuff\MPC\MPCv2\Prefs\mpcassist.py", line 498, in convertCode midi = code2midi(code, patches, offsets, specialOffsets) File "C:\Documents and Settings\Pro\My Documents\Stuff\MPC\MPCv2\Prefs\mpcassist.py", line 427, in code2midi time, tempo, tracks = parse(code, offsets, specialOffsets) File "C:\Documents and Settings\Pro\My Documents\Stuff\MPC\MPCv2\Prefs\mpcassist.py", line 384, in parse time, rest = code.split('*') ValueError: need more than 1 value to unpack
|
|
|
Post by moriapainter on Mar 13, 2009 23:02:22 GMT -6
BTW, unless you're doing a batch convert, you have to use "Load Song Code" or paste in some code before using "Save Midi", because the Save Midi only exports what's in the text box.
If that wasn't the problem, can you give me the code of the file you tried to convert? (Via pm if you don't want to post it publicly). The error message seems to indicate there was no * after the time signature at the beginning...
|
|
|
Post by lih on Mar 14, 2009 0:56:11 GMT -6
It works! Thanks ^_^
|
|
|
Post by moriapainter on Mar 14, 2009 5:14:44 GMT -6
Great! I think I've fixed the 3.0 bug now - it works without IDLE on my computer. download link
|
|
|
Post by lih on Mar 15, 2009 2:50:04 GMT -6
It works fine now.
|
|
|
Post by moriapainter on Mar 16, 2009 2:08:35 GMT -6
A few new features for version 1.15: Binary distribution for windows! (Thanks to py2exe!) You should be able to run this even if you don't have Python installed. The source is still available in case you have Python (it's a much smaller zip file.) The script/exe doesn't have to be in the Prefs directory. If it isn't, it will ask you to locate the Prefs directory and then remember it. Change instruments feature: e.g. you can switch all the flowers to cars in a song, or swap dogs and cats. download linkbinary download linksource download link
|
|
KM
Yoshi
penid
Posts: 1,463
|
Post by KM on Mar 18, 2009 14:45:12 GMT -6
I have no idea what the heck you're talking about...
|
|
|
Post by LuckyTrixter on Mar 18, 2009 17:16:13 GMT -6
Works great for me! Very fun and useful tool.
|
|
|
Post by Ford Prefect on Mar 20, 2009 7:02:17 GMT -6
As I'm working on MPC file importing for the AMS, I tested your AMS saving feature to see what you're doing when you encounter a low A glitch. This is what I always get when I try to export a file as AMS:
Traceback (most recent call last): File "Tkinter.pyc", line 1410, in __call__ File "mpcassist.py", line 234, in saveAMS File "mpcassist.py", line 730, in convertCode File "mpcassist.py", line 712, in parse IndexError: string index out of range
Like I said, I'm working on MPC importing myself, so the AMS export option of your script might be unnecessary soon, but I thought you might want to know.
I tested this on Windows Server 2008 (with administrator rights). I wanted to start your script via Python on MacOSX, but I get this:
Syntax error in script /Users/Felix/Downloads/mpcassist115_source/mpcassist.py: invalid syntax (mpcassist.py, line 568)
|
|
|
Post by moriapainter on Mar 20, 2009 16:59:43 GMT -6
As I'm working on MPC file importing for the AMS, I tested your AMS saving feature to see what you're doing when you encounter a low A glitch. This is what I always get when I try to export a file as AMS: Traceback (most recent call last): File "Tkinter.pyc", line 1410, in __call__ File "mpcassist.py", line 234, in saveAMS File "mpcassist.py", line 730, in convertCode File "mpcassist.py", line 712, in parse IndexError: string index out of range Like I said, I'm working on MPC importing myself, so the AMS export option of your script might be unnecessary soon, but I thought you might want to know. Thanks, could you possibly PM me the file which caused this error? How is the 'low A glitch' supposed to behave when played? An import function built into your sequencer will be more convenient, but I thought it would be easier to write the conversion code in Python than in REALbasic (especially since I already had the parsing code for midi export), so I tried to provide a temporary alternative. I tested this on Windows Server 2008 (with administrator rights). I wanted to start your script via Python on MacOSX, but I get this: Syntax error in script /Users/Felix/Downloads/mpcassist115_source/mpcassist.py: invalid syntax (mpcassist.py, line 568) Which version of Python are you running on OSX? Unfortunately to make this program compatible with Python 3.0, I had to use some features (like byte literals, which first occur on the line you mention) which have been backported to the latest Python 2.6, but not to earlier versions.
|
|
|
Post by Ford Prefect on Mar 21, 2009 7:35:16 GMT -6
Well, I have Python 2.5.1 on MacOSX, the newest MacPython release seems to be 2.5.3, so there's no point in installing it. I believe Python 3 will come with MacOSX Snow Leopard... As for the low A glitch, watch Lolo's tutorial vid: www.youtube.com/watch?v=Y8tn3wrYDVAThis gave me some trouble when stored in an MPC file, because the non-existing low A position ist stored as position "17" (while all other positions are stored with a single letter). I'll send you two of my files that didn't work for testing - the second one has a low A note somewhere, though it's accidentally there and I discovered it only as I tested my importing code with it.
|
|
|
Post by moriapainter on Mar 24, 2009 21:14:15 GMT -6
Well, I have Python 2.5.1 on MacOSX, the newest MacPython release seems to be 2.5.3, so there's no point in installing it. I believe Python 3 will come with MacOSX Snow Leopard... The Python website does have a Mac download for 2.6.1 though. As for the low A glitch, watch Lolo's tutorial vid: www.youtube.com/watch?v=Y8tn3wrYDVAThis gave me some trouble when stored in an MPC file, because the non-existing low A position ist stored as position "17" (while all other positions are stored with a single letter). I'll send you two of my files that didn't work for testing - the second one has a low A note somewhere, though it's accidentally there and I discovered it only as I tested my importing code with it. Thanks for the PM. The problem seemed to be not the low A's but the double tempo at the end. ("407%424 instead of "%424). I think I've fixed that. At the moment the program just drops the low A's since it seems they aren't supposed to play in the original program. I suppose the ideal when exporting to AMS would be to convert them to mutes on the notes used by that instrument in the last chord, but since you've already implemented that I won't bother. Are you planning to add midi export to AMS, or should I adapt this script to convert AMS to midi at some point?
|
|