
Soul – A language and IDE for audio coding - ttoinou
https://soul.dev/playground/?id=55e627cb87ad63674a8c07cf3664991d
======
pierrec
I'm excited that audio-programming-in-the-browser is becoming a thing. It
means more people are likely to fall down this exquisite rabbit hole. I'm
totally in this field so I'll list a few websites that let you program music
in the browser, and my rough opinion on them:

\- [http://wavepot.com/](http://wavepot.com/) is just built on top of
Javascript. The code tends to be long since the library is pretty bare-bones
right now, but it's really well executed.

\- [https://gibber.cc/](https://gibber.cc/) is also JS-based. The library and
functions provided make for some pretty terse yet readable code, though
focused on somewhat traditional synthesis methods (and I still don't think JS
is ideal for this...)

\-
[http://ctford.github.io/klangmeister/](http://ctford.github.io/klangmeister/)
is based on Clojurescript, which is a safe choice since Overtone has long
demonstrated that Lisp is great for music programming. Right now there's not
much of a library to go with it, though.

\- [http://faust.grame.fr/editor/](http://faust.grame.fr/editor/) \- Faust is
one of the greatest music programming languages, and it also runs in the
browser, but I think they haven't sufficiently polished the browser experience
in a way that lets a novice learn the language in the browser.

\- [https://audiomasher.org/browse](https://audiomasher.org/browse) \- I'm
biased on that one since I made it. An obvious weakness is that the language
is a little frightening at first glance, but there's a tutorial. It's terse
yet open-ended, and the built-in library is pretty extensive.

For SOUL, it seems running in the browser is just a little demo, and the
language is meant to be used in other situations. In fact, most of the above
projects have grander aspirations than running in the browser - it's generally
just a way of getting people to try out the language or system. But I still
wish more projects would take the extra step and create a community-style
website where anyone can upload and play with each other's code, otherwise the
web experience just seems like a proof-of-concept.

~~~
ris
But is a browser-based audio environment ever going to have the low latency
and robustness requirements for something like live performance?

~~~
julesrms
WASM will probably start catching up with natively-compiled C++ eventually,
but we're working on the hypothesis that even natively-compiled C++ can't
quite get the best performance out of audio hardware, because running it on
the CPU in a normal OS is the wrong place for a realtime task like that.

Something we do want to create will be network-attached SOUL audio i/o devices
which can run the code using native JIT engines. Then, Javascript in a browser
can send its SOUL code to be compiled + executed directly on these bare-metal
devices and get super-low latency.

------
majkinetor
Just for the sake of completeness and for those new to the topic, here are
some mainstream audio programming languages people might also want to take
look at:

\- Csound This is one of the first ones, a little bit dated now but there is
ton of material and nice books

\- Pure Data (max/msp) Graphical audio language, also popular and very nice
for beginners

\- Supercollider Object oriented platform for audio synthesis (smalltalk)

\- Overtone Functional audio synthesis platform using Clojure (totally
awesome)

~~~
ivarv
Sam Aaron (original dev behind Overtone) has been focused on building out
Sonic Pi ( [https://sonic-pi.net/](https://sonic-pi.net/) ) for a few years
now and it's an amazing tool aimed at simplicity (literally aimed at ten year
olds) and power (used for gigging).

~~~
soperj
>Sam Aaron (original dev behind Overtone)

Was he actually the original dev? I get that he contributed a lot to the
project, but overtone isn't dead, and I don't think he was the original dev.

------
julesrms
Hello HN - thanks for giving our website a proper stress-test!

I'm the developer of SOUL - happy to answer any questions you guys have.. :)

~~~
potatomaster2
Hi julesrms,

Some quick 2-second feedback - I tried running the default example in Brave,
it failed, and then as a good user I wanted to report the bug to the
community, but that requires finding the ROLI forum and signing up (providing
DOB!) etc. I think it would be great if it were a bit easier to submit bug
reports without as much hassle.

~~~
sigil
You could report the issue here: [https://github.com/soul-
lang/SOUL/issues](https://github.com/soul-lang/SOUL/issues)

(We might open the soul.dev website too at some point, but that's private for
now.)

------
tomduncalf
For anyone looking for more context see [https://github.com/soul-
lang/SOUL/blob/master/docs/SOUL_Over...](https://github.com/soul-
lang/SOUL/blob/master/docs/SOUL_Overview.md) and [https://github.com/soul-
lang/SOUL/blob/master/docs/SOUL_FAQ....](https://github.com/soul-
lang/SOUL/blob/master/docs/SOUL_FAQ.md)

To quote the overview: "The SOUL platform is a language and an API. The
language is a small, carefully crafted DSL for writing the real-time parts of
an audio algorithm. The API is designed to deploy that SOUL code to
heterogeneous CPUs and DSPs, both locally and remotely."

~~~
ttoinou
Exciting! The team behind it is partly from the JUCE team, it looks serious
enough

~~~
tomduncalf
Heh yeah, I have the pleasure of working with them, it’s pretty serious :)

~~~
ttoinou
Lucky :D

------
yellowapple
I recall seeing Soul pop up on HN before, and at the time I was critical of it
for being announced way too early (no working examples or even any indication
of what the code might look like). This is much better, and it's good to see
that it's actually progressing instead of being yet another case of vaporware.

That said, still disappointing that there doesn't appear to be any info on an
actual compiler or runtime or however this is supposed to be used in actual
projects; the editor configs and code samples are a start, but kinda useless
if the only way to actually put 'em to use is to use a buggy web app :)

And speaking of "buggy web app", mousewheel-scrolling in the playground seems
to be entirely broken on Firefox on Linux. Apparently this is true of all
instances of Microsoft's web-based "Monaco" editor widget (on which the Soul
playground appears to be built). What the hell, Microsoft?

~~~
cesaref
Thanks for the spot of the monaco bug - that's a regression that we'd
previously fixed. It's been patched and re-deployed and should work now.

~~~
yellowapple
Confirmed; still doesn't scroll _smoothly_ (or at least as smoothly as most
other things in Firefox), but it at least does scroll now, so that's good
enough for me. Thanks!

------
jchook
Any info on the motivation for making an entire language instead of a library
for an existing language (e.g. for C, Python, or Go)?

Especially if the syntax mimics C-like languages, what important advantages do
we get?

~~~
julesrms
We pre-emptively answered this inevitable question in the overview doc:
[https://github.com/soul-
lang/SOUL/blob/master/docs/SOUL_Over...](https://github.com/soul-
lang/SOUL/blob/master/docs/SOUL_Overview.md)

The main TL;DRs are:

\- this needs to get JITed to compete with C++ performance, so dynamic and
interpreted languages are out.

\- it needs to stop people doing anything which is real-time unsafe, so any
language which involves a heap or GC is out

\- it needs to be secure enough to not pose a security risk if deployed to an
embedded bare-metal device, so C is out.

\- it needs to be super-easy to learn for all programmers, and especially for
grizzled old C/C++/Javascript/C# people who aren't into any of that fancy
functional nonsense

\- it needs to strongly enforce and represent a graph structure at a syntactic
level, so.. pretty much all existing languages are out.

~~~
jcelerier
> \- it needs to strongly enforce and represent a graph structure at a
> syntactic level, so.. pretty much all existing languages are out.

... except languages designed for real-time signal processing based on
dataflow graphs such as Kronos
([https://www.mitpressjournals.org/doi/pdfplus/10.1162/COMJ_a_...](https://www.mitpressjournals.org/doi/pdfplus/10.1162/COMJ_a_00330)),
Céu ([http://www.ceu-
lang.org/chico/ceumedia_webmedia16_pre.pdf](http://www.ceu-
lang.org/chico/ceumedia_webmedia16_pre.pdf)), Antescofo
([https://hal.inria.fr/hal-01585489](https://hal.inria.fr/hal-01585489)) and
the oldies such as SIGNAL, Lustre, Esterel, etc... :p

~~~
julesrms
OK, fair point! Maybe a better way for me to phrase what I meant there would
have been "pretty much all _mainstream_ languages are out"

------
sletz
Concerning Faust-to-SOUL support, it is still reserved for people not afraid
of installing and compiling Faust from github: [https://github.com/grame-
cncm/faust](https://github.com/grame-cncm/faust)

Then a faust2soul script can be used to directly compile Faust DSP to SOUL
source code: [https://github.com/grame-cncm/faust/tree/master-
dev/architec...](https://github.com/grame-cncm/faust/tree/master-
dev/architecture/soul)

To be tested, the generated SOUL code can then simply be copy/pasted in the
SOUL playground.

------
deltron3030
How are the relationships with Ableton who are also in the Web Audio space and
users of Juce?

They've built a Music Learning platform with Elm (afaik):
[https://learningmusic.ableton.com/](https://learningmusic.ableton.com/)

Elm wants to target WebAssembly, wouldn't it be able to compile to Soul too in
theory?

~~~
julesrms
I've not seen the Ableton platform, but the Faust guys have already released
Faust-to-SOUL support, and we're hoping it'll make a really good back-end for
that kind of thing (of which there are many examples)

------
gugagore
I hope there's some benefit to other domains that rely on real-time signal
processing, like control systems. I would like to have something like this for
robotics.

~~~
julesrms
We come from an audio background, but all the way through developing the
project, we've been saying "...I bet this is useful for some other domain that
we know nothing about.." so have been careful to make it about signal
processing in general, not for only audio.

Yes, could be that it works really well for machine control, robotics, etc.
Hopefully as it gets more established, people from those worlds will get
involved and see what happens.

------
jarmitage
More background:
[https://www.youtube.com/watch?v=-GhleKNaPdk](https://www.youtube.com/watch?v=-GhleKNaPdk)

------
julesrms
This has been a great thread, thanks for all the comments!

One final note I'd like to add is that we've also been running a closed early-
adopter group for industry insiders, where we're sharing some other non-web
tools including our LLVM JIT engine and C++ generator, and discussing
partnerships etc.

If you represent a company that think should join this group, ping me and let
me know..

------
_pmf_
There's also ChucK:
[https://chuck.cs.princeton.edu](https://chuck.cs.princeton.edu)

~~~
laurentoget
chuck was really interesting but has been pretty much abandoned, as far as i
know...

~~~
cozzyd
[https://github.com/ccrma/chuck](https://github.com/ccrma/chuck) doesn't look
super abandoned to me...

------
iafrikan
This soup is great but need to understand a bit more. Does it allow for
manipulation of audio using code? Use case examples?

~~~
iafrikan
*This is great

~~~
ryanfchase
The soup is also great.

------
lukejduncan
Dumb question -- but what exactly is an audio programming language? Google
seems to be failing me.

I can make some guesses by looking at the example in OPs link. But what is the
primary goal of an audio programming language? Who's using it? How?
Alternatives?

Genuinely curious.

~~~
detaro
A programming language specializing into generating audio. Where environments
like Processing or the languages used for GPU shaders are designed to generate
pixels (the former at a high level, the latter at a very low level, targeting
specialized hardware), these languages are for making music and sounds.

------
billfruit
I think csound is mature system for programmatic generation of sound/music.
How is this different from what csound is offering?

~~~
julesrms
This is about building a cross-platform infrastructure that would sit _below_
things like csound, Faust, and many other similar front-ends, and allow them
to emit code that'd run optimally on hardware platforms other than just a
desktop CPU, to get better latency and performance.

...and without wanting to "throw shade" at csound or anyone else, we think the
SOUL syntax is _much_ nicer to write of course :)

------
52-6F-62
I'm not sure if this is just related to my machine, but I couldn't get it to
compile.

    
    
        POST https://media.noise.fm/soul net::ERR_CERT_AUTHORITY_INVALID
    

(this looks very cool and I want to try it out)

~~~
ttoinou
Try http. Also try Chrome; I think it doesn't work on my Firefox

~~~
52-6F-62
Hm. I was in Chrome, and thought maybe it was one of my extensions (HTTPS
Everywhere, Adblock), but no.

Tried in FF as well and got CORS errors.

------
sagichmal
This is cool.

Can I have it against CoreAudio or Pulse or anything other than WebAudio?

~~~
julesrms
Have a read of the FAQ and overview docs, or watch the talk:
[https://github.com/soul-lang/SOUL](https://github.com/soul-lang/SOUL)

The browser-based stuff is just a demo to let people explore the language and
learn about what we're trying to do. The actual goal is to create the fastest,
lowest-latency infrastructure for audio on all platforms.

