{"id":2554,"date":"2012-02-25T17:31:55","date_gmt":"2012-02-25T15:31:55","guid":{"rendered":"https:\/\/yehar.com\/blog\/?p=2554"},"modified":"2012-08-04T11:29:16","modified_gmt":"2012-08-04T08:29:16","slug":"bytebeat","status":"publish","type":"post","link":"https:\/\/yehar.com\/blog\/?p=2554","title":{"rendered":"Bytebeat"},"content":{"rendered":"<p title=\"Bytebeat \u2014 Kragen\"><em>Bytebeat<\/em> is a music synthesis technique that was <a title=\"countercomplex: Algorithmic symphonies from one line of code -- how and why?\" href=\"http:\/\/countercomplex.blogspot.com\/2011\/10\/algorithmic-symphonies-from-one-line-of.html\">discovered<\/a> by Ville-Matias Heikkil\u00e4 (viznut\/pwp). Kragen Javier Sitaker has a <a title=\"Bytebeat \u2014 Kragen\" href=\"http:\/\/canonical.org\/%7Ekragen\/bytebeat\/\">good writeup on the subject<\/a>. The way it works is that you generate a stream of 8-bit audio with the samples calculated by a function of sample index. This means that the song is defined by the function. In pure-form bytebeat, the function corresponds to a computer program that employs bit-wise and basic arithmetic operators, meaning that a small-sized formula would also have a small-sized implementation if realized in machine language or something like that. It may have been vital to Viznut's discovery that he experimented with a low 8 kHz sampling frequency. With high sampling frequencies, the flat spectral envelope arising from bit-wise operations and numerical wrapping makes the sound thin and harsh. I regretfully admit that initially I had doubts that the methodology would be able to produce anything else than <em>glitch<\/em>-y noise, but it turns out that some formulas produce songs suitable for a wider audience.<\/p>\n<p>My bytebeat formulas are quite orthodox, but their construction is largely deterministic. There is still a lot of random trial and error both in fine-tuning of numerical values and in testing different structures for sub-formulas. As a principle I shy from direct summing of voices, avoid floating point stuff, and use a 8 kHz sampling frequency. It helps that I don't know the syntax of Javascript well enough to use anything but elementary operations. The most interesting ones of my songs are available as 44.1 kHz ogg downloads. For the rest, there's a link to a Javascript-based player. Prior to encoding this kind of material it is good to eliminate any constant DC bias and to normalize the audio in a way that clipping of <a title=\"Gibbs phenomenon - Wikipedia, the free encyclopedia\" href=\"http:\/\/en.wikipedia.org\/wiki\/Gibbs_phenomenon\">Gibbs effect<\/a> overshoots (from 8 kHz to 44.1 kHz upsampling) is eliminated. A gain value of -5 dB may be needed in worst case.<\/p>\n<p>In general, mathematical equations cannot be copyrighted. Use these any way you like.<\/p>\n<p>It would be interesting to try out bytebeat in balanced ternary, arguably the most beautiful number system. Also it would be good to try out the 44.1 kHz sampling fequency with some filtering to make the average spectral envelope more agreeable.<\/p>\n<h2>Songs<\/h2>\n<h3>No 1<\/h3>\n<pre class=\"crayon:false\"><span style=\"color: #993300;\">t*(t&gt;&gt;((t&gt;&gt;11)&amp;15))<\/span>*<span style=\"color: #0000ff;\">(t&gt;&gt;9&amp;1)<\/span>&lt;&lt;2<\/pre>\n<p><a href=\"http:\/\/wurstcaptures.untergrund.net\/music\/?oneliner=t*%28t%3E%3E%28%28t%3E%3E11%29%2615%29%29*%28t%3E%3E9%261%29%3C%3C2&amp;duration=180\">Play as Javascript<\/a>, 8 kHz.<\/p>\n<p>Quite a primitive piece. This could be used as the \"melody\" in some hardcore acid trance maybe. Has an <span style=\"color: #993300;\">arpeggiator<\/span> and <span style=\"color: #0000ff;\">gating<\/span>. Originally published at <a href=\"http:\/\/pouet.net\/topic.php?which=8357&amp;page=20\">pou\u00ebt.net BBS<\/a> 2012-02-24.<\/p>\n<h3>No 2<\/h3>\n<p>u=t&gt;&gt;10,8*t*t*<span style=\"color: #993300;\">(t&gt;&gt;u%3+15)<\/span>\/<span style=\"color: #008000;\">(3+(u&amp;(u&gt;&gt;5&amp;3|4)))<\/span>|<span style=\"color: #ff0000;\">t&gt;&gt;4<\/span><\/p>\n<p><a href=\"http:\/\/wurstcaptures.untergrund.net\/music\/?oneliner=8*t*t*%28t%3E%3E%28t%3E%3E10%29%253%2B15%29%2F%283%2B%28t%3E%3E10%26%28t%3E%3E15%263%7C4%29%29%29%7Ct%3E%3E4&amp;oneliner2=&amp;t0=0&amp;tmod=0&amp;duration=180&amp;separation=100&amp;rate=8000\">Play as Javascript<\/a>, 8 kHz <a href=\"http:\/\/yehar.com\/blog\/wp-content\/uploads\/2012\/02\/No-2.ogg\">(ogg<\/a>, 1096 KiB).<\/p>\n<p>A song with progression and a repeating pattern of chords. It has a <span style=\"color: #ff0000;\">bass drum<\/span>, an <span style=\"color: #993300;\">arpeggiator<\/span> derived from song No 1, and uses division to arrive at approximate <span style=\"color: #008000;\">note frequencies<\/span> <span style=\"color: #000000;\">generated by a formula<\/span>. Unfortunately, it gets a bit dissonant in the 4th quarter of the repeating pattern. Originally published at <a href=\"http:\/\/pouet.net\/topic.php?which=8357&amp;page=20\">pou\u00ebt.net BBS<\/a>, 2012-02-24.<\/p>\n<h3>No 3<\/h3>\n<pre class=\"crayon:false\"><span style=\"color: #ff0000;\">t&gt;&gt;4+!(-t&gt;&gt;13&amp;7)+2*!(t&gt;&gt;17)<\/span>|t*t*<span style=\"color: #993300;\">(t&gt;&gt;(t&gt;&gt;12^t&gt;&gt;11)%3+10)<\/span>\/<span style=\"color: #008000;\">(7+(t&gt;&gt;10&amp;t&gt;&gt;14&amp;3))<\/span>*<span style=\"color: #0000ff;\">!(t&amp;512)<\/span>&lt;&lt;3+(t&gt;&gt;14&amp;1)<\/pre>\n<p><a href=\"http:\/\/wurstcaptures.untergrund.net\/music\/?oneliner=t%3E%3E4%2B%21%28-t%3E%3E13%267%29%2B2*%21%28t%3E%3E17%29%7Ct*t*%28t%3E%3E%28t%3E%3E12%5Et%3E%3E11%29%253%2B10%29%2F%287%2B%28t%3E%3E10%26t%3E%3E14%263%29%29*%21%28t%26512%29%3C%3C3%2B%28t%3E%3E14%261%29&amp;oneliner2=&amp;t0=0&amp;tmod=0&amp;duration=180&amp;separation=100&amp;rate=8000\">Play as Javascript<\/a>, 8 kHz (<a href=\"http:\/\/yehar.com\/blog\/wp-content\/uploads\/2012\/02\/No-3.ogg\">ogg<\/a>, 1363 KiB).<\/p>\n<p>Quite similar in form to song No 2, but the progression is done using the <span style=\"color: #ff0000;\">bass drum<\/span>. Has <span style=\"color: #0000ff;\">gating<\/span> to make the ti-ti-ti-ti-ti-ti-ti. Has additional elements for fine-tuning of the sound.<\/p>\n<pre class=\"crayon:false\"><span style=\"color: #ff0000;\">t&gt;&gt;4<\/span>|t*t*(t&gt;&gt;6&amp;8^8)*<span style=\"color: #993300;\">(t&gt;&gt;11^t\/3&gt;&gt;12)<\/span>\/<span style=\"color: #008000;\">(7+(t&gt;&gt;10&amp;t&gt;&gt;14&amp;3))<\/span><\/pre>\n<p><a href=\"http:\/\/wurstcaptures.untergrund.net\/music\/?oneliner=t%3E%3E4%7Ct*t*%28t%3E%3E6%268%5E8%29*%28t%3E%3E11%5Et%2F3%3E%3E12%29%2F%287%2B%28t%3E%3E10%26t%3E%3E14%263%29%29&amp;oneliner2=&amp;t0=0&amp;tmod=0&amp;duration=180&amp;separation=100&amp;rate=8000\">Play as Javascript<\/a>, 8 kHz.<\/p>\n<p>A no-frills variant with a somewhat simpler <span style=\"color: #993300;\">arpeggiator<\/span>.<\/p>\n<p>Originally published at <a href=\"http:\/\/pouet.net\/topic.php?which=8357&amp;page=21\">pou\u00ebt.net BBS<\/a>, 2012-02-25.<\/p>\n<h3>No 4<\/h3>\n<pre class=\"crayon:false\"><span style=\"color: #000000;\"><span style=\"color: #000000;\"><span style=\"color: #808080;\">v=t\/2^(t&amp;64?63:0),v=v&gt;&gt;v,<\/span><\/span><\/span><span style=\"color: #000000;\"><span style=\"color: #000000;\"><span style=\"color: #808080;\">v\/(1+(v&gt;&gt;7))<\/span>&amp;<span style=\"color: #ff0000;\">t\/32<\/span>|<span style=\"color: #993300;\">(t&gt;&gt;11)%8%3<\/span>*t*t&amp;15<\/span><\/span><\/pre>\n<p><a href=\"http:\/\/wurstcaptures.untergrund.net\/music\/?oneliner=v%3Dt%2F2%5E(t%2664%3F63%3A0)%2Cv%3Dv%3E%3Ev%2Cv%2F(1%2B(v%3E%3E7))%26t%2F32%7C(t%3E%3E11)%258%253*t*t%2615&amp;oneliner2=&amp;t0=0&amp;tmod=0&amp;duration=180&amp;separation=100&amp;rate=8000\">Play as Javascript<\/a>, 8 kHz <a href=\"http:\/\/yehar.com\/blog\/wp-content\/uploads\/2012\/02\/No-42.ogg\">(ogg<\/a>, 869 KiB).<\/p>\n<p>Monotonic minimalistic trance. Features a poor man's \"sinusoidal\" <span style=\"color: #808080;\">bassline<\/span> that has a nice development coming out of the formula, driving the whole song forward. On top of that there's a <span style=\"color: #ff0000;\">bass drum<\/span> making the bassline duck, and then there's a bit of high-frequency spice. Originally published at <a href=\"http:\/\/pouet.net\/topic.php?which=8357&amp;page=21\">pou\u00ebt.net BBS<\/a>, 2012-02-26.<\/p>\n<h3>One million alarm clocks<\/h3>\n<pre class=\"crayon:false\">t*t\/<span style=\"color: #008000;\">(t&gt;&gt;12&amp;t&gt;&gt;8&amp;63)<\/span>&lt;&lt;7<\/pre>\n<p><a href=\"http:\/\/wurstcaptures.untergrund.net\/music\/?oneliner=t*t%2F(t%3E%3E12%26t%3E%3E8%2663)%3C%3C7&amp;oneliner2=&amp;t0=0&amp;tmod=0&amp;duration=60&amp;separation=100&amp;rate=8000\">Play as Javascript<\/a>, 8 kHz.<\/p>\n<p>This would make a really nasty ringtone or an alarm clock buzz. Originally published at <a href=\"http:\/\/pouet.net\/topic.php?which=8357&amp;page=21\">pou\u00ebt.net BBS<\/a>, 2012-02-27.<\/p>\n<h3>No 5<\/h3>\n<pre class=\"crayon:false\">u=<span style=\"color: #ff0000;\">3*t&gt;&gt;t\/4096%4<\/span><span style=\"color: #008000;\">&amp;-t%(t&gt;&gt;16|16)*t&gt;&gt;14<\/span><span style=\"color: #808080;\">&amp;8191,u\/(u&gt;&gt;6|1)*4<\/span><\/pre>\n<p><a href=\"http:\/\/wurstcaptures.untergrund.net\/music\/?oneliner=u%3D3*t%3E%3Et%2F4096%254%26-t%25(t%3E%3E16%7C16)*t%3E%3E14%268191%2Cu%2F(u%3E%3E6%7C1)*4&amp;oneliner2=&amp;t0=0&amp;tmod=0&amp;duration=300&amp;separation=100&amp;rate=8000\">Play as Javascript<\/a>, 8 kHz (<a href=\"http:\/\/yehar.com\/blog\/wp-content\/uploads\/2012\/02\/No-5.ogg\">ogg<\/a>, 1035 KiB)<\/p>\n<p>This uses a kind of <span style=\"color: #808080;\">\"loop sampler\"<\/span> of a nice smack!-kinda sound to create both a <span style=\"color: #ff0000;\">bass<\/span><span style=\"color: #000000;\"> and<\/span><span style=\"color: #ff0000;\"><span style=\"color: #000000;\"> a<\/span> bass drum<\/span> sound. The loops don't repeat evenly, creating an interesting polyrhythm. There's also an additional <span style=\"color: #008000;\">high-pitched sound<\/span>. Originally published at <a href=\"http:\/\/pouet.net\/topic.php?which=8357&amp;page=21\">pou\u00ebt.net BBS<\/a>, 2012-02-28.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Bytebeat is a music synthesis technique that was discovered by Ville-Matias Heikkil\u00e4 (viznut\/pwp). Kragen Javier Sitaker has a good writeup on the subject. The way it works is that you generate a stream of 8-bit audio with the samples calculated by a function of sample index. This means that the song is defined by the &hellip; <a href=\"https:\/\/yehar.com\/blog\/?p=2554\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Bytebeat&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":3573,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14],"tags":[],"_links":{"self":[{"href":"https:\/\/yehar.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2554"}],"collection":[{"href":"https:\/\/yehar.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/yehar.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/yehar.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/yehar.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2554"}],"version-history":[{"count":0,"href":"https:\/\/yehar.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2554\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/yehar.com\/blog\/index.php?rest_route=\/wp\/v2\/media\/3573"}],"wp:attachment":[{"href":"https:\/\/yehar.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2554"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/yehar.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2554"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/yehar.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2554"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}