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.

30 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

Added a shnth program loader to this repo :slight_smile: Consider it beta quality** at best!

Start by updating in Maiden, then create the following directory on Norns:

mkdir /home/we/dust/code/shnth-patches

Put your .txt patches in this folder then run SHNTH/LOADER from the Norns SELECT menu.

Norns app controls:

  • ENC 1/2/3 - scroll list of shnth programs
  • KEY 2 - load selected shnth program
  • KEY 3 - reload list of programs from disk

** I had to recompile shlisp for ARM Linux with a few modifications, so it might be a bit fiddly. Give Norns a restart with shnth plugged in if you’re having issues, mine didn’t work at first until I did that. I’ve been having a lot of issues with shnth on Big Sur, which is why I made this.

Notes:

  • does not show load failure/success or compiler errors on Norns, but will print that info in Maiden
  • best way is to create the directory above, edit in Maiden or via SSH, then deploy with this app
  • if you edit in Maiden and have developed Norns scripts you’ll probably accidentally keep tapping cmd-p to run it :slight_smile: hehe
  • here’s an example patch horns.txt I wrote to verify this app works:
; created by colin drake
{
(left (horn (bar 48) (barb)))
(right (hornb (barc 48) (bard)))
(left (right (wind)))
}
11 Likes

THIS CANT BE REAL

tell me i’m misunderstanding:

not fish but raw shlisp text in maiden and served to shnth via norns??

4 Likes

Yes, you can edit shlisp code (non-visual Fish) files in Maiden or vim/emacs/nano with SSH and deploy it to your shnth with this script.

I didn’t have to do much TBH :slight_smile: shlisp was already ported to Linux by PB, I just recompiled it on my Norns (binary is included in the repo) and slapped together a quick GUI for it.

6 Likes

yikes! I can’t wait to try this when I’ve got my norns in front of me
thank you for sharing!

5 Likes

Ok, so I realized this maybe exists better as a mod, that way you can change shlisp patches while accompanying or processing the shnth with another Norns script running. Just removed the loader script and moved it to lib/mod.lua instead.

Enable the mod as you would any other, then after restting your Norns you can K3 into the shnth mod and deploy patches by scrolling + using K3. Tap K2 to back out of the mod menu.

Apologies for the whiplash!

3 Likes