Is anyone using midi2cs? help! i've installed the midi2cs executable on my windows XP system, and can call it, but when i try to convert a midi file nothing happens, just the registering info at the command prompt (register by december 1 1995!). the program should render a .sco, .orc, and .hdr file...
This looks like a fantastic utility, if only i could figure out what i'm doing wrong.
thanks for any tips.
MIDI2CS!
Submitted by noospherean on Tue, 04/01/2008 - 09:51.



It looks to me as if Midi2CS
It looks to me as if Midi2CS is pretty defunct. It was one of the apps I looked for before creating my own (see my recent blog entry). I couldn't find much about it then, and another search just now turned up mostly dead links except for a few binary download sites.
If you have Ruby on your machine, you might want to try the 'midi2sco' program I wrote. It doesn't do nearly as much as Midi2CS is purported to, but it will create a score from a midifile.
Cheers,
-- Pete --
midi2sco
Downloaded ruby and this script and have it up and running but can't figure out how to work it. I am new to csound and am trying to utilize a freeware midi composer to create midis that I then can convert to .sco files with this script. I can get it do some stuff but I don't understand exactly what it is doing. I'm not really understanding the documentation that accompanied it. Is there some knowledge I should have first before I attempt to use this or am I just not getting it? The line that's really killing me is: "Output of score commands is to stdout, so you should redirect this to
your desired '.sco' file for use." but there isn't any instructions on how to change the output. I could really use some help here... very lost.
Shell tricks
This is a command line trick. If you run any script using the following:
command filename
and see a bunch of stuff scroll by, a way to capture the output of that command is to use a 'shell redirect' to an output file.
command filename > outputfilename
The output file, in your case, would be the new .sco file you want to create.
I would be more specific, but since I'm on Linux, my way of running Ruby scripts might be much different than yours . . . I have the script in /usr/local/bin, as an executable file, so I can just do something like
midi2sco file.mid > file.sco
to get the equivalent score file. I have no idea how this works on Windows, but if you can get the script to run at all, you can use the trick above to catch the output -- it works the same on both systems.
The ruby docs might have info on how to run ruby scripts from the command line.
==
http://www.jamendo.com/en/artist/bruce.h.mccosar
http://bmccosar.wordpress.com/
Urkk... Sorry!
[Addendum: Heh --- I see that Bruce and I crossed paths! He may have explained things better than I did, too, but anyway this is what I said:]
I suspect you're using Windows, and not familiar with the concept of "redirection". [It's very hard when writing documentation not to make some assumptions that aren't necessarily true! (:-/)]
I gather from what you say first of all that you are able to run it from the command prompt. Do you see the score output displayed in the prompt window OK? If that's working, all you have to do to get it to go to a file is to use the same command line, but append a '>' ('greater-than') sign, followed by the name of the file you want to create. For example (leaving out the switch options you might actually want to include):
midi2sco mymidi.mid > myscore.scoThis should send the text you saw before to that file, suitable for submitting to Csound. Of course, you're likely to have to tweak the file -- add function tables and so on -- but the instrument events should be right.
And further to what Bruce said about running Ruby in Windows,
I think that as long as Ruby is "installed" and runnable from any folder you should be able to run the script OK. Probably best to have midi2sco and the files you want to work on all in the same folder, so you can just 'CD' to that folder from the command prompt and do your work there. (You may need the 'midifile' package there too, but it should also be possible to put it wherever Windows Ruby keeps its library scripts (".rb" files).)
Hope that makes it clearer. I never bothered to add any 'output' option to the program, because it's no more convenient than redirection, and I thought everyone would know about that. Obviously not!
Sigh... Doesn't work under Windows -- unless patched
[REVISED POST !]
I had an opportunity today to install Ruby (1.8.6) on a nearby Windows machine, and I'm sorry to report that my 'midifile.rb' seems not to be able to read a standard midifile on that platform! I invariably get an error in the readVarlen method (line 92).
... And I've finally realized the problem. Trust Windows to be the OS that shows up something that I've never had to deal with in the last 30 years or so! Windows needs a binary file to be specified as binary when it is opened! (The (almost) universal 'open' method has always had this option, but I've always safely ignored it on any system I've worked with.)
So you will have to edit the supplied 'midi2sco' (not midifile.rb -- that in fact is OK) at line 211.
Simply change "
open(ARGV[0])" to "open(ARGV[0], "rb")" (leaving the rest of the line as is). You should be a little more successful then...Sorry about that.
Archive updated
I've fixed up the 'midi2sco' script and updated the zip and tar archives on the web page, so it should now work if you download it again.