1
\$\begingroup\$

Try to regenerate the olympic theme song, "Bugler's Dream" using the programming language of your choice. The language/platform used must be able to emit the physical sound. Only playing the main melody (trumpets) is required, but doing more would be great.

You must generate all the tones yourself - you cannot play back a midi/wav or any other sound file.

Here are the sound files for reference:

http://www.jonfullmer.com/music-of-the-month/buglers_dream/buglers_dream.mp4 http://www.armory.com/~keeper/1/bugdream.mid

Good luck!

\$\endgroup\$
8
  • \$\begingroup\$ Try? C: "" 0 characters, I win. Do, or do not, but don't bother otherwise. \$\endgroup\$
    – Nick T
    Commented Feb 8, 2014 at 7:38
  • 1
    \$\begingroup\$ @NickT you better use perl/python/bash/something else. "" does not compile in C. \$\endgroup\$
    – mniip
    Commented Feb 8, 2014 at 10:07
  • \$\begingroup\$ Twinkle Twinkle Little Star was a simple song, and the question gave the exact notes you had to produce, making it objective. This does not, and any attempt to simplify the (rather complex) music is going to sound horrible. To make it objective, I think either the exact notes should be defined in the question, or it should be changed to popularity contest. But if it is a popularity contest, I guess answerers will have to post a link to their output (as far as I know you can only attach picture files here, correct me If I`m wrong.) So complex, it could be more about data compression than music! \$\endgroup\$ Commented Feb 8, 2014 at 11:12
  • \$\begingroup\$ I would be fine changing this to a popularity contest, I just thought with the olympics, it would be cool if there was a code-golf that played the olympic song. Maybe even cooler if the code was arranged creatively, such as to create the olympic rings in ASCII or something like that. Can popularity contest still be graded on how short the source code is? \$\endgroup\$ Commented Feb 8, 2014 at 16:47
  • \$\begingroup\$ @mniip it does compile (with warnings); an empty file won the IOCCC one year for shortest quine. \$\endgroup\$
    – Nick T
    Commented Feb 8, 2014 at 18:47

1 Answer 1

1
\$\begingroup\$

Mathematica 2576

Code

Sound[{{d, {0., 1.2}}, {a, {0., 1.2}}, {e, {0., 1.2}}, {f, {1.2, 2.2}}, {e, {1.2, 2.2}}, {e, {2.2, 2.4}}, {f, {2.2, 2.4}}, {a, {2.4, 3.}}, {c, {2.4, 3.}}, {b, {3., 3.6}}, {e, {3., 3.6}}, {d, {3.6, 4.2}}, {a, {3.6, 4.2}}, {e, {3.6, 4.2}}, {a, {4.2, 4.8}}, {c, {4.2, 4.8}}, {b, {4.8, 5.4}}, {e, {4.8, 5.4}}, {b, {5.4, 5.8}}, {e, {5.4, 5.8}}, {b, {5.8, 6.}}, {e, {5.8, 6.}}, {b, {6., 6.6}}, {e, {6., 6.6}}, {d, {6.6, 6.9}}, {a, {6.6, 6.9}}, {b, {6.9, 7.2}}, {e, {6.9, 7.2}}, {c, {7.2, 7.5}}, {a, {7.2, 7.5}}, {a, {7.5, 7.6}}, {c, {7.5, 7.6}}, {b, {7.6, 7.8}}, {e, {7.6, 7.8}}, {d, {7.8, 8.1}}, {a, {7.8, 8.1}}, {a, {8.1, 8.4}}, {c, {8.1, 8.4}}, {b, {8.4, 9.6}}, {e, {8.4, 9.6}}, {d, {9.6, 10.8}}, {a, {9.6, 10.8}}, {e, {9.6, 10.8}}, {f, {10.8, 11.8}}, {e, {10.8, 11.8}}, {e, {11.8, 12.}}, {f, {11.8, 12.}}, {a, {12., 12.6}}, {c, {12., 12.6}}, {b, {12.6, 13.2}}, {e, {12.6, 13.2}}, {d, {13.2, 13.8}}, {a, {13.2, 13.8}}, {e, {13.2, 13.8}}, {a, {13.8, 14.4}}, {c, {13.8, 14.4}}, {b, {14.4, 15.}}, {e, {14.4, 15.}}, {b, {15., 15.4}}, {e, {15., 15.4}}, {b, {15.4, 15.6}}, {e, {15.4, 15.6}}, {b, {15.6, 16.2}}, {e, {15.6, 16.2}}, {d, {16.2, 16.5}}, {a, {16.2, 16.5}}, {b, {16.5, 16.8}}, {e, {16.5, 16.8}}, {c, {16.8, 17.1}}, {a, {16.8, 17.1}}, {a, {17.1, 17.2}}, {c, {17.1, 17.2}}, {b, {17.2, 17.4}}, {e, {17.2, 17.4}}, {d, {17.4, 17.7}}, {a, {17.4, 17.7}}, {a, {17.7, 18.}}, {c, {17.7, 18.}}, {e, {18., 19.2}}, {a, {18., 19.2}}, {c, {18., 19.2}}, {d, {19.2, 20.4}}, {a, {19.2, 20.4}}, {e, {19.2, 20.4}}, {f, {20.4, 21.4}}, {e, {20.4, 21.4}}, {e, {21.4, 21.6}}, {f, {21.4, 21.6}}, {a, {21.6, 22.2}}, {c, {21.6, 22.2}}, {b, {22.2, 22.8}}, {e, {22.2, 22.8}}, {d, {22.8, 23.4}}, {a, {22.8, 23.4}}, {e, {22.8, 23.4}}, {a, {23.4, 24.}}, {c, {23.4, 24.}}, {b, {24., 24.6}}, {e, {24., 24.6}}, {b, {24.6, 25.1}}, {e, {24.6, 25.1}}, {b, {25.1, 25.2}}, {e, {25.1, 25.2}}, {b, {25.2, 25.8}}, {e, {25.2, 25.8}}, {d, {25.8, 26.1}}, {a, {25.8, 26.1}}, {b, {26.1, 26.4}}, {e, {26.1, 26.4}}, {c, {26.4, 26.7}}, {a, {26.4, 26.7}}, {a, {26.7, 26.9}}, {c, {26.7, 26.9}}, {b, {26.9, 27.}}, {e, {26.9, 27.}}, {d, {27., 27.3}}, {a, {27., 27.3}}, {a, {27.3, 27.6}}, {c, {27.3, 27.6}}, {b, {27.6, 28.8}}, {e, {27.6, 28.8}}, {d, {28.8, 30.}}, {a, {28.8, 30.}}, {e, {28.8, 30.}}, {f, {30., 31.}}, {e, {30., 31.}}, {e, {31., 31.2}}, {f, {31., 31.2}}, {a, {31.2, 31.8}}, {c, {31.2, 31.8}}, {b, {31.8, 32.4}}, {e, {31.8, 32.4}}, {d, {32.4, 33.}}, {a, {32.4, 33.}}, {e, {32.4, 33.}}, {a, {33., 33.6}}, {c, {33., 33.6}}, {b, {33.6, 34.2}}, {e, {33.6, 34.2}}, {b, {34.2, 34.7}}, {e, {34.2, 34.7}}, {b, {34.7, 34.8}}, {e, {34.7, 34.8}}, {b, {34.8, 35.4}}, {e, {34.8, 35.4}}, {d, {35.4, 35.7}}, {a, {35.4, 35.7}}, {b, {35.7, 36.}}, {e, {35.7, 36.}}, {c, {36., 36.3}}, {a, {36., 36.3}}, {a, {36.3, 36.4}}, {c, {36.3, 36.4}},{b, {36.4, 36.6}}, {e, {36.4, 36.6}}, {d, {36.6, 36.9}}, {a, {36.6, 36.9}}, {a, {36.9, 37.2}}, {c, {36.9, 37.2}}, {e, {37.2, 38.4}}, {a, {37.2, 38.4}}, {c, {37.2, 38.4}}} 
/. {n_, t_} :> SoundNote[n, Round[t, .1], "Trumpet", SoundVolume -> 0.7]] 
/. {a -> "C#5", b -> "D#5", c -> "F4", d -> "F5", e -> "G#4", f -> "G#5"}

Output

Bugler's Dream, Trumpet track.

buglers dream


Saving to file

Export["bugler.mid", bugler]

bugler.mid

\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged or ask your own question.