Passthrough

No trouble at all. It works now. :slight_smile:

Deleted and reinstalled MLR, then added the lib and code back in. I had L24 same as you, but had what you note as L362 at L370 under init = function(). Put it as you note and voila. Thanks!

Glad it’s working for you now :slight_smile:

1 Like

i’m wondering if there’s sufficient validation for some sort of UI to “load additional lib” or something.

my gut feeling is that unless it’s very well designed and considered there will inevitably be difficult code conflicts to resolve.

i do think the MIDI devices section could have a couple util functions added, such as port redirection (like this lib does). it’d also be nice to have a little midi monitor built-in to the menu.

8 Likes

@Frederickk has made a great update to Passthrough, which allows for user event callbacks to be defined in your scripts, alongside a couple of nice bits of polish. This allows you to hook into the MIDI event stream in Passthrough, and define your own behaviours.

Update in Github repo linked in the top post or install using Maiden catalogue.

2 Likes

does anyone know what the best method to pass midi through my norns (fates) and back into my octatrack would be? i have octa midi going through a digitone and then model cycles which send midi thru to the norns which goes into the octatrack. I also have a nanokontrol running midi into the norns. I would like to be able to pass the midi from the octatrack back into itself through the norns and have the ability to control my octatrack with the nanokontrol through the norns as well.

i have tried unsuccessfully to use this script. Cant figure out how to add the code to another script without getting a run error. but i dont really need it to be attached to any particular script if that isnt necessary. is there a way to pass midi from either device port straight through the norns without any particular script running? or is there a way to do that with this script?

Passthrough was initially built to pass MIDI into an Octatrack I was using. If I’m following correctly, I think you are looking for multiple devices (Nanokontrol + model cycles) to be supported with an interface (Octatrack). Passthrough doesn’t currently support this, although its a good feature request that I’ll try to get round to implementing. I believe there was talk of creating this kind of routing as part of the core Norns MIDI feature set, but I haven’t really followed so unsure of the status there.

Am interested what are the run errors you are getting, there are instructions for implementing it in scripts.

thanks so much for this @nattog! was able to get a Midi Fighter Twister hooked up to a Zoia no problem, and was able to do what I was hoping would work out of the box - using the same cc to control norns and zoia params. (I’m still new to MIDI; this is probably an obvious use-case)

1 Like

First of all, thank you for making this! I’m also using Norns to broker messages between my MFT and Zoia (as well as control some params on the Norns).

Just confirming something before I go deeper down a rabbit hole: Are CC messages unidirectional (Device --> Interface)?

I’m trying to have Zoia send MIDI CC back to the MFT (to update knob state) and I don’t seem to be able to. I am able to send CC to the Zoia via the MFT, but when I try to send CC from the Zoia it never reaches the MFT. I’m able to sniff the MIDI CC coming from the Zoia on the interface I’m using using MONITOR-MIDI so I know that I’m at least sending CC from the Zoia into the interface but I’m assuming that those control messages aren’t passed along.

Would love to see this kind of thing built into the MIDI implementation, the flexibility that would afford is kind of mind-blowing.

1 Like

It’s certainly possible - with Passthrough interfaces already send clock events to devices so it’d be simply a case of expanding the interface event function to handle CC. I’ll likely make an options param for CC message direction too. I’ll aim to get round to it soon.

3 Likes

That would be spectacular! I’ll make sure I’m watching the GH repo (and this thread). I doubt that I could figure out how to implement the expansion of the interface event function myself but I’ve been looking for a good practical entrypoint to LUA so maybe I’ll be able to actually contribute!

Check this commit . I had a quick look, although was not with my Norns so this is coding blindfolded and not certain to work! Let me know if it does / any trouble, I’ll probably see to the rest tomorrow.

Thank you so much, this is totally incredible.

Loaded that commit into my Norns and just lost the last 2 hours setting default knob values for Oneiroi (including changing the colors of the knobs via CC!) so it certainly works. Thank you so much! Looking over your changes, I even learned a little about Lua!

The only issue I’m having, which isn’t related to these changes at all I suspect is I can’t figure out how I got a default PSET set up with Passthrough in the first place. Whatever default PSET that Passthrough is loading doesn’t set the cc_direction option so I have to flip the switch every time. A minor annoyance but I’m sure it’s just something dumb I’m doing!

EDIT: Fixed my issue. Seemed to be an issue with Greyhole and I solved it by adding params:read() to the last line of the init function. I AM VERY HAPPY!

2 Likes

Glad you got it working!

I’m sorry, I somehow missed this reply. I just sent you a pm but I’ll put it here to clarify as well.

It’s possible that I’m misunderstanding the point of this script. I’m just trying to use it to pass midi through the fates and onto the octatrack so I don’t have to switch the midi cable between those two devices. Basically adding a “thru” port to the fates. I don’t even really need it to do anything else but it would be nice to have more control over the routing I suppose.

I’m trying to get my nanokontrol2 which is connected to my Fates midi device port 4, to go through fates and into my octatrack, which is already receiving midi from the Fates midi out via a usb midi to din cable.

As far as I understand, you need to have another script running to use it, correct? So I put the “Passthrough.lua “ file into the main code directory of whichever script I want to use it with. Then put the two lines of code at the top of that main script’s code.

I have done a similar thing with midigrid when in was using mlr64 with a launchpad and I never had the problem I’m having now, which is: when I add the two lines of code, it doesn’t seem to matter where I put it, but it breaks the script and I can’t open it without getting an error.

So I feel like I’m missing something. Do I need to add it to an existing script to run it? Where is that midi menu in your initial post with the key step selection? And is there a more specific line in the script that I should be adding the code to, or would you happen to have an example script showing where I would put it?

I have tried using the example script that you added to this one but I couldn’t figure that out either.

I’ll grab the error and edit it in here shortly

Hey, sorry you’re having problems! Let’s try to figure this out - I was going to reply a bit later on to your PM but nice to keep things documented out in the open.

It would be helpful to see those error logs. Maybe you can also add some screenshots/code chunks of your implementation so I can see how you’ve been doing it and help to debug it.

Passthrough operates as a library, an extension to a script - it wasn’t really intended to be a standalone script in as much as it is not a particularly exciting thing to run on its own on a Norns. The screenshots I shared of the menu are dependent on Passthrough.init() being called in a script’s init function.

Just a quick thought, how are you saving passthrough in a script? Do you name it cased like this passthrough.lua and place it in the lib directory of a script? If I remember correctly, someone else flagged an issue where the casing of the file + include line had to be the same.

1 Like

i’m so sorry, i must have missed the notification for this reply (again! i dont know why that keeps happening, i apologize). thanks for the help. let me see here

ok so after i put just the “passthrough.lua” file inside of the Caliper script’s “Lib” folder, and added:
local Passthrough = include("lib/passthrough") to the top of the Caliper code, it did open this time.

so i don’t know if this is relevant here, but here is the matron log after i opened Caliper with the included passthrough file:

Summary
1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

-- caliper

--

-- tuner with reference tone,

-- frequency counter,

-- v/oct calibration helper

--

-- e1 - set reference freq

-- e2 - set reference tone amp

-- e3 - set voltage offset

-- k1 - hold for fine control

-- k2/k3 - lower/raise voltage

-- offset in octaves

local Passthrough = include("lib/passthrough")

engine.name = 'Caliper'

musicutil = require 'musicutil'

filters = require 'filters'

log2 = math.log(2)

matron

sc

norns.script.load("code/caliper/caliper.lua")

# script load: /home/we/dust/code/caliper/caliper.lua

# cleanup

# script clear

including /home/we/dust/code/caliper/lib/passthrough.lua

# script run

loading engine: Caliper

>> reading PMAP /home/we/dust/data/caliper/caliper.pmap

m.read: /home/we/dust/data/caliper/caliper.pmap not read.

<ok>

Engine.register_commands; count: 3

___ engine commands ___

amp_threshold f

sine_amp f

sine_freq f

___ polls ___

amp_in_l

amp_in_r

amp_out_l

amp_out_r

cpu_avg

cpu_peak

input_freq

pitch_in_l

pitch_in_r

# script init

done allocating new mean filter

*EDIT: oops, i forgot “init”

ok, seems to be working now! i got the Passthrough menu in the Edit screen finally.i think the problem was that i wasn’t actually moving the passthrough lua file into the other script’s ‘lib’ directory. thank you so much for clarifying and great work on this. it will be very helpful

1 Like

Glad you got it working!

Prompted by the magnificent norns.community effort (see thread: Norns.community), I spent some time overhauling the documentation for Passthrough. It should hopefully be a lot more comprehensive for getting up and running with this library. The documentation is here: passthrough | norns community or on Github (see top post)

As ever, I’m always pleased to dive in and help with any questions.

2 Likes

Hi @nattog

I was hoping you could help me with an “extended” use case for Passthrough. Is it possible to get it to send midi thru the 16n trs MIDI out from another USBmidi device connected thru norns with Passthrough? I have a foot switch and I’m already using a 16n as a controller for my Octatrack, would love to use Passthrough as a way to get both 16n and foot switch midi data to the OT.

Thanks!

hey there! as far as i can tell, getting this to work may not be the responsibility of passthrough/norns - it would require the 16n to merge incoming midi data with the outgoing data from its faders, which has been discussed on another thread (initial post). without being very familiar with the 16n firmware, i’m probably not the best person to help here. If this behaviour was possible with 16n, then passthrough should work for your use case.

1 Like