a thread to discuss softcut on norns 2.0
replaces: Norns 1.0: softcut
now that we have a Norns 2.0 beta, looks like a lot of great stuff has changed with softcut! particularly excited that itās now system-level, which allows it run alongside other audio engines.
I tried updating cranes last night, but I think the combo of the changes and my prior misunderstandings of the original syntax did not make for successful translation.
@zebra, if syntax is not expected to change drastically along the beta phase, would you be able to share a quick āgetting startedā for scripting with softcut?
check out /norns/lua/softcut/halfsecond.lua
i can help look at cranes with you also.
dope, ty
.
for the curious:
-- half sec loop 75% decay
local sc = {}
function sc.init()
print("starting softcut/halfsecond")
audio.level_cut(1.0)
audio.level_adc_cut(1)
audio.level_ext_cut(1)
softcut.level(1,1.0)
softcut.level_input_cut(1, 1, 1.0)
softcut.level_input_cut(1, 2, 1.0)
softcut.pan(1, 0.5)
softcut.play(1, 1)
softcut.rate(1, 1)
softcut.loop_start(1, 1)
softcut.loop_end(1, 1.5)
softcut.loop(1, 1)
softcut.fade_time(1, 0.1)
softcut.rec(1, 1)
softcut.rec_level(1, 1)
softcut.pre_level(1, 0.75)
softcut.position(1, 1)
softcut.enable(1, 1)
softcut.filter_dry(1, 0.125);
softcut.filter_fc(1, 1200);
softcut.filter_lp(1, 0);
softcut.filter_bp(1, 1.0);
softcut.filter_rq(1, 2.0);
params:add_separator()
local p = softcut.params()
params:add(p[1].rate)
end
return sc
I was looking at halfsecond last night, but couldnāt get any action when I tried running it. will revisit tonight and likely will DM.
E, youāre off the hook!
this file (and the other in lua/softcut/) donāt get run directly. they get included into other scripts.
you can live-add these like this
h = require 'halfsecond'
h.init()
basically the important part is this initialization, a series of softcut commands (iāve annotated with comments):
audio.level_cut(1.0) -- softcut master level (same as in LEVELS screen)
audio.level_adc_cut(1) -- adc to softcut input
audio.level_ext_cut(1) -- ext (sc) to softcut input
softcut.level(1,1.0) -- softcut voice 1 output level
softcut.level_input_cut(1, 1, 1.0) -- softcut input level ch 1
softcut.level_input_cut(1, 2, 1.0) -- softcut input level ch 2
softcut.pan(1, 0.5) -- softcut voice 1 pan center
softcut.play(1, 1) -- voice 1 play on
softcut.rate(1, 1) -- voice 1 rate 1.0
softcut.loop_start(1, 1) -- voice 1 loop start @ 1.0s
softcut.loop_end(1, 1.5) -- voice 1 loop end @ 1.5s
softcut.loop(1, 1) -- voice 1 enable loop
softcut.fade_time(1, 0.1) -- voice 1 fade time
softcut.rec(1, 1) -- voice 1 enable record
softcut.rec_level(1, 1) -- voice 1 record level
softcut.pre_level(1, 0.75) -- voice 1 prerec (overdub) level 0.75
softcut.position(1, 1) -- voice 1 set position 1.0s
softcut.enable(1, 1) -- enable voice 1
softcut.filter_dry(1, 0.125); -- voice 1 filter settings...
softcut.filter_fc(1, 1200);
softcut.filter_lp(1, 0);
softcut.filter_bp(1, 1.0);
softcut.filter_rq(1, 2.0);
oh, for sure ā apologies, I wasnāt clear. I took the meaty init bits and threw them into a simple script, but couldnāt get things moving. Iāll revisit, as it was a 10:30pm couch sesh. not always conducive to my best coding work ![]()
also, dang, thank you for the annotations! that is immensely helpful. <3
when you have maiden running check out norns.local/docs and i did some similar/loose comments on the entire softcut API (in case i missed something above)
weāre (@ppqq @okyeron @jasonw22) working on a āprogramming referenceā similar to the TT reference sheets. and iām hoping to get together a new norns study devoted to softcut soon.
just to say, softcut+lua is an total dream come trueā it was the guiding design goal for the entire norns project. now that itās been optimized and refined iām pretty ecstatic @zebra
time for new sounds!+++++++
is it possible to address 2 softcut voices with one command in the maiden repl?
youād have to make your own multi-voice functions ie
function both_positions(x)
softcut.position(1,x)
softcut.position(2,x)
end
but you could also just do:
for v=1,2 do
softcut.position(v,x)
end
where 1,2 are the start/end voice numbers, x is the position/value
New softcut is rad. I thought putting echo on a piano was corny but as a varispeed loop pedal with rec/play toggles itās pretty rad. Recorded a little thing starting with the halfsecond lib and fussing around with maiden params. I think I need a MIDI foot pedal board now.
all HID devices should be usable though you may need trial+error to determine correct event codes for a particular device
[ https://github.com/monome/norns/blob/master/lua/hid.lua ]
this looks interesting too:
If you want to grab my HID demo scripts, you can plug in the footswitch and run the hid-events.lua script and look at the output in Maiden (while triggering the switch). This should get you started to figure out the code the switch is sending. ![]()
Does this look correct? I get a loud buzz when its turned to 1 in the param menu. Would it be better to just turn the volume of the voices down?
function both_enables(x)
softcut.enable(1,x)
softcut.enable(2,x)
end
params:add{type = "number", id = "both_enables", name = "enables",
min=0, max=1, default = 1,
action = function(x) both_enables(x) end}
well, did you do anything else to set the parameters of those voices, as in the halfsecond lib/example? is this on top of halfsecond?
use enable flag if you want to completely stop/start processing per voice (consume no CPU when off). the param mapping looks plausibly correct, but it is probably not something you want to modulate (hard clicks will occur.)
@rdfm youāll need to set a bunch of default param values. just enabling it will mean itās in a somewhat unknown state.
iām not sure when this thread was created, stuff merged &c, but iām seeing a lot of recent reactions to older posts. so, wanted to point out that all my statements before march 2019 refer to a completely different and more limited version of softcut than the current one. specific references to implementation details no longer apply.
see here for current lua syntax to control softcut parameters
[ https://github.com/monome/norns/wiki/syntax-2.0 ]
these map pretty directly to OSC commands understood by the crone audio process:
[ https://github.com/monome/norns/blob/dev/crone/osc-methods.txt ]
Say I wanted to add āhalfsecondā or something similar to a script, but didnāt want it to immediately start up, but wanted to be able to selectively turn it on/off.
How would I go about this?
softcut is a lot of fun! excited for some docs on the parameters, but just changing values and commenting things in and out is a little treasure hunt. here is a super minimal multi-tap ping-pong delay based on halfsecond.
brass synth pulse from a repeating ableton clip running into norns
-- multitap delay using softcut
function init_sc()
audio.level_cut(1.5)
audio.level_adc_cut(1)
audio.level_ext_cut(0)
for i=1,3 do
softcut.level(i, 1.0)
softcut.play(i, 1)
softcut.rate(i, 1)
softcut.position(i, 1 + (.2 * i))
softcut.pan(i, -.5 + (.5 * i))
softcut.enable(i, 1)
end
end
function init()
init_sc()
end
EDIT: just wanted to say this relied on some setup code that half-second had which I didnāt realize I needed. Resetting audio will make this script not work. Iām working on a more sophisticated multi-tap thing right nowā¦will share when thatās finished.
finding some trouble with softcut.buffer_clear() being effective on 190303 ā the command doesnāt seem to work as expected (an immediate clear of all buffers). if anyone is able to confirm operator error or otherwise, please lmk!