while this is both a cool idea & possible, the model “use cheat codes on the grid, play passersby with a midi controller” would be about 1000% times easier and a totally approachable starting point for a beginner

essentially, midi and grid are handled by separate blocks of code called functions. so combining midi and grid (which live in separate functions) would be much more cut and paste, whereas your original idea would require a rewritten grid function(s) that handles both passersby and cheat codes

for starters, here’s a block of code from passersby (on GitHub) that handles midi (+ shares it w the engine)

-- Engine functions

local function note_on(note_num, vel)
  engine.noteOn(note_num, MusicUtil.note_num_to_freq(note_num), vel)
  table.insert(active_notes, note_num)
  input_indicator_active = true
  screen_dirty = true
end

local function note_off(note_num)
  engine.noteOff(note_num)
  for i = #active_notes, 1, -1 do
    if active_notes[i] == note_num then
      table.remove(active_notes, i)
    end
  end
  if #active_notes == 0 then
    input_indicator_active = false
    screen_dirty = true
  end
end

local function set_pitch_bend(bend_st)
  engine.pitchBendAll(MusicUtil.interval_to_ratio(bend_st))
end

local function set_channel_pressure(pressure)
  engine.pressureAll(pressure)
end

-- MIDI input
local function midi_event(data)
  
  local msg = midi.to_msg(data)
  local channel_param = params:get("midi_channel")
  
  if channel_param == 1 or (channel_param > 1 and msg.ch == channel_param - 1) then
    
    -- Note on
    if msg.type == "note_on" then
      note_on(msg.note, msg.vel / 127)
      
    -- Note off
    elseif msg.type == "note_off" then
      note_off(msg.note)
      
    -- Pitch bend
    elseif msg.type == "pitchbend" then
      local bend_st = (util.round(msg.val / 2)) / 8192 * 2 -1 -- Convert to -1 to 1
      set_pitch_bend(bend_st * params:get("bend_range"))
      
    -- Pressure
    elseif msg.type == "channel_pressure" or msg.type == "key_pressure" then
      set_channel_pressure(msg.val / 127)
      
    end
  end
end

not too bad to read over !

this, plus another line which orders up the passersby engine from supercollider

local Passersby = require "passersby/lib/passersby_engine"

is pretty much the “meat” of that task I laid out. I’m probably (definitely (edited to add engine functions a few lines up)) missing a few bits and bobs, but pasting those two chunks (+ determining how you want to change the sound, maybe params) will be close to all you need to add a simple midi synth to any softcut script

3 Likes

I’m so sorry to ask this here, but I’ve been searching the megathreads and it’s been hard to locate… how do I add new scripts to my new DIY norns? I have SFTP’d in with FileZilla and I can browse the guts, but I don’t know which directory the lua scripts live in…

project manager !!

1 Like

Thanks! I just found this when you posted it. much appreciated!

Thanks. Is it possible to plug my laptop in to the usb sockets and use midi over usb or are there issues over whether it is a device or a host?

This isn’t possible as both are USB hosts. You would need something like a 2host in between the computer and norns.

1 Like

I’d say easiest computer <—> norns communication option wld be osc

but it might require (simple) modifications on the computer side depending on yr use case

Recording to TAPE on my DIY Norns, I hear everything absolutely fine through monitoring.

However, the final WAV file out has, every few minutes, this DC offset/spike in it:

image

DIY norns, grid + 16n on usb, headphones only connected to audio, decent USB power supply.

Any thoughts?

well I can confirm I’m not reproducing that for a couple recordings I looked at just now from norns shield

did you confirm that it’s script independent ? weird softcut arrangements can make DC offsets

the weird thing is I absolutely did not hear any of this. Like, the tape recording is nothing like what I heard at those points. (It happened on two tapes from two different scripts: mangl and cheatcodes.

Has anyone experienced screen banding when filling big shape with multiple curves with screen.level(1) & screen.aa(1) and text at level(15)?
I switched to using lines from curve and it improved, so I suspect this is a low level software issue?

(On fates hardware, not that is should matter as its the exact same new haven display module)

do you recall if your MONITOR level is turned up? ie is the audio input stage getting into the tape recording?

(side note: the shield audio circuitry is primitive compared to the actual norns (which has good isolation))

this is normal for the newhaven displays, and it’s annoying for sure. there might be some driver-level adjustment that could be made (though i’ve spent too long with NH tech support already, if someone wants to jump in on that).

ah, yes, MONITOR was all the way up, but nothing connected. so that’s not a good start, and might be related… and I had Wifi on as well. It was just the first time I looked at a TAPE recording on a computer, is all, hence flagging it. I’ll keep an eye on it and try something again in the near future.

Is there a general MIDI I/O and learning or does it change between engines?

midi learn works for most parameters. parameters are defined by the script, and are often associated with engine params. yes you have to remap midi mapping for each script— it generally doesn’t make sense to have persistent mappings as scripts differ drastically. you could theoretically write a script that have standard mappings, but i don’t think that’s what you were asking?

1 Like

Learning how to use my new Norns. I’ve manage to download a bunch of new apps from the Maiden library that all appear to be working, save for the one I want to use most: Otis. Initially I was getting an error saying it was missing Decimator, but after deleting and reinstalling it that problem was fixed.

Now I’m just getting an “error: init” message. Here’s the matron info:

SCRIPT ERROR: init

/home/we/norns/lua/core/softcut.lua:140: bad argument #3 to ‘cut_param’ (number expected, got nil)
stack traceback:
/home/we/norns/lua/core/norns.lua:126: in function </home/we/norns/lua/core/norns.lua:126>
[C]: in field ‘cut_param’
/home/we/norns/lua/core/softcut.lua:140: in function ‘core/softcut.pre_filter_fc_mod’
/home/we/dust/code/otis/lib/tlps.lua:88: in field ‘init’
/home/we/dust/code/otis/otis.lua:239: in global ‘init’
/home/we/norns/lua/core/script.lua:93: in function ‘core/script.init’
[C]: in function ‘xpcall’
/home/we/norns/lua/core/norns.lua:127: in field ‘try’
/home/we/norns/lua/core/engine.lua:91: in function </home/we/norns/lua/core/engine.lua:89>
reading PMAP /home/we/dust/data/otis/otis.pmap

Thanks!

Did you restart Norns after install? That’s when I typically get a error:init

there’s a bug in the last norns update that will be fixed momentarily

2 Likes

Ah got it! Thanks.

I did restart Norns after the update. That confused me at first, but I did it eventually!

Just updated Norns again, but still getting the error: init message on the main screen unfortunately. Again, appears to just be for Otis. Every other app seems to be working. Any ideas?