Gwion is a strongly-timed musical programming language inspired by ChucK. In this episode, Gwion’s creator Jérémie Astor talks us through what goes into making a language for making music.
How would you describe Gwion to the average programmer?
It's a programming language meant to be approachable, without leaving advanced concepts aside. More importantly, it's meant to make sound and music.
What problems is Gwion trying to solve?
I always wanted to have a tool allowing me to create new scales/sounds/rhythms either in a purely explorative way or to use in my contemporary music work. I think music is also a great way to teach mathematics. Finally, I wanted to make some research in human (or band, actually) - computer interaction. At one point, I stumbled upon ChucK, which really seemed to fit the bill, but it turned out it was not performance oriented enough for my needs. So I started developing this project.
What makes Gwion unique?
It is very similar in approach to ChucK, in that it's:
Strongly and statically typed
Strongly timed (ability to precisely control the flow of time in code)
Made to make sound
So the key difference here may be performance. But while learning programming in order to complete this project, I eventually came across features I found missing in ChucK, like function pointers and generics. It did go quite a long way and now has some features I did not plan initially, like variadic generics, effect handler and virtual time (a way to handle computation in a timed manner but not synced to the sound card as Gwion usually is).
What's the coolest thing that's been built with Gwion so far?
A company named Amrai that is developing a multi-platform (including arm64) audio software meant to power a hardware audio device contacted me last year and is using Gwion for their project. We have been working together since. This project is very exciting in that it will possibly help people all around the world to make music and that's an achievement that I couldn't probably afford with just my music practice. It is also interesting as a language developer because Gwion is used not only to generate sounds but it also handles the rest of the project, like a general purpose language would.
What are some of the toughest challenges with building Gwion?
I started this project more than six years ago and I had to learn a lot about programming to achieve it. Things like template implementation were very challenging at first. I think the next big challenge will be to implement some fancy memory management strategy, for example, as Lobster does.
What’s next?
I made a simple back-end (dsvm) a while back and I plan to switch to it soon. It has a fast register machine and the ability to run multiple JITs. I'm also working on a SWIG module to help with plugin development.
Where can people learn more?
There are a few sites with short, runnable examples:
Please note that these are pretty WIP and I would love some help here. Other helpful links:
Show us some code!
I love this snippet. It makes use of an embedded language and demonstrates both explicit timing and concurrency.
This one is also nice! It shows how easy it can be to react to HIDs.