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.

32 Likes

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

3 Likes

Thanks! Exactly what I needed!

3 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)))
}
12 Likes

THIS CANT BE REAL

tell me i’m misunderstanding:

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

5 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.

7 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!

4 Likes

Hi all - just pushed another update to the shnth repo! Update via Maiden.

News:

(1) new script!

I’ve ported @Rodrigo’s Samplazzi Max patch to Norns. Check the SHNTH/SAMPLAZZI script and read the docs before launching for controls. It should be the same as the original Max patch.

(TL;DR: choose four samples from params and control them [wildly] with the shnth).

Demos and UI video:



edit: I’m a terrible human. I thought I had documented within the script more lol. controls:

  • bars: control sample 1-4 playback rate and pan
  • corps: l/r slews rate changes for samples 1/2 and 3/4 respectively
  • upper buttons: fwd/rev toggle
  • lower buttons: 0.5/1 playback rate toggle
  • don’t forget to tap orange tar to set corps to zero position (i.e. slew)

(2) new shlisp binary!

I’ve also recompiled the shlisp binary with the latest from Peter’s Github repo. I believe (?) this adds support for tank and boats (classical Lisp functions), but perhaps it was always there and I never noticed.

20 Likes

I wish I could like this more than once!! Hell yes.

4 Likes

Oh my - will be checking this out for sure :grinning: thank you

2 Likes

holy fracken…i don’t know even where to begin…

FRACKEN AWESOME!!!

started warping noiz right away!

could you add the install shortcut in your big description for any new norn(s)hnth users?

;install https://github.com/cfdrake/shnth

can’t wait to see other scripts develop with this!!!
:stuck_out_tongue:

3 Likes

Here’s a first try - such an awesome script. Thankyou :slight_smile:

10 Likes

wow!! this is so much fun!! thank you !!!

1 Like

first noiz exploration…

5 Likes

my first session with samplazzi

7 Likes