simont: A picture of me in 2016 (Default)
simont ([personal profile] simont) wrote2005-11-07 10:06 am

Name that tune

I woke up this morning with a fragment of a tune running round my head, and no idea where it came from. I've just managed to identify it, thankfully, but it's been driving me mad in the two hours between then and now; and there's another tune fragment which I've been trying to identify for months if not years.

What I'd therefore like to do is to post the tune in my diary so that all my readers can see if they know it; but I don't know of any sensibly standard way to represent music in ASCII. I could sing it into a microphone and post a link to an MP3 (or, probably more usefully, synthesise it programmatically into an MP3, which wouldn't require recording hardware and also wouldn't involve my poor singing voice complicating the issue), or I could write it down in musical notation and post a link to a picture; but both of those solutions strike me as woefully wasteful of bandwidth given that the actual information content of the few bars I can remember ought in principle to be no more than a line or two of text. I could enter it into some sort of sequencer program and post the file saved from that, but that suffers from standardisation problems: it would limit my audience to people with the same sequencer program.

If only everybody had a Spectrum, I could post a sequence of BEEP commands which would play the tune, and this would actually be a more standard low-bandwidth approach than anything else I'd thought of. It even briefly occurred to me that you can get Spectrum emulators for most operating systems… But that's not a good idea either, because the trouble with Spectrum emulators is that you can't cut and paste into them, so it would be a matter of everyone manually typing in the BEEP commands I posted.

I must be missing something obvious. Is there no sensible way at all for me to post a few lines in a text-based forum and have the majority of readers be able to cut and paste that text into something which will convert it into a possibly recognisable tune?

[identity profile] pseudomonas.livejournal.com 2005-11-07 10:09 am (UTC)(link)
ABC format (http://abc.sourceforge.net/)?

[identity profile] pseudomonas.livejournal.com 2005-11-07 10:19 am (UTC)(link)
ABC is a fairly-widely supported format, there certainly exist ABC to MIDI and ABC to Lilypond. If there doesn't already exist a web gateway where you can paste in a chunk of text and have a Midi file spat out at you I'll try and set one up tonight.

[identity profile] pseudomonas.livejournal.com 2005-11-07 10:27 am (UTC)(link)
Yes. Windows Media Player handles Midi, as do QuickTime, RealPlayer, and just about all the others. On my desktop at home I have to use timidity, but that's just because my sound card drivers are iffy.
mair_in_grenderich: (Default)

[personal profile] mair_in_grenderich 2005-11-07 10:23 am (UTC)(link)
do mobile phone "compose" functions have a standard format?

[identity profile] pseudomonas.livejournal.com 2005-11-07 10:27 am (UTC)(link)
I don't think there's a standard there, but ICBW.

[identity profile] womble2.livejournal.com 2005-11-07 10:43 am (UTC)(link)
Some phones support MIDI files; others use some bastardisation thereof.
mair_in_grenderich: (Default)

[personal profile] mair_in_grenderich 2005-11-07 11:32 am (UTC)(link)
I guess most people download ringtones etc these days, rather than entering them manually. My phone certainly has a function where I can type in something like d1b1d1b1g2, and have it play oranges and lemons at me. I forget how it handles octaves, but it does manage a couple.

[identity profile] pseudomonas.livejournal.com 2005-11-07 09:19 pm (UTC)(link)
Ah, and you can write a player for it with the system beep:
($B,$D,$O,$/)=(63,4,6);$f{(qw/C C# D D# E F F# G G# A A# H/)[$_%12].(int($_/12)
+2)}=440*(2**(1/12))**($_-45)for(1..88);for(split(/[^\w\=\#\.]+/, uc(<>))){if(
/(\w)=(\d+)/){$$1=$2;next}if(/^(\d*)([PA-H]\#?)(\.?)(\d?)$/){$n=($3?60:90)/$B/
($1||$D);`@{["xset b 75 ".int($f{$2.($4||$O)}||1)." ".($2=~/P/?0:int($n*1000))]
}`;print chr(7),`sleep $n`}} # I apologise for this, I really do. I was bored.
shortcipher: (Default)

[personal profile] shortcipher 2005-11-07 10:32 am (UTC)(link)
Not text-based, but... MIDI?

[identity profile] cartesiandaemon.livejournal.com 2005-11-07 10:35 am (UTC)(link)
Don't the notes have names like C and D#? Can't you just write those down?

Or find a font with music notes in, or write a program which will draw them in ascii art?

Come to think of it, parhaps a gif of the music *is* the right solution -- it should compress fairly well, no?

[identity profile] cartesiandaemon.livejournal.com 2005-11-07 10:48 am (UTC)(link)
I assumed recognising a famous a snippet was likely to have relatively simple timing/octave, to the extent you could just write it in brackets or something, or use an accent mark (which most people should figure out). ("GGGEb...")

"I think I'm currently leaning more towards audio solutions than musical notation ones, simply because not everybody can read music."

Indeed. Though there's probably some correlation between not recognising stuff and

Have you tried services like http://www.shazam.com/music/ where you ring them up and hum it and they tell you the answer? I've never tried it, but I've heard it's a lot better than I expected.

[identity profile] cartesiandaemon.livejournal.com 2005-11-07 12:12 pm (UTC)(link)
Mmm. But I'm sure I remember *some* service it was worth trying with. It'd almost be worth the cost of the call just out of curiousity imho

[identity profile] songster.livejournal.com 2005-11-07 04:32 pm (UTC)(link)
Write it out on a proper stave, scan it, post the link?

[identity profile] songster.livejournal.com 2005-11-07 04:33 pm (UTC)(link)
I take on board the point that many people can't read music - on the other hand, those who can actually answer your question are vastly more likely to be able to...

[identity profile] songster.livejournal.com 2005-11-07 04:36 pm (UTC)(link)
Hum. Only if you're considering *your* bandwidth and processor time, as compared to everyone else's who has to decode the information from the textual representation, surely? I include wetware processor time in this calculation.

[identity profile] mooism.livejournal.com 2005-11-07 10:40 am (UTC)(link)
There are unicode characters for music notes, presumably with <pre> and <s> or <u> you could mock up a stave to display them on.

[identity profile] mooism.livejournal.com 2005-11-07 10:41 am (UTC)(link)
Bandwidth is cheap.
gerald_duck: (organ)

[personal profile] gerald_duck 2005-11-07 11:06 am (UTC)(link)
Quite a few of us grok mup, which is a fairly legible textual format. Unfortunately, the software that converts it into postscript or MIDI, while being available as source code, isn't free of charge.

Personaly I have an even more serious soft spot for the music notation used by AMPLE, which isn't designed to be converted nicely into staff notation but is much easier on the (well, my) eye in textual form. But the software died with the BBC Micro platform; I keep feeling I should resurrect it.

[identity profile] dave holland (from livejournal.com) 2005-11-07 11:43 am (UTC)(link)
What was the tune, just out of interest?

For linux users, there's...

[identity profile] antifuchs.livejournal.com 2005-11-07 11:54 am (UTC)(link)
beep(1):

beep allows the user to control the pc-speaker with precision, allowing
different sounds to indicate different events. While it can be run
quite happily on the command line, it's intended place of residence is
within shell/perl scripts, notifying the user when something interest-
ing occurs. Of course, it has no notion of what's interesting, but
it's real good at that notifying part.

It runs from the command line, tone pitch and duration are controlled by its arguments.

Re: For linux users, there's...

[identity profile] satanicsocks.livejournal.com 2005-11-07 01:10 pm (UTC)(link)
I've used beep in the past to simulate mobile phone rings (to annoy a colleague *grin*) and I think, various trickery with xset b too. You could assemble those into some sort of shell script, et voila?

Re: For linux users, there's...

(Anonymous) 2005-11-07 01:48 pm (UTC)(link)
You could implement the relevant escape sequences in PuTTY and wait for people to upgrade. Most people reading your journal use PuTTY, right? :)

[identity profile] naath.livejournal.com 2005-11-07 01:51 pm (UTC)(link)
Phone post?

[identity profile] marnanel.livejournal.com 2005-11-07 03:32 pm (UTC)(link)
I'm sure I remember a book, many years ago, which listed thousands of tunes in perhaps the simplest possible format:

* = first note
U = up from previous note
D = down from previous note
S = same as previous note

e.g.

*SUSUSDDSDSDSD = "Twinkle Twinkle Little Star"

And then the keys were just sorted into alphabetical order.

I'm sure an online database could be used for this these days.

[identity profile] senji.livejournal.com 2005-11-09 01:08 pm (UTC)(link)
Parson's Code (http://en.wikipedia.org/wiki/Parsons_code).

[identity profile] marnanel.livejournal.com 2005-11-09 03:29 pm (UTC)(link)
Gosh, thank you. It's really good to have a name attached to it.

[identity profile] senji.livejournal.com 2005-11-09 03:53 pm (UTC)(link)
I happened to have been coïncidentally talking about it to [livejournal.com profile] claroscuro the other day and it took me about an hour to remember the name…

[identity profile] feanelwa.livejournal.com 2005-11-07 05:29 pm (UTC)(link)
You could write 16 stars (or however many beats the tune goes on for) on the first line, and then on the second line you could write the notes where they happen and a dash if the previous one was long and still continuing. This would however require either a piano or [livejournal.com profile] deborah_c.

[identity profile] keithlard.livejournal.com 2005-11-07 07:05 pm (UTC)(link)
There are such things as dictionaries of melodies, where all the tunes are transposed into C and just written down as 'C C D A B C' ekcetera.

There's probably an Intarwebs version of that now.