pouët.net

Go to bottom

8 note slide as f(t)

category: code [glöplog]
i been reading this book on functional programming in javascript and i do must say that i like the concept (as i already liked it when first learning prolog / haskell).

it streamlines processes a lot, especially when dealing with data sorting and such. i still haven't fully wrapped my head around it to "use it in the field" but i do see some elegance in it. what usually throws me back is the horrible horror of trying to develop your own functions returning functions kind of thing. i reckon it's a matter of getting used to it, but i see it like regular expressions: i can usually figure out what they're doing there, but i wouldn't want to open that can of worms on my own unless i really have to. and that's never a big incentive to using it in practice.

anyways, all this to say that functional programming can be cool imho, and would be nice to see more of it on graphics and sound. it does feel like it's riding a hype somewhat. but it renders certain problems a lot easier to solve (or solved in a more elegant form). haven't achieved that required zen state yet but would be interesting. :)
added on the 2014-08-22 13:04:59 by psenough psenough
ok, I know I'm getting OT, but I found another way to do particle effects without a particle engine which is in something that will be released at some point, which is to take a sphere made of pointsprites and deform it a lot. I'm sure folks have been doing this since there have BEEN pointsprites.
As I'm a graphician coming from the other end of the toolchain, I'm not sure what the code behind that is, but presumably standard shader calculations.
Thanks for your input guys.

Preacher, you can have emitters if all the particles loop periodically (independent of each other). There are many examples for this on shadertoy already: Volcano, Sparks, Particle Fireworks

I basically did a particle system here in slow-motion or better "bee-motion". See the "spawnAgent" function (more bees if you wait some time) Beehive

There are also methods to fake more particles, for example domain repetition with altered offsets to hide symmetries or artefacts.

All of them are stateless.

Which brings me back to the original topic of this thread ... stateless note slide through 8 notes w/o break and click! :)
added on the 2014-08-22 15:48:33 by movAX13h movAX13h
What is quite hard for me to do in a stateless shader is pixel-image explosions because pixels will overlap. I think no one has done it properly yet ... at least not on st.
added on the 2014-08-22 16:12:35 by movAX13h movAX13h
Code:/* linear-frequency-slide->phase generator function t: absolute time in seconds ts: starting time of the slide (absolute) tl: duration of the slide in seconds k: frequency difference (if the frequency before the slide is f, it's going to be k + f after the slide) */ float f1(float t, float ts, float tl, float k) { float o1 = clamp(t - ts, 0.0, tl); float o2 = max(t - (ts + tl), 0.0); return o1 * o1 * k / (2.0 * tl) + o2 * k; }


Problem solved by srtuss. Sound wonderful :) He said he might release a song with it on st soon. I'm also working on one but that's going to take a while. Demofox will have it in his next audio basics blog/shader I guess after releasing a very rough approximation (and difficult to tune) today.
added on the 2014-08-23 03:43:41 by movAX13h movAX13h
very cool!
added on the 2014-08-23 15:47:18 by psenough psenough

login

Go to top