Tuesday, November 20, 2007

this morning i spent an hour training gamera. As final projects are quickly approaching, I have been spending a bit more time preparing for these, to avoid last minute rushes (as much as possible). For 614, I am attempting to make a content-aware effects unit, which should be pretty difficult for me, as I have never written a project in c++ before. I do, however, have a working framework in matlab, and have mapped out the outline already. It just remains to be seen if i can implement the code within the 2 1/2 week timeframe.

Friday, November 16, 2007

This last week I have been doing a lot of background mathematics brushups in eigenvector/value calculations - different methods used, along with an informal efficiency ranking of each. This is in preparation for my final project for 612, which will be towards using the high resolution techniques for an onset detection scheme for musical audio. Although not a new idea by any means, its new to me, and is a completely different method than say, fft based phase, energy or complex domain approaches which i have used in the past.

I have been training Gamera with prepared early sheet music over the past week as well.

Wednesday, November 7, 2007

today I spent all morning and part of the afternoon on the wiki entry that explains the new findings based on the newly implemented changes (see last entry)...

Tuesday, November 6, 2007

For the last two weeks I have been quite busy with coursework, but here and there I have had brief moments to finish odds and ends. After posting the results of the staff removal analysis, I received feedback from Christoph Dalitz who has recommended that I try the rotate() plugin to get better results from linetracking.He has also noted that we should be using 'all', not 'bars' for the crossing_symbols parameter.

Therefore, my entire day has been spent editing the code from mstaves and the scripts that i am using for the test. I have since rerun the experiment, and have posted the images on the website.

The link to the files is:
http://coltrane.music.mcgill.ca/GEMM/images/main.php

I will revise my results today and re-post the results on the gamera board by tomorrow morning.

Thursday, October 25, 2007

Last night (10.24.2007) and this morning (10.25.2007), I am making some minor edits on the wiki, such as changing names of test sets to more clearly define them...also making another edit of the text before it gets sent out for others to read...

the next step, to be tackled in the coming week(end?) will be to begin writing a split function for gamera, which directly cuts the glyphs in half. there are already split-x and split-y commands, but these look for minimums. 2 approaches seem valid to me...1) to cut the plane directly in half, and 2) find first black pixels on either side of plane and then perform a simple averaging method to find the median-x point (for a split-x type of command) to use as a slice point.

...oh, and i started drinking coffee again...

Monday, October 22, 2007

On friday (10/19/2007), I wrote the staff removal evaluation summary for the wiki, and chose selected images which demonstrated the errors for comparison between the two best performers of the set - fujinaga and skeleton. This can be found here:

http://coltrane.music.mcgill.ca/DDMAL/index.php/Evaluation_of_staff_removal_algorithms


This morning (10/22/2007) I have added some more information to the wiki.

Thursday, October 18, 2007

after looking at jlibrary, and consultation with Andrew, we've decided to go with "Gallery", an online content management system for visual media. Quite a cool software! The images are now up online at:

http://coltrane.music.mcgill.ca/GEMM/images/main.php


now i am working on the writeup for the evaluation of these methods...will be done shortly...


Wednesday, October 17, 2007

Wednesday (10.17.2007)

Today I am going to upload the entire set of test images hopefully using jLibrary, then write a small progress report explaining the decision as to which stave removal algorithm I thought to operate best...
afterwards, I will be creating a separate folder containing those images which present reasons why this decision was made.

Tuesday, October 16, 2007

since the last post, I have been quite busy...

Melissa and I have finally received our belongings from the states, and are now in the process of organizing all of our "stuff".

With the ICASSP paper submitted, I had made a quick webpage with some results to hear. that site can be found at:

http://www.music.mcgill.ca/~hockman/ARTMA/examples.html

Apart from that, I have been quite busy with coursework for Phillipe's DSP class. I've had only short periods of time to devote to the job this past week...over the next two weeks however, I don't foresee any barriers to getting more work done on pitch fields analyzed within gamera.

Wednesday, October 10, 2007

On friday, the ICASSP submission was due, so there were several last minute revisions that needed to be in place before the weekend was through (since they dont actually close the submissions until first thing monday morning). So on the TWELVE hour journey to NYC for AES, I was able to finish that as well as become more familiar with the subtleties of the mathematical substitutions behind fourier transforms... On the way back on Monday, (10/08/2007) I was able to make significant headway on the pitch field script. Between Monday and Wednesday (10/10/2007), I have been able to accomplish pitch field extraction from the stave removal algorithms. The next step of the process is to iteratively export glyphs from Gamera, and analyze the pitch points from the centers of the noteheads:). In other news, Melissa has just moved up here this last weekend, and the furniture/clothing/studio/etc has just arrived today (10/10/2007)...

Tuesday, October 2, 2007


today i had a splitting headache...not sure what brought it on, as i usually dont get them...

anyways, i left the lab at arount 2:30, relaxed then got started on the actual coding of the pitch fields stuff. things are going much easier this time around for this part of the project, and ive gotten some background information from marni about the extremities of the pitches represented in the music we are looking at... (as well as clef information). Variable field information is coded such that new staff positioning provides fully adjustable fields. for each line of music. Next step will be (finally!) looking at the output of gamera's glyph data and determining pitch centers...

Thursday, September 27, 2007

monday (09.24) through wednesday (09.26) I have been working on a paper for ICASSP, as well as digesting the mathematical transformations presented in Phillipe's class. Today (thursday, 09.27) I will be starting to develop a pitch point analysis algorithm.

Friday, September 21, 2007

after a not so simple fix, i was able to use graphic converter to change the database to the two forms of each pic that were needed. I then simply made two versions of the script, batchConvert_A.py and batchConvert_B.py. The results are currently being run, and I assume that it will take a good portion of the evening.

But this part of the script is completed. Next I will need to start looking at pitch height... most likely on monday afternoon.

here is the code for batchConvert_B.py ... although i should note that this blogger doesnt seem to care for indents much.


import os
import sys

from gamera.core import *
from gamera.toolkits.musicstaves import musicstaves_rl_simple
from gamera.toolkits.musicstaves import musicstaves_rl_carter
from gamera.toolkits.musicstaves import musicstaves_rl_fujinaga
from gamera.toolkits.musicstaves import musicstaves_rl_roach_tatem
from gamera.toolkits.musicstaves import musicstaves_linetracking
from gamera.toolkits.musicstaves import musicstaves_skeleton
init_gamera()

source_folder = ['/Users/jasonos/SRI_B/']
target_folder = ['/Users/jasonos/SRI_B_conversion/']
folder_contents = os.listdir("/Users/jasonos/SRI_B/")[1:]

line_removal = ["rl_simple",
"rl_carter",
"rl_fujinaga",
"rl_roach_tatem",
"linetracking",
"skeleton"]

for i in range(0,len(folder_contents)):
source = folder_contents[i]
target_subfolder = str(target_folder)[2:-2] + source[:-4]
os.system("mkdir %s" % (target_subfolder))
os.system("cp %s %s" % ((str(source_folder)[2:-2]
+ "/" + source), str(target_subfolder)))

# gamera commands
image = load_image(str(source_folder)[2:-2]+source)
onebit = image.to_onebit()
onebit_name = source[:-4]+".png"
onebit.save_PNG(onebit_name)

os.system("mv %s %s" % (onebit_name, target_subfolder))
image = onebit

# music staves stuff
for n in range(0, len(line_removal)):
ms = eval("musicstaves_" + line_removal[n]
+ ".MusicStaves_" + line_removal[n]
+ "(image)")
ms.remove_staves(crossing_symbols = 'bars')
no_staves_img = ms.image.image_copy()
rl_name = source[:-4] + "_" + line_removal[n] + ".png"
no_staves_img.save_PNG(rl_name)
os.system("mv %s %s" % (rl_name, target_subfolder))

today I'm wrestling with the gamera script again to use the linetracking and skeleton utilities algorithms - shouldn't take too long...famous last words...

Tuesday, September 18, 2007

Monday (09.17.2007)

iterative plugins now are operational using simply using eval("whatever the string is") - not sure why this wasnt working before during command line - perhaps it was, but i wasnt aware that the output i was getting was what i needed...

with this solved i will be adding the one bit conversion to the python code on wednesday or thursday.


Sunday, September 16, 2007

Saturday (09.16.2007) - basic functioning

I spent the day working on the python script, which went rather nicely. I spent the afternoon and evening getting familiar with gamera through script commands and came up with the following (although not perfect by any means it works):


import os
import sys

from gamera.core import *
from gamera.toolkits.musicstaves import musicstaves_rl_simple
from gamera.toolkits.musicstaves import musicstaves_rl_carter
from gamera.toolkits.musicstaves import musicstaves_rl_fujinaga
from gamera.toolkits.musicstaves import musicstaves_rl_roach_tatem
init_gamera()

source_folder = ['/Users/jasonos/test_images/']
target_folder = ['/Users/jasonos/test_images_conversion/']
folder_contents = os.listdir("/Users/jasonos/test_images/")[1:]

line_removal = ["simple", "carter", "fujinaga", "roach_tatem"]

#folder generation & file copy
for i in range(0,len(folder_contents)):
source= folder_contents[i]
target_subfolder=str(target_folder)[2:-2] + source[:-4]
os.system("mkdir %s" % (target_subfolder))
os.system("cp %s %s" % ((str(source_folder)[2:-2] + "/" + source), str(target_subfolder)))

# gamera commands
image = load_image(str(source_folder)[2:-2]+source)
onebit = image.to_onebit()
onebit_name = source[:-4]+".png"
onebit.save_PNG(onebit_name)
os.system("mv %s %s" % (onebit_name, target_subfolder))
image = onebit

# music staves stuff -> staff removal
for n in range(0, len(line_removal)):
ms = "musicstaves_rl_" +line_removal[n] +".MusicStaves_rl_" + line_removal[n] + "(image)"
ms.remove_staves(crossing_symbols = 'bars')
no_staves_img = ms.image.image_copy()
rl_name = source[:-4] + "_" + n + ".png"
no_staves_img.save_PNG(tl_name)
os.system("m %s %s" % (rl_name, target_subfolder))


actually i lied. the last bit doesnt work yet because i havent figured out how to get a string to run as a command in python yet. I assume it has something to do with the eval statement, such that if I write my own little function, I can then evaluate that func. but I also think that there has to be some sort of simple transform functionality that im missing. anyways, the function DOES work without thte final for loop by replacing that tidy bit of code with blocks for each line removal algorithm.

Thursday, September 13, 2007

INSTALLING GAMERA (via python universal binaries)

here's how:

1) do you have XCODE installed?

make sure that the developers tools are installed with the SDK option. The developer's tools are available for free @:

http://developer.apple.com/tools/download/

(again, during install, don't forget the SDK option)


2) which version of PYTHON do you have?


check which version of python is currently running...you can do this in terminal with the command:

python

if it comes up as: Python 2.4.4 , thats a good thing move on to step 3.

otherwise, verify that Python 2.4 is NOT on your machine by searching the following directory:
/Library/Frameworks/Python.framework/Versions/

and if 2.4 is not present download the Python 2.4 universal binary here:
http://www.pythonmac.org/packages/py24-fat/index.html

the installer will then make this version the current one, so you should be all set. verify this returning to terminal (if not there already) and type:

python

this time it should read:
Python 2.4.4


3) which version of wxPYTHON do you have?

wxPython is required for proper communication bt/ c++ wxwidgets and python.
you'll need wxPython 2.8.4.2 unicode (although versions up to 2.8.6.1 have been successful), which can be downloaded here (under MAC OS X section, in Python 2.4):
http://www.wxpython.org/download.php#binaries



there. the background stuff is complete.


4) is SVN on your system?

Subversion is the version control program utilized for the Gamera project. You will need to have Subversion (SVN) on your computer to download Gamera properly. If you do not have SVN. please download the most recent stable universal binary here:
http://metissian.com/projects/macosx/subversion/


5) $PATH: is SVN in your path?

SVN may not be in the path of searchable folders, so in terminal, check if:
'/usr/local/bin' is in the path, by typing:

$PATH

if not, simply write (in terminal):

export PATH = $PATH:
/usr/local/bin

this command will place this folder into your path temporarily (it will reset once the terminal shell is closed). If you choose to later, you can permanently change the path by editing your .profile file with vi, emacs, or pico... all within terminal.



6) download GAMERA using SVN

now we are going to download the most recent Gamera using subversion, within terminal. Type the following:

svn co https://gamera.svn.sourceforge.net/svnroot/gamera/trunk/gamera


if it says permission denied, type:

sudo svn co https://gamera.svn.sourceforge.net/svnroot/gamera/trunk/gamera

you will be asked for your password (which is your account password for your computer). Gamera will now download, trunk, branches and all...it is possible to download the trunk alone, but thats not what we did...


7) build and install GAMERA:

a) using Terminal enter the Gamera directory, find the trunk, then keep entering folders until you are in the folder
with setup.py (should just be gamera/gamera). Once there, you can begin the build. Type:

python setup.py build

again if you get a return error that reads permission denied do a 'sudo'.

sudo python setup.py build
then enter your password.

b) once the build is completed, you can do the install:

sudo python setup.py install

when this is completed, you can check to see if Gamera is working by typing:

gamera_gui


8) install MUSIC STAVES

follow the instructions on the music staves page... works wonderfully ;)
http://lionel.kr.hs-niederrhein.de/~dalitz/data/projekte/stafflines/


9) install AOMR2: properly soon...

the AOMR2 software will hopefully be rehosted soon, and as a result, has been installed in piecemeal fashion from the html pages comprised of the most recent versions of the code. for quick access to this version, until rehosted please send an email.
Wednesday (09.12.2007)

In the morning I continued studying Python scripting in preparation for my upcoming script weekend. :D I plan on using much of thursday and friday finishing review of the python tutorial and gamera/music staves class information, then starting to build the script on the weekend.

Spent much of the day reading an article, "Fast Sinusoid Synthesis for MPEG-4 HILN Parametric Audio Decoding", as well as a lot of the day and evening reviewing the mathmatical formulas found in the paper. Then I went home and reviewed trigonometry and calculus for the rest of the evening into the next morning.


Wednesday, September 12, 2007

Tuesday (09/11/2007)

worked on python tutorial further - now I'm getting into derived classes and such in greater detail than before, which is exactly the information I will need to begin the script for the Music Staves thing I'm working on... Basically I spend the full day reviewing this sort of material, apart from meeting with Ich.

Thursday, September 6, 2007

today I continued learning python from the online tutorial. Progress has been quite swift through the first few chapters and I am finding that I am understanding the basics with greater ease than the c++ tutorials ive been through - which is expected...I also had Professor Scavone's class today, in which we had a brief overview of basic Matlab filter design - very interesting :). This weekend I must travel to Ithaca and will be back early Monday, but am taking the tutorial with me as I hope to get through a large amount of it by the beginning of next week so I can write the script for the database of image samples for friday.


Wednesday, September 5, 2007

I have been given the task of finding pitch position of the output glyphs from Gamera after MusicStaves has extracted staff lines.

Yesterday, I went though the music staves documentation to figure out a good starting point to get pitch information from the stave points. Clearly 'get_staffpos' is the place to get this information, as the StaffObj outputs 'staffno' (staff number) and 'yposlist' (y position list of the staff lines). These lines can be used to create fields onto which the glyph note (and rest) centers may be overlaid for determination of pitch information.

Today, this project has been put on hold briefly, to create a python script that will run the staff removal algorithms on a small database of image samples...

Saturday, September 1, 2007

moving and then music staves

yesterday (friday) I had to move...

but today I was able to get MusicStaves up and running. Long story short, I tried several options to make round become attributed with the math namespace, vs the viagra one, but finally chose lround vs round in both 'skewed_runs' and 'staff_removal_fujinaga'. After that the install went smoothly, and all is up and running. I'll be in tomorrow to play with the program...

Thursday, August 30, 2007

today I spent the entire day with the same compilation problem, but thats ok - I wanted to force myself to sit and look at the music-staves issue and try several attempts at "fixes". Unfortunately, no solution was found, but now I feel fully comfortable sending a message to the board. Hopefully there will be someone who has encountered the error that I have seen, looked up and know well.


Wednesday, August 29, 2007

I've forgotten to write a progress report for a couple days now, so this one will catalog the developments for the last few:


Between last thursday and friday, through steve sinclair's help I was able to get Gamera up and running using Python 2.3 and wxPython 2.4. To do this we had to comment out a few tester lines in the python code, and install on a .local off the main directory. This then proved to be a difficult fix as Music-Staves would not install.

So, I spent the weekend with this problem, and finally on monday, brainstormed with Andrew about possible fixes. He thought the best option was to do a clean install using uni-binaries of the newest Python and wxPython's and then build and install Gamera. An easy and simple process, which worked immediately after we switched the paths (
I must say that Andrew has aided me immensely in getting up and running here, for which I am extremely appreciative).

From that point I then had to try to get Music-Staves and AOMR2 running. Unfortunately until today, Music-Staves is still not running, and I have tried several versions, including downloading previous versions via CVS (in an attempt to avoid GCC compilation differences). So on monday, I decided to put this on the back burner while i worked on getting AOMR2 running. The CVS repository has been taken down so I copy and pasted the most recent versions of all the files into a folder and built and installed it - as a result, AOMR2 is now up and running, and staff-lines may be removed and I can begin training. Laurent has said he will provide me with some training material either tomorrow or friday.

As far as Music-Staves, I have tried several "fixes" but to no avail. Tonight I will post on the developers list, and hopefully someone will get back to me regarding its install.

Beyond that, I've somewhat postponed the daytime c++ and python reading, as reading code and troubleshooting is as great way as any for me to learn a language. In these last few days, I've noticed a marked reduction in the usage of the finder and an increase in the terminal and pico.


Friday, August 24, 2007

On thursday, I continued t0 work through chapter 4, which continues to discuss the necessity of proper header files and the difference between c and c++ headers. Today I'm going to take a break from c++, and read a python tutorial, and hopefully gain some exterior insight on the topics covered thus far.

Wednesday, August 22, 2007

today (08.22.2007) I reviewed chapter 3, with most of the review focused on the usage of makefiles... then went into chapter 4 of the book, which provides an intro on developing a c++ library (as well as integrating other libraries). The main focus was the distinction between C coding v. C++ in these regards. As I am not too familiar with the former, this was a slow read, but I've left it with a 'fair' understanding of the differences. Basically, no need to typedef, and declaration and initializations take place within the struct. Scope resolution operators are used to identify specific struct or global scopes, so that the call is: Struct::add vs. add(CStruct s etc)
On tuesday, I basically finished chapter 3 of the c++ book. I say basically, as there was a lot of information that was covered in it, and today I am going to do a quick overview of the most relevant features, as well as a bit more detailed study of make files. Yesterday, I was also able to delve further into terminal, into features such as profile personalization, search features, and tab completion (thanks andrew!).

Administratively, I need to hand in the working forms to Valerie when she returns from vacation next week. Hopefully there won't be an issue with handing in timesheets retroactively...

Tuesday, August 21, 2007

Not sure why I forgot to post this when I was done last night, but...

yesterday (Monday, 08/21/2007) was quite fruitful, starting with the new bank account, then gaining a broader understanding of c++ and terminal, and shell scripting in general. Many questions regarding the usage of the book examples have now been explained when using them in conjunction with terminal - seemingly simple now, but unfortunately I found no reference that mentioned the connection in clear words.

Friday, August 17, 2007

apologies for the brevity of this entry:

by the end of the day today (thursday) i came close to finishing chapter 3 in the book... although I had to stop to go sign a lease with Melissa on a beautiful 41/2 with a yard in southeast NDG - a close walk to the vendome metro. I will be back to work on the c++ tomorrow...

Wednesday, August 15, 2007

today I was able to cover a large amount of material. I arrived at the lab at early (and still here). I've gone over storage allocation, a review of operators, casting, typedef+ structs, and am now reviewing arrays. the overall data handling and file management is becoming less arcane to me.
today i went through pointers and references (again) and continued into storage allocation methods, and quickly through operators. The majority of the information (other than pointers and references) can be related to my experience with matlab thus far, with modification of course. Thus far, I've been retyping/editing the provided examples and trying some of my own creation, so as to get a feel for the structure of the language. The last few days have been a little less productive for me, as I was looking for a place and getting some administrative stuff out of the way but with these things out of the way, ill have much more time to focus on the program.

Tuesday, August 14, 2007

ID cards and apartments with a bit of c++

Monday I spent the first part of the morning getting a permanent ID card and in the international aid office. After some more work on c++ in the lab, I went off to the Vendome metro stop, to the lower portion of NDG, to look for an apartment. Actually the first one I looked at was a recently renovated 4 1/2 - which Melissa and I are taking. So when she comes up thursday, well be signing for it thursday night.

Friday, August 10, 2007

For the last week, I have been performing administrative tasks (CAQ, student visa, etc.) as well as learning C++ from Bruce Eckel's book. It was a bit slow going at first, as I couldn't figure out where he was coming from, but once he begins using code examples, everything makes sense, and I've been progressing much more rapidly...

Yesterday I rented a car from discount and drove to the border, finally getting my student visa. Once there, the process was surprisingly easy.