A blog about skating and cycling, or vice versa

Giving it FLAC#

Tue, 07 Oct 2008 01:21:16 +0000

In my quest for a scriptable mixing system I tried csound (the syntax does my head in, and it won't read flac without having to convert it manually first), supercollider (doesn't work on 64 bit boxes), and ecasound (simpler than csound but requires too much base 60 arithmetic, and pitch/speed shifting for some reason sounds absolutely horrendously awful). Some time on Sunday I had the idea to write a bit of Perl that'd take a tracklist with specification of fades, pitch changes etc and turn it into an ecasound command line for me, and then I found Audio::FLAC::Decoder and decided to see if I could do it all in-house, so to speak.

From http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=501250 :

From: Daniel Barlow 
To: Debian Bug Tracking System 
Subject: libaudio-flac-decoder-perl: Does not produce same output as flac -d: data
 interleaved in weird way
Date: Sun, 05 Oct 2008 23:49:53 +0100
Package: libaudio-flac-decoder-perl
Version: 0.2-2.2+b1
Severity: important

I have rated this "important" because its effect is to make the output sound absolutely awful. On inspection of the decoded output and visual comparison with that from flac -d, it appears that each correct 16 bit word in the Audio::FLAC::Decoder output is followed by another word from elsewhere in the file.

It's the kind of code you would look at and think "how the hell did that ever work" - except of course that there's no clear evidence it did. The resulting audio is sufficiently reminiscent of the original that at first I suspected it was just my really abysmal computer speakers (then I spent an hour trying to see if it was Perl's weirdo utf8 handling, just in case) but eventually I bit the bullet and broke out od.

Having hacked it back together (there's a patch in that bug report for anyone else similarly afflicted) I find that playing two tracks at once in a no-attention-paid-to-efficiency-at-all fashion eats about 20% cpu, but there are some really stupid format conversions going on there (libflac produces 16 bit samples in the msb of 32 bit words, then A::F::D converts into 16 bit packed samples and makes it a perl string, then my perl code unpacks it into an int array again to add the values one by one to the other stream) so I think it'll be fine for more complex stuff too if we can make it a bit less stupid first. If not, we get to play linking-ECL-with-libflac just to see what happens, but that involves writing glue for the callback system and for the moment I'm just as happy using someone else's that already works. Or at least, would be if it did.

In related news, still only halfway through ripping my CD collection - the process sort of ran down as 50% of the disks I try now don't rip cleanly. I am hoping I haven't toasted my CDROM drive ...

FNRttC#

Mon, 20 Oct 2008 12:01:48 +0000

From http://www.anothercyclingforum.com/index.php?topic=50989.msg726177;topicseen#new :

The FNRttC, like all real magic, is about transitions and boundaries.

We start out at the boundary between one day and the next, and ride to the boundary between land and sea, and between those points we see the transitions from city to 'burb, from 'burb to countryside and from dark to dawn to daylight - and all of them change so subtly, like the humming of a fan you don't notice until it switches off, that it's only afterwards you realise what's happened.

It's genius. G K Chesterton would have reviewed it favourably.

Elevator pitch: the Friday Night Ride to the Coast is a bike ride from London to the coast which happens on a Friday night (usually the closest Friday to the full moon). For more info see the basics on the blog

Back and back and forth and forth#

Mon, 20 Oct 2008 12:07:27 +0000

The other week:

anticlockwise f-b: start by setting the right foot down pointing leftwards so that it crosses the direction of forward motion. Not sure why this helps, but it does.
I've been doing Mike's Turns & Stops course recently, which has been a mix of some stuff I can do no problem, some stuff I can do on one side only, and some stuff I can't do or can't do cleanly. For example, finishing off a lunge stop with my feet in the right places. And some stuff I more or less already found through experimentation but didn't know the names of. For example, the lunge stop.

Anyway, while I've been in a skate technique frame of mind I've been playing with the transitions again - and can answer the question I raised above: it's not about which way the foot is pointing per se, it's about weight distribution. Steering the right foot under the body is not actually required, it's just one way to get my weight properly on the right foot when I pivot the left foot, therefore the left foot doesn't drag in a messy and aurally displeasing fashion.

Lunge turns at near-ground level are fun.

E pur si muove#

Mon, 27 Oct 2008 11:37:20 +0000