Introduction

Worp is an experimental sound / music / DSP engine written in LuaJIT, currently in early alpha state.

Example code

The fragment below plays a piano loop with Linuxsampler, adds a wah-wah effect with a LFO-controlled bandpass filter, and plays some simple reverberated percussion in the background:

example.mp3
  j = Jack:new("worp")
  l = Linuxsampler:new("piano", "/opt/samples")
  m = Metro:new(150, 10)
  v = l:add("piano/megapiano.gig", 0)
  n = Dsp:Noise()
  nf = Dsp:Filter { type = "bp", f = 8000, Q = 5 }
  p = Dsp:Pan()
  a = Dsp:Adsr { A = 0, D = 0.03, S = 1, R = 0.05 }
  r = Dsp:Reverb { }
  f = Dsp:Filter { type = "bp", Q = 5 }
  lfo = Dsp:Osc { f = 4 / m:t_meas() }
  
  ns = { 36, 75, 79, 84, 34, 75, 79, 74, 84, 82 }
  
  function loop(i)
  	play(v, ns[i], ns[i] < 40 and 0.8 or 0.6, 1.0)
  	i = (i % #ns) + 1
  	at(m:t_beat(), loop, i)
  end
  
  j:dsp("wah", 1, 1, function(vi)
  	f:set { f = lfo() * 500 + 700 }
  	return f(vi)
  end)
  
  j:dsp("perc", 0, 2, function()
  	return p( r( nf( a() * n() ) ) )
  end)
  
  function click()
  	nf:set { f = rr(8000, 12000) }
  	p:set { pan = rr(-1, 1) }
  	a:set { vel = rr(0.2, 0.8)  }
  	at(0.01, function() a:set { vel = 0 } end)
  	at(m:t_beat() * 0.5, "click")
  end
  
  loop(1)
  click()
  
  j:connect("piano", "worp:wah")
  j:connect("worp:wah", "system:playback")
  j:connect("worp:perc", "system:playback")

Built on LuaJIT

Worp is built on LuaJIT, a Just-In-Time Compiler (JIT) for the Lua programming language. LuaJIT offers the flexibility of the Lua programming language, while delivering near native performance. This allows for low-level DSP code (filters, reverbs, etc.) to be written in a high level language.

Libraries

Worp comes with default bindings for Jack audio and midi, and has built-in support for Linuxsampler and Fluidsynth. A growing library of DSP primitives is provided: oscillators, filters, delays, pitch-shifters, etc.

Live coding

Worp supports live coding through the use of a plug-in for your favourite editor (if your favourite editor is Vim). Code is sent from the editor into the Worp process, where it is compiled and executed without disrupting the current program flow.

Worp is in early development and subject to lots of changes. Expect documentation to be outdated, examples to fail and API's to be different then described.

Running

The Worp source code is hosted on github. Currently there are no official releases available, so get the latest code from Github and hope for the best. There is no 'make install' target, simply start Worp from the source directory.

Check http://github.com/zevv/worp for the latest code.

  $ git clone https://github.com/zevv/worp.git
  $ cd worp
  $ make
  $ ./worp