Webgl, audio synthesis and elixir

hi all!
So, having being using clojurescript as my language of choice , i would love to begin to work up some examples with elixir … my interests lie in 3d graphics, physics and signal processing using webgl and webaudio. Am just wondering where to start with elixir and webgl and glsl based application development…
could anyone point me in the right direction?
very excited by the great community here!
Good to join you all!

1 Like

Elixir is the server-side, things like 3d Graphics, Physics (well unless the server is handling physics interpolation), webGL, and webAudio are all client-side, and for that you can use whatever you want, javascript, elm, bucklescript, clojurescript, whatever. :slight_smile:

So the first thing to decide, what will you have the server control?

1 Like

So to summarise an overview, phoenix is the clientside partner here - to
build the ui etc…
…and i could use elixir to manage and process things like :
app world state,
3d point data vectors,
signal processes(sine wave manipulations for audio synthesis and
data vis)
some math transformations on matrices
user created data analysis …
… then talk to dbase via ecto to store results, histories of
actions, visual captures, sound files etc…
…is that the correct division of labour here?

For instance,

  • something like a realtime granular synth where many thousands of data
    inputs generate audio streams which processed and concatenated together
    to form 3d audio space in online game…

  • a particle engine which takes data from many streams and uses it to
    create xyz,scale,rotation etc nodes which an application can call as a
    service in realtime…

  • video processor that can capture screen grabs and process them down to
    video stream…

are these good fits for elixir?

1 Like

It really depends on how much you want to store server-side, and how much you want to keep track of client-side. Elixir only runs server-side. (Although, albeit young, there is elixirscript which compiles to JS).

If you want to do the synthesizing server-side (e.g. on dedicated hardware that you have available), then Elixir is a great fit, because it is fault-tolerant. If, however, you want to run most of this stuff on the client’s graphics card, then you’ll probably end up in writing most of your code in JavaScript (or a language that compiles to it such as Elm, Purescript, ???).

Because immutability is innately slower than mutability, Elixir is less well-suited to efficiently handle math-based calculations on gigantic streams of data. The actual synthesis is therefore something you’d want to do either in another, compiled language (Rust, C) or, even better (as sound synthesis is often paralellizeable by definition) on dedicated hardware, such as on a GPU using either WebGL if it is on the client’s computer, or OpenGL if it’s on your server-side dedicated graphics hardware.


thats great! thankyou!
Sorry to ask such general questions … just trying to get my toolchain correct and do the right things in the right places!
management of users, user actions, messages, threads and states via elixir,
processing and math and frontend via elm/cljs to webgl/webaudio/dom,
database via ecto

time to jump in!
many many thanks !