Remove hint.html and index.html
As per discussions on GitHub the index.html and hint.html files should be deleted in favour of README.md files (from any .text/.txt/.markdown/.md files which will be turned into README.md in an upcoming commit).
This commit is contained in:
1 parent
ee8a36310f
commit
77fb0f11a2
143 files changed
-28606
No files matched your search
@@ -1,185 +0,0 @@
|
||||
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional //EN">
|
||||
<html>
|
||||
<head>
|
||||
<meta name="GENERATOR" content="mkd2html 2.2.2">
|
||||
<meta http-equiv="Content-Type"
|
||||
content="text/html; charset=utf-8"> <link rel="stylesheet"
|
||||
type="text/css"
|
||||
href="../hint.css" />
|
||||
<title></title>
|
||||
<title>Most percussive</title>
|
||||
</head>
|
||||
<body>
|
||||
<CENTER>
|
||||
<IMG SRC="/png/ioccc.png" ALT="IOCCC" height=78 width=267>
|
||||
<P><FONT size="6"><I>The International Obfuscated C Code Contest</I></FONT></P>
|
||||
<div id="bar">
|
||||
<ul>
|
||||
<li><a href="../index.html">About the 27th IOCCC</a></li>
|
||||
<li><a href="../whowon.html">27th IOCCC Winners</a></li>
|
||||
<li><a href="/index.html">IOCCC home</a></li>
|
||||
<li><a href="/winners.html">List of All Winners</a></li>
|
||||
<li><a href="/judges.html">The Judges</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<P><FONT size="6"><B>A 27<sup>th</sup> IOCCC Winner</B></FONT></P>
|
||||
</CENTER>
|
||||
|
||||
|
||||
<h1>Most percussive</h1>
|
||||
|
||||
<p>Nathan Otterness<br/>
|
||||
<a href="https://github.com/yalue">https://github.com/yalue</a></p>
|
||||
|
||||
<p>The code for this entry can be found in <a href="prog.c">prog.c</a></p>
|
||||
|
||||
<h2>Judges' comments:</h2>
|
||||
|
||||
<h3>To use:</h3>
|
||||
|
||||
<pre><code>make
|
||||
./prog < input.mid > output.mid
|
||||
</code></pre>
|
||||
|
||||
<h3>Try:</h3>
|
||||
|
||||
<pre><code>wget -O cvikl.mid 'http://www.kunstderfuge.com/-/midi.asp?file=beethoven/symphony_6_1_(c)cvikl.mid'
|
||||
./prog < cvikl.mid > output.mid
|
||||
|
||||
# Play output.mid with your favorite player
|
||||
wget -O entertainer.mid https://www.midiworld.com/download/3857
|
||||
./prog < entertainer.mid > output2.mid
|
||||
# Play output.mid with your favorite player
|
||||
</code></pre>
|
||||
|
||||
<h3>Selected Judges Remarks:</h3>
|
||||
|
||||
<p>In an entry that boasts not using literals, one would expect to see straightforward ways to produce
|
||||
small integers like <code>!(x^x)<<!(x^x)</code>, etc. but this entry is trickier than that. Deciphering what it does,
|
||||
apart from reading stdin and writing to stdout, would take a while.</p>
|
||||
|
||||
<p>While doing that, you can be audially <em>entertained</em> by a sample of its output.</p>
|
||||
|
||||
<h2>Author’s comments:</h2>
|
||||
|
||||
<h3>MIDI “boots and cats”</h3>
|
||||
|
||||
<p>This program seeks to automatically “improve” standard MIDI files (.mid) by
|
||||
adding an extra track that provides a driving drum beat to bring some
|
||||
excitement into boring video-game music rips or classical music sequences that
|
||||
otherwise only see the light of day when modern musicians import them into FL
|
||||
Studio to copy a few chords.</p>
|
||||
|
||||
<h4>Prerequisites</h4>
|
||||
|
||||
<p>If you’re not using Windows Media Player or already familiar with MIDI files,
|
||||
you may need to install some additional software to be able to listen to them.
|
||||
For example, on Ubuntu, I was able to play them in VLC after installing
|
||||
<code>vlc-plugin-fluidsynth</code> and <code>fluid-soundfont-gm</code>.</p>
|
||||
|
||||
<p>You can obtain MIDIs in many places, but I mostly tested the program using
|
||||
files I found <a href="http://www.kunstderfuge.com/beethoven/variae.htm#Symphonies">here</a>.
|
||||
However, as discussed under the Limitations heading below, not all of them
|
||||
work correctly. I will admit to having used
|
||||
<code>http://www.kunstderfuge.com/-/midi.asp?file=beethoven/symphony_6_1_(c)cvikl.mid</code>
|
||||
for most of my testing.</p>
|
||||
|
||||
<h4>Usage</h4>
|
||||
|
||||
<p>Compile the program using the following command (I tested this using both
|
||||
<code>clang</code> and <code>gcc</code>):
|
||||
<code>
|
||||
$CC -pedantic -Wall -Werror -Wextra -O3 -o prog prog.c
|
||||
</code></p>
|
||||
|
||||
<p>The program expects a MIDI on stdin, and writes a modified MIDI to stdout:
|
||||
<code>
|
||||
./prog <input.mid >output.mid
|
||||
</code></p>
|
||||
|
||||
<p>If the program encounters an error, no output will generally be produced, and
|
||||
it will exit with a specific status code. Meanings of the various status codes
|
||||
are listed below, under the “Program error codes” heading. On success, the
|
||||
program exits with a code of 0.</p>
|
||||
|
||||
<h4>Limitations</h4>
|
||||
|
||||
<ol>
|
||||
<li><p>The program does not support MIDI files over 4 MB (specifically, it will
|
||||
not take input files larger than 2<sup>22</sup> - 1 bytes). This is unlikely to be a
|
||||
big limitation in practice, since even lengthy MIDIs are rarely over a
|
||||
couple hundred KB.</p></li>
|
||||
<li><p>Not all MIDIs set (or <em>correctly</em> set) their timing information, which will
|
||||
lead to the tempo of the drum beat not matching the track. This will be
|
||||
especially true for “live performance” .mid files.</p></li>
|
||||
<li><p>There may be some types of MIDI messages that the program is unable to
|
||||
correctly parse, but I have rarely seen this in practice. The largest
|
||||
cause of program failures, in my experience, has been Limitation 2.</p></li>
|
||||
</ol>
|
||||
|
||||
|
||||
<h4>Obfuscation notes</h4>
|
||||
|
||||
<p>I had one primary goal when writing this program: include no C literals
|
||||
whatsoever. The final C file includes no numerical, string, or character
|
||||
literals. Instead, all literals have been replaced with a handful of global
|
||||
variables, which are occasionally modified throughout the file to prevent
|
||||
simple uses of find-and-replace.</p>
|
||||
|
||||
<p>So, in a sense, this obfuscation is simply an intentional use of global
|
||||
variables' classic problem: absolute spaghetti code. The absence of any sort
|
||||
of literals has the added benefit of forcing any would-be reader to trace the
|
||||
contents of many variables starting from <code>main</code>, since, without literals, very
|
||||
little of the code gives any inherent visual cues as to its purpose.</p>
|
||||
|
||||
<p>I already took the liberty of running <code>prog.c</code> through <code>clang-format</code>, since it
|
||||
still fits in the size limit and the formatting of the code was never intended
|
||||
to be an obfuscation technique here.</p>
|
||||
|
||||
<h4>Other remarks</h4>
|
||||
|
||||
<p>MIDI files are generally divided up into one or more “tracks” that play
|
||||
concurrently. While it is easy to find the positions of each of these tracks
|
||||
in the file, figuring out the amount of time each track is supposed to play is
|
||||
more difficult, and requires parsing every track in its entirety. This means
|
||||
that generating a drum beat that covers the entire piece of music requires
|
||||
parsing every track (the entire file) in order to determine the longest track.</p>
|
||||
|
||||
<p>Once the program has determined the longest track in the file, it generates a
|
||||
new track, containing the simple 4-note percussion sequence, to match the
|
||||
length (in beats) of the longest-running track. It appends the new track onto
|
||||
the end of the file, taking care to update the file header, as well.</p>
|
||||
|
||||
<h3>Program error codes</h3>
|
||||
|
||||
<p>If the program encounters an error, it will exit with a nonzero code. The error
|
||||
codes can be interpreted as follows:</p>
|
||||
|
||||
<ul>
|
||||
<li><code>1</code>: Encountered an invalid MIDI variable-length integer in the input.</li>
|
||||
<li><code>2</code>: Attempted to write an invalid MIDI variable-length integer to output.
|
||||
(This would be an internal error).</li>
|
||||
<li><code>3</code>: Encountered an unsupported MIDI event in the input.</li>
|
||||
<li><code>4</code>: Encountered a bad MIDI track header in the input.</li>
|
||||
<li><code>5</code>: The input MIDI file uses SMPTE time division, which isn’t supported.</li>
|
||||
<li><code>6</code>: Failed allocating a temporary buffer to hold a single copy of our “beat”
|
||||
messages.</li>
|
||||
<li><code>7</code>: Failed allocating a buffer to hold the new track data.</li>
|
||||
<li><code>8</code>: Failed allocating a buffer to hold the input file.</li>
|
||||
<li><code>9</code>: The input file was too large.</li>
|
||||
<li><code>10</code>: The input file’s MIDI header was incorrect (but this isn’t checked
|
||||
very thoroughly).</li>
|
||||
</ul>
|
||||
|
||||
<BR>
|
||||
<HR>
|
||||
<TABLE><TR>
|
||||
<TD><a rel="license" href="https://creativecommons.org/licenses/by-sa/3.0/"><img alt="Creative Commons License" style="border-width:0" src="/png/by-sa-3.0-88x31.png" /></a></TD>
|
||||
<TD><P>© Copyright 1984-2020,
|
||||
<A HREF="/judges.html">Leo Broukhis, Simon Cooper, Landon Curt Noll</A>
|
||||
- All rights reserved<BR>
|
||||
This work is licensed under a <a rel="license" href="https://creativecommons.org/licenses/by-sa/3.0/">Creative Commons Attribution-ShareAlike 3.0 Unported License</a>.</P></TD>
|
||||
<TD> <!--<a href="https://validator.w3.org/check?uri=referer"><img src="https://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01 Transitional" height="31" width="88"></a>--></TD>
|
||||
</TR></TABLE>
|
||||
</body>
|
||||
</html>
|
||||
Reference in new issue
Block a user