Norns + shnth: library

norns + shnth

Library for using the shbobo shnth as a controller for Norns.

Requirements

  • norns/fates
  • shbobo shnth

Documentation

Connect your shnth, select it in HID devices menu.

In your script:

-- Include helper library.
local shnth = include("shnth/lib/shnth")

function init()
  -- Connect to HID device.
  -- Let library handle parsing events.
  dev = hid.connect()
  dev.event = shnth.event
end

-- Override a callback to receive data.
function shnth.bar(n, d)
  print("bar" .. n .. " pressed at depth " .. d)
end

Continuous values range from -1 to 1, and buttons are 0/1 based like regular Norns key.

Be warned that most of the continuous inputs are a little noisy.

A demo script, demo.lua is provided.

API

After setting the event handler, override these functions to receive data:

function shnth.bar(n, d)
  -- bar input, always firing
  -- n bar index
  -- d bar depth
end

function shnth.corp(n, d)
  -- corp input, always firing
  -- n corp index
  -- d corp depth
end

function shnth.major(n, z)
  -- major buttons, fires on touch
  -- n button index
  -- z button state
end

function shnth.minor(n, z)
  -- minor buttons, fires on touch
  -- n button index
  -- z button state
end

function shnth.wind(d)
  -- wind input, always firing
  -- d wind depth
end

Download

Clone from Github.

29 Likes

Keep the Good Stuff :tm: coming!
:fire: :fire: :fire: :fire: :slight_smile:

3 Likes

Thanks! Exactly what I needed!

2 Likes

20 characters of awesome!!

4 Likes

hi i’m testing this library and just tried demo.lua
i expected the screen to update values from touching shnth but nothing happens

just confirmed with fish gwonzer that my shnth works so i’m confused
any tips?

Small update/note on the shnth lib - if anyone’s having trouble ^ we found that sometimes connecting HID devices can be a bit fiddly. Just try to replug it and ensure SHNTH is showing up at HID slot #1 and you should be good to go.

Here’s a quick demo script I cooked up recently for trippy 60s sci-fi sounds:

-- note: assumes both awake and shnth are installed
local shnth = include("shnth/lib/shnth")
local hs = include("awake/lib/halfsecond")

engine.name = "TestSine"

function init()
  s = hid.connect()
  s.event = shnth.event
  
  hs.init()
end

function shnth.bar(n, d)
  if n == 1 then
    engine.hz(120 + (d * 1000))
  elseif n == 2 then
    engine.amp(d)
  elseif n == 3 then
    params:delta("delay_rate", d)
  elseif n == 4 then
    params:delta("delay_pan", d)
  end
end
3 Likes

Sweet! I’ll check this out when I get home.

1 Like