2007-02-14

Music in pieces

I was involved in a discussion a few days ago about my favourite track featuring a guitar.. and I realised that I really don't listen to anything with guitars in. All of the music I listen to tends to lack guitars, and, in fact, stringed instruments of any kind (I'm including the piano here).

Further than that, it tends to lack instruments that I can't distinguish between whilst it's playing. To pick an extreme (aha) example, Straight Ahead (Hardcore remix) ( sample: as .ogg ), despite sounding awfully chaotic, contains "clearly" distinguishable instruments (I count seven), each of which are on their own "channel".

When I say "clearly", I mean that you can work it out, not that it's easy to do so. It takes me a depressingly long time. I'm using the MOD definition of "channels", ie. if you have a set of audio samples (snippets), you can only have one playing on any given channel at a time.

This raises a couple of interesting (at least, for me) questions:

  • Can you teach a computer to take it back to samples and a playing order? Assuming this is insanely hard to do, can you do it for a restricted set/layout/etc. of songs, and/or with human interaction?
  • Would the sampled version offer better quality/compression? This depends on loads of things, like track length, repetitiveness, how well you can store the samples themselves (lots of little dissimilar files tend to be harder to compress than a long one), etc.
  • Assuming it does, and the artists are in on it (ie. you don't have to do the conversion), would this help with music distribution? How small can you get a 70min CD?
  • Can people with "different" hearing to me distinguish between guitars/other string instruments in anything but the simplest of songs?
  • If so, does people's varying ability to "focus" on the music change their enjoyment of it?
  • What would you do with partially discrete instruments like pianos, where more than one key can be held at once, producing a subtly different sound. 88 samples or one sample and fiddle the frequency? Fading off over time? Fall back to what'd have to be done with voice: try and seperate out "verses" of piano, and have them as a sample? Piano Track would be particularily susceptible to that.
  • Could one design a game based on people's ability to pick out instruments/number of channels? It'd have to be more fun than DDR and Guitar Hero. ;)
  • Do I really think that I can rate tracks simply on the number of channels they'd require to compose, ie. their compressability? ie., for ogg, Chris Lake - Changes (musicbrainz) (generated by oggspot and sed).
  • ..and so on.

This unfocused ramble was sponsored by Lasse Gjertsen's Ameteur (two channels).


2007-01-19

Belkin's USB Wireless Adapter G: f5d7050uk

Dear Belkin, choice makes humans sad.

Which f5d7050 do I have? No idea.

As usual, the device has a huge STOP: Run the Installation CD-ROM FIRST. Inserting the CD and clicking "install" gets me:

---------------------------
Belkin Wireless USB Utility
---------------------------
Click on icon if you want to communicate directly to another wireless computer near you (Ad-Hoc).
---------------------------
OK
---------------------------

...and then disappears.

I decided, at random, to download the latest version of the drivers for Windows XP, ie. f5d7050-ver4.exe, a tiny 28MB, which do exactly the same as the CD.

A WinRAR extract of the download (eventually) yields a folder called Driver containing the necessary Windows driver files for 98 thru XP. Total compressed size of the necessary parts of the Driver folder that are needed for XP? 120kB. I don't even want to know what craplets were bundled along with the driver.

Result: A working wireless network card having completely ignored all of the warnings from the packaging, setup, installer, manual, etc. and only the final step, installing the (non-WHQL'd) driver, as Administrator.

And people wonder why it's the technically inept that have all the problems with their OSes...


2007-01-10

About me

My name is Chris West. I live in London, UK.

I'm a developer. I love developing. And sysadmin. I'm currently interested in mostly-remote, part-time contracts.

Hire me.

Please don't waste my time by sending me full time positions. I couldn't accept one, even if I wanted to. Which I don't. Check back here to see if I've changed my mind.

I've previously worked for a machine learning fintech startup, a major British broadcasting corporation, a payroll company, and a JVM vendor.

I'm around the internet in various places as Faux or FauxFaux, mostly linked down the side.

Gpg key: 408A E4F1 4EA7 33EF 1265 82C1 B195 E1C4 779B A9B2.


2007-01-10

Adobe GIL and <windows.h>

I've been playing with Adobe GIL, following it's inclusion into Boost, and I've been getting some fun compile errors in relation to <windows.h>. Note that, even if you aren't including <windows.h>, some of the boost headers do.

Here lies: What not to do, so you don't waste hours on it like I did.

Test-case:

int main()
{
    ::gil::rgb8_image_t a;
    ::gil::jpeg_read_and_convert_image("a", a);
}

Compiled with Visual Studio 2005 SP1, Boost 1.33.1 and JPEG 6b (27-Mar-1998):

cl /EHsc jpegio.cpp /I c:\sdk\libs /I c:\boost\include\boost-1_33_1

First attempt, <windows.h> first:

#include <windows.h>

#include <gil/core/gil_all.hpp>
#include <gil/extension/io/jpeg_dynamic_io.hpp>

Error:

jpegio.cpp
c:\sdk\libs\gil\core\channel.hpp(90) : warning C4003: not enough actual paramete rs for macro 'min'
c:\sdk\libs\gil\core\channel.hpp(92) : warning C4003: not enough actual paramete rs for macro 'max'
c:\sdk\libs\jmorecfg.h(161) : error C2371: 'INT32' : redefinition; different bas ic types
        C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\basetsd.h(62) : see declaration of 'INT32'
c:\sdk\libs\jmorecfg.h(215) : warning C4005: 'FAR' : macro redefinition
        C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\windef.h(145) : see previous definition of 'FAR'

Second attempt, other way around, Error:

jpegio.cpp
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\basetsd.h(62): error C2371: 'INT32' : redefinition; different basic types
        c:\sdk\libs\jmorecfg.h(161) : see declaration of 'INT32'

Third attempt:

#include <windows.h>
#include <gil/core/gil_all.hpp>

#define XMD_H
#include <gil/extension/io/jpeg_dynamic_io.hpp>
#undef XMD_H

This should, in theory improve matters, as XMD_H being #defined stops <jmorecfg.h> trying to redeclare INT32.

Oh no.

Error:

jpegio.cpp
c:\sdk\libs\gil\core\channel.hpp(90) : warning C4003: not enough actual parameters for macro 'min'
c:\sdk\libs\gil\core\channel.hpp(92) : warning C4003: not enough actual parameters for macro 'max'
c:\sdk\libs\jmorecfg.h(215) : warning C4005: 'FAR' : macro redefinition
        C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\windef.h(145) : see previous definition of 'FAR'
c:\sdk\libs\gil\core\color_convert.hpp(148) : error C2589: '(' : illegal token on right side of '::'
        c:\sdk\libs\gil\core\color_convert.hpp(221) : see reference to function template instantiation 'void gil::color_converter_default_impl<lt;T1,C1,T2,C2>::operator ()<lt;SrcP,DstP>(const P1 &,P2 &) const' being compiled
        with
        [
            T1=SrcChannel,
            C1=SrcColorSpace,
            T2=DstChannel,
            C2=DstColorSpace,
            SrcP=gil::pixel<lt;gil::bits8,gil::cmyk_t>,
            DstP=gil::pixel<lt;gil::bits8,gil::rgb_t>,
            P1=gil::pixel<lt;gil::bits8,gil::cmyk_t>,
            P2=gil::pixel<lt;gil::bits8,gil::rgb_t>
        ]
        c:\sdk\libs\gil\extension\dynamic_image\../../core/image_view_factory.hpp(71) : see reference to function template instantiation 'void gil::default_color_converter::operator ()<lt;gil::pixel<lt;T,C>,gil::pixel<lt;T,gil::rgb_t>>(const SrcP &,DstP &) const' being compiled
        with
        [
            T=gil::bits8,
            C=gil::cmyk_t,
            SrcP=gil::pixel<lt;gil::bits8,gil::cmyk_t>,
            DstP=gil::pixel<lt;gil::bits8,gil::rgb_t>
        ]
        c:\sdk\libs\gil\extension\dynamic_image\../../core/image_view_factory.hpp(69) : while compiling class template member function 'gil::pixel<lt;T,C> gil::color_convert_deref_fn<lt;SrcConstRefP,DstP,CC>::operator ()(gil::pixel<lt;T,gil::cmyk_t> &) const'
        with
        [
            T=gil::bits8,
            C=gil::rgb_t,
            SrcConstRefP=gil::cmyk8_ref_t,
            DstP=gil::pixel<lt;gil::bits8,gil::rgb_t>,
            CC=gil::default_color_converter
        ]
        c:\sdk\libs\gil\extension\io\jpeg_io_private.hpp(166) : see reference to class template instantiation 'gil::color_convert_deref_fn<lt;SrcConstRefP,DstP,CC>' being compiled
        with
        [
            SrcConstRefP=gil::cmyk8_ref_t,
            DstP=gil::pixel<lt;gil::bits8,gil::rgb_t>,
            CC=gil::default_color_converter
        ]
        c:\sdk\libs\gil\extension\io\jpeg_io_private.hpp(178) : see reference to function template instantiation 'void gil::detail::jpeg_reader_color_convert<lt;CC>::apply<lt;V2>(const View &)' being compiled
        with
        [
            CC=gil::default_color_converter,
            V2=gil::rgb8_view_t,
            View=gil::rgb8_view_t
        ]
        c:\sdk\libs\gil\extension\io\jpeg_io.hpp(147) : see reference to function template instantiation 'void gil::detail::jpeg_reader_color_convert<lt;CC>::read_image<lt;Image>(Image &)' being compiled
        with
        [
            CC=gil::default_color_converter,
            Image=gil::rgb8_image_t
        ]
        jpegio.cpp(12) : see reference to function template instantiation 'void gil::jpeg_read_and_convert_image<lt;gil::rgb8_image_t>(const char *,Image &)' being compiled
        with
        [
            Image=gil::rgb8_image_t
        ]
c:\sdk\libs\gil\core\color_convert.hpp(148) : error C2143: syntax error : missing ')' before '::'
c:\sdk\libs\gil\core\color_convert.hpp(148) : error C2780: 'T gil::channel_invert(T)' : expects 1 arguments - 0 provided
        c:\sdk\libs\gil\core\channel.hpp(235) : see declaration of 'gil::channel_invert'
c:\sdk\libs\gil\core\color_convert.hpp(148) : error C2059: syntax error : ')'
c:\sdk\libs\gil\core\color_convert.hpp(149) : error C2589: '(' : illegal token on right side of '::'
c:\sdk\libs\gil\core\color_convert.hpp(149) : error C2143: syntax error : missing ')' before '::'
c:\sdk\libs\gil\core\color_convert.hpp(149) : error C2780: 'T gil::channel_invert(T)' : expects 1 arguments - 0 provided
        c:\sdk\libs\gil\core\channel.hpp(235) : see declaration of 'gil::channel_invert'
c:\sdk\libs\gil\core\color_convert.hpp(149) : error C2059: syntax error : ')'
c:\sdk\libs\gil\core\color_convert.hpp(150) : error C2589: '(' : illegal token on right side of '::'
c:\sdk\libs\gil\core\color_convert.hpp(150) : error C2143: syntax error : missing ')' before '::'
c:\sdk\libs\gil\core\color_convert.hpp(150) : error C2780: 'T gil::channel_invert(T)' : expects 1 arguments - 0 provided
        c:\sdk\libs\gil\core\channel.hpp(235) : see declaration of 'gil::channel_invert'
c:\sdk\libs\gil\core\color_convert.hpp(150) : error C2059: syntax error : ')'

...

Fourth attempt, the "right" way:

#include <gil/core/gil_all.hpp>

#define XMD_H
#include <gil/extension/io/jpeg_dynamic_io.hpp>
#undef XMD_H

#include <windows.h>

This works as intended.

Solutions?

Assuming that we're not going to get the JPEG code patched, the INT32 definition from <windows.h> comes from <basetsd.h>, which declares the BASETSD_H header-guard macro.. it'd be nice if GIL issued an explanation of what was going to go horribly wrong, instead of that lovely template error in test three?


2007-01-06

Dell's 2407WFP

... is a stunning monitor. Really, go buy one. Even better in portrait mode.

I've had two minor issues with mine (rev a03):

  1. The usb hub in the monitor turns off when you turn the monitor off, meaning that any devices you had plugged into it will be "unplugged", then re-plugged-in when you turn it back on. This'll probably only affect you if you plug your mouse and keybard into the two ports in the back (that were so obviously designed for this purpose) as it might take a few seconds after powering on the monitor before you can use them.
  2. Flickering. Some images that have been crafted by scheming web-designers, when displayed on certain areas of the screen cause artefacts. I'm not sure if nobody has noticed this, or if it's a defect with my panel. I've captured a few here. These need to be viewed as close to fullscreen as possible, without any scaling on. Try hitting F11 in your browser.
    • A shot of a random Java6 documentation page (with all the boring bits removed) gets a row of randomly flickering (dead-looking) pixels to the left of the "J".
    • A manipulated screenshot based on the background from the C++ pastebin on sourceforge. The vertical lines near both edges of get very jaggedy, and the colour-spectrum has random dead-pixels in, too. Assuming this happens on anyone else's monitor at all, if you look closely at the bottom-left, the lines are fine, as the "background" bit to the right has been tuned (read: waggled around madly) such that there's no flicker.
    This effect is rather hard to reproduce by accident, but is very clear when it happens.

Anyone had anything similar?


2007-01-01

Things I'd like to see happen in 2007.

Alternately: This'd be a wish list but I'm a realist.

Developers:

  • Better awareness of "unicode", especially the terminology (the word 'unicode' itself, encodings, etc.). Joel on Software's article on Unicode is a good start.

    I'm going to blame the developers for user's inability to grasp "unicode", as it should be on by default, and should be very hard to break.
  • Better awareness of displays. There are a whole range of types of display, not all of them are 4:3.

    There might even be more than one display present, I don't expect you to make use of both of them, but it'd be nice if you didn't assume that the primary one was the only one.
  • Better awareness of Limited User Accounts (also Least User Access). This applies equally to Windows developers (Vista will be very annoying when applications need elevated privileges, even if they are avaliable) and to those writing software to be packaged (or to manage packages) for linux distributions (desktops tend not to be multi-user machines, your old ethos is dead).
  • Seperation of Content and Display (ie. MVC). Your application or website has something to offer it's users(/visitors), they want to be able to access it. Websites with 400kB of navigation, menus and (precious, precious) advertising; applications with wooooshy! buttons and pretty colours may be "cool", but they suck for people who want to get the Content out.

    RSS, Google Sitemaps and various web-services are a good start, but they're not benifiting the end user (much) yet.
  • Integration, applications should look and feel alike. Microsoft are terrible at this (see Windows Media Player and Office 2007, for instance), and they're not helped by some libraries.
  • I'd also like to see the GPL die a horrible, fiery death, but that's the subject of another rant.

Industries:

  • The Music industry. Many people have argued this to death. You can't charge what you think you can charge (99p for a DRM'd, low-quality track, for history's sake) and expect people to care. DRM is fine, but it (significantly?) reduces the value (and hence the price) of your product. Go adopt AllOfMP3's business model where price has some relation to the quality of the product.

    As a specific wish, I'd like the Ministry of Sound to put their archives up for sale under that model. They're not making you any money as it's currently impossible to buy most of the cds.
  • The Movie industry. With the release of Vista, and PCs (or XBoxen) moving under people's televisions, you have a whole range of media protection features, use them, and people's fast internet connections, and start renting us stuff.

    £3 for a single play of a movie (in HD) five days after release would be both awesome, destroy piracy and really piss off the cinemas. Oh well.
  • All the others: Staggering releases around the world is lame (TV and Game industries, I'm looking at you).

The internet:

  • Communities: Most community sites as of now are either dead (on the soul side), (ie. Slashdot, Digg, Reddit), or heading that way (Myspace, Facebook, Youtube). Can social communities exist on the internet? Evidence suggests not, oh well, we're not going to lose much.

    Wish: Webmasters need to work out that their site is NOT a community site, before it's too late. You know who you are. Please?

Predictions on timescales for any of these, anyone? I've picked some that very few people care about, or that, in general, people disagree with me on, and I can't see any of the above happening in 2007.

We shall see.


« Prev - Next »