Add missing MIDI files to 2020/otterness
These files in particular were previously to be downloaded prior to use of the program (or try section). These files have now been downloaded and added to the repo. Format/typo check README.md file. Updated bugs.md with features/limitations.
This commit is contained in:
1 parent
635bad2b1a
commit
495e20265c
5 files changed
+91
-58
No files matched your search
+56
-39
@@ -5,6 +5,17 @@ make
|
||||
```
|
||||
|
||||
|
||||
### Bugs and (Mis)features:
|
||||
|
||||
The current status of this entry is:
|
||||
|
||||
```
|
||||
STATUS: INABIAF - please **DO NOT** fix
|
||||
```
|
||||
|
||||
For more detailed information see [2020 otterness in bugs.md](/bugs.md#2020-otterness).
|
||||
|
||||
|
||||
## To use:
|
||||
|
||||
```sh
|
||||
@@ -15,27 +26,27 @@ make
|
||||
### Try:
|
||||
|
||||
```sh
|
||||
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
|
||||
|
||||
# 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
|
||||
# Play output2.mid with your favorite player
|
||||
```
|
||||
|
||||
|
||||
## Judges' remarks:
|
||||
|
||||
In an entry that boasts not using literals, one would expect to see straightforward ways to produce
|
||||
small integers like `!(x^x)<<!(x^x)`, etc. but this entry is trickier than that. Deciphering what it does,
|
||||
apart from reading stdin and writing to stdout, would take a while.
|
||||
In an entry that boasts not using literals, one would expect to see
|
||||
straightforward ways to produce small integers like `!(x^x)<<!(x^x)`, etc. but
|
||||
this entry is trickier than that. Deciphering what it does, apart from reading
|
||||
`stdin` and writing to `stdout`, would take a while.
|
||||
|
||||
While doing that, you can be audibly *entertained* by a sample of its output.
|
||||
|
||||
|
||||
## Author's remarks:
|
||||
|
||||
|
||||
### MIDI "boots and cats"
|
||||
|
||||
This program seeks to automatically "improve" standard MIDI files (.mid) by
|
||||
@@ -44,6 +55,7 @@ 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.
|
||||
|
||||
|
||||
#### Prerequisites
|
||||
|
||||
If you're not using Windows Media Player or already familiar with MIDI files,
|
||||
@@ -51,14 +63,15 @@ 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
|
||||
`vlc-plugin-fluidsynth` and `fluid-soundfont-gm`.
|
||||
|
||||
You can obtain MIDIs in many places, but I mostly tested the program using
|
||||
files I found [here](http://www.kunstderfuge.com/beethoven/variae.htm#Symphonies).
|
||||
However, as discussed under the Limitations heading below, not all of them
|
||||
work correctly. I will admit to having used
|
||||
You can obtain MIDIs in many places, but I mostly tested the program using files
|
||||
I found [here](http://www.kunstderfuge.com/beethoven/variae.htm#Symphonies).
|
||||
However, as discussed under the [Limitations](#limitations) section below, not
|
||||
all of them work correctly. I will admit to having used
|
||||
`http://www.kunstderfuge.com/-/midi.asp?file=beethoven/symphony_6_1_(c)cvikl.mid`
|
||||
for most of my testing.
|
||||
for most of my testing (see [cvikl.mid](cvikl.mid)).
|
||||
|
||||
#### Usage
|
||||
|
||||
### Usage
|
||||
|
||||
Compile the program using the following command (I tested this using both
|
||||
`clang` and `gcc`):
|
||||
@@ -67,7 +80,7 @@ Compile the program using the following command (I tested this using both
|
||||
cc -pedantic -Wall -Werror -Wextra -O3 -o prog prog.c
|
||||
```
|
||||
|
||||
The program expects a MIDI on stdin, and writes a modified MIDI to stdout:
|
||||
The program expects a MIDI on `stdin`, and writes a modified MIDI to `stdout`:
|
||||
```
|
||||
./prog <input.mid >output.mid
|
||||
```
|
||||
@@ -77,20 +90,22 @@ 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.
|
||||
|
||||
#### Limitations
|
||||
|
||||
1. The program does not support MIDI files over 4 MB (specifically, it will
|
||||
not take input files larger than 2^22 - 1 bytes). This is unlikely to be a
|
||||
big limitation in practice, since even lengthy MIDIs are rarely over a
|
||||
couple hundred KB.
|
||||
### Limitations
|
||||
|
||||
2. Not all MIDIs set (or *correctly* 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.
|
||||
1. The program does not support MIDI files over 4 MB (specifically, it will
|
||||
not take input files larger than `2^22 - 1` bytes). This is unlikely to be a
|
||||
big limitation in practice, since even lengthy MIDIs are rarely over a
|
||||
couple hundred KB.
|
||||
|
||||
2. Not all MIDIs set (or *correctly* 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.
|
||||
|
||||
3. 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.
|
||||
|
||||
3. 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.
|
||||
|
||||
#### Obfuscation notes
|
||||
|
||||
@@ -103,13 +118,14 @@ simple uses of find-and-replace.
|
||||
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 `main`, since, without literals, very
|
||||
contents of many variables starting from `main()`, since, without literals, very
|
||||
little of the code gives any inherent visual cues as to its purpose.
|
||||
|
||||
I already took the liberty of running `prog.c` through `clang-format`, since it
|
||||
still fits in the size limit and the formatting of the code was never intended
|
||||
to be an obfuscation technique here.
|
||||
|
||||
|
||||
#### Other remarks
|
||||
|
||||
MIDI files are generally divided up into one or more "tracks" that play
|
||||
@@ -124,24 +140,25 @@ 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.
|
||||
|
||||
|
||||
### Program error codes
|
||||
|
||||
If the program encounters an error, it will exit with a nonzero code. The error
|
||||
codes can be interpreted as follows:
|
||||
|
||||
- `1`: Encountered an invalid MIDI variable-length integer in the input.
|
||||
- `2`: Attempted to write an invalid MIDI variable-length integer to output.
|
||||
(This would be an internal error).
|
||||
- `3`: Encountered an unsupported MIDI event in the input.
|
||||
- `4`: Encountered a bad MIDI track header in the input.
|
||||
- `5`: The input MIDI file uses SMPTE time division, which isn't supported.
|
||||
- `6`: Failed allocating a temporary buffer to hold a single copy of our "beat"
|
||||
messages.
|
||||
- `7`: Failed allocating a buffer to hold the new track data.
|
||||
- `8`: Failed allocating a buffer to hold the input file.
|
||||
- `9`: The input file was too large.
|
||||
- `10`: The input file's MIDI header was incorrect (but this isn't checked
|
||||
very thoroughly).
|
||||
- `1`: Encountered an invalid MIDI variable-length integer in the input.
|
||||
- `2`: Attempted to write an invalid MIDI variable-length integer to output.
|
||||
(This would be an internal error).
|
||||
- `3`: Encountered an unsupported MIDI event in the input.
|
||||
- `4`: Encountered a bad MIDI track header in the input.
|
||||
- `5`: The input MIDI file uses SMPTE time division, which isn't supported.
|
||||
- `6`: Failed allocating a temporary buffer to hold a single copy of our "beat"
|
||||
messages.
|
||||
- `7`: Failed allocating a buffer to hold the new track data.
|
||||
- `8`: Failed allocating a buffer to hold the input file.
|
||||
- `9`: The input file was too large.
|
||||
- `10`: The input file's MIDI header was incorrect (but this isn't checked
|
||||
very thoroughly).
|
||||
|
||||
|
||||
## Copyright and CC BY-SA 4.0 License:
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -3617,6 +3617,32 @@ exactly 16 bits per sample, but it allows any sample rate and any number of
|
||||
audio channels.
|
||||
|
||||
|
||||
## 2020 otterness
|
||||
|
||||
### STATUS: INABIAF - please **DO NOT** fix
|
||||
### Source code: [2020/otterness/prog.c](2020/otterness/prog.c)
|
||||
### Information: [2020/otterness/README.md](2020/otterness/README.md)
|
||||
|
||||
The author listed the following limitations:
|
||||
|
||||
1. The program does not support MIDI files over 4 MB (specifically, it will
|
||||
not take input files larger than `2^22 - 1` bytes). This is unlikely to be a
|
||||
big limitation in practice, since even lengthy MIDIs are rarely over a
|
||||
couple hundred KB.
|
||||
|
||||
2. Not all MIDIs set (or *correctly* 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.
|
||||
|
||||
3. 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.
|
||||
|
||||
See also the [Program error
|
||||
codes](/2020/otterness/README.md#program-error-codes) written by the author
|
||||
which lists some other conditions which should be considered features, not bugs.
|
||||
|
||||
|
||||
# 2021
|
||||
|
||||
There was no IOCCC in 2021.
|
||||
@@ -3632,25 +3658,6 @@ There was no IOCCC in 2022.
|
||||
There was no IOCCC in 2023.
|
||||
|
||||
|
||||
# Final words
|
||||
|
||||
We hope this document was of use to you in determining which entries are known
|
||||
to have a problem, what entries are known to have features that are not bugs and
|
||||
so on. We also thank you for going through this document and, if you propose any
|
||||
fixes via a [GitHub pull
|
||||
request](https://github.com/ioccc-src/temp-test-ioccc/pulls) or otherwise, we
|
||||
thank you as well for the help! We will happily add you to the
|
||||
[thanks](/thanks-for-help.md) file.
|
||||
|
||||
There was no IOCCC in these years.
|
||||
|
||||
# 2023
|
||||
|
||||
Probably there will be no IOCCC in 2023 but we do hope to at least run the
|
||||
IOCCCMOCK contest this year. This depends entirely on the work in this repo
|
||||
and the [mkiocccentry](https://github.com/ioccc-src/mkiocccentry) being
|
||||
completed.
|
||||
|
||||
# Final words
|
||||
|
||||
We hope this document was of use to you in determining which entries are known
|
||||
|
||||
@@ -4443,6 +4443,15 @@ set by the late Christopher Tolkien, son and literary executor and heir to
|
||||
J.R.R. Tolkien).
|
||||
|
||||
|
||||
## <a name="2020_otterness"></a>[2020/otterness](/2020/otterness/prog.c) ([README.md](/2020/otterness/README.md))
|
||||
|
||||
|
||||
[Cody](#cody) added the MIDI files [cvikl.mid](/2020/otterness/cvikl.mid) and
|
||||
[entertainer.mid](/2020/otterness/entertainer.mid) from the URLs we suggested so
|
||||
that one need not download them and to make sure they can always be obtained
|
||||
even if the domain or link goes dead.
|
||||
|
||||
|
||||
## <a name="2020_tsoj"></a>[2020/tsoj](/2020/tsoj/prog.c) ([README.md](/2020/tsoj/README.md))
|
||||
|
||||
[Cody](#cody) added [alternate code](/2020/tsoj/README.md#alternate-code) that will feel
|
||||
|
||||
Reference in new issue
Block a user