Friday, May 26, 2006
Tuesday, May 09, 2006
|Version 1122 (Sun May 7 15:02:14 2006)|
Many scientists and engineers spend much of their lives writing, debugging, and maintaining software, but only a handful have ever been taught how to do this effectively: after a couple of introductory courses, they are left to rediscover (or reinvent) the rest of programming on their own. The result? Most spend far too much time wrestling with software, instead of doing research, but have no idea how reliable or efficient their programs are.
This site presents an intensive course on basic software development practices for scientists and engineers. Its aim is not to turn biochemists and mechanical engineers into computer scientists; instead, it introduces them to the 10% of modern software engineering that will satisfy 90% of their needs. The course has been taught at laboratories and universities in Canada and the United States since 1998. It is now being upgraded, and will be made freely available under an open license in the fall of 2005.
Tuesday, May 02, 2006
Anyway, JFugue is admirably clean and simple looking, but written in java.
I've had some luck with jython recently, so I thought I'd pursue it. www.jython.org
First the happy ending,
[208-186-48-2:remo/MusicViz/JFugue] apple% jython
Jython 2.2a0 on java1.5.0_06 (JIT: null)
>>> from org.jfugue import *
>>> pattern=Pattern("C D E F G A B C")
For this to work, I need only have JFugue's directory tree called "org" in the current directory.
The above four lines are considerably shorter and simpler than than original java
public class MyMusicApp
public static void main(String args)
Player player = new Player();
Pattern pattern = new Pattern("C D E F G A B");
System.exit(0); // If using versions lower than Java 5.0
and to run the java code you must apparently
1) give the file the name MyMusicApp.java
2) compile the file using the incantation
javac -classpath ./jfugue.jar MyMusicApp.java
3) run the file using the incantation
java -cp ./jfugue.jar:. MyMusicApp
(and the colon is a mac-specific necessity. On windows you use semicolon(??))
Typing the classpath is a nuisance, and getting it into the environment requires the kind of unix geekery that drives me crazy. But I did find a really elegant little java IDE called JJEdit that gives you a compile button and a run button, and a form-field into which you can enter a classpath of ./ and get on with iterative development. http://homepage.mac.com/jmacmullin/
So this is more bearable, if much more cumbersome than working in jython.
On the other hand, I must say that the jython documentation leaves something to be desired. www.jython.org points you to an installer for Mac Classic(!) http://www.jython.org/platform.html.
Google led me to a darwin port installer which installed admirably and works as shown above.
But I just noticed
(a) that somehow I'm running version 2.2a0 and
(b) that it doesn't respond to command line arguments, so I can't run it non-interactively.
Fixing this will require tweaking the shell script that invokes jython I suppose...
but sheesh! Genuinely simple simplicity is apparently not simple....