Skip to content

teadrinker/bytebeat-notes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

Technological Bass

A bit of music generated from 244 characters of code, listen here. Made for Love Byte 2023. The "music" is very basic, most of the character budget was spent on sound design.

Annotated source

Open in bytebeat player

s=t/4e4,                   // s = time in seconds, almost...
s+=(1-exp(-s))*38,         // warp time for crazy intro
t=s*6.4,                   // t = song position/time, in 16th
x=108*s*(               

                           // --- calculate synth frequency ---
    s<50?t*0.97:           // use crazy frequency for crazy intro
    1+((t|0)%3)/2          // arpeggio loop using *[1, 1.5, 2]
      *!!(t/4&16))         // enable/disable arpeggio every 4 bars
      *((t&63)>47?1.19:1)  // play every 4th bar ~3 semitones higher,
                           // also helps last siren sweep of the intro 
       
  %2-1,                    // convert to range -1 to 1 (sawtooth)
	
f=1-pow(t%1,               // f = normalized filter envelope 
       -sin(t/8)           // filter oscillator
       *1.8+2), 
                           // "SYNTH" - transform saw to filtered saw:

x=-(.44*(f-2)*(f+.7)*x*(x*x-1))/((f-.25)*x*x-f/2-.25),

b=t/4%1,                   // b = normalized time for kick

                           // To combine kick and synth, use linear
                           // interpolation instead of add, then use
                           // mix amount to create a side-chain feel
                           //
                           // out = mix(synth, kick, clamp01(1-2*b))
( x+(
     sin(b**.53*214)       // kick
  -x)*
      min(max(1-2*b,0),1)  // mix amount (kick=0, synth=1)

  +1)*127                  // scale from -1 to 1 to byte range
   

Approximated filtered sawtooth

The minimal form of the curve I used would be something like:

(x*x*x-x)/(f*x*x-1)

I tried to improve the loudness and also the second derivative so filtered is more sin-like. By not maximizing the curve we get free volume envelope! (I made a shorter and even louder version that turned out to sound more boring, so I reverted to the more awkward equation you see in the source)

Prototyping

I used my old live-coding tool Mad Tea Lab to prototype. For example, you can set it up like this to tweak a simple kick!

Love Byte

I had great fun participating in Love Beat 2023, thanks especially to the organizing team, psenough, jeenio, gasman and the Byte Battle participants! Also some learned some interesting stuff like using Five-limit tuning in the Seminar by pestis!

This was my first real size-coding attempt. I have always loved to find minimal ways to express logic, but I also dislike obfuscation. This made me more tolerant I guess, but not sure if that is a good thing? :)

More Byte Beat Stuff!

Step by step Intro

Annotated

Minimal

Other

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published