Just wondering if there is an example of slew/lag of values on the lua side of things? I’m imagining something like how the location block works with the survey knob/input in a cold mac. My goal is to apply slew to midi cc values that I am outputting from norns to get some varied but related cc modulation out of a single source of values. I understand that the midi cc won’t be “smooth” but that’s ok for my use case. Thanks!
yeah, I implemented a little lua slew in arcwise.
The function is on line 18 here:
happy to explain how it works if you’d like!
thank you @alanza!!! And thank you for arcwise!
I always amazes me how quickly you’re able to point me in the right direction, but maybe I shouldn’t be anymore haha
Let me try to dig into this and apply it to my script. I’ll get back to you if I have any questions but feel free to explain how it works if you have time and think other people could benefit!
Sure! So the idea is a simple “exponential filter,” the design for which I think I learned from this little white paper. The filtering happens 15 times per second, hence the presence of a 15 on line 28. Associated to each param id, there’s a little datum
object, which has a “delta” value (datum.d
), and a slide
time; according to the website above, you should think of the param’s value as reaching 99% of the intended value after about 4 or 5 times the slide
time. This corresponds to d
being very small.
Anyway, at each calling of the event
function, we use the slide time to determine what size of a “chunk” to bite off of d
and feed out to the param using params:delta()
. Since the user is allowed to remap arc rings to different params on the fly, we check whether the param is still mapped, and if it is not and we’ve reached within 0.001
of our target value, we let go of the datum
, as it’s effectively no longer needed. Incoming turns from the arc get added to the d
value to be filtered.
Came across this today
Neat thanks for posting, I am really drawn in by networked music but tbh I haven’t fully figured out what that is. I mean there is “networked music”, there even is a topic here, but there seems to be a difference between using the capabilities of a networked digital instrument vs. playing together at-a-distance. This paper seems to talk more about the former which is cool!
Just opened my norns!
Until I get a wifi dongle, is there any way to connect to maiden through a wire or something?
EDIT: Very glad I checked the bag the power cable came in, there’s a dongle in there!
On a new Norns, and I cannot power it on. it was running cranes while plugged up, and seems to have drained the battery or gone into a frozen hibernation mode. Is there a way to revive the unit. When I hold down k1 nothing happens and no lights come on in the back. It is currently plugged up.
Hi, small question about the headphone output of the norns. Some people use it for other things than that? In my case, I just tested it as an audio splitter to get the signal from the norns before my effects chain and send it to a filter. It works normally but I wanted to have an opinion anyway. Thanks!
yes you can use it as a normal audio output, though it’s running through an additional headphone amplifier internally so if you want the raw line-level output it’d just use the normal outputs. (if you just want to use a stereo cable though, go for it)
Hi, first post here! Was hoping to get some help with a small part of a script I’m developing. The script is a text editor/compiler that compiles a small subset of a UXN/6502 type assembly language. The text editor allows you to plug in a keyboard straight into norns, write a small script in this language, compile and run it, and save/load it from a file. The goal is a teletype-like livecoding environment.
I’ve run a few tests using Lua’s I/O library and it works outside of norns, but when I try to run it from maiden it returns an error saying “Permission denied”. Is there any way to give a script permission to load and write external files from norn’s file system? Here’s a sorta pseudocode example of the function:
function writeToFile(filename, text)
file = io.open(filename, 'w')
if file then
file:write(text)
file:close()
else --if file doesn't open/can't create a new file
print('file is null')
end
end
Huh. It looks like it should work? I think? are you trying to do this from the Maiden REPL or as part of a script?
Both actually! First I tried it as part of a script executed through Maiden and then I tried it again just in the Maiden REPL to try to figure out what was going wrong. In both cases I got the same “Permission denied” error.
So odd. what kind of filename are you feeding it? it might want a full path to the file.
i do something similar in foulplay and it works…
function savestate()
local file = io.open(_path.data .. "foulplay/foulplay-pattern.data", "w+")
io.output(file)
io.write("v1" .. "\n")
for j = 1, 25 do
for i = 1, 8 do
io.write(memory_cell[j][i].k .. "\n")
io.write(memory_cell[j][i].n .. "\n")
io.write(memory_cell[j][i].prob .. "\n")
io.write(memory_cell[j][i].trig_logic .. "\n")
io.write(memory_cell[j][i].logic_target .. "\n")
io.write(memory_cell[j][i].rotation .. "\n")
io.write(memory_cell[j][i].mute .. "\n")
end
end
io.close(file)
end
function loadstate()
local file = io.open(_path.data .. "foulplay/foulplay-pattern.data", "r")
if file then
print("datafile found")
io.input(file)
if io.read() == "v1" then
for j = 1, 25 do
for i = 1, 8 do
memory_cell[j][i].k = tonumber(io.read())
memory_cell[j][i].n = tonumber(io.read())
memory_cell[j][i].prob = tonumber(io.read())
memory_cell[j][i].trig_logic = tonumber(io.read())
memory_cell[j][i].logic_target = tonumber(io.read())
memory_cell[j][i].rotation = tonumber(io.read())
memory_cell[j][i].mute = tonumber(io.read())
end
end
else
print("invalid data file")
end
io.close(file)
end
for i = 1, 8 do reer(i) end
end
I’ve tried just ‘test.txt’ and ‘~/dust/code/sketches/test.txt’. When I write the former I get a permissions denied error, with the latter I get a ‘directory does not exist’. Maybe I’m formatting the path wrong? I would assume that a simple ‘test.txt’ would just open the file from the current directory (which I assume would be the folder where the script is located, in the case just called ‘sketches’)
aha! yeah it’s expecting the full path to the file. Lua isn’t smart enough to do tilde expansion or relative paths by itself. You can use _path.yadda
(or norns.state.yadda
) stuff as @Justmat suggests to get something that will work