Thursday, September 29, 2005

Music search engine

Many times I have had a fragment of a tune run through my mind, and wondered what it came from. Sometimes I've found the same fragment appear in two different melodies--with a slight change in a note.

Suppose you could type in (with sound, so you can hear what you've put in and make sure it is what you want) a string of notes, and then ask the search engine to find all works where this was part of the melody (or part of the viola part, and so on). You could use this to find the tune that you wanted to use but couldn't remember the name of, or to find out if the song you composed was invented or remembered, or look for similar motifs to research influences among composers.

Suppose one were to scan or otherwise incorporate the various musical lines for a given work into a searchable database, so that you could look for works that matched a given fragment. A work might consist of one musical line (a simple tune) or many (the voices for each instrument in a symphony), together with any lyrics involved. It would not be hard to define a search for a string of notes. (A rest is a note for this purpose.)

What would be hard is optimizing the search. The text search engines search for word matches. Words are nicely separated (by spaces, commas, end-of-line, etc), and there are only a finite set of them. Unfortunately there aren't always neat divisions, and the blocks of notes are quite long. You could try arbitrarily partitioning a musical line into chunks all the same size, and using a pre-indexing that lists all the different such chunks that were used. This might get rather big, but I don't have a good feel for how big Google's indexing system is, so I've no way to guess how feasible it is.

After getting the base search engine running, the obvious next step is implementing fuzzy searches, where one or two of the notes aren't exact; and shaped searches, where the key is arbitrary. This would make is useful to the rest of us who aren't musical pros or academics.

Of course you need to have some standard descriptions of notes and formats for downloading musical directions and standards for associating musical lines into a single work, but I'd think these would be fairly straightforward to devise.

Thursday, September 15, 2005

Displaying photographs with lighting contrasts

You can find musings about how to use dynamic lighting in photographs.

I've taken pictures of a beautiful scene only to discover later that a great part of its beauty lay in the contrasts not of color but of light. The human eye is amazingly dynamic, able to flick from one part of the view to another with 10 times the light in a fraction of a second. Unfortunately the developed picture can only use reflected light, and you do not get the same dynamic range of intensities that we see every day. But suppose a picture were displayed not by reflected but by transmitted light. Imagine a picture (a slide) illuminated from behind by light that is not uniform. It would not be terribly hard to hand make masks for a particular slide using filters and a very bright light source. It seems quite hard to do this automatically. Even digital images, which use the CRT to generate different light intensities, have a certain flatness. Can we make a CRT (or LED-based system) with a greater range of brilliancy, and will the intrinsic coarseness of resolution for the light source interfere with the fine resolution of the picture itself?

It turns out there's been some interesting work that might easily have a bearing on this. In the September 2005 NASA Tech Briefs on page 70 is a report about work done by Kevin Yu on "Sol-Gel Glass Holographic Light-Shaping Diffusers." The idea is to use holographic light diffusers to spread the light around in a light table to be where you want it to be, and Yu's teams' contribution is to include sol-gel optical glass.

OK, cool. The missing link between their work and my ideas is how to make a holographic plate given some kind of pixelated light meter. I think that's just a matter of some calculations to generate the holographic mapping. I dunno if sol-gel is substantially better than other material for the somewhat less severe requirements of a photo display box (they write of being able to withstand temperatures of 1000 degrees C).