28th November 2007, 10:31 pm
I have finally got round to getting the sound synthesiser application set up as a webstartable app and made it available for download. It is pre alpha, so is lacking in features and probably contains a fair number of bugs. If you want to give it a try grab a copy from here. At least then you can see what I am talking about.
I have not written any instructions but hopefully it should be fairly self explainitory. Alter the amplitude and frequency lines and then click play to listen to the sound effect generated. Right clicking adds a node to the line when your cursor is on a line and deletes a node when the cursor if over a node.
Have fun and let me know what you think. Next step for me is to automate the publish process so I can just run an ant script and have the latest version posted on marblemist.com
I am quite happy with the idea of going from idea to prototype in just over a month, given the fact Java is still new to me and this is the first GUI sytle app I have written for ages. An illness midway through knocked me out for a while and I have had plenty of real life distractions. Ok aditably it is a clone so there were not many design decisions and I still have a long way to go before it really is useful. I decided to label it version 0.01.
Enjoy.
27th November 2007, 07:56 pm
I heard a nice little one liner the other day “Progressing like slugs in a freezer”. That is kind of how my coding feels at the moment. While it feels like that looking at what I have done, progress has been reasonably swift.
Fixed some long standing problems with the graph editor, well I call it a line editor. It is my custom swing widget that allows you to edit points on a line. The whole widget needs a bit of a re-write, not really surprising when you consider it was the piece of complex swing code I wrote. For now it stays as I want to progress in other areas. But it is on the list.
I also decided the whole user interface was taking up to much space. To fit it all in the window had to be pretty big. Again probably from my lack of experience with UI design. 30minutes with the NetBeans GUI builder and I have a prototype of a different layout. Looks better and is more compact - it is not like I had a ton of features I have been trying to cram on the window.
It turns out WebStart is pretty easy to get going. It sounded like it was going to be a nightmare to get set up and running. WebStart for those not in the know is a way of distributing apps over the internet that can install onto you computer like a normal app, but also automatically update whenever a new version is published - it does a lot of the hard work for you. It sounds like nirvana but reading into people do seem to have problems with it not working correctly on computers. It is cross platform and supports Windows, MacOS, SunOS and Linux. My main for looking into
it is because it seams an ideal way to ship alpha/beta software. I am hoping put a very early alpha out some time very soon, a small number of items need addressing.
Anyway enough rambling from me.
21st November 2007, 06:54 pm
I have been pretty quiet on the blog front. I have finally recovered from the cold the was plaguing me, energy levels are finally returning to their normal levels. Code wise I am still pushing on with the sound synth program.
Been implementing some of the more boring stuff. Stuff like loading and save as xml files and tidying up the UI. It is starting to get close to the point I am thinking of letting it out in the wild - as an early alpha release, probably as a webstart app. It is starting to get fun to playing around with it, creating all sorts of strange sound effects although some members house hold seem to disagree. I still have a pretty large work list for this app but progress does seem to be going at a reasonable rate. Of course the moment I write this I will get problem after problem to set me back.
I have a fairly long list of articles of would like to write on this blog but for now I am resisting the urge and focussing on coding and keeping well!
9th November 2007, 08:59 pm
Been suffering from a bit of a cold the past week or so. Not felt like doing much other than lying on the sofa. I have made some slow progress on the sound synthesiser - but it has been limited.
As my brain was addled from cold I was doing some low risk refactoring and working though the many TODOs I add when coding. Just little things that I spot that need polish or a slight reworking but as I am in the flow of adding a feature I don’t want to be distracted and actually stop and fix them. Bang a // TODO comment along with a sentence to say what my thoughts are and I can continue adding the feature I was working on safe in the knowledge I will return to the area to fix what I spotted when I do a search for TODO. It helps stop my memory getting clogged down with the details.
So refactoring it was. I managed to remove a few classes as they became redundant from various refactorings, plus added a few interfaces along with some factory classes where needed to make things a little more abstract. Overall the code is in much better shape. Continue reading ‘Illnesses really slows you down.’ »
6th November 2007, 10:55 am
As seen in the diagram we define a line segment to be between P1 and P2 and want to know the Point on the line segment that is closest to our point P3. We call this closest point on the line point P. An assumption is made that P1 and P2 are not co-incident (exactly the same).

We can write the Point P as

where u is a simple scaler. If we can work out u then it is easy to find P. For a line segment u must be between 0 an 1 as this keeps P between P1 and P2. If we are considering an infinite line defined by P1 and P2 then u can be any value.
The shortest distance is given when the line between P3 to P and the line p1 to p2 is perpendicular to each other. That is they have an angle of 90 degrees. The 90 degrees should give you a hint that we will need to use the dot product (inner product) to solve this problem. When the angle between two lines is 90 degree the dot product is zero. Therefor

Substitute in the value for P we obtain

Then is you site down and solve this you get

Now you know u find P is trivial.
Remember to clamp u between 0 and 1 if you are solving for the line segment rather than the infinite line case.