Archive for September, 2007

Penner easing for c++

Monday, September 24th, 2007

As I said last week, I’m also using robert penner’s easing equations in openFrameworks, so I’ve ported them to c++.

This has been relatively straightforward, but, as with the actionscript to java conversion, I’ve run into some nuances between languages and I’ve definitely learned the hard way (read “wasting some hours of my life”) why pre and post increment operators can be evil.

Grab them here

For usage, you can have a look at the openFrameworks app provided. If you want to have a quick glance at the types of movement, see the easing applet (p5 version).

Being this a programming exercise, it will have improvable things for sure. I’m thinking of some, but if you know anything, please let me know.

tags:

taking notes about what you are listening to on last.fm: the hacky way

Monday, September 17th, 2007

Some time ago, I wondered how could I take some notes about the music I was listening to.

After having a look at the last.fm player source code* I instantly saw what a stupid thing I had suggested. In no way I’d be able to figure out that bunch of c++ classes (not that it made any sense to try, just to implement such a simple thing).

I thought of some other alternatives, mostly involving desktop widgets, but as far as I could see, none of the options could cover both my local music and the last.fm player (for when I’m listening to radio). I gave up the idea.

But one day, while sending a recommendation to a friend via the player I realized that I could write some text in that text box. Could I send recommendations to myself? Yes. And how could I take those recommendations out of last.fm? Luckily, they offer an rss feed for manual recommendations in their web services.

auto recommendation on last.fm

So I hacked together some code that parsed my recommendations and sent the ones with my username to my helipad notebook (not public, so I don’t have much to show). I set up a cron job and… You can see that I still use it in my rss feed.

The code is so trivial (and so tied to helipad in my case) that I’m sure you can do it better quickly, but in case you are interested, I could try to clean some of the php mess and send it upon request.

Although they are kind of personal, I’ve been thinking of publishing the notes directly here, since the rss feed is public anyway (and explicit sharing can improve your personal content, I think)

As a side note, I think last.fm could get some value of implementing such a thing. On one hand users could get some sort of musical microblogging, like a contextual twitter. On the other hand, since the info is always from last.fm, it could really enrich artists, songs and album pages, and more seamlesly than the current shoutbox, in my humble opinion.

* yes, I learned how to use subversion. Now I can’t live without it.

tags:

penner’s easing equations processing library

Sunday, September 16th, 2007

Being an actionscript head, I’ve frequently used rober penner’s easing equations in processing*. To avoid copy/paste each time I’ve packed them as a processing library.

While I was at it, I discovered a couple of implementations (1, 2), but I was almost done, and wanted to learn how to make processing libraries anyway.

So in the hope that it is useful to somebody, here it is:
http://jesusgollonet.com/processing/pennerEasing/

*I’m also using them in openFrameworks, so I’ve begun porting them to c++ too. They’ll be here when I’m done.

tags: