snake_case is a great name!

Also, that’s a really useful resource, even for earlier in the learning process, to help read other people’s code and know, with a bit more detail, what’s going on.

I was wondering if there’s a way to trigger another function at the end of a loop / clip in softcut- a little like an end of cycle trigger? I guess that you can poll position… say in the situation I wanted to loop twice on a section of the buffer then shift the entire loop bracket after the end of the second iteration - what would be best?

currently you have to poll position.

but i’ve been meaning to (re-)add a simple trigger poll on loop ends. (trigger output was available in old ugen format.) no-one had asked for it yet :slight_smile:

this wouldn’t be hard to add if someone wants to take it on.

https://github.com/monome/norns/issues/871

it’s minimal. no actual serial port traffic is produced if led state hasn’t changed

3 Likes

If you happen to be like me and keep accidentally hitting cmd+[ and cmd+] in Maiden, backing out of the page and losing your changes… First you’ll try and edit the aceeditor implementation’s key bindings, then you’ll realise an easier solution is to make an “app” out of maiden using something like https://fluidapp.com . It’s Mac only unfortunately, but it’s saved me a lot of frustration. Plus it looks a lot cleaner without the browser chrome.

1 Like

How heavy of a lift would it be to use softcut to create a short, glitchy “delay” like that found on the Drolo Stammen? I plan to begin the studies in a couple of weeks and am looking for an initial project. Wondering if this would be level 1 or level 30, so to speak.

1 Like

interesting pedal. you can take a look at tunnels to get an idea. some of the modes are not far off and just a matter of tweaking a few params. feel free to just add a mode or two and send a pull request! (I actually have a few more that I just haven’t added to the repo yet - and I need to check out the new filtering)

I think it’s a good initial project. if you’re like me, most of your time will be spent discovering how the various params work together.

2 Likes

A question for the residents of Nornsville, regarding the UI module.
I’d like to get some simple playback icons, for example using:

UI.PlaybackIcon.new(64, 5, 10, 1)
UI.PlaybackIcon:redraw()

I’ve tried putting these directly into function redraw() at the end of my script and also wrapping them into a function first, but I keep getting the error:

attempt to index a nil value (global ‘UI’)

I’m sure I’m probably getting some syntax wrong here, so has anyone got an easy example of using the UI module I could see? I’d be keen to use some of the dials and sliders from there too!

Are you importing the library?

ah no, should I be?!
edit: I cant immediately find where the module would be imported from in the docs… hmm

Yes you’ll need to bring it into the scope - that’s why UI is presently nil in your script.
UI = require 'ui' is what you’re after

2 Likes

riiight ok, yes that makes sense! thank you :slightly_smiling_face:

Or maybe keep it local?
local UI = require 'ui'
:slight_smile:

1 Like

definitely a good idea

2 Likes

Thanks again for the tips, but still a bit puzzled by this…

So I’ve got:

local UI = require 'ui'

then:

local function pbicon()
  UI.PlaybackIcon.new(64, 5, 10, 1)
  UI.PlaybackIcon:redraw()
end  

but when I call:

pbicon()

I get:

stack traceback:
[C]: in function ‘s_rect’
/home/we/norns/lua/core/screen.lua:119: in function ‘core/screen.rect’
/home/we/norns/lua/lib/ui.lua:529: in method ‘redraw’
/home/we/dust/code/loopzilla/loopzilla.lua:41: in upvalue ‘pbicon’
/home/we/dust/code/loopzilla/loopzilla.lua:175: in function ‘redraw’
/home/we/dust/code/loopzilla/loopzilla.lua:81: in field ‘event’
/home/we/norns/lua/core/metro.lua:165: in function </home/we/norns/lua/core/metro.lua:162>

I’ve never actually used the UI module so am uncertain here - have you found other scripts using it? Worth seeing how they implement it

1 Like

OK, hah, I’ve fixed it. Basically this syntax works.
Thanks again and sorry for the noise! I should probably go to bed now…

local function pbicon()
  hello = UI.PlaybackIcon.new(64, 5, 10, 1)
  hello:redraw()
end
2 Likes

Has anyone worked with unit tests for lua scripts? I’ve been looking a little into it this morning to allow me to work on things without the unit in front of me.

1 Like

I ended up separating out my Norns script into a testable library script and then a front end script that uses it. That way I was able to do a lot of the work on my Mac and run my tests and then just write the Norns integration on the Norns. There’s probably a better way to do this, but you can look here for what I came up with: https://github.com/JakeCarter/circles/tree/master/lib

5 Likes

Thanks! This is the kind of approach I was thinking.

1 Like

Hello, I have a question regarding polls.

I have the following in my function init:

local pl = poll.set(“amp_in_l”)
pl.time = 0.25
pl:start()

All good so far. Next if I try and reference the poll in the script, such as:

local ampin = pl:update()

I get the following error:

/home/we/dust/code/jiffy/untitled.lua:148: attempt to index a nil value (global ‘pl’)

stack traceback:

/home/we/norns/lua/core/norns.lua:190: in metamethod ‘__index’

/home/we/dust/code/jiffy/untitled.lua:148: in main chunk

[C]: in function ‘dofile’

/home/we/norns/lua/core/script.lua:143: in function </home/we/norns/lua/core/script.lua:143>

[C]: in function ‘xpcall’

/home/we/norns/lua/core/norns.lua:191: in field ‘try’

/home/we/norns/lua/core/script.lua:143: in function ‘core/script.load’

(…tail calls…)

script clear

Tried doing this with/without declaring as local etc, but get the same errors… Any ideas?

I basically want to perform an action when the amp_in_l reaches a certain amplitude.

Thanks!