•April 8, 2008 •
Leave a Comment
Not much happening at the minute with the project due to the assignments taking up nearly all of our time. We have tried to stick to a schedule whereby we will have allk of the assignments done soon so that focus can be put back on the project but this is proving difficult as each assignment is quite large and is taking longer then we thought to finish. this week we will write a compiler for minijava, next week we will need to finish a cacm encoder and also write a Z specification for the voardgame havanah. Yesterday was a good day as we finished a queuing simulator to simulate both an m/m/1 and m/m/2 system.
More on this later………
Posted in Progress
•March 13, 2008 •
Leave a Comment
With some Nice visuals created by Brendan i managed to integrate the Graphical element of the tuner into the GUI. I also used the Matlab tuning function described in another post too return a frequency to java. I then setup a compare method to Note objects i have created in the Tuning Thread. This enabled me to set the current string which the user is playing and the nearest note to their current tuning. to diplay how far off the user is from the correct frequency i needed to rotate the needle which Brendan had drawn. To do this is used a RotatePanel class found here. I then setup checks to ensure that the needle reacted appropriatly depending on which note was being played.
At the minute i am not 100% happy with the Tuner as i feel the Matlab method can be enhanced further. I will visit the Tuner again this week but at the minute i am a bit worried about deadlines for some of the other subjects and so the Project is taking a bit of a back seat while we try and get something going ton them.
Below is a sample screen of the tuner in action.

Posted in GUI, Tuner
•March 12, 2008 •
Leave a Comment
Started coding the tuner today. One of the main problems with this was deciding how to present it to the user in a way which would be a close to realtime as possible. The method we decided on was recording in 2secs of a sample, converting that into a vector to be analysed in matlab and then return the result to java.
The matlab method simply finds the first note played in the sample as this will be the fundemental frequency, the function file we have created also finds the frequency of this note according to the formula ((position in fft/ length of sample)*sample rate)
I made an attempt to begin the integration into the GUI. This again caused a problem. I created a tuner thread which would constantly send the requests to matlab once the start tuning button was pressed. This caused a major problem in that I couldnt press anyother button in the GUI while this thread was running, so i couldnt stop the tuner.
To overcome this i found the SwingWorker thread class. This enabled me to run the thread in the backround and then send an interrupt which would stop the thread.
More on this tomorrow when I start creating the graphical representation of the Tuning needle…tricky
Posted in Tuner
•March 7, 2008 •
Leave a Comment
Spent this morning working on the ideas i came up with last night for Chord building. I am really pleased with the reults, so far i have implemented the functionality which will allow the user to select a chord and display the notes in there corect position in the chord and also will set the note to be sharp if it is needed to be in the current chord.
This was quite complex to think about at first, i need to apply the circle of fifths method to each chord (explained here) , Once i had a method to do this i incorporated it into my GUI:

Posted in Music Theory, Note Models
•March 7, 2008 •
Leave a Comment
Have started today thinking about chord generation. This will involve first of all building a chord from an input, say the user wishes to view the chord D, the chord would need to be constructed as follows
1. D (Major)
2. E (Minor7)
3. F (Minor7)
4. G (Major)
5. A (dominant7)
6. B (relative minor)
7. C (diminished)
Each note in the chord has a special place in the chord of D, and normally on guitar each note is not played. For any major chord only the first, third and fifth note will be played, other notes can also be played and this is still technically the chord of D but it just wouldnt sound good.
I came up with a way in java of creating a chord object based on the chord the user selects and then building the chord with the notes in the right place.
The next problem is to come up with a method which will take in any chord and then draw the relavant chord diagram, to begin with i decided to stare at my guitar for a while. Later myself and brendan did some tests on basic chords on the idea we came up with and it seems to hold true for most chords. the basic outline of this algorithim for major chords is as follows:
1. Take in the chord structure.
2. Start on the first String, search each fret for an occurance of either the first, third or fifth note in the chord.
3. When found paint a button to display which fret should be held
4. Repeat steps two and three for each string.
5. Include a check for certain chords which “guitar wise” should mute certain strings.
The next step which i will look at tomorrow will be to decide how to handle minor notes (Whereby the third note in the chord is flattened). this shouldnt be a major stretch. I would also like to come up with a way to draw these diagrams for all frets.
More on this soon.
Posted in Music Theory
•March 4, 2008 •
Leave a Comment
After a solid day of work and nearly killing everyone around me… i have the GUI working the same as it was two days ago however…. All the panels are now in sperate classes with the main GUI class simply creating blank panels and filling these panels from the other classes. It is now alot easier to develop and add new panels as you go. This has also made it alot easier to see what is going on at any given time in the program.


The main problems i had here where first of all recreating the GUI from scratch and with the amount of functionality already contained within, this was an immense task. My main problem was that each different panel class would need to have access to the same instance of some variables. This was solved by creating a class which would contain all variables needed and act as a variable controller. So each time one of these variables are needed, an instance would be created in one of the classes and then updated when any changes have taken place. this would be the same for all classes and so the same data would be constintly updated.
One of the best things about this redesign is that we can now work on seperate panels and when it comes time to incorporate into the main GUI we can just send the panel to eachother and simply set and empty panel equal to it. This makes development and integration extremmly simple.
Ok its time to sleep, hopefully will get some more done tomorrow, i need to do a validity check on the buttons again and the effects.
Posted in GUI, Progress
•March 3, 2008 •
Leave a Comment
After alot of thought today i have decided to redesign the GUI. At the minute the GUI consists of panels overlaid on top of each other with each panel being setVisible or invisible depending on the situation. This has become very convoluted and hard to design. So i am going to place each panel in a seperate class.
I hope that this will create a more modular and managable GUI. So as the plan is for me to put each panel in a seperate class (View) each calling the MatlabController (Model) which will handle the back end calculations and then a main GUI class (Controller) which will change between which view the user is being shown.
I will get cracking on this tomorow and hopefully problems will be kept to a minimum. More on this tomorrow.
Posted in GUI
•March 3, 2008 •
Leave a Comment
We have finally finished the TEF effect section of the projectt. This involves three “custom” effects which we have created by havnig a look at what you can do with fourier transformed signals. The problem was trying to decide on effects which where both priginal to anything we have seen done in matlab before and also those which would be useful.
Synth – in order to create the synth effect we create a low pass filter of values below a maximum in the fourier transform, the user is given the option to choose this maximum. This creates a synth type efffect and sounds cool with undistorted single note samples.
Repeater – first of all the signal is sampled and thus replicated, next step was to set various elements in the fourier transform to different volumes which seperates the sample from the original in playback and gives a replicated effect whereby the sample plays “under” the original.
Convolution Delay – This involves letting the user specify how many spikes there will be in the comb, these spikes are then placed at random intervals in the comb vector and convolved with the original to produce a kind of random delay effect.
The effects section is now complete and we can start focusing on some other modules.
Posted in Effects
•February 28, 2008 •
Leave a Comment
Ok so a small problem i had was to retrieve the length of a sample, to overcome this i need to find a way to view the samples current data. this would give me the number of sample per second and the total number of samples. Using this i could work out the length of a sample to the nearest second.

To do this is used the display(player) attribute of the matlab audioRecorder function. This gave me a string with the details i needed. I then wrote a method which used substrings to ectract the relavant data, next step is to convert that data to ints and divide the total number by the samples per second to retrieve what i was looking for. Im going to just use this to display the time and total number of samples to the user just for an added frill.
Posted in GUI, Progress
•February 25, 2008 •
Leave a Comment
Spent the day working on the effects today. Integrated brendans reverb into the GUI and we began researching some of the weird effects we plan to let the user play about with. Some of our ideas so far are to implement a synth effect by setting various values in the FFT to zero. We will spend the next few days messing around with the frequency domain and trying to see what effects we can come up with. When this is finished we can finally begin work on the tuner and key recognition although we will probably have a load of assignments to do by then so development will slow down considerably.
Posted in Effects