Can someone let me know if this works? midicraft.py should work as before (GUI or CLI, hopefully without as many bugs, requires numpy) but there should be a MIDICraft.exe in the "Windows" subdirectory now. It works for me, of course, but I don't have enough spare machines sitting around to fully test this. Sorry!
[see newer posts for links]
I'd like to think I've fixed the dependency issues and the bugs, but like I said--I can't be sure.
Can someone let me know if this works? midicraft.py should work as before (GUI or CLI, hopefully without as many bugs, requires numpy) but there should be a MIDICraft.exe in the "Windows" subdirectory now. It works for me, of course, but I don't have enough spare machines sitting around to fully test this. Sorry!
If by "it works" you mean it's giving you the note blocks, that's unfortunately expected behavior. I forgot to throw up any sort of "Success!" dialog when you're done. And if you're running it in Windows, you should get some sort of Windows error even though I didn't ask it to import anything.
or do you mean it doesn't work? What's the error?
e: Oh good! Sounds like I'm finally having some good luck here!
thingkinfast: hooray that it works! Note that your MIDI would sound a lot better if it was a Minecraft-friendly tempo (you run at about 4 blocks per second, so 60 or 120 bpm are the best. I could add an option to force that tempo, but for now it takes a little bit of optimizing before converting.)
Craftminerx: hooray for dependency errors! Are you running the .py or the executable? You're using Windows I guess.
Hm. I know very little about Python, obviously, but I thought that it would look into the directory that you're running the .py from and there's certainly a tkinter.py in the Minecraft directory. Does running the executable work?
"When a module named spam is imported, the interpreter searches for a file named spam.py in the current directory."
So yeah. It should be finding Tkinter.py, and it's actually only looking for tkinter because it couldn't find Tkinter. So that's not it. Let me ask some actual Pythonheads and see what they think!
Ok i downloaded the newest one and i get this error in the cmd prompt on the windows EXE one.
WScript error ImportError('No module named win32com.client',)
Exception in Tkinter callback
Traceback (most recent call last):
File "c:\Users\Jonathan\Downloads\midicraft\midicraft\Tkinter.py", line 1410,
in __call__
File "c:\Users\Jonathan\Downloads\midicraft\midicraft\midicraft.py", line 87,
in _convertButtonPressed
File "c:\Users\Jonathan\Downloads\midicraft\midicraft\midicraft.py", line 217,
in convert
ValueError: Trailing \ in string
Exception in Tkinter callback
Traceback (most recent call last):
File "c:\Users\Jonathan\Downloads\midicraft\midicraft\Tkinter.py", line 1410,
in __call__
File "c:\Users\Jonathan\Downloads\midicraft\midicraft\midicraft.py", line 87,
in _convertButtonPressed
File "c:\Users\Jonathan\Downloads\midicraft\midicraft\midicraft.py", line 217,
in convert
ValueError: Trailing \ in string
Exception in Tkinter callback
Traceback (most recent call last):
File "c:\Users\Jonathan\Downloads\midicraft\midicraft\Tkinter.py", line 1410,
in __call__
File "c:\Users\Jonathan\Downloads\midicraft\midicraft\midicraft.py", line 87,
in _convertButtonPressed
File "c:\Users\Jonathan\Downloads\midicraft\midicraft\midicraft.py", line 217,
in convert
ValueError: Trailing \ in string
It repeats 3 times because i hit the convert button 3 times.
You wanted some feedback so here it is!
Mabye because my user is not Jonathan(i assume this is you) it reads the file incorrectly?
I have no idea but please fix this i really want to try this file http://www.ray.hutchings.dial.pipex.com ... lbel13.mid it sounds good!
EDIT: I also tryed ti with the .py files (i ran midicraft.py) and got a similar error.
WScript error ImportError('No module named win32com.client',)
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Users\jedlicka\Documents\minecraft\midicraft\midicraft\Tkinter.py", l
ine 1410, in __call__
return self.func(*args)
File "C:\Users\jedlicka\Documents\minecraft\midicraft\midicraft\midicraft.py",
line 87, in _convertButtonPressed
convert(file,w,staircaseBlock,walkwayBlock,pressurePlateBlock,d)
File "C:\Users\jedlicka\Documents\minecraft\midicraft\midicraft\midicraft.py",
line 217, in convert
mpqn+=c.decode('string-escape').encode('hex')
ValueError: Trailing \ in string
whoa how did that happen. why am i so terrible at computer
e: The trailing \ bit is an actual problem with my code, at least. The midi formatting tool I'm using is disgusting and does this weird encoding thing with the tempo data. It's a problem coming up because of the MIDI file you're using (which is over five minutes long and would take forever to convert, by the way). That doesn't mean I'm not trying to fix it, but you should try something else (even a different version of the pachelbel) and see if that works.
ee: Wait. I feel like those are actually both the same problem? If it was that confused about the local directory thing than you'd be having problems way before that. Maybe somewhere in compiling the executable it just decided that it was in my directory. Try running the EXE with a different midi.
eee: Fixed I think? Try [old link] (no executable, sorry). Thanks for pointing out some silly programming on my part, I was doing some ugly string manipulation and suffered for it.
This is probably worth a new post: if you're lucky enough to get MIDICraft running, don't try using it with six-minute long files with tons of instruments like the Pachelbel's canon posted above! My computer's been working on this for nearly half an hour and I'm not sure when it's going to finish. An effective Minecraft song isn't going to have more than three or four notes at a time (plus drums) and shouldn't be more than a minute or two long. Remember that you only have two melodic instruments available (harp and bass, which really gets less useful towards the low end) and only two octaves to work with, and rhythms any faster than your walking speed (eighth notes at 120 bpm) are going to get condensed into the same note. Although MIDICraft will convert any file you get it, you will nearly always get better results by tweaking the MIDI by hand in Finale or a similar program first.
These problems won't be as dramatic when I stop allowing simultaneous notes, though, and I want to add some options to force friendlier tempos/ranges as well.
There's a lot of other factors than just length, of course. It really depends more on how many notes it has to place, which depends on note density, number of instruments, and length. The Pachelbel MIDI you posted is just too many notes—I let it run for several hours last night and it eventually crashed with a Memory Error. Testing the program with reasonable MIDIs (2-4 melodic tracks and drums) gives me these numbers:
valse0.mid (5s): 3s to convert
jump.mid (34s): 22s to convert
flim2.mid (106s): 46s to convert
Like I said, optimizing the MIDI by hand gets you much better results—even just deleting all but the essential tracks is going to make things a lot faster.
Yeah, I just downloaded it, I am having the exact same problem, I try to run it, the command line pops up for a tenth of a second and then disappears, doesn't seem to do anything.
Yeah, I just downloaded it, I am having the exact same problem, I try to run it, the command line pops up for a tenth of a second and then disappears, doesn't seem to do anything.
Yeah, I get that too. I'm running windows XP btw. I opened it in python and it seems to be an invalid syntax with these lines near the end:
Specifically the apostraphe after each print command is what is causing the syntax error. Unfortunately I don't know what to change it to so it doesn't produce an invalid syntax, and I hope demanusflint will fix it. Because of this, it seems that MIDIcraft can only run on macs.
I wonder if y'all are using Python 3.x, which uses print('whatever') rather than print 'whatever' . If you don't want to wait for a newer release from me, you can comment out the print lines (with #) or change them to:
The newer syntax works in my version (2.6), so I'll change my code for the next release. pymclevel isn't tested with 3.x, though, so I can't make any promises if you fix this one thing.
e: Of course. numpy isn't ported to Python 3 yet, so for now you'll need to use 2.6 or 2.7.
I wonder if y'all are using Python 3.x, which uses print('whatever') rather than print 'whatever' . If you don't want to wait for a newer release from me, you can comment out the print lines (with #) or change them to:
The newer syntax works in my version (2.6), so I'll change my code for the next release. pymclevel isn't tested with 3.x, though, so I can't make any promises if you fix this one thing.
I just tried that, and I am still getting a syntax error, I will try to find a way to make it so I can SEE what this error is, hold on...
..Error No Module named Numpy...but I installed it...Going to try to reboot and see if that fixes it somehow
Yeah numpy is not wanting to Install, it goes through it all like it is installing, but then it apparently does not actually install because I get the error, no module named numpy still
Make sure the version of numpy you downloaded corresponds to the version of Python you're using (it should be in the filename of the installer you download from sourceforge). Other than that I don't know!
Can someone let me know if this works? midicraft.py should work as before (GUI or CLI, hopefully without as many bugs, requires numpy) but there should be a MIDICraft.exe in the "Windows" subdirectory now. It works for me, of course, but I don't have enough spare machines sitting around to fully test this. Sorry!
[see newer posts for links]
I'd like to think I've fixed the dependency issues and the bugs, but like I said--I can't be sure.
Hay, it works but i get an error in the console and it exits on finishing. Want a video?
Edit :
Video
IMPORTANT TO READ FIRST ANNOTATION!
Oh heres the error message
WScript error InportError('No module named win32com.client',)
Thats exactly how it said.
for you
[tnt] [tnt] [tnt]
[tnt] [DORE] [tnt]
[tnt] [tnt] [tnt]
Just do it...
or do you mean it doesn't work? What's the error?e: Oh good! Sounds like I'm finally having some good luck here!
Craftminerx: hooray for dependency errors! Are you running the .py or the executable? You're using Windows I guess.
So yeah. It should be finding Tkinter.py, and it's actually only looking for tkinter because it couldn't find Tkinter. So that's not it. Let me ask some actual Pythonheads and see what they think!
WScript error ImportError('No module named win32com.client',)
Exception in Tkinter callback
Traceback (most recent call last):
File "c:\Users\Jonathan\Downloads\midicraft\midicraft\Tkinter.py", line 1410,
in __call__
File "c:\Users\Jonathan\Downloads\midicraft\midicraft\midicraft.py", line 87,
in _convertButtonPressed
File "c:\Users\Jonathan\Downloads\midicraft\midicraft\midicraft.py", line 217,
in convert
ValueError: Trailing \ in string
Exception in Tkinter callback
Traceback (most recent call last):
File "c:\Users\Jonathan\Downloads\midicraft\midicraft\Tkinter.py", line 1410,
in __call__
File "c:\Users\Jonathan\Downloads\midicraft\midicraft\midicraft.py", line 87,
in _convertButtonPressed
File "c:\Users\Jonathan\Downloads\midicraft\midicraft\midicraft.py", line 217,
in convert
ValueError: Trailing \ in string
Exception in Tkinter callback
Traceback (most recent call last):
File "c:\Users\Jonathan\Downloads\midicraft\midicraft\Tkinter.py", line 1410,
in __call__
File "c:\Users\Jonathan\Downloads\midicraft\midicraft\midicraft.py", line 87,
in _convertButtonPressed
File "c:\Users\Jonathan\Downloads\midicraft\midicraft\midicraft.py", line 217,
in convert
ValueError: Trailing \ in string
It repeats 3 times because i hit the convert button 3 times.
You wanted some feedback so here it is!
Mabye because my user is not Jonathan(i assume this is you) it reads the file incorrectly?
I have no idea but please fix this i really want to try this file http://www.ray.hutchings.dial.pipex.com ... lbel13.mid it sounds good!
EDIT: I also tryed ti with the .py files (i ran midicraft.py) and got a similar error.
WScript error ImportError('No module named win32com.client',)
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Users\jedlicka\Documents\minecraft\midicraft\midicraft\Tkinter.py", l
ine 1410, in __call__
return self.func(*args)
File "C:\Users\jedlicka\Documents\minecraft\midicraft\midicraft\midicraft.py",
line 87, in _convertButtonPressed
convert(file,w,staircaseBlock,walkwayBlock,pressurePlateBlock,d)
File "C:\Users\jedlicka\Documents\minecraft\midicraft\midicraft\midicraft.py",
line 217, in convert
mpqn+=c.decode('string-escape').encode('hex')
ValueError: Trailing \ in string
i hope this helps you!
e: The trailing \ bit is an actual problem with my code, at least. The midi formatting tool I'm using is disgusting and does this weird encoding thing with the tempo data. It's a problem coming up because of the MIDI file you're using (which is over five minutes long and would take forever to convert, by the way). That doesn't mean I'm not trying to fix it, but you should try something else (even a different version of the pachelbel) and see if that works.
ee: Wait. I feel like those are actually both the same problem? If it was that confused about the local directory thing than you'd be having problems way before that. Maybe somewhere in compiling the executable it just decided that it was in my directory. Try running the EXE with a different midi.
eee: Fixed I think? Try [old link] (no executable, sorry). Thanks for pointing out some silly programming on my part, I was doing some ugly string manipulation and suffered for it.
These problems won't be as dramatic when I stop allowing simultaneous notes, though, and I want to add some options to force friendlier tempos/ranges as well.
E: And it would be nice to have a loading bar to tell you how much is left
valse0.mid (5s): 3s to convert
jump.mid (34s): 22s to convert
flim2.mid (106s): 46s to convert
Like I said, optimizing the MIDI by hand gets you much better results—even just deleting all but the essential tracks is going to make things a lot faster.
e: and yes! Let me look into loading bars.
Yeah, I get that too. I'm running windows XP btw. I opened it in python and it seems to be an invalid syntax with these lines near the end:
print 'converting...'
convert(file,w,staircaseBlock,walkwayBlock,pressurePlateBlock,d)
print 'done!'
Specifically the apostraphe after each print command is what is causing the syntax error. Unfortunately I don't know what to change it to so it doesn't produce an invalid syntax, and I hope demanusflint will fix it. Because of this, it seems that MIDIcraft can only run on macs.
The newer syntax works in my version (2.6), so I'll change my code for the next release. pymclevel isn't tested with 3.x, though, so I can't make any promises if you fix this one thing.
e: Of course. numpy isn't ported to Python 3 yet, so for now you'll need to use 2.6 or 2.7.
Though numpy doesn't want to install :l
I just tried that, and I am still getting a syntax error, I will try to find a way to make it so I can SEE what this error is, hold on...
..Error No Module named Numpy...but I installed it...Going to try to reboot and see if that fixes it somehow
Yeah numpy is not wanting to Install, it goes through it all like it is installing, but then it apparently does not actually install because I get the error, no module named numpy still
I am using 2.6, I suppose I better try 2.7 or something....