Archive for July, 2008
SpiderSynth progress
I am finally starting to put some more time into SpiderSynth. I have been messing around with the simplest possible UI for the wave for editor. For such a small feature it does seem to require quite a bit of work. Still it should be useful once complete as it lets you alter the sounds generated in subtle ways.
Currently I have started implementing the UI as a dialog but having started to travel down to the round I kind of reached the conclusion that is would be better done by putting the Amplitude and frequency editors into a pane of their own that can sit in a tabbed panel along side the wave form editor. That way while in the waveform editor you can still mess around with effects and so on. Looks like I am going to be refactoring the UI yet again. It is surprising how much time gets put into the UI and even then it is not the best UI ever created in Java (Understatement of the day:).
Still a couple of nights where I can get my head down to it should get my this part sorted then I just have to get the implementation of the UI sorted out and finally get the next release out. I don’t like going a long time without releases at such an early stage of the project.
Scala IDE’s
I have spent some time looking for a good IDE to code Scala in. I had been using notepad++ for a while. It is ok when doing a small amount of code but you start to want more. The Netbeans plug in works but does not have many features yet. I read the programmer does not expect to get the plugin into a good state until the release of Netbeans 6.5
The scala website promotes eclipse plugin. This is so far the most developed IDE for scala that I have found, but it still has a long way to go. I could not really get unit testing to work in a pure Scala project. So what I have done is create a Java project and then turn on the scala nature option. This lets you code in both Java and scala in the same project which is pretty cool. I use this to code in scala but create the unit tests in Java.
I know maven has good support for scala but I just cannot get motivated to learn another tool for xml style tool for building things. I really just want the IDE to do this stuff for me – life is just to short :)
It is a shame that the Netbeans plug in does not allow for mixed language projects at the moment as it sure would be nice fiddle with scala in the context of spider synth. The UI for spider synth is built with the Netbeans Matisse so I can’t just take the code and compile it in eclipse. Although I am sure it is possible with some reading and hard work.
Update: Actually maven with the netbeans plugin does not seem to be that bad.
Timing in Scala revisited
In a previous post I published some code to create an Averaged time delta class it was pretty much how one would write it in java. Chris Hanson commented that I could use the concept of closures to make this more functional. Investigating further on the web revealed that many introductions to Scala use a timing class to demonstrate closures.
So here is my attempt at using closures to time some code.
class TimeCode {
def apply[R]( codeBlock: => R) = {
val lastTime = System.currentTimeMillis()
codeBlock
val currentTime = System.currentTimeMillis()
println("It took:"+ (currentTime – lastTime) + "milliseconds")
}
}
Ok it is not the averaging one I previously posted but it should be fairly simple to create a similar class. Currently I am a bit time limited – see previous post. In some ways it is reminiscent of C++ code I have written using constructors and destructors in C++ inside code blocks to time sections of code.
Yes I know it looks like all the other examples, there really is a limited number of ways you can write this code!
Yep it has gone all quiet on this blog
Although our house hold has gained a very vocal new member who seems to like waking up at night and causing no end tiredness. Once we figure out how to deal with this 7lb monster normal blogging will resume. You would have thought this being the third time this has happened we would be masters at it.