This commit is contained in:
Miloslav Ciz 2022-11-25 13:49:50 +01:00
parent c6a0966159
commit 0c26b4f54b
9 changed files with 37 additions and 22 deletions

View file

@ -1,6 +1,6 @@
# Bytebeat
Bytebeat is a procedural [chiptune](chiptune.md)/8bit style music generated by a short expression in a programming language; it was discovered/highlighted in 2011 by [Viznut](viznut.md) (author of [countercomplex](countercomplex.md) blog) and others, and the technique capable of producing quite impressive music by single-line code has since caught the attention of many programmers, especially in [demoscene](demoscene.md). There has even been a [paper](https://arxiv.org/abs/1112.1368) written about bytebeat.
Bytebeat is a [procedural](procgen.md) [chiptune](chiptune.md)/8bit style music generated by a short expression in a [programming language](programming_language.md); it was discovered/highlighted in 2011 by [Viznut](viznut.md) (author of [countercomplex](countercomplex.md) blog) and others, and the technique capable of producing quite impressive music by single-line code has since caught the attention of many programmers, especially in [demoscene](demoscene.md). There has even been a [paper](https://arxiv.org/abs/1112.1368) written about bytebeat. Bytebeat can produce music similar (though a lot simpler) to that created e.g. with [music trackers](music_tracker.md) but with a lot less complexity and effort.
This is a [beautiful](beauty.md) [hack](hacking.md) for [LRS](lrs.md)/[suckless](suckless.md) programmers because it takes quite a tiny amount of code, space and effort to produce nice music, e.g. for [games](game.md) (done e.g. by [Anarch](anarch.md)).
@ -53,7 +53,7 @@ General tips/tricks and observations are these:
It is not exactly clear whether, how and to what extent [copyright](copyright) can apply to bytebeat: on one hand we have a short formula that's uncopyrightable (just like mathematical formulas), on the other hand we have music, an artistic expression. Many authors of bytebeat "release" their creations under [free](free_culture.md) [licenses](license.md) such as [CC-BY-SA](cc-by-sa.md), but such licenses are of course not applicable if copyright can't even arise.
We believe copyright doesn't and SHOULDN'T apply to bytebeat. To ensure this, it is good to stick [CC0](cc0.md) to any released bytebeat.
We believe copyright doesn't and SHOULDN'T apply to bytebeat. To ensure this, it is good to stick [CC0](cc0.md) to any released bytebeat just in case.
## Examples
@ -66,3 +66,8 @@ The following more complex examples come from the [LRS](lrs.md) game [Anarch](an
- distortion guitar rhythmical beat: `~((((i >> ((i >> 2) % 32)) | (i >> ((i >> 5) % 32))) & 0x12) << 1) | (i >> 11)`
- electronic/techno: `((0x47 >> ((i >> 9) % 32)) & (i >> (i % 32))) | (0x57 >> ((i >> 7) % 32)) | (0x06 >> ((i >> ((((i * 11) >> 14) & 0x0e) % 32)) % 32))`
- main theme, uses an extra variable: `(((i) & 65536) ? (a & (((i * 2) >> 16) & 0x09)) : ~a)`, where `uint32_t a = ((i >> 7) | (i >> 9) | (~i << 1) | i)`
## See Also
- [music tracker](music_tracker.md)
- [MIDI](midi.md)