VRAPL (2017)

VRAPL is a block-based sculptural programming language. It is used from within VR to manipulate the virtual world around you. It can be used to generate streams of audio for playing out loud and for controlling the physics of the virtual world objects. Its motivating goal was to enable the user to fully program the virtual world with sound.

Demos

Self-Playing Bongo; Portals

One way that audio can control the world: a bongo that makes sound when it is hit + a drumstick that's levitated with a square wave.

Don't forget that the programming language is just one augmentation of the view of the virtual world (AVR!) -- step through a portal to hide the programming language and just see a world that behaves as you have programmed it.


Wires

What if you're creating a program for frequency modulation? If you insert the sine wave directly into the frequency slot, then you wouldn't be able to pick it up and look at it without breaking the connection.

The solution: wires! You can connect anything to anything, and the wires don't physically obstruct anything. You can reverse the direction of the wire, if you made a mistake in setting it up, or you can delete the wire if you don't want it to exist anymore!


Functions

One of the main affordances of functions is encapsulating functionality. Here, I've made that literal by making a function an actual room you can teleport inside of. It has a porthole you can peek through, and if you put your head all the way through then you get inside the porthole.

Functions have arguments, which are named according to their blocks (in VR, no one can hear you... type?).

But, the real magic of functions is having an archetype of a specific functionality, that when you make changes to it, all instances of it update to reflect the changes. All blocks can be cloned in VRAPL, but when you clone a function, then update its clone, the original and all the clones update themselves too to reflect the new function definition.


Audio Comments

Comments are an essential part of programming. They help us remember what we were thinking when we come back to our code later on.

In a non-textual medium, why should comments be text, or even visual at all? This is an example of an audio comment.

Eventually, your programmed world will become a sound-garden of comments. (If you practice "good coding style"! :) )


Graphs

One simple way that audio can affect visuals is by building audio visualizers. Here, I've built a time domain visualizer, useful if you want to debug a control signal to see what it looks like.


Events (1)

Not everything in the world is a continuous signal. Another set of programming blocks to explore is event-driven blocks. (Strongly-timed down to the audio sample, of course!) These blocks show their behavior: visualizers change color when they receive an event; a "wait" block uses a pipe metaphor showing input and output events; and the event clock that produces events shows both when it produces an event and how quickly it's doing so at the moment.

Of course, this is all programmable (or it should be...!) using the rest of the blocks in the language. For example, you can change the clock speed according to the height of your hand.


Events (2)

You can also use events to drive physics in the world! Even more fun than that, you can use blocks that send out multiple events for every event they receive in! Here, I use this block to make a bongo that hops to (roughly) the height of my hand. Like a cute little pet.


Events (3)

There's also a block for only sending out an event every N you receive in. This block's color gets more and more saturated the more events it receives, in the spirit of programming blocks being transparent about their state.

Here, there's a bongo that hops continually, and also occasionally takes a hop away from you. It's trying to be sneaky.


Events (Collision Response)

Events don't have to come from a clock – they can also come from things happening in the world! Here, I make a bongo jump up every time it's collided with to make a new kind of bouncing bongo. (Something is buggy in my collision detection somewhere, so it behaves a bit inconsistently... :) )


Future of the Project

This project has been suspended temporarily as I learn more about what kinds of things people might like to create in VR. Let me know if you have any bright ideas!