Greetings, ChucK is awesome! I only discovered it slightly a week ago, and I'm a total convert now. I can write programs much more elegantly in chuck than I ever could in pd, and it is _such_ a pleasure to do everything in text. Dev team: you guys rock! I'm working on a chuck->lilypond[1] translator (well, a chuck program that generates lilypond code, gets lilypond to compile it, and then displays the sheet music). I was talking about this with Adam Tindale[2], and he said that ChucK could do system calls. In the source code for chuck, I saw a reference to "std.ck", which is supposed to demonstrate this, but evidently this example file was removed before 1.2 came out. Could anybody shed more light on this? [1] GNU/LilyPond is a notation program that generates beautiful music from (text) input files; I'm their Documentation Editor. http://lilypond.org [2] I'm a music undergraduate student at UVic; Adam is the TA for one of my courses. Ideally I'd like to be able to output strings to a file and run shell commands (ie "lilypond foo.ly" and "open foo.pdf" -- maybe also "ls foo.pdf" to check if lilypond has finished). I could do this in pd via the textedit and "shell" external object, but I'd much much rather use chuck. :) Cheers, - Graham Percival
Here are the contents of that file: // chuck stdlib test std.randf() => stdout; std.randf() => stdout; std.randf() => stdout; std.randf() => stdout; std.randf() => stdout; std.randf() => stdout; std.randf() => stdout; std.abs(-10.0) => stdout; std.system("pwd"); std.getenv("USER") => stdout; std.sgn(-1.0) => stdout; std.setenv( "LAUGH", "HAHA" ); I think you are right about it not being in the distribution. stout is the old ChucK style of printing. The .system .getenv and .setenv all seem to work. You should be able to accomplish what you want with these tools. Good luck --art
Thanks, it was even easier than I thought. In case anybody is searching for this in the mailist archives, here's the solution: ----- // lilypond preamble std.system("echo { > foo.ly"); // actual music //std.system("echo c'4 d' e' fis'8 e' >> foo.ly"); std.system("echo c\'4 d\' e\' fis\'8 e\' >> foo.ly"); // lilypond postamble std.system("echo } >> foo.ly"); std.system("lilypond foo.ly"); std.system("open foo.pdf"); ---- I'm going to wait until chuck has better string handling before doing more -- I'd really like to have string appending, for example. "echo " + notes + " >> foo.ly" => message; std.system(message); But I know that this is on the feature list. :) Cheers, - Graham
participants (2)
-
Adam R. Tindale
-
Graham Percival