The positions of sounds

Glass smash with liquid GNOME bug 616743 includes a patch which, if you have stereo speakers, will make the system bell move horizontally depending on which window it happened in. For example, if you’re editing a file in a terminal on the left of the screen, and the terminal bleeps, the sound will come from the left. If your mutt terminal is on the right of the screen, you will hear a bleep on the right when you receive new mail.

Sounds other than the system bell won’t be affected by this change. For example, music played by a music player will not be affected by the position of the window.

(The patch also appears to set the vertical position of the system bell according to the y-coordinate of the window.  Your chronicler is having difficulty imagining the sound system where this would be distinguishable, but perhaps is not experienced enough in these matters.)

We are rarely minded to accept enhancement patches, since every new line of code is a line of code we have to maintain for ever.  However, this one isn’t complicated, and appears to have a positively useful result.

What are your thoughts on the matter, gentle reader?

Photo © whisperwolf, cc-by-nc.

10 Comments

  1. Simon
    Posted May 2, 2010 at 11:53 pm | Permalink

    Sounds like a useful feature, particularly for those using multi-head setups.

  2. Screwtape
    Posted May 3, 2010 at 12:00 am | Permalink

    I remember Mac OS 9 used to do this with all its system sounds – window dragging, button pressing, menu furling and unfurling. Mac OS had so many such sounds that it got overwhelming and I turned it off pretty quick, but that was just the quantity of sounds — I rather liked the polish of having stereo-correct noises.

    I say, commit it!

  3. Posted May 3, 2010 at 12:15 am | Permalink

    Is this 100% of the sound to a single side or higher on one side and lower on the other? I think the latter would make a better effect but maybe it’s harder to code and process at runtime. Anyway I hope there’s an option to turn it of in case it doesn’t work very well (I’m still very intrigued by the feature though).

  4. Posted May 3, 2010 at 12:24 am | Permalink

    Re: Y-coordinate.

    Most likely taking headphones into consideration. I mean, you only have two ears no matter the amount of speakers you add and can still place sounds vertically just fine.

    See binaural recording and visit the virtual barbershop for more info.
    http://en.wikipedia.org/wiki/Binaural_recording
    http://www.youtube.com/watch?v=IUDTlvagjJA&f=18&fmt=18

  5. Posted May 3, 2010 at 12:30 am | Permalink

    @Dextro
    Just setting the loudness according to the distance from the center ought to be good enough. It’s not like you’ll detect where the person in question is in relation to the screen(s) anyway.

  6. Posted May 3, 2010 at 3:26 am | Permalink

    The nice thing, in terms of feature overhead, is that PulseAudio or libCanberra (I don’t actually know which) deal with the tricky part; we just state where the sound comes from (in the same place we already add hints for the bell sound) and the rest happens somewhere else!

    GTK’s widget sound effects and Empathy’s notifications also use libCanberra’s sound_for_widget function for positional sounds, to the same effect.

    @Dextro: This does proper positional sounds; gradually higher and lower on each side based on the position of the sound.

    @Të: Indeed, it can’t be quite as clever as you describe (though I wouldn’t put it past Lennart :b) but we can trust the speakers to be on either side of the screen, so the sound seems to be pretty well connected to its source on the display. Works best with big screens, for sure.

    I’ve been eating my own dogfood on this for a while and I’ve been pretty happy with it. It wouldn’t be hard to push the widget position hints into a conditional controlled by a gconf key, but I would much rather see that option in PulseAudio itself; Metacity is just passing along some data it has handy. It really has no knowledge, itself, that that data has anything to do with positional sounds :)

  7. Posted May 3, 2010 at 6:24 am | Permalink

    Sounds good to me too; it could make you instictively draw your attention faster to the thing that needs it.

  8. Posted May 3, 2010 at 10:50 am | Permalink

    @Dylan McCall
    Cool, very very nice. :)

  9. Posted May 3, 2010 at 1:56 pm | Permalink

    Sounds like the kind of feature you didn’t know you would like to have. I suggest you to apply the patch and ask users to provide feedback during the beta phase, and then revert if it’s annoying. No options, please, except maybe for a gsetting for distributions.

  10. Calum
    Posted May 7, 2010 at 2:29 pm | Permalink

    Good use of sound is a much-overlooked accessibility feature, and this sounds like it would be a useful addition. (For much more on this topic, google for ‘earcons’.)

One Trackback

  1. […] This post was mentioned on Twitter by Ben Steeves. Ben Steeves said: i want this feature for OS X: http://bit.ly/cn2WaU […]