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
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.
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:
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
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.
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.
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.
thank you for the swift reply!
16n actually added this in their latest firmware(soft midi thru). But it seems like it’s not working with this specific use case. I’ll check with the devs
ah i wasn’t aware… i’ve got a 16n (i think updated to latest firmware) and i couldn’t get it to work/see any indication of it in the online editor
EDIT - i was on 2.0.1. will update and have another look
not sure if this is due to passthrough or other norns stuff, but I got this message in matron:
midi inconsistency for device: 16n ALSA lib rawmidi_hw.c:111:(snd_rawmidi_hw_status) SNDRV_RAWMIDI_IOCTL_STATUS failed: No such device
So having updated my 16n i can get midi output using the TRS jack with passthrough.
- Ensure soft midi thru on in 16n config editor
- i have a DAW midi track that sends note output to norns through an iConnectivity Mio.
- load up passthrough (example script in repo)
- parameters are : Device = mio / Interface = 16n
- 16n TRS connected to another midi track in my DAW.
I can now see the correct note data coming through, and I can map some parameter in my DAW to the 16n faders just fine.
I don’t have the same error message, have to say it does not mean much to me - perhaps worth checking in on the 16n thread.
Thank you so much for investigating. Will do some more research on my end.
oh, this is a system error message which i typically see whenever a connected MIDI device which a script is addressing suddenly becomes disconnected mid-stream – might be worth checking your connected cable!
Thanks Dan! I got it working using the example_event script and switching the device/interfaces a couple of times. But I could not get it working with CC2 earlier today. Is there any way to «flush» the midi device cache?
i just tried a 16n out with passthrough + the passthrough/cc2 combo, both required a bit of switching to work – i found that either:
- selecting the
- jogging the
Deviceselector to the extremes while moving a slider on the 16n, then choosing an
…seemed to do the trick!
it seems like this is something I need to do everytime I boot up the script, even if the params are saved in pset/collections(in CC2). I need to head into the passthrough params and deselect/select either interface or device. but it works after Ive done that.
That sounds like something I need to work on!
What work would need to be done to permit “tee” devices, or simultaneous use of a MIDI event stream by Passthrough and a Norns app? I tried naively adding a third device entry and writing all events, not just to the interface but to the tee device as well, and then setting that to “virtual” and having the Norns app also connect to “virtual”, but I can still only get either Passthrough or the other Norns app to work with the MIDI.
Does the event callbacks built into Passthrough help for this use case? I’m not sure I entirely follow the meaning of tee device here, so forgive me for being a little slow, but embedding passthrough in a script should allow for sharing midi event data with that script - see here for documentation on user event handling: passthrough/README.md at main · nattog/passthrough · GitHub