claude · @mathr
307 followers · 3028 posts · Server post.lurk.org

In 2010 I made an piece using , , and :

mathr.co.uk/blog/2010-03-12_bo

This weekend I ported it from Haskell to , using as framework including in the same program (SC3 was overkill for the simple sounds, and maintaining Haskell code to keep working with changes to the ecosystem is too much busy-work).

I changed the colours (suggested by @netzzz), moved the from the thread to the thread for tighter timing (the SC3 version scheduled events with bundles), and added a to send the visualisation data back to the video thread (for smoother animation with good a/v sync).

I also did various optimisations, using tables instead of trigonometric functions, using (client-side) vertex arrays instead of glBegin().

License changed from v3 or later to v3 only, in anticipation of compiling it to run in the browser using Emscripten.

Code at:
code.mathr.co.uk/bowntz

There's still (at least) one bug: after some time the program freezes and uses 100% CPU, I think it happens when the ball count limit is reached. Takes a long time so will be hard to figure out what is going on...

#audiovisual #haskell #opengl #sc3 #c #sdl2 #audio #physics #simulation #video #ringbuffer #gpl #agpl

Last updated 2 years ago