Skip to main content

Posts

Showing posts from October, 2012

Rocksmith, guitars, and music making on the iPad

The other day I invested in the long awaited (in the EU, that is) Rocksmith music game. This lets you play with your good old electric guitar or bass hooked up to your PS3, instead of the plastic gadgets made infamous in the 00s. I haven't had/taken the time to sit down rock out much with the game itself, but I have had a quick try at something that I guessed might be possible - to use the included cable, the so-called Real Tone Cable, as an interface between my guitar/bass and my iPad. Plugged, played, and lo and behold, it worked! Amp modelling and recording in Garageband, analog modelling filters with Moog's filtatron, etc. Classe ! (I have not confirmed the sound quality , but latency wise it is not too bad.)

Tabular data from PDFs with the help of Ruby

Sometimes I need to get data out of tables buried in PDFs, so I've written a tiny adaptable Ruby hack for when copying and pasting doesn't cut it - exploiting a couple of excellent libraries. Here's an example. Loading... (Admittedly not the most elegant of scripts, but hey! it gets the job done.) What I do first here is just load up the relevant libraries. (The pdf-reader I use is this one: https://github.com/yob/pdf-reader - installable with a simple command line 'sudo gem install pdf-reader' if you are using Ruby 1.9. (Drop the sudo if you're on Windows.)) Next up is to instantiate input pdf and output table. Straight forward enough. By examining the pdf I found the data I was interested in on pages 42 through 69, so a simple call to pages give me those -  pdf_reader . pages [ 42 . . 69 ] . I'll go through the text on each of them line by line and decide if they contain what I want based on regular expressions. These are my simple rules (in th...