Experimental music from very short C programs
category: code [glöplog]
*MEH*
I previously posted the wrong URL!
here is the GOOD ONE:
t*(t/256)-t*(t/255)+t*(t>>5|t>>6|t<<2&t>>1)
I previously posted the wrong URL!
here is the GOOD ONE:
t*(t/256)-t*(t/255)+t*(t>>5|t>>6|t<<2&t>>1)
Some REALLY cool micro tunes.
rez: I dunno which language you wrote this in, but in JavaScript Numbers are 64bits floats cast to 32bits integers when applied a bitwise operation.
Therefore foo<<128 makes little sense. In effect it just round the variable foo. Here the variable t is already an integer, so... t<<128 === t.
rez: I dunno which language you wrote this in, but in JavaScript Numbers are 64bits floats cast to 32bits integers when applied a bitwise operation.
Therefore foo<<128 makes little sense. In effect it just round the variable foo. Here the variable t is already an integer, so... t<<128 === t.
p01: thank a lot for the hint, in fact I entered some random value fastly and when it sounded fine I didn't changed them :D
Isn't the difference in number representation in JS and on lower level hardware kind of a problem? Wouldn't it make sense to make a 8-bit register, a 16-bit register, and a 32-bit register version? If so, would that require a minimal interpreter of a kind? I might work on it...
Quote:
Isn't the difference in number representation in JS and on lower level hardware kind of a problem?
Isn't the entire point of interpreted code to specify the language exactly and then leave the burden of such details to the people doing the native implementation? What would happen with your 32-bit register on a 16-bit machine? Or a machine with 36-bit words? or 64-bit little endian machine? Or trinary logic? Or some thing that we can't even imagine yet but that's commonplace in 2030?
BTW, there's an AS3 version at http://entropedia.co.uk/generative_music/ that allows you to modify the formula while playing.
A little ditty which sounds a little like Frere Jacques (Mester Jacob): (t>>7|t*3|t>>(t>>15))*10+((t>>8)&5)
This one sounds like it has a high-pass-filted delay which is an octave or 2 higher than the original melody: (t>>9|t*3|t>>(t>>8))+((t>>7)&15)*8
(those two were done in the as3 player btw)
loving the as3 player heheh
By popular demand I made a 4k version of the 128 B VCS implementation:
genmusic1-4k.bin. Source code etc. at genmusic1
I also implemented (t>>7|t|t>>6)*10+4*(t&t>>13|t>>6) as genmusic2.bin (or genmusic2-4k.bin). Similarly, source code at genmusic2. I had to hack this one a bit to fit, placing some code in the reset vector area.
genmusic1-4k.bin. Source code etc. at genmusic1
I also implemented (t>>7|t|t>>6)*10+4*(t&t>>13|t>>6) as genmusic2.bin (or genmusic2-4k.bin). Similarly, source code at genmusic2. I had to hack this one a bit to fit, placing some code in the reset vector area.
here is an "arabic-noisy" one:
t*4+t*(12*cos(t>>10&t>>12)%1)+t*(12*cos(t>>10&t>>12)%1)+t*(12*cos(t>>12+t))
that online music generation is dope :D
t*4+t*(12*cos(t>>10&t>>12)%1)+t*(12*cos(t>>10&t>>12)%1)+t*(12*cos(t>>12+t))
that online music generation is dope :D
rez: funny
hey, this is fun! t*((t>>10)^42) :)
including a silly bassline: ((t*((t>>10)^42)&255)>>1)+((t>>5)&1)*((64-t)&63)
@rez the arabic one is fantastic, especially after 30 mn of listening to experimental glitch noise
A soundtrack for some robots walking in some massive parallax scroller...
(((t*13)^(t*17)) >> 8)|(t >> 5)*(t >> 3)
A soundtrack for some robots walking in some massive parallax scroller...
(((t*13)^(t*17)) >> 8)|(t >> 5)*(t >> 3)
t/31337*t
obviously my best attempt sofar
obviously my best attempt sofar
And now, the 'Lemmings March' ^^
(t>>5)|(t<<4)|((t&1023)^1981)|((t-67)>>4)
(t>>5)|(t<<4)|((t&1023)^1981)|((t-67)>>4)
and another one:
((t>>4&t>>3|t<<8)^(t<<8))|((t%2==0)?t*2:t*8)+(t>>10)*(((t+2)%2==0)?t*6:(((t+4)%2==0)?t*8:t*4))
still trying to get something "musical" but not succeed yet :D
((t>>4&t>>3|t<<8)^(t<<8))|((t%2==0)?t*2:t*8)+(t>>10)*(((t+2)%2==0)?t*6:(((t+4)%2==0)?t*8:t*4))
still trying to get something "musical" but not succeed yet :D
@marmakoide: That Lemming march is awesome, could definitely be used as a basis sample for something else.
@Garga He he, thanks ^^ That seems to be the challenge for 'one-liner music'. Getting a good enough loop is not too hard, play & tweak. But then, trying a melody on top of that texture, can't touch this (tuuudududum). Yet.
t*(t>>6)|(t<<8)|(t<<4)|(t>>4)|((t&400)^2)|((t-256)>>2)
I have no clue what I am doing.
t*(t>>12)|(t<<8)|(t<<4)|(t>>4)+sin(t)|((t&400)^2)|((t-256)>>124)
I have no clue what I am doing.
t*(t>>12)|(t<<8)|(t<<4)|(t>>4)+sin(t)|((t&400)^2)|((t-256)>>124)
copy-pasta seems to be needed for url 2 for some reason.