repl-looper
project name: repl-looper
project url: https://github.com/awwaiid/repl-looper
author: awwaiid
description: mash of REPL and looper; a live performance code sequencer
discussion url: https://llllllll.co/t/51485
tags: sequencer looper grid keyboard

Norns REPL-LOOPER

Anagogically integrated UI for Norns / Matron / Grid

Experimental performance and creative tool, mashing together several things that I like. REPL (Read-Eval-Print-Loop, a code execution console) for interactive code creating. Grid to have a tactile UI (maybe we’ll throw in a midi pedal too). Dance between sound-generating code, recording commands, looping, slicing, mixing, generating tools and patterns on the fly, and maybe make some self-modifying loops.

Check out the dev branch and dev branch development journal for ongoing development work. The main branch is the current “stable” (haha) version.

Recent Releases

Installation

Install directly from maiden or by running this in the maiden/matron console:

;install https://github.com/awwaiid/repl-looper

Then start repl-looper on the norns.

There are two primary ways to control repl-looper – A USB keyboard and a Monome-Grid. The keyboard is for typing in live code that gets executed, the Grid for visualizing and sequencing events.

BONUS interface: A USB/Midi foot pedal! You can use this to select the current loop and start/stop recording!

Basic Usage

The workflow is similar to maiden’s REPL - you run Lua commands and see the results. Besides being on the norns directly, the other big thing you get is a tiny DSL, Domain Specific Language, which are some nice built in shortcuts for doing some loop manipulation.

Let’s get started! First, verify that everything is running with some simple math, type in:

2+2

Which should output 2+2 -> 4 (give or take). You can see both the input and the result. While you can run any Lua commands you want, repl-looper comes with a built-in engine and a bunch of tools. The built-in engine is a mash-up of Timber, Goldeneye, and Molly the Poly, along with some lua wrappers. Try these commands:

-- Timber piano shortcut
p
p'c'
p'd'
p(68)

molly:note(60)
molly:randomize()
molly:note(62)
molly:stop()

Press <tab> for some completions. You can press <up> or <down> arrows to select previous commands or tab-completion choices. Press <enter> without any command to run the previous command again. You can use <left>, <right>, <home>, <end>, and <backspace> to do some light editing.

Next thing to play with is loops/sequences. There are 8 pre-defined 16-step loops, one for each row, put into variables a to h. Start by recording into loop a:

a:rec()

Loop a is now playing and recording! You can see the current step and steps with recorded events on the grid. Now run:

p'c'

Wait a bit, and then run:

p'd'

The loop is playing and will wrap back around at 16 steps and keep recording, so if you add more events they stack up on top of each other. Now try:

a:stop() -- this stops recording but keeps playing
a:stop() -- stop again to also stop playing

At this point press some of the grid buttons to trigger all the events recorded at that step immediately (this ignores their sub-step timing). Here are a few more things to try:

a:show() -- show the loop contents
a:play() -- start loop again
a:clear() -- erase loop contents

Now that you have the script running on norns and everything working, read through the Usage Reference below and Techniques to get more some ideas!

The Grid

repl-looper-grid

The Grid visualizes the loops, their content, and their current status.

Resources

Fullish Usage Reference

UI

Library and Live-Coding Helpers

There are a lot of pre-defined variables, functions, and objects to make live-coding with repl-looper convenient. These have been built organically based on usage, suggestions are welcome! In particular tab-complete-friendly prefixes for method names could be improved.

Pre-defined variables/functions

Loop

There are 8 pre-defined loops, a, b, c, d, e, f, g, and h. Each loops is assigned to a row on the grid. So a is on the first row and h is on the bottom row.

Here we use loop a as the example, but you could run these commands on any loop.

Engine wrappers

BONUS: all object wrapper

Development

I made a fancy script that rsyncs changes to the lua files when you save:

# Auto-push to norns
./util/watch-sync.sh

I also like to run VNC so that I can have it all on my laptop. I have a modified version of framebuffer-vncserver (the upstream one was causing weird screen glitches) which I run on the norns:

cd local/framebuffer-vncserver/build
./framebuffer-vncserver -k /dev/input/event0

And then locally the best client I found was the proprietary RealVNC client; it did the scaling without blur the best. I’m still not sure how to get rid of the local X cursor. Bleh.

vncviewer EnableToolbar=0 SecurityNotificationTimeout=0 ColorLevel=full SendPointerEvents=0 norns.local:5900

Future Ideas

Shout Outs!