dark mode light mode Search Menu
Search

A Whale of a Language

seabamirum on Flickr

What I love about the topic of programming languages is that there are always some unusual ones that make you rethink what programming even is. For this issue, that language is ORCA, created by the artist/programmer duo 100rabbits, a pair famous not just for their fascinating projects that blur the lines between art and code but also for creating all of this computational art while sailing the world in a small boat they restored.

So…what is ORCA? It’s a language that looks more like odd ASCII art than anything else. For example, here’s a tiny program that plays a random melody in the minor pentatonic scale with a regular drum beat.

There are three important concepts when it comes to ORCA. The first is that ORCA is base-36, using 0-z as numbers. This is a weird number system to use, but it allows for really compact programs, in which no piece of data needs to take more than a single square of space on the screen. Similarly, ORCA uses A-Z (plus two special characters) to represent the operators in the programming language and each of these operators has its own input and output. For example, the letter A takes inputs on either side, adds them together, and then spits out the result below. We can chain different operators together, like the clock that ticks up over time, with the addition operator:

Now the final big concept is the : and ; operators that make music need an event to actually fire. The main operator that generates events is the D operator, which creates events directly below itself.

To try out ORCA yourself, I recommend going to orca.wtf where you’ll be able to either watch an example program at work or go to a blank ORCA screen. I recommend listening to the sample song and watching how it moves.

The orca.wtf site has a number of instruments built into it.

These are labeled by the numbers 0 – F. If you want to play one of these instruments you would do something like this,

Meaning that, every four frames, instrument 7 is triggered to play the note A4 (A in the fourth octave). If you try this you should be able to hear the tone play. Now, you can use code to change these parameters. For instance, you can use R to generate a random number to pick an instrument.

The problem, though, is that if you do something like this,

The 4 you’re using to control how fast the D fires is now getting fed in as the left argument of the R, which says what the minimum random number is. That means you’re automatically excluding the first four instruments. This introduces the importance of operators like J that let you pass data downward. You can instead write your code like this:

And, you can now set the minimum to 0 like it should be. I chose to set the max to A because I wanted to only use the more melodic sounding instruments.

This is generally how you build up programs in ORCA. There are not a ton of tutorials out there but there are some good ones on YouTube, listed in the links below. Here’s a really good interactive tutorial: https://metasyn.github.io/learn-orca/

ORCA actually has a lot more potential than just playing music. Technically, it can send messages that can be received by all sorts of programs. For example, there’s an NES emulator that can receive ORCA commands to control the original Mario game.

In conclusion, ORCA is a great general algorithmic art and music tool and might be one of the strangest languages I’ve ever played with.

Learn More

Orca

https://esolangs.org/wiki/Orca

Making a tracker with Orca

https://www.youtube.com/watch?v=nKAjx6n97IY

What is Orca?

https://100r.co/site/orca.html

Orca Website

https://github.com/hundredrabbits/Orca