pouët.net

Experimental music from very short C programs

category: code [glöplog]
Mine can be optimized to t&t>>13|t>>6

Funny how I didn't realize that before...

If you want to actually combine the two parts you can do this:
((t*(t>>8|t>>9)&46&t>>8)) ^ (t&t>>13|t>>6)

& is decent too
>> reminds me of traverse de rn85 (dubmood)
added on the 2011-09-29 05:44:37 by xpansive xpansive
whoops I meant << for the last part
added on the 2011-09-29 05:45:19 by xpansive xpansive
this thread just made my day :) thank you guys!
After a bit of trial&error: (t*3<<0|t>>2|t>>6)*30&((t*7<<-1|t>>-2|t>> ;12)*4)

Would pass as an semi-decent start actually :)
added on the 2011-09-29 11:35:10 by oasiz oasiz
does <<0 make sense?
Shift to left, 0 bit?

And I don't get the semicolon in front of the 12.

What "language" is this actually? I wanted to understand clearly, what we are doing here exactly and found out, that I don't know it :)
added on the 2011-09-29 12:51:13 by FeN FeN
; is a typo, isn't supposed to be there.
And just try changing that zero.
As I said, This was mostly trial & error, so I didn't really optimize it :)
added on the 2011-09-29 13:30:38 by oasiz oasiz
Uhm: ((t%40000)<5000) ???
It's C, not Java. Would you like -(t%40000-5000>>31) instead?
added on the 2011-09-29 15:15:34 by 216 216
Duh I was missing a zero when I was interpreting what the code meant. I was reading %4000, and not 40000. Ooops.
I find this very interesting and entertaining, however I lack programming knowledge and I'm not understanding exactly what I am doing here:

t>>40&t<<2&90

It's probably some basic math with C...any idea where I could read into it and hopefully refresh my math skills on the way? :)
http://en.wikipedia.org/wiki/Operators_in_C_and_C%2B%2B

added on the 2011-09-29 16:17:26 by FeN FeN
this might be bettwer http://en.wikipedia.org/wiki/Bitwise_operation. so learn it.
however, you should have a basic understanding of binary-decimal relationships.
added on the 2011-09-29 16:54:57 by rudi rudi
Thanks for the links! I'll read into it. Yes, I think I have a basic understandig of binary-decimal relationship but I never really dug into logical operators. I probably have to write down bits and draw a graph to understand what happens :) Will try that tonight.
Awesome job dudes and dudettes!
added on the 2011-09-29 17:41:13 by Zplex Zplex
You can use IQ's graph toy for visualizing the data - e.g.

f1(x) = ((x*(x>>8|x>>9)&46&x>>8)) ^ (x&x>>13|x>>6)

http://www.iquilezles.org/apps/graphtoy/
thx.
I understood the bitwise operations, but I couldn't get behind, why they make sense in a equation. But if you see it visual, it makes sense... thanks :)
added on the 2011-09-29 20:06:27 by FeN FeN
(t*50)*10*(sin(t*0.0001))^2
wob wob wob!
added on the 2011-09-29 20:18:36 by las las
haha :)

c64 drumloop...sorta

((t>>7|t<<sin(t)|t>>6)*10)+45
FeN: in boolean algebra there are actually symbols for logic-operations like this. so, its an own branch. for example the XOR operator has its own symbol (actually there are two). But the one I use to describe in some of my formulas for a random number generator i use Simpson's xor-symbol: (+).
added on the 2011-09-29 21:26:13 by rudi rudi
Nice one Varjohukka =]
Not C...
but inspired from this thread...
some 4 bit PCM madness ... http://pouet.net/prod.php?which=57826

added on the 2011-09-30 00:39:54 by lsl lsl
more javascript hackery
(((j=Math.round(t/1500)%16))%8==1|(j==3)|(j==6)) * sin(200-200*Math.sqrt((t%6000)/6000))*50 + Math.random()*40*(j%8==5) + (((t|(t>>9|t>>7))*t&(t>>11|t>>9) )&63)*(j%3==0)
added on the 2011-09-30 01:28:18 by red red
Well, that set the bar high!

Now I somehow expect a generic dubstep equation in 3...2...1...
sin(t/1000)*2000+2000+sin(t/800)*1800+2300+sin(t/1200)*2000+2100+(Math.random()* t&40)

Trying to do dubstep but it sounds more like a motorcycle
added on the 2011-09-30 02:58:15 by xpansive xpansive
Okay here's some random dubstep (changes every time you refresh I think):

r=typeof r=='undefined'?Math.random()*400+1800:r,sin(t/(r/1.5))*r+r+sin(t/(r/1. 7-200))*(r-200)+(r+200)+sin(t/(r/1.4+200))*2000+(r+100)+(Math.random()*(Math.pow( sin(t/2000),40)*400))+(Math.random()/3*(Math.pow(sin(t/4000),200)*200))
added on the 2011-09-30 03:32:07 by xpansive xpansive

login