another +1 for sublime text… for more ‘involved’ work (or integration) - Linux x86/mac OS

VI for lightweight/quick changes ,or terminal/ssh work, as works on any platform.

1 Like

If my Lua questions should go elsewhere, let me know… In the meantime:

When I’m working with smallish number ranges (like the 1-8 selection for sequences in Walkabout), I would like to have less encoder sensitivity. I found the set_sens function in encoders.lua, but am not sure how to use it. If I put the following in my script:

local Encoders = require 'encoders'
Encoders.set_sens(0, 0.01) -- (should lower the encoder sensitivity for all 3 encoders)

… it doesn’t seem to accomplish anything. What am I missing?

[ddg]

(not sure this is the right place for this!?)

@tehn ,I was playing with Earthsea yesterday (latest build) looking at the midi, as i wanted to play with the new api

I noticed whilst this is working , its not using the new virtual devices, as I could not force it to use a particular midi device - it used all.

my assumption is that the recommendation is to move away from midi_add setting d.event .

rather we should do something like:
(pseudo code, had it working last night, but didn’t save it)

local midi as Midi.connect(1)


init()

if midi then midi.event = midi_event end

the difference is…
midi virtual device by default is all, so for most users it wont appear any different,
but it allows the user to use the System menu to now choose a specific device if they want.

also I thought the midi refactoring was going to include filtering , seems odd that every script writer should have to still need to know the midi code for note_on :slight_smile:
perhaps if this was not wanted to be ‘hardcoded’ in norns (not sure why not, midi spec is pretty static), then perhaps some canned functions in dust/lib?

so we do something like
midi.event = stdmidi_handler(note_on, note_off, cc)

(where params are funcs and can be nil if your not interested in handling these midi messages)

1 Like

If anyone wants to help me track down a semantic error on a Saturday night, pm me! Having a really hard time finding it in my script.

2 Likes

Has anyone implemented a 14-bit MIDI control script in LUA? I made the below SuperCollider class with the help of 10-year old forum posts to help me connect up my Sensel Morph and use the 14-bit X, Y, Z values more easily. Can anyone help me adapt this to LUA for the norns?

2 Likes

Boingg.

9 Likes

Is this a mod of flin, or something new? Either way it looks exciting!

@artfwo 's code for flin was heavily copied in the making of it. It’s a super simple but very fun bouncing lights app.

1 Like

I know a SoftCut study will come later, but I’m having a hard time achieving reverse playback of a buffer without severe glitching. poking around @tehn’s MLR script confirms it should be do-able, but any time I livecode engine.rate(1,-1) in maiden as a test in halfsecond (after freezing the buffer) the engine spazzes.

any pro-tips ahead of the study would be raaaaaad, but not expected <3 (just looking to add reverse as options in cranes before pushing it to GH)

3 Likes

lol, yesterday I ported the Aleph grid tutorial to a Norns script. Would a documented tutorial be useful too?

5 Likes

YESSSSSSSSS!!! Hero!

1 Like

@lazzarello nice work! much of this will be overlap with the forthcoming (this week) midi/grid study, so i’d hesitate to merge it at this point.

@dan_derks i’ve also seen some glitch/crash business with SoftCut and need to spend more time figuring out what’s going on. if you have a simple, commonly reproducible crash situation please do file a github issue for it!

1 Like

Starting a library of drawing functions. I’m not well versed in the flow of github right now, but I’ve got my functions on a single script here. It would be cool to get more together.

1 Like

If I make a lua library of functions (a separate file from my main script) - this does not get recompiled (or whatever) when the main script is re-run from maiden.

The only way I could get the changes to the lib to show up is to “run script” on the library.

Bug or Feature?

(lua) feature, i think.
require 'foo' - searches for foo.lua in all available paths (see the paths we add in norns/lua/config.lua), runs once and stores in package cache
dofile('foo.lua') - always executes foo.lua in the current directory

Therefore… using require, how does one get the library to reload/recompile?

(I was previously trying to just have some functions load in, but have updated to proper library module format)

there isn’t an explicit mechanism for doing that but you can manipulate the package cache directly:

-- import
local myfoo = require "foo"

-- un-import 
myfoo = nil
package.loaded["foo"] = nil
2 Likes

stupid thing of the day - a big gauge mapped to encoder turn:

15 Likes

Hey… so the grid and midi study went up, but maybe you still have questions about what device info is available? Like maybe… can I get the height and width of a connected grid?

The grid and midi objects (is that the right term?) are tables with sub tables:

 grid.list     -- contains port and device name
 grid.devices  -- contains port and device name
 grid.vport    -- which device is on which virtual port

So it’s handy to print those and see what’s inside:

tab.print(grid.list)  

This is nice to confirm which device is attached to which port

I like something like this to get details of each attached device:

 print("-Grid device details-")
 for i,v in pairs(grid.devices) do
   tab.print(grid.devices[i])
   print("-")
 end

which prints out:

-Grid device details-
cols	8
rows	8
serial	4676000
id	2
ports	table: 0x14d9e20
key	function: 0x1455310
name	monome 4676000
dev	userdata: 0x70305920

So to answer my question above - the number of columns available on this grid would be grid.devices[2].cols and the rows grid.devices[2].rows

NOTE - the grid.devices table uses an id key which is different from the port key in grid.list. The id would be a number chosen by norns when you plug/unplug a device. The port is going to be the numer you’d use in grid.connect() or as selected from the SYSTEM>DEVICES menu.

5 Likes

doing the studies tonight and playing around some in the process, have a few questions that i don’t want to clutter the thread with. is anyone online that has experience that wouldn’t mind answering a couple coding questions?