Skip to content

Commit

Permalink
Merge pull request #6 from cachilders/feat-sample-events
Browse files Browse the repository at this point in the history
Feat sample events
  • Loading branch information
cachilders authored May 19, 2024
2 parents 31bea5c + 0502d99 commit 13b2f5d
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 5 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,18 @@
# lemniscate
an 8-track-cassette-inspired looper for norns

![lemniscate screenshot](./assets/lemniscate.png)

## In a few words
It's a stereo looper (softcut-based) with an adjustable length between four seconds and five minutes, forty-eight seconds. From there, it's conceptually based on the operation of an 8-track cassette, such that a four minute loop is one minute of tape with four "programs" running in parallel. One can hop the play/record head from program to program, maintaining the relative position.

That's it. Simple looper with a little trick. Control for playback amplitude, overdub iteration amplitude, and LPF are in params. There's also a param for mixing in 8-track player noises authentic, if cloying, nostalgia and feedback.

- ENC 3 adjusts loop length (non-destructive)
- K2 plays and pauses
- K1 + K2 records and halts recording
- K3 selects the next program
- K1 + K3 stops playback and recording, jumping the counter to the start
- K1 + K2 + K3 clears the buffer without affecting playback/record status

That's all, folks.
Binary file added assets/lemniscate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 19 additions & 1 deletion lemniscate.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
-- lemniscate
-- enc3 -> loop length
-- k1 + k2 -> toggle record
-- k2 -> toggle play
-- k1 + k3 -> stop all
Expand Down Expand Up @@ -134,6 +135,13 @@ end
local function toggle_play()
playing = util.wrap(playing + 1, 0, 1)


if _bin_to_bool(playing) then
engine.play('eject', params:get('lem_skeuo_amp'))
else
engine.play('insert', params:get('lem_skeuo_amp'))
end

for i = 1, 2 do
softcut.play(i, playing)
end
Expand All @@ -144,6 +152,8 @@ end
local function toggle_record()
recording = util.wrap(recording + 1, 0, 1)

engine.play('record', params:get('lem_skeuo_amp'))

for i = 1, 2 do
softcut.rec(i, recording)
end
Expand All @@ -170,7 +180,7 @@ local function stop_all()
softcut.rec(i, 0)
end

engine.play('eject', 1)
engine.play('eject', params:get('lem_skeuo_amp'))

position = 1
program = 1
Expand All @@ -182,6 +192,8 @@ end
local function program_select(n)
local segment_position = position - get_program_offset()

engine.play('program_select', params:get('lem_skeuo_amp'))

if n then
program = n
else
Expand Down Expand Up @@ -306,8 +318,14 @@ function key(k, z)
elseif k == 2 and z == 1 and shift then
alt = true
elseif k == 2 and z == 0 and not shift then
if _bin_to_bool(playing) and _bin_to_bool(recording) then
toggle_record()
end
toggle_play()
elseif k== 2 and z == 0 and shift then
if not _bin_to_bool(playing) and not _bin_to_bool(recording) then
toggle_play()
end
toggle_record()
elseif k == 3 and z == 0 and not shift then
program_select()
Expand Down
2 changes: 1 addition & 1 deletion lib/engine/Engine_Lemnisc8.sc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Engine_Lemnisc8 : CroneEngine {
SynthDef(\Lemnisc8, {
arg amp=1.0, buf=0, loop=0, t_trig=1;
var sample = PlayBuf.ar(1, buf, trigger: t_trig, doneAction: 2);
Out.ar(0, Splay.ar([sample]));
Out.ar(0, Splay.ar([sample]) * amp);
}).add;

context.server.sync;
Expand Down
2 changes: 2 additions & 0 deletions lib/engine/lenmisc8_engine.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
-- Nothing here. Boilerplate just in case.

local Lemnisc8 = {}
local ControlSpec = require 'controlspec'
local Formatters = require 'formatters'
Expand Down
12 changes: 9 additions & 3 deletions lib/parameters.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ local loop_parameters = {
}

function Parameters.init(set_param)
params:add_group('lemniscate_loop', 'LEMNISCATE (loop)', #loop_parameters)
params:add_group('lemniscate_loop', 'LEMNISCATE', #loop_parameters)
for i = 1, #loop_parameters do
local parameter = loop_parameters[i]

Expand All @@ -36,9 +36,15 @@ function Parameters.init(set_param)
parameter.formatter
)
end
params:set_action(parameter.id, function(val) print(parameter.id);set_param[parameter.id](val) end)
params:set_action(parameter.id, function(val) set_param[parameter.id](val) end)
end

params:add_group('lemniscate_ux', 'LEMNISCATE (ux)', 1)
params:add_control(
'lem_skeuo_amp',
'Skeuomorph Amp',
ControlSpec.new(0, 1, 'lin', 0, 0),
function(param) return quantize_and_format(param:get()*100, 1, '%') end
)
params:bang()
end

Expand Down

0 comments on commit 13b2f5d

Please sign in to comment.