maybe i’m misunderstanding, but it seems like you should be able to do this with variations of something like

function change_param(some_param, value) 
	if params:get(‘related_param’) ~= value then 
		params:set(‘some_param’, value)
	end
end

as far as i know you should be able to stick that kind of thing throughout the script and even in the params:set_action function and it should work?

Well, I’ve decided to take a different approach, but in this case I was trying to use the parameters menu to change the crow input event handlers. So I have something like:

  params:add_option('crow_input1', 'crow input 1', {'reverse', 'hold', 'clock'}, 1)
  params:add_option('crow_input2', 'crow input 2', {'reverse', 'hold', 'clock'}, 2)

and then the crow change events will behave differently depending on which option is selected.

I know I could check if crow_input1 is set to a given option, and then prevent crow_input2 from doing anything if it is set to the same option, but my question is if there is an easy way to literally remove that option from the list in the parameters menu for crow_input2 if it is selected for crow_input1, so it is impossible for the user to select it, and then add it back once it is deselected.

I was imagining calling something like params:update_option('crow_input1', newOptions) (which I know doesn’t exist in the current paramset API)

I’m likely overcomplicating things though, and I suppose I don’t really need to do this if I just do a similar check to what you wrote above.

I also decided I can just have both inputs use different sets of options if I don’t want them to be set to the same things, but I can imagine other use cases where the behavior I’m describing might be desirable, like having multiple modulation sources with configurable destinations where you may always want a 1-to-1 src -> destination relationship

i don’t think that will work without a lot of hacking of the option and maybe paramset internals. (e.g., option params assume that their option set will not change after instantiation.)

the action system is flexible enough to implement ‘radio groups’ pretty directly.

here’s an untested example of a helper class that modifies a list of option parameters such that when any one is updated, any other that shares the new selection will update to select an arbitrary ‘fallback’ value.

RadioParams = {}

-- create a new radio parameters group
-- @param params: list of option parameter specs that you want to 'radioize'
-- @param fallback: "none" or "deselected" index to fall back on
-- @return: list of parameter specs with updated action funcs

RadioParams.add_params = function(opts, params)
   local n = #params
   for local i=1..n do
      local act = params[i].action
      -- create a wrapper function that checks all the other params in the group
      params[i].action = function(x)
	 -- check if any of the other params is equal to `x`
	 for local j=1..n do	   
	    if params[j]:get() == x then
	       -- if so, set that param to the "fallback" value
	       params[j]:set(fallback)
	       act(x)
	    end
	 end
      end	    
   end
   return params
end


return RadioParams
2 Likes

thanks for that! the “fallback” approach is a good solution for this, and I’ll likely end up using it in the future.

Hi :slight_smile:

I’m back with more silly questions, but this time I feel like I once knew the answer but I’ve looked everywhere and can’t find where the answer was, this thread is a monster.

I was wondering,

Is it possible to connect the norns via usb and have it being detected as a midi device?

And listen to the incoming midi events?

Right now I open a serial connection and send UDP events which are basically midi data, but it feels really silly, ideally if I could have the norns show up as a midi device when I connect it to my computer, that would be huge for me.

the only thing norns can be via the mini-usb power connector is a usb-tty interface (because it has an FTDI uart on the hardware).

one solution to do what you want is to use a midi host-host solution… there are a few threads here about this.

edit for link: How to sync two USB MIDI hosts

aaah right, I wasn’t sure if it was possible or not, but yes I remember now that usb-tty is all that’s allowed ever at once.

I don’t want more midi dongle bits right now.
Thanks for the quick answer!

you could hack a couple programs together to connect via tty and convert midi… but it wouldn’t be a class compliant solution

That’s pretty much what I do at the moment, I have a python udp listener that just passes the 3 midi bites over to the repl.

1 Like

I’m hitting an issue where if I have an error in my code within redraw() various parts of norns seem to break outside my script, anyone else hit something like this?

LuaFormatter

@tehn, @zebra; I’ve been working on adding LP Pro suppor to the midigrid codebase, and I noticed something really odd in awake 2.2.0; @ L199 we’ve got if g then, but I always get a stub table back, even with nothing connected, in which e.g. device = nil and name = none, and I can see e.g. loom 1.0.5 @ L893 uses (essentially) if grid_device.device then

tldr; What’s the correct way to check for a grid?

FWIW, I’m on fates 191230

real quick, i think awake is out of date, now grid.connect returns a vport and the correct way is to check device (i’ll try and remember to verify this later)

Hello all,

Had a curious problem with my pmap file for Benjolis (https://github.com/scazan/benjolis). I updated the script to include a few more parameters at the top but had a MIDI parameter mapping already set for my 4th line parameter (in this case “freq 1”).

The problem occurred when I added a new parameter to the top pushing “freq 1” down to the 5th line and a separator into the 4th position. This made my “freq 1” parameter no longer work (actually it just made all of my MIDI controls off by one). No problem, I remapped the “freq 1” parameter to the correct knob but, while it would show the proper MIDI CC number in the menu, it would not work.

I noticed that for some reason, since the pmap file was set previously with “freq 1” at index 4, it would never change… so I couldn’t remap that CC number to that parameter again without deleting my pmap file.

Easy fix for me but worried about pushing an updated release as it might cause errors for people who have mappings.

Is this a bug or is there a good way to deal with this?

EDIT: Actually it seems like it is just a matter of unmapping any already mapped CC numbers. Editing the pmap file equally works.

DOUBLE EDIT: Ok, I see that the pmap is always written by index in lua/core/menu/params.lua. I’ll take this to github

@scazan that’d be this old issue: https://github.com/monome/norns/issues/600

1 Like

made a gh issue but cross-posting here since it’s a documentation thing !

3 Likes

I’m looking at the norns scripting tutorials, but I’m getting engine missing errors.
Is there a way I can load in the PolySub or TestSine engines from the Maiden package manager?

those are part of the we repo. so update that one from the base collection.

That makes sense, and that’s where I thought. I just realized that I didn’t reboot norns after I re-installed it! Thank you!

Here’s some questions I’ve come up with tinkering with softcut:

Does that buffer start at 1 or 0 ? Starting at 1 would be more inline with Lua conventions, but buffer position is specified in seconds, so starting at 0sec makes some sense too?

Is there a way to slew the panning without re-implementing a slew function in my script? (Softcut feature request?)

Is there any reason that buffers get “stuck” on script (re)start from maiden?

(Update: two more softcut questions)

Is there a way to get the length of a loaded file?

Is there a way to get the current output level of a voice? i.e. envelope follower mentioned in another thread…

And more general Norns than Softcut, For a static background, is it better to draw a bunch of polys on every frame, or draw them once and write them to a PNG & then load the PNG every frame?