blog.humaneguitarist.org

discoveries in digital audio, music notation, and information encoding

Archive for the ‘music’ Category

keyword vs. phrase searching of the Soundboard, a GFA publication

leave a comment

As I mentioned before, last summer I went to the Guitar Foundation of America convention in Charleston.

I also mentioned that I'd asked some questions about whether the GFA journal, "Soundboard" was full-text indexed.

Via the FlippingBook software the GFA uses to display current issues online (membership required), there is full-text searching capability because the content is indexed as far as I can tell. But as I was saying, I don't think one can search across *all* online Soundboards simultaneously – i.e. fire off one query and get results across all online Soundboards. I could be wrong about that.

In contrast, the PDF back issues sold on a DVD-ROM are not full-text indexed nor full-text searchable with Adobe Acrobat Reader as far as I can tell. And I think this is where there's real confusion – perhaps on my part – about what we mean when we use terms like "keyword" searching.

To me, keyword searching means full-text and not a "find" (as in Acrobat Reader). The Webopedia site differentiates these as "keyword" and "phrase" searches, respectively. The GFA is using a different meaning, per the "How to search Soundboard back issues.pdf" file that comes with the DVD, for "keyword" searching:

"These issues have been processed both to reproduce the page-by-page appearance of the originals on your computer screen, and to apply an "optical character recognition" (OCR) process to the text, so that every page of every issue is now keyword searchable."

In my experience, however, the search provided internally via Adobe Acrobat Reader (and Foxit Reader, too) is what I'd just call a "find" (i.e. the same as Ctrl-F on your browser). In fact, in my version of Acrobat Reader and per the screenshot in the "How to search Soundboard back issues.pdf" file, Adobe also uses the phrase "find" and not "search" in their application. Their "Advanced Search" adds options really dealing with what to search (comments, all files in a folder, etc.) but not really how to search (in the algorithmic sense) – so, it's still a "find", though more feature-rich. Now, if you have Acrobat Pro (admittedly I do through work) you apparently can create an index and then actually do a full-text search, but that doesn't help people who don't have the pro version and won't/can't buy it.

Granted, I can index the PDF with my operating system (Windows) and do a full-text search, but I don't really get much useful information other than what files match. I don't get useful information on where the passage exists (page number, etc).

Consider the following passage from Soundboard Volume 1, Number 1, 1974:

"Mr. Llois Mauerhofer, Elizabethstrasse 93, 8010 Graz, Lustria, was reported working on a doctoral dissertation at the University of Graz on Leonard von Call, early 19th c. guitarist active in Vienna who is best remembered for his serenades for guitar and strings."

A "find" won't match that passage if you search for "Graz University" or "University Graz" or "strings Vienna" but a real keyword search likely would.

Of course, a demonstration is in order, so using a tool called Apache Tika to extract the text from the aformentioned PDF scan of Soundboard v.1, #1, 1974; a little Python software script I wrote to output the data to a database-friendly file; and an online database, I indexed the data and made a little API – all that means is that there's page you can go to, throw some search terms at it, and get the results back as structured data (um, usually not fun to read through).

By the way, I normally use more technical jargon in my posts but I have some guitarist buddies who I want to read this page.

Anyway, here are the three searches mentioned above that don't yield results in Acrobat Reader but do using a full-text search (you can see the search terms in bold in the links below). Don't worry if you can't read the output, just focus on the fact that something comes back (provided my database isn't down at the moment!).

http://blog.humaneguitarist.org/uploads/Soundboard/currentVersion/search/?q=Graz+University
http://blog.humaneguitarist.org/uploads/Soundboard/currentVersion/search/?q=University+Graz
http://blog.humaneguitarist.org/uploads/Soundboard/currentVersion/search/?q=strings+Vienna

For a more user-friendly version, try going here:

http://blog.humaneguitarist.org/uploads/Soundboard/currentVersion/soundboard_search.html

Try typing in the three searches mentioned above. Then try some more searches for fun. For simplicity's sake, I hard-coded the system to never return more than 10 results.

Of course, this should all scale to indexing the text of all the PDFs on the DVD, but exposing those openly on the web wouldn't be appropriate.

But my point with this demo is to say that this is more like what I meant by "keyword" searching at the GFA convention. There's probably a way to ingest the old PDFs into the FlippingBook software or at least something else like the Internet Archive book reader. That would probably require re-OCRing the images so that the coordinates of the words could be indexed as well, allowing one to see where on a page the results are, just as with the current issues via FlippingBook.

Ok, if you're still here and are a geek, here's the Python script, "soundboardToTabDelimited.py".

'''
usage example:
  $ python soundboardToTabDelimited.py V01-n1-1974.pdf

This yields "V01-n1-1974.xhtml" and then "V01-n1-1974.txt"
 
Note: you must have the lxml module installed (which isn't always fun).
You can get it here: http://lxml.de/
'''

import codecs, subprocess, sys
from lxml import etree

##### globals
tab = "\t"
br = "\n"


##### run Apache Tika on the file passed via the command line
soundboard = sys.argv[1].replace(".pdf", "")
command_string = "java -jar tika-app-1.2.jar %s > %s" %(soundboard + ".pdf", soundboard + ".xhtml")
command = subprocess.Popen(command_string, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
command.wait() #wait until the subprocess finishes.


##### write file headers (this needs to be deleted if you're going to later import the file via PHPMyAdmin).
tab_delimited = codecs.open(soundboard + ".txt", "w", "utf-8") #output file

tab_delimited.write("journal_id" + tab + "volume" + tab + \
                    "issue" + tab + "year" + tab + \
                    "page_id" + tab + "text_id" + tab + "text" + br)


##### extract volume, issue, year from filename
volume = int(soundboard.split("-")[0].replace("V", ""))
issue = int(soundboard.split("-")[1].replace("n", ""))
year = int(soundboard.split("-")[2])
journal_id = "%04d_%04d_%04d" %(volume, issue, year)


##### parse xhtml file
soundboard_parse = etree.parse(soundboard + ".xhtml")
root = soundboard_parse.xpath(".")

div_tags = root[0].xpath("//xhtml:div[@class='page']",
             namespaces={"xhtml":"http://www.w3.org/1999/xhtml"})


##### extract text from each div/p tag and write data to file
page_id = 1
for div_tag in div_tags:
  text_id = 0
  p_tags = div_tag.xpath("xhtml:p",
             namespaces={"xhtml":"http://www.w3.org/1999/xhtml"})

  for p_tag in p_tags:
    p_text = p_tag.text
    if p_text !=None and p_text !="":
      p_text = p_text.replace(br, "")
      p_text = p_text.replace(tab, "  ")
      p_text = p_text.strip()
      if p_text != "":
        tab_delimited.write(str(journal_id) + tab + str(volume) + tab + \
                            str(issue) + tab + str(year) + tab + \
                            str(page_id) + tab + str(text_id) + \
                            tab + p_text + br)
        text_id = text_id + 1
     
  page_id = page_id + 1

tab_delimited.close()
# fin
--------------

Related Content:

Written by nitin

January 5th, 2013 at 12:35 pm

Rock Me Milos Forman

leave a comment

I'm enjoying (sort of) a little vacation given that the institution I work at is closed for the holidays. I have a lot of composition stuff I'm working on these days which equates to some exhausting mornings and a lack of practicing the pieces I'm working on.

Anyway, I've been meaning to write a little post for some time on one of my all time favorite films, and arguably the film that most changed the direction of my life, Milos Forman's "Amadeus".

Amadeus movie poster

This movie is one of three I credit with having an enormous influence on my life, the other two being "Star Wars" (yes, I call it "Star Wars" not a "New Hope") and "Sholay". The former probably did more to instill a perhaps naive and childish optimism in me, the latter – almost to the contrary – taught me that doing the right thing is often not glorious, but painful.

But "Amadeus" is the reason I got into Music more than anything. It also is likely the first film that made me aware of film as an art and not this mystical audio-visual experience that "Star Wars" and "Sholay" were for me, given that I was much younger when I first watched those. There was so much talk about F. Murray Abraham's and Tom Hulce's performances, that I couldn't *not* be made aware of it as a cinematic product.

For all three films, I estimate I've easily seen "Star Wars" over 100 times, and I've probably seen "Sholay" and "Amadeus" at least 50 times each. I could still watch "Star Wars" with relative ease but watching "Sholay", given the ending, is a bit of trying experience, most especially during the song "Yeh Dosti" which foreshadows the tragic ending of the film; but if I wanted to watch it again I could do it.

In contrast, I recently tried to watch "Amadeus". I just couldn't. And perhaps I don't need to anymore.

I think the biggest factor was that I had the director's cut and all the extra scenes were really jarring to me, it was like discovering an undesirable dimension to a person I thought I knew well. It's somewhat like how Music has changed for me, too. It's no longer a mystery, it's work, work that I enjoy most of the time.

Anyway, there's a good comparison between the theatrical/director's versions here (warning: there might be some movie poster images on the website that you might not want to see).

In large part, I think the theatrical version is far better. The director's cut has … how does one say? … "too many notes".

The only thing I really found interesting about the extra scenes was how much food played a part in Salieri's life, as if his denial of other worldly pleasures had led him to gluttony. But F. Murray Abraham is too thin for that to work and also by hiding some details about his flaws and his conniving as in the theatrical version, I think he more effectively comes across (in the theatrical version) as a symbol of jealousy and the rightful patron saint of mediocrity.

    Written by nitin

    December 27th, 2012 at 3:44 pm

    Frankenstein and the inverse guitar

    leave a comment

    Several years ago, while living in Charleston and before I really knew anything about subscription databases in academia, I hand-compiled a list of poetry that references the word "guitar" in it. I called it "1/Guitar" or the "In-Verse Guitar Project". Unlike what I wrote at the top of the page in 2005, I doubt I'll ever go back and augment the list – at least not by hand.

    Anyway, the work was driven, in part, from reading a blurb about some guitar strings that were analyzed from a guitar once thought to be owned by Percy Bysshe Shelley.

    Quick aside: I once wrote a melody/harmony to his "Love's Philosphy" in college but never did anything with it since I would have made myself write at least one or two more settings of other poems of his so that it wasn't a one-off. I never really worked out the texture for guitar for the harmony, but I can still hear the melody with harmony in my head. Anyway, they'd just have languished given that I wouldn't have harassed any singers in college to learn them, etc.

    Getting back on track (for now) I'm pretty sure this is what I read – man, this was a long time ago in Chucktown!

    Rambling on, I recently finished reading Mary Shelley's Frankenstein.

    There are a four references to the guitar, during the part where the "monster" spends time in the forest watching over a family he longs to befriend.

    Here they are:

    1. "It was on one of these days, when my cottagers periodically rested from labour—the old man played on his guitar, and the children listened to him—that I observed the countenance of Felix was melancholy beyond expression; he sighed frequently, and once his father paused in his music, and I conjectured by his manner that he inquired the cause of his son's sorrow. Felix replied in a cheerful accent, and the old man was recommencing his music when someone tapped at the door.

    2. "The next morning Felix went out to his work, and after the usual occupations of Agatha were finished, the Arabian sat at the feet of the old man, and taking his guitar, played some airs so entrancingly beautiful that they at once drew tears of sorrow and delight from my eyes. She sang, and her voice flowed in a rich cadence, swelling or dying away like a nightingale of the woods.

    3. "When she had finished, she gave the guitar to Agatha, who at first declined it. She played a simple air, and her voice accompanied it in sweet accents, but unlike the wondrous strain of the stranger. The old man appeared enraptured and said some words which Agatha endeavoured to explain to Safie, and by which he appeared to wish to express that she bestowed on him the greatest delight by her music.

    4. "When his children had departed, he took up his guitar and played several mournful but sweet airs, more sweet and mournful than I had ever heard him play before."

    It's interesting that #2 and #3 clearly reference vocalization. And I like how in #3 that it's the voice that "accompanied" the guitar. That makes me wonder about #1 and #4. Were they pieces for solo guitar? Was #1 an intabulation of the song in #2 and, if so, is that why it made Felix so sad – because it reminded him of when the woman he loved sang the melody?

    And on a final note, I'd like to paste one more quote from the book, which I think provides a nice overview of the novel's message to me, the interpreter. These words are the last spoken by Frankenstein. It gets at what I think about a lot: people who do out of selfishness and ego rather than passion and love. The former will never know what it's like to play truly "mournful but sweet airs".

    "Farewell, Walton! Seek happiness in tranquillity and avoid ambition, even if it be only the apparently innocent one of distinguishing yourself in science and discoveries. Yet why do I say this? I have myself been blasted in these hopes, yet another may succeed." – Victor Frankenstein.

    --------------

    Related Content:

    Written by nitin

    September 16th, 2012 at 12:00 am

    Anivil Crackers: of Anvil, Ginger Snaps, WrestleMania, and the two Coreys

    leave a comment

    I've had this post in "draft" mode for months, though there never was any text.

    As I wait a little while before I have a Sunday night drink (vodka, soda, slice of orange FTW!), I wanted to quickly mention that I saw these two films and really enjoyed them.

    Interestingly, they are both connected to Canada …

    The first is Anvil: The Story of Anvil

    Anvil poster

    Now, I like heavy metal – at least the pre-90's stuff. It's actually what got me into classical music given that so many 80's metal guitarists were seriously into classical music. So I might be more inclined to watch this than some. But I'd encourage anyone who thinks they are dedicated to something they love to watch this film. These guys are damn dedicated to playing music even though they never got the "success" they seemed poised to achieve. There are funny moments and heart-wrenching ones, too. The relationship between this Canadian band's frontman "Lips" and drumming virtuoso Rob Reiner is really something to behold.

    For some reason this film reminded me a lot of Beyond the Mat, the wrestling documentary, particularly the parts about Jake "The Snake" Roberts (which had to be the inspiration for The Wrestler). Maybe because both are about people doing what a lot of people might think aren't serious endeavors. But these people are really serious. And they're seriously real. Much more than a lot of people I know who like to think they're smart, unique, etc. when they're just dull and delusional.

    On to film #2, Ginger Snaps.

    Ginger Snaps poster

    There's a lot of vampire-inspired stuff around these days, so it's nice to see some lyncathropes on film every now and then, too. Both actresses are great in this Canadian gem. Like the Anvil film, this, too, reminded me of another film: The Lost Boys – which, of course, starred the "Coreys".

    I guess wherever there are werewolves, there are vampires, eh?

    --------------

    Related Content:

    Written by nitin

    July 15th, 2012 at 9:45 pm

    the GFA 2012, Charleston, and me

    leave a comment

    Last week I went back home in a couple of respects.

    I went to Charleston, South Carolina to attend the 2012 Guitar Foundation of America International Convention and Competition.

    I was born and reared in Columbia, SC but at the end of 2001 – after a brief stint near San Francisco with my cousin – I moved to Charleston.

    Charleston's my home.

    I lived there for almost 8 years, and in many respects I'm still there, albeit not physically. My greatest friendships were formed there and I loved living there. Unfortunately, at the time I was there the combination of my education and the job market made me move on. For now. I hope there's someway I can get back to Charleston one day. But it was great to visit again, if only for a week.

    As for my other home, Music, the trip was really great, too. I met some new and interesting people, heard some great playing, and met up with some old friends.

    I may work in libraries, but I developed a kinship for libraries only in the sense that they provided me a way to study music.

    Anyway, in the lines below I'll outline what I did each day as those activities relate to Charleston and the GFA convention.

    Tuesday, June 26

    Got into town about an hour and half late – I missed the I-26 exit because I turned my cell phone off because the GPS/Google Navigation makes it overheat. That, and I'm directionally challenged. Maybe it's time to ditch the smartphone and just buy the right tool: a standalone GPS unit for the car.

    Checked into the King Charles Inn. Met Dave and chatted about Charleston before he helped take my luggage. Dave lives on a boat.

    Went to dinner at Sermet's. Interior is totally different. Talked to Sean the bartender. Sean's an artist. He gave me his card, I passed it onto a friend of mine I met for coffee later in the week.

    Late night drink at Burns Alley.

    Later night drink at … well I can't say.

    Wednesday, June 27

    Went home-home. Visited my former apartment on 4 John St. Luckily, my landlord, Mr. James was outside. We talked on the upstairs patio for a couple of hours – about 4 John, his travels abroad, my health, the Chucktown home market, the neighborhood association, the public library, and lots of other things.

    Lunch at good old La Hacienda. The waiter who used to come into the library and ask me for things to help his English is no longer there. Hope he's well wherever he is.

    Dinner at El Cortile del Re. Never ate there when I lived there, so I stopped in. Chatted with Terry, my bartender. We talked about how nice it is to step out in the middle of the night sometimes in Charleston and just walk around all the old buildings and by the ocean. Peace.

    At some point we, the owner, and one of the servers started talking about old Saturday Night Live skits, Ginger vs. Mary Ann, Daphne vs. Velma, et al.

    We couldn't remember the names of the girls in Scooby-Doo and the owner though it was funny that all the guys went to their cell phones to look it up while she didn't have a smartphone. We talked about how before cell phones the information wouldn't even have been important enough for us to even bother with researching. She also pointed out the one bathroom at the inn across the street and that the blinds were almost never closed and how easy it was to look inside – whether you'd want to or not.

    Dessert at Belgian Gelato on King. This place is new and new to me. I like it.

    Thursday, June 28

    Met my friend Christina for coffee at Kudu. Talked about old times and got updates on friends. Talked about what we dubbed "short films", the idea that people often try to make "features", i.e. try to do more than they are capable, that they fail when there are people out there making "shorts" – things of quality that actually affect people though they might seem less massive. Ultimately, nobody cares about how ambitious you are – or think you are – if you just produce junk. Quality matters. Precision matters. Aesthetics matter. Size doesn't. At least not in this context.

    Talked about the lack of female plays/playwrights in Charleston. Gave her Sean's card.

    Ah. Charleston summers … and Wimbledon. Watched Nadal get beaten by Rosol. If Nadal has a problem with Rosol's return motion, maybe he should stop delaying the server – which isn't only distracting, it's against the rules.

    Lunch at Gilroy's.

    Went to the Simmons Arts Center to get my GFA name tag, etc. and attend a lecture. Couldn't find registration desk. Had to ask around. Learned it was intermixed with the vendor booths. No sign that screamed at me and said "This is the registration desk." Strike one.

    Went to room 309 per the GFA website to attend Alexander Dunn's "Beethoven Songs with the Guitar" lecture. Walked in the Sergio Assad masterclass. Went back to registration. Learned that the printed program said the lecture was in room 101. Print > web; data mismanagement. Strike two.

    Missed the first couple minutes of Dunn's presentation because of the communications problem. Great presentation. Particularly found the comments about the expertise of the Diabelli arrangements to be of interest. Enjoyed the songs that Dunn played with a singer. Would have preferred to hear on period instrument. Talked to Alexander about this later in the week, sounds like such a recording might be in the works down the road.

    Skipped the Kavanaugh concert. Program consisted of student repertoire and her own pieces scattered throughout the program. Not what I go to the GFA for. Strike two and a half. Sorry.

    Dinner at Bocci's with friends Jim and Karen. Jim had a presentation the next morning.

    Dessert with Jim and Karen at Belgian Gelato on King. Used the coupons I got the night before.

    Late drink at Burns Alley – hey, only the locals know about it and how to find it. I think that's the point.

    Friday, June 29

    Went to the GFA Round Table. Introduced by Executive Director Galen Wixson. Hosted by Tom Heck.

    A few comments made about the online Soundboards (SB). Don't think my question about whether they are full-text indexed was understood. So I dropped it.

    I was particularly asking about whether I could search across all SB's simultaneously online. While their ebook software (http://flippingbook.com) is indexing each SB and I can search full-text across an issue, I still don't see a way to search across all the ones that are available through the GFA website. Same for the back issues in PDF. Sure, I can probably index it with with my operating system's built-in indexer, but we need to do more and index it and make it a web service. Or maybe I'm missing something.

    And now why I came: presentation by Robert Coldwell of the Digital Guitar Archive (DGA). Good overview of Robert's work re: harvesting metadata from across diverse online digital score archives. "Metadata" never uttered once, of course. These are guitarists, not librarians.

    Conversation starts about using iPads to view sheet music. I commented that it's interesting that all the talk is about co-opting a general purpose device (the iPad) when maybe it's simply insufficient for music. Mentioned something like the original Microsoft Surface is perhaps better. Maybe the stand and the tablet are one. Someone had previously mentioned wanting a digital score view that automatically turned the page as it listened to the player. I felt he and I were talking about what needs to happen whereas some others were talking about simple accepting what exists and trying to make it fit. Reminds me of what my former professor at South Carolina, Mr. Berg, always said about sitting: "…bring the guitar to you, don't bring yourself to the instrument (paraphrase)".

    In light of some of the things I heard here and the website problems I'm got the feeling I might be able to make some contributions to the membership just in raising awareness about things like digital symbolic music representation, music metadata, etc. As of this post the winners are still not listed on the GFA Drupal site itself, but rather on the WordPress blog; the Drupal site is still presenting information about registration!

    My friend Jim Buckland presented on the Guadagnini family of luthiers. Lots of new information for the attendees to absorb and some shattered stereotypes (people gasped audibly when they learned Giuliani's Fabricatore has a scale length that exceeds current convention). Jim's research is critically important and I keep pestering him to formally document as much as he can. After the allotted hour, people were asked if they wanted to hear more. Almost everyone stayed for about another hour. I helped Jim by advancing the PowerPoint slides so he could focus on speaking and answering questions.

    Chatted with Alexander Dunn a bit. Met Jim McCutcheon. Took a few pictures for him, was in a few pictures with him.

    Few of us agreed to have lunch. I walked with Robert and we discussed geek stuff like his SQL schema, his preferred scripting language choices for the DGA, and whether he'll eventually offer up an API. He later said this was the only technical conversation he's ever had at one of these conventions. I'll definitely be talking more to Robert and I hope there's something we can work on together down the road.

    Lunch at Mellow Mushroom with Robert, Tom, the two Jims, and Karen. Had an Abita Purple Haze on draft. Saw beginnings of the Federer/Benneteau epic on the television. Took a nap in the hotel. Woke up to Fed taking the last set. Whew.

    Quick dinner with Jim, Karen, Geoff Ferdon of Alhambra Guitars and Patrick, another South Carolina grad at Coast Bar and Grill.

    Friday concert was the legendary Assad Brothers. Practically got a standing ovation for walking onto the stage. Second half by far stronger than the first. Amazing how different their techniques are given how seemlessly they merge their sounds.

    Solo pieces by Sergio, played by Odair, were probably best thing on the program. Unlike some others, Sergio's music is on par with anything else they could play so it's OK if his music is played throughout the concert. Less established composers need to segment their stuff off to the end of the program in my opinion for two reasons: so that people can leave (sorry) and so one doesn't try to "boost" the value of their music by sandwiching it between established works.

    Sitting behind me was an old friend, Rick Zender from the College of Charleston. That was a happy coincidence. It was great to talk with him again. I'd known him through my event programming activities when I worked at the Charleston County Public Library.

    Dessert at Kaminsky's. Got my favorite: the Cuban coffee and some cake as well just for fun. Walked around the Market a little bit while waiting for a seat.

    Saturday, June 30

    Attended Christiano Porqueddu concert. All Gilardino, all the time. Given how many, um, flaky concert programs I saw this week I went to this largely in support of Porqueddu's commitment to serious programming. This is an international guitar festival after all. Let's be serious here.

    The Gilardino I've heard and looked at is as hard to listen to as to play, but I still respect it. Porqueddu's playing was very good. He was in fact the only person I heard at the Sottile Theater (the default concert venue) that didn't use a microphone. Not that I associate that with good playing; rather it's just an observation.

    By the way if people are using mics: then I'm thinking the Sottile isn't the right venue. At the 1999 convention in Charleston, I remember hearing concerts at the nearby church (which one?, so many) and the acoustics and ambiance were superior to the Sotille (which is dealing with some internal renovation work, too).

    Porqueddu said not one word during the concert. And I think he should re-think that approach. Especially when you are playing music many people have never even heard or heard of. Lighten things up, talk a little and guide us through what you're playing and why it means something to you. Tuning problems same as on some of his CDs. This could be due to a lot of reasons and is more likely due to a preference for certain intervals then it is due to any musical/hearing issues, etc. But it's still distracting here and there.

    Walked around town with Jim and Karen. Hollywood Video on Calhoun/Alexander is gone and the Starbucks (where we went) seems run down. It used to feel so new. Walked by the library and saw an old co-worker coming out. Chatted for a few seconds.

    Went to the Charleston Museum: they had guitars made by Martin Co. One had a Stauffer/Legnani headstock. Totally ruined by trying to make it a steel string after the fact. Major structural damage. Sold by Siegling Music House of Charleston. I've been saying for years that there are probably 19th century guitars lying around in Charleston here and there. Never saw guitars in the museum before. And I used to live only 3 doors down. I'll be researching Siegling …

    Quick dinner at Nick's BBQ on King. Another place that's new to me.

    Went to the Roland Dyens concert. Opened with an improvised piece. Played some Tchaikovsky and some Chopin amongst his own works. I had to use the restroom during the intermission and missed the first set of the second half.

    Unfortunately, they had cranked the microphone up between the 1st and 2nd half.

    Bad decision. Now, I'm not having to actively listen, now the music's being shoved in my face and the mid range is so muddy it's working against this man's fine playing. Why are we even using mics in classical guitar concerts? I hope this wasn't Dyens' idea. I'd prefer to blame the audience or the GFA for catering to the lowest common denominator. I need to start an anti-mic campaign for the next convention. The players don't need it and neither do responsible listeners.

    Anyway, I enjoyed the Dyens though I would have preferred a more structured program. It felt a little too casual and light to me for a final concert.

    Went out by myself to a few new bars who's names I can't recall. Thanks to Kristin and Sonny for doing shots at the bar after they pretty much closed for the night. Good luck to Sonny as he pursues his chemistry degree.

    Sunday, July 1

    Went to Clinton, SC for the day. Hung out with Jim, Karen, and their cat Bria.

    Dinner at local Mexican restaurant. Unfortunately, our standard El Jalisco is closed on Sundays but this other place was good. Waiter was super happy that Spain trounced Italy in the football match.

    Heard some of the new Maccari-Pugliese CD: "Music for Guitar & Piano". Speechless. I love these dudes and their playing. They need to be playing at a future GFA. They are too good. Plus, they're crazy fun to hang out with!

    Watched "Tenure" with Luke Wilson – interesting to watch with two professors.

    Headed to my parents' home in Columbia for a doctor's appointment the next day.

    … and "life", as it were, resumes though I feel refreshed and rejuvenated.

    Final Thoughts

    I need to go to Charleston more:

    • it's only 4.5 hours away.
    • I miss it.

    The GFA needs to do more:

    • better coordination between the data on the website, their blog, and their printed documents. i.e. better organization and communication before, during, and after the convention.
    • maybe form a task force to get feedback from members in a structured manner to try and make things even better next year.
    • consider having TV's in the waiting area of the halls with live feeds of the concerts for people who are too sick to sit comfortably inside the concert hall, etc.
    • consider social media: tweets, SMS, etc. for rapid updates during the convention and for on-the-fly meet ups and events.
    • work harder to promote scholarly activity. There were only like 2 scholarly presentations. Seriously? Come on folks. Rumor does have it that a scholarly, peer-reviewed supplement to the SB is being discussed. This needs to happen.
    • consider "tracks". i.e. every day should have a "performance" track about technique, etc., a "scholarly" track about research,  a "guitar and technology" track, etc, etc. An attendee should have options in each track throughout each day. Let's be more methodical, more organized, more comprehensive, and more deliberate with our gatherings.
    • ban microphones. If the player needs it, don't invite them. If the hall requires it, don't use it.
    • summer dates in places as hot as Charleston might not be the best idea.
    --------------

    Related Content:

    Written by nitin

    July 4th, 2012 at 11:40 am

    Posted in music,news

    Tagged with , , ,

    museline: trying to add support for compressed MusicXML

    4 comments

    Just a quick follow up to the last post about using Google Chart Tools to outline melodic contours from MusicXML files …

    I wanted to add support for compressed MusicXML files in addition to the non-compressed ones. So far, the code I've got seems to be working with the two or three compressed MusicXML files from Wikifonia I tested.

    Here's a screenshot below of A-Ha's "Take On Me", one of the best songs from the 80's with one of the absolute best videos, too! To make the graph I passed it to the app a la "http://localhost:8083/?mxml=http://static.wikifonia.org/1934/musicxml.mxl".

    museline_aha_screenshot.png

    Here's the video:

    Keep in mind the contour script doesn't take repeats into account and that the entire melody repeats three times in the song.

    Also, I don't like to make code downloadable if I'm still working on it because I don't want to junk up my web directory, but I'll paste everything essential below: the Google App Engine YAML file, the Python code, and the Jinja/HTML template.

    YAML:

    application: museline
    version: 1
    runtime: python27
    api_version: 1
    threadsafe: true
    
    handlers:
    - url: /stylesheets
      static_dir: stylesheets
    - url: /.*
      script: museline.app
     
    libraries:
    - name: jinja2
      version: latest
    - name: lxml
      version: latest
    

    Python:

    ### museline.py
    ### 2012, Nitin Arora
    
    ### import modules
    import urllib
    from lxml import etree
    import math
    import re
    import webapp2
    import jinja2
    import os
         
    jinja_environment = jinja2.Environment(
      loader=jinja2.FileSystemLoader(os.path.dirname(__file__)))
      
    #####
    class museline(webapp2.RequestHandler):
      def get(self):
        
        ### read MusicXML file
        try:
          url = self.request.get('mxml')
    ##      url = 'http://blog.humaneguitarist.org/uploads/i_heart_thee.xml' #test line
          if url[-4:] == '.xml': # uncompressed MusicXML
            readUrl = urllib.urlopen(url).read()
            
          else: # compressed MusicXML
          ### References:
            # http://stackoverflow.com/a/8858735
            # http://stackoverflow.com/questions/1313845/if-i-have-the-contents-of-a-zipfile-in-a-python-string-can-i-decompress-it-with
            from cStringIO import StringIO
            compressed = urllib.urlopen(url)
            compressedString = StringIO(compressed.read())
            import zipfile
            zipped = zipfile.ZipFile(compressedString, "r")
    
            archiveFiles = zipped.namelist()
    ##        self.response.out.write(archiveFiles) # test line
            for archiveFile in archiveFiles:
              if archiveFile[-4:] == ".xml" and "/" not in archiveFile:
                realXML = archiveFile
            extracted = zipped.open(realXML,'r')
            readUrl = extracted.read()
    
    ##      self.response.out.write(readUrl) # test line
                    
        except:
          errorMessage = '''<pre>
    You must pass an "mxml" parameter.
    If you have but still see this message, then there is a problem accessing/reading the MusicXML file.
    </pre>'''
          self.response.out.write(errorMessage)
          return
    
        ### setup pitch values
        notes = ['C','D','E','F','G','A','B']
        i = 0
        noteVals = {}
        for note in notes:
          if note == 'C' or note == 'F':
            noteVals[note] = i + 1
            i = i + 1
          else:
            noteVals[note] = i + 2
            i = i + 2
    
        ### parse MusicXML file
        parsed = etree.XML(readUrl)
    
        ### get basic descriptive metadata
        metadata = []
        elementList = ['work-title',
                       'work-number',
                       'movement-number',
                       'movement-title',
                       'creator[@type="composer"]',
                       'creator[@type="lyricist"]']
        for element in elementList:
          xpath = str(".//%s") %element
          if parsed.find(xpath) !=None:
            found = parsed.find(xpath).text
            att = re.match(r'(.*)type="(.*)\"', element)
            if att:
              element = att.group(2)
            if found:
              metadata.append((element,found))
    ##    self.response.out.write(metadata) # test line
    
        ### access part one tree                       
        part = parsed.find('.//part[@id="P1"]')
        pitches = part.findall('.//pitch')
    ##    self.response.out.write(str(len(pitches)) + " pitches.\n") # test line, number of notes (non-rests)
    ##    self.response.out.write(str(len(pitches)*.618) + " Golden Ratio.\n") # test line, maybe something for the future.
    
        ### put pitch values in a list
        pitchList = []
        i = 1
        for pitch in pitches:
          if pitch.find('.//alter') != None:
            alter = int(pitch.find('.//alter').text)
          else:
            alter = 0
          step = pitch.find('.//step')
          octave = int(pitch.find('.//octave').text)
          pitchPos = str('pitch: ' + str(i))
          pitchClassVal = ((int(noteVals[step.text]) + alter)) * .01
          pitchVal = ((int(noteVals[step.text]) + alter) + (octave * 12)) * .01
          label = (pitchPos, pitchVal, pitchClassVal)
          pitchList.append(label)
          i = i + 1
    
    ##    for pitch in pitchList: # test block
    ##      self.response.out.write(str(pitch)+'<br>')
          
        #data for the Jinja template  
        template_values = {
          'pitchList': pitchList,
          'url': url,
          'metadata': metadata}
    
        template = jinja_environment.get_template('museline.html')
        self.response.out.write(template.render(template_values)) #write data to the html template
      
    app = webapp2.WSGIApplication([('/', museline)],
                                  debug=True)
    

    Template:

    <!DOCTYPE HTML>
    <!-- museline.html -->
    <html>
      <head>
        <title>
          museline
        </title>
        <link type="text/css" rel="stylesheet" href="/stylesheets/style.css" />
        <script type="text/javascript" src="http://www.google.com/jsapi"></script>
        <script type="text/javascript">
          google.load('visualization', '1', {packages: ['corechart']});
        </script>
        <script type="text/javascript">
          function drawVisualization() {
            // Create and populate the data table.
            var data = google.visualization.arrayToDataTable([
            ['pitch position', 'melodic contour'],
            {% for pitch in pitchList %}
              ['{{ pitch[0] }}', {{ pitch[1] }}],
            {% endfor %}
            ]);
           
            // Create and draw the visualization.
            new google.visualization.LineChart(document.getElementById('visualization')).
            draw(data, {curveType: "function",
              width: 800, height: 400,
            vAxis: {maxValue: 1}}
            );
          }
          google.setOnLoadCallback(drawVisualization);
        </script>
      </head>
      <body>
        <div id="visualization"></div>
        <p>Metadata:</p>
        <ul>
        {% for metadatum in metadata %}
          <li>{{ metadatum[0] }} : {{ metadatum[1] }}</li>
        {% endfor %}
          <li>URL: <a href="{{ url }}">{{ url }}</a></li>
        </ul>
      </body>
    </html>
    
    --------------

    Related Content:

    Written by nitin

    May 5th, 2012 at 5:36 pm

    museline: charting melodic contours via web service

    leave a comment

    In the last post, I mentioned I was playing with Google App Engine and Google Chart Tools.

    Last night, with some silly movie streaming in the background, I was in bed tinkering with a little idea that I'm sure has been done a-thousand times already and that may be built into high end music notation applications. But it hasn't been done by anyone as stoopid as me!

    :P

    What I did was whip up a little App Engine/Python app where one can pass it a partwise MusicXML file and it will use Google Chart Tools to create a little line chart of the melodic contour of the first <part> element.

    Here's a screenshot below of the results using the MusicXML sample file available on the MakeMusic site of Schumann's "Im wunderschönen Monat Mai" from the Dichterliebe. The app has an "mxml" parameter that tells it which MusicXML file to use a la "http://localhost:8083/?mxml=http://downloads2.makemusic.com/musicxml/Dichterliebe01.xml".

     

    I've embedded a really nice performance on YouTube if anyone wants to follow along. The contour graph represents the vocal part only.

     

    Now, this is just a start. There's a lot of work to do if I pursue this. For starters, I'd like to make the chart synced with an audio/video recording. I don't know if I can do that with Chart Tools, but probably with the <canvas> element if nothing else. Also, I haven't tried this yet with any non-homophonic parts. Anyway, it's a start and it's kinda fun.

    I tried to add another line for the actual pitch class contour but it wasn't as interesting to look at as the melodic contour so I disabled that "feature". By pitch class, I mean I was using octave equivalency so that all "C" notes, for example, were plotted at the exact same vertical position as opposed to the screenshot above where two "C" notes an octave apart would have different vertical points on the graph to depict the intervallic difference.

    As far as plotting the notes, I ignored rests and durations. I just plotted the pitches as below, starting with "C" with a value of "1" and with the "B" a seventh up from that "C" receiving a "12".

    • C : 1
    • D : 3
    • E : 5
    • F : 6
    • G : 8
    • A : 10
    • B : 12

    This way a "C-sharp" and "D-flat" receive a score of "2", for example, because they lie between "C as 1" and "D as 3".

    In MusicXML, the <step> element has the note name and the optional <alter> element, which is a number, tells you if it's sharp or flat, etc. The numerical <octave> element tells you what octave range the pitch is in.

    So what I'm doing is pulling out the <step> value and converting it to a number as above, adding the <alter> value (a flat is a negative number), and then multiplying adding that sum to 12 times the <octave> value. Then, I multiple the value by ".01" just to reduce the number because I want the graph's vertical limit to be a small number even though this shouldn't change the contour itself.

    Last, I'm trying to pull some basic descriptive metadata if they are present in the MusicXML file and show it below the graph.

    Maybe I'll do more with this later. Just goofin' for now.

    --------------

    Related Content:

    Written by nitin

    May 3rd, 2012 at 3:55 pm

    just goofin’ with a little Python CSV function and a limerickesque

    leave a comment

    This is probably a total waste of anyone's time but  …

    The other night, after I'd worked on the Aguado Rondo (Op. 2, #2), I started goofing around with a little Python function that would turn a delimited text file into a Python dictionary, allowing me to target a specific cell in a delimited file, i.e. a "spreadsheet", without using the CSV module.

    It works (well, at least I hope it does) this way:

    films = csv2dict("films.txt", ";") #pass filename and delimiter
    print films["title"] #print "title" column sans the header
    print films["title"][-1] #prints last cell in the "title" column
    

    It seems helpful to be able to do this. I've tested it with a UTF-8 file to write to file with some accent markings on people's names, etc. but I'm pretty sure it'll break on stuff I haven't thought of.

    Anyway, maybe it'll come in handy to me for something.

    Here's the function:

    def csv2dict(fileName, delimiter):	
      f = open(fileName, "r") #open file
      lines = f.read() #read file
      f.close() #close file
      
      rows = lines.split("\n") #put lines in list
      headers = rows[0].split(delimiter) #put header titles in list
      rows.pop(0) #remove header from "rows" list
    
      i = 0
      worksheet = {}
      for header in headers: #for each header, i.e. each column
        columnCells = []
        for row in rows: #for each non-header row in delimited file
          if row != "":
            rowCells = row.split(delimiter) #get cells in row
            columnCells.append(rowCells[i]) #put column's cells in list
        worksheet[header] = columnCells #set header as KEY and set "columnCells" list as VALUE
        i = i + 1
    
      return worksheet

    And for any guitarists out there, here's a little silly rhyme I wrote when living in my home eternal, Charleston, SC. I know the Sor as "warrior against the French" thing isn't accurate, but it helps the punchline.

    :P

    The title is, of course, that as Sor's famous duet.

    "Le Deux Ami"
    
    Fernando Sor,
    who served in the war,
    fought Bonaparte in the army.
    
    But Dionisio Aguado,
    who lacked such bravado,
    preferred to run home to his mommy.
    --------------

    Related Content:

    Written by nitin

    February 16th, 2012 at 8:44 pm

    drawing on straws: making stringing my guitar easier

    4 comments

    This is somewhat off-topic, but not really since music's the basis of this blog and stuff, really.

    So anyway, I own two fine guitars made by my friend Dr. James Buckland. For the last couple years, I really only use the Panormo inspired one shown below. As you can see it has bridge pins.

    And I hate putting on new strings because I like to tie the string knot after the string is protruding outside of the soundhole so I can then pull the string through before I insert the pins.

    But it's a pain – especially with the treble strings (that's gut treble, thank you very much) – because inserting them from the top (through the bridge) rarely results in them easily finding their way out of the soundhole and into my hands. By the way I use Gamut strings and really like them …

    Anyway, I've used a set of tongs before to get them, but I just moved and don't have a set of tongs lying around. Nor do I have any tools to make something more appropriate. But I do have flexible straws …

    So, using two straws I've got a nice little tool that I can insert into the soundhole and that helps me hook the string and pull it through the soundhole so I can then get onto tying the knot and restringing my guitar.

    Obviously, I'm so excited about such a dopey little thing I decided to blog about it.

    It's a lot safer for the guitar than a set of metal tongs, too. Also, you can't drink smoothies with a set of tongs.

    In the days before the Internet, I could have probably made a few bucks a year selling this thing through the Soundboard with a vague description and the phrase "Patent Pending" in the ad. Oh, for the good old days.

    And here's what the "Bridge Pin Helper (Patent Pending)" looks like. Order yours today!

    :P

    --------------

    Related Content:

    Written by nitin

    May 8th, 2011 at 11:59 am

    Posted in music

    Tagged with , ,

    when worlds collide: guitar meet online library

    leave a comment

    Thomas Heck's "Expanding the GFA's Online Resources" from a recent issue (Vol. 36, no. 3) of the Guitar Foundation of America's Soundboard listed some cool online resources that I know of and use and some that were new to me.

    They all appear to be listed on the GFA page here: http://www.guitarfoundation.org/drupal/node/4112.

    The coolest of all is the Boije Collection which I backed up to my local drive and all my backup areas as soon as I learned about it a few years ago.

    I will never in my life learn a score by reading it off a screen, but I can print scores out from this collection and work on them. Given that it's mostly a 19th century music collection, it fits perfectly with the type of repertoire I work on. Thankfully, the scores are hand-written, if not facsimiles, as I really hate working on scores produced by machines. They aren't beautiful and don't look alive even though the music itself is. Also, they make learning the music harder for me and less fun. I could go on …

    --------------

    Related Content:

    Written by nitin

    December 19th, 2010 at 9:27 am

    Posted in music,music notation

    Tagged with , ,

    Switch to our mobile site