Alga: interpolating live coding environment

Hello everyone!

I have just decided to finally publicly share a project that I have been working on for a while, and I thought this would be a good place to share it.

Alga is a new language for live coding that focuses on the creation and connection of sonic modules. Unlike other audio software environments, the act of connecting Alga modules together is viewed as an essential component of music composing and improvising, and not just as a mean towards static audio patches. In Alga , the definition of a new connection between the output of a module and the input of another does not happen instantaneously, but it triggers a process of parameter interpolation over a specified window of time.

As of now, Alga only exists in the form of AlgaLib, an extension for the SuperCollider environment. While AlgaLib contains all the core features of Alga, I also plan to build a custom syntax on top of the audio implementation (similarly to what TidalCycles does with SuperDirt).

To install AlgaLib, you can either:

  1. Use the Quarks system: Quarks.install("https://github.com/vitreo12/AlgaLib")
  2. git clone this repository to your Platform.userExtensionDir.

These are a couple of very basic examples that should show some of the features of Alga:

Check the Help files and the Examples folder for usage and examples!

Let me know what you think and if you have any questions!

Have a great day :slight_smile:

10 Likes

Hi!

I guess you’re planning to organize algaraves… :roll_eyes:

I’m a noob, so I don’t understand clearly “Unlike other audio software environments, the act of connecting Alga modules together is viewed as an essential component of music composing and improvising, and not just as a mean towards static audio patches.” Looking at compositions in SC, connecting synths is generally essential.

Triggering interpolations “as of now” is a relevant need for me. I had the idea of doing an overlay for GLSL shaders that just does that, because the only uniform we get is the time since startup, so it’s difficult to make transitions from a unknown point in time during performances. TidalCycles already has some transition functions.

My two cents for your potential, own live coding env: do not do a custom syntax, because nowadays programming is not only about writing text, but also about having extra tools to make you write more comfortably. TidalCycles is a Haskell library, thus you can use any editor with Haskell addon to have syntax coloration, autocompletion, etc. for free, and then one can make a custom grammar which inherits the Haskell grammar to add coloration of TidalCycles patterns. Yaxu is making a custom editor with fancy visualizations, but you can use it for writing plain Haskell as well. In the same way, FoxDot is a Python library with a custom editor, SonicPi is a Ruby library with a custom editor, etc. and they all rely on SC for synthesis. Besides, you also get for free all the features of the host language: loops, conditionals, subprocedures, maybe async processing, libraries, etc. In brief, I encourage you to find a language that you like and extend it, rather that doing your own.

1 Like

Thank you for your answer!

I guess you’re planning to organize algaraves… :roll_eyes:

That’s a good pun, I might have to start using it :slight_smile:

Looking at compositions in SC, connecting synths is generally essential.

It surely is, and that is what Alga leverages. However, I would define the default connection of synths in SuperCollider as static, as it is with Max, PD, or any other environment I know of. What I mean by static is that there is a discontinuity between the sound before a connection (e.g. the value 440) and the one after the connection has been made (e.g. the value 220, after calling the set method). JITLib solves the issue with the xset methods by creating a new Synth and fading its volume in, while fading the old one out. On the other hand, Alga keeps the Synth running, but interpolates the values of the connections themselves, resulting in a smooth transition (however long).

In any case, I see where your confusion might come from. In its current state Alga is best described as a live coding environment within SuperCollider (I have modified the title of the post to reflect this). The language around Alga has not been developed yet, but it will be the next step for me.

I have experience in creating programming languages for audio programming (see Omni), so I am well aware of the pitfalls that creating new syntaxes might bring. However, I also believe that specific features need specific languages to reflect the uniqueness of that feature, as I think Alga’s interpolation is.

TidalCycles already has some transition functions.

That is surely true, but Alga is definitely not aiming at being a substitute of TidalCycles: they have completely different approaches to live coding. Alga promotes interpolation between connected modules running at any rate (both audio and control), as well as pattern interpolation, where each pattern element can also be any other AlgaNode (Alga’s modules). On the other hand, TidalCycles is a pattern language, whose focus is only on patterns. There is no concept of audio modules within it.

In a way, as mentioned, Alga is much similar to JITLib, with 4 main differences:

  1. Alga takes care of converting the rate of any parameter accordingly, giving the option of “patching anything to anything” that modular synthesizers have.

  2. Alga takes care of not only mapping inputs of a module (via the NamedControl syntax), but also its outputs (see AlgaNode's and AlgaSynthDef's help files to see what I mean here, togehter with the Examples folder).

  3. Alga takes care of ordering all the nodes in the server so that no audio delay is introduced when patching modules together (unless feedback connections are introduced, as shown in the Examples folder).

  4. Alga does not fades audio in and out when making new connections, but effectively interpolates the contents of the connections over specified windows of time.

4 Likes

aaah the delay issue is one the things that has kept me from being able to use JITlib for certain things!

excited to try this out!

also: wow the pattern interpolation is fascinating

1 Like

I would not fully agree. “Programming” has one set of goals; live coding has a different set of goals. They overlap, but it isn’t reasonable to assume that what is good for “programming” is also necessarily good for a specific live coding project’s goals.

Most(?)… or at least many… programming languages prioritize stability and future maintenance over immediacy and convenience. Onstage, a tool that’s oriented toward writing things in a way that is legible/maintainable 5 years from now may be a hindrance.

Live coding is partly about imagining mechanisms for data representation that are convenient to manipulate experimentally in real time. If a language’s existing syntax discourages such mechanisms, then new syntax may be appropriate.

For example, in vanilla SC Pbind, inserting a note at a specific metric position in the bar requires multiple disparate edits to separate lines in a way that a/ is easy to mess up and b/ doesn’t communicate the intent to a live audience. In my system, I can start with a kick drum pattern "o| o| o|" and insert an unaccented note on the “e” of beat 3 by adding two characters "o| o| _o |" but oh dear, I’ve gone and created new syntax.

The trade-off is indeed access to editing tools. But I wouldn’t accept that the gains brought by new syntax are always trivial. It’s up to the designer of the project to decide the right balance for that project, not for someone to make a global assertion.

hjh

2 Likes

I played with Alga this afternoon and I really, really like the syntax.
I did not encounter any bug, it’s stable.
I’m impressed !
Small FR (for @Spacechild1 or you, I don’t know), it would be cool to be able to use VSTPlugin in an AlgaNode.
Thanks again for making it public !

1 Like

Thanks a lot for checking it out! :slight_smile:

Regarding using VSTPlugin within Alga, it would be great to make it feasible! If it’s working for JITLib, it should definitely work for Alga. I might take a look at it myself when I have some spare time.

1 Like

Yes, VSTPlugin works with JITLib
I tried using the NdefVstController with an AlgaNode, just in case, but it did not work.
Thanks again, alga is definitely worth it !