Skip to content

defaultxr/cl-renoise

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 

Repository files navigation

cl-renoise

This is a Common Lisp library to interface with Renoise. Currently in very early stages of development; not much functionality is written yet.

Setup

  1. Put cl-renoise in your quicklisp local-projects (it is not on Quicklisp yet).
  2. Enable OSC in Renoise. Edit->Preferences->OSC->Enable Server. Make sure “Protocol” is set to “Udp”.
  3. Load the library. If Renoise is running on another host or you changed the OSC port, set those variables:
    (ql:quickload :cl-renoise)
    
    (setf renoise:*renoise-host* #(192 168 0 24)) ; If Renoise is running on 192.168.0.24. If it's running on the same computer as Lisp, you can skip this step.
    
    (setf renoise:*renoise-port* 8000) ; Not needed if you use the default port of 8000.
        
  4. That’s it! You can now interact with Renoise from Lisp.

Usage

Evaluate Lua in Renoise

(renoise:evaluate "renoise.app():show_warning((\"Hello from Lisp!\"))") ; Send Lua code to Renoise.

(renoise:warning-dialog "Hello again :^)") ; Show a warning, as above, but more conveniently.

Edit the song

(renoise:edit :pattern 0 :track 1 :line 0 :column 0 :note 70) ; Set the first cell to be MIDI note 70.
;; (Note that patterns, lines, and columns start from 0, while tracks start from 1.)

Start/stop notes

(renoise:note-on 48) ; Start playing the current instrument.

(renoise:note-off 48) ; Stop playing it.

Start/stop the song

(renoise:start) ; Start playing the song.

(renoise:stop) ; Stop playing it.

Receive OSC messages from Renoise

If you want to be able to receive OSC messages from Renoise, run initialize-osc-replier to set it up on the Renoise end, and start renoise:receiver in a thread on the Lisp end.

(renoise:initialize-osc-replier) ; Allow Renoise to send OSC to Lisp.

(ql:quickload :bordeaux-threads) ; Load Lisp's de facto threading library.

(bt:make-thread 'renoise:receiver :name "Renoise receiver thread") ; Make an OSC receiver thread to catch incoming messages.

You can then use add-reply-handler and remove-reply-handler to delegate OSC messages to functions.

(defun handle-blah (param) ; Define a function for processing received /blah OSC messages.
  (format t "Received /blah OSC message: ~S~%" param))

(renoise:add-reply-handler "/blah" 'handle-blah) ; Set an OSC handler for /blah messages.

(renoise:send-reply "/blah" "Howdy!") ; Make Renoise send an OSC message to the Lisp process (which will be handled by the /blah handler).

(defun handle-other (&rest msg) ; Define a function for processing other received OSC messages.
  (format t "Received OSC message: ~S~%" msg))

(renoise:add-reply-handler t 'handle-other) ; Add a catch-all reply handler that will be run when no other handler matches the message.

(renoise:send-reply "/foobar" 99 23.0) ; Make Renoise send an OSC message to the Lisp process (which will be handled by handle-other).

Related projects

cl-patterns is an algorithmic sequencing library for Common Lisp. Patterns generate sequences of numbers or values, and music is sequenced by composition of patterns.

A Renoise backend based on cl-renoise is being developed, which will allow you to import and export Renoise patterns.

(Unfortunately it is not possible to actually control Renoise as a synthesizer, since Renoise seems to ignore OSC time tags.)

Lua Common Lisp is an implementation of Common Lisp targeting the Lua language. The goal of this project is to provide an implementation of Common Lisp that can be used wherever an unmodified Lua VM is running.

LCL is not a Common Lisp to Lua compiler. LCL has a Common Lisp to Lua compiler. LCL is an implementation of Common Lisp that happens to be running on Lua.

Fennel is a programming language that brings together the simplicity, speed, and reach of Lua with the flexibility of a lisp syntax and macro system.

Fennel is basically a lisp-like language that compiles to Lua. It is not compatible with Common Lisp, but it’s certainly much nicer than writing Lua directly.

SuperCollider and Renoise extensions that allow better integration between the two tools.

Maps SynthDef’s to Renoise instruments such that they can be sequenced/played/recorded in the manner of any other Renoise instrument, and provides quick access to all of Renoise’s OSC commands.

SuperCollider Renoise event type example that allows you to easily generate patterns which will be played by Renoise. Useful if you want to make patterns with VSTi.