project name: | passthrough |
project url: | https://github.com/nattog/passthrough |
author: | nattog |
description: | midi passthrough library with examples |
discussion url: | https://llllllll.co/t/passthrough/31156 |
documentation url: | https://norns.community/authors/nattog/passthrough |
tags: | utility mod midi |
passthrough offers midi routing between connected ports on norns. it is similar to midi thru on hardware devices although it comes with some extra functionality.
passthrough extends norns to act as a midi routing hub. each incoming data to a port can be assigned to either a specific port for output, or all ports. it allows the user to send midi while simultaneously running a norns script.
passthrough is built as a mod and also as a library that can be added to individual scripts. they are functionally the same, but the mod version runs at all times, during scripts or when no script is loaded. If the mod is installed and turned on in the mods menu, passthrough will be running.
send notes through norns from a usb midi controller to a midi-compatible synthesizer.
scale quantization of incoming midi note data from controllers
routing an external clock source through norns between devices
by leveraging callbacks at a script level, incoming midi events can be shared between norns scripts and external hardware
converting MIDI note data to cv/gate, and CC data to cv by sending to crow
norns + midi devices
if your midi hardware does not offer midi via usb, a midi interface such as an iConnectivity mio helps to connect with 5-pin midi ports.
passthrough is available from the maiden catalogue or by running the following command in the maiden repl
;install https://github.com/nattog/passthrough
passthrough assigns some midi routing settings for each connected midi device in the norns system menu found at SYSTEM > DEVICES > MIDI
:
Active
turns on or off passthrough for this portTarget
may be all connected devices, or individual ones. this is the destination of incoming midi dataInput channel
selects which midi channel is listened to for incoming midi dataOutput channel
changes outgoing midi data to a specific midi channel, or leaves unchangedClock out
allows/prevents clock messages being outputQuantize midi
wraps note data to scales (quantization is set per connected midi device, so different scales can be used if desired)Root
sets the root note of the current scaleScale
sets the scale type (Major, Minor.. )CC limit
sets the limit of midi CC messages to be sent for every channel per 25ms
timeframe. if more messages than this limit are received, then the last messages (per channel) will be sent automatically on next timeframe. this is useful when a midi controller is generating too many messages too fast (eg. moving all the faders at once on a novation launchcontrol xl). the Pass all
option allows all CC messages to passthrough, without any kind of limiting. the Pass none
option doesn’t allow any midi CC messages to passthrough, effectively removing all of themCrow note output
allows note and gate data to be sent to Monome Crow output pairs 1+2
or 3+4
.Crow cc output
allows two streams of control change data to be sent to Monome Crow output pairs 1+2 or 3+4Crow cc out a
sets the MIDI control change number to assign to the first of the assigned pair of Crow cc output
Crow cc out b
sets the MIDI control change number to assign to the second of the assigned pair of Crow cc output
additionally, Midi panic
is a toggle to stop all active notes if some notes are hanging.
there are two example scripts, showing how to interact with passthrough either as a mod or a library. they detail how to include it in scripts so that users can define callbacks on incoming midi data.
navigate to the mod menu at SYSTEM > MODS
, scroll to PASSTHROUGH
and turn encoder 3 until a +
symbol appears. restart norns and passthrough is running. when norns is shutdown, the current state of passthrough is saved. When norns is next powered on, this state will be recalled.
navigate back to the mod menu and this time there will be a >
symbol to the right of PASSTHROUGH. press key 3
and the screen should display the passthrough mod menu
key 2
returns to SYSTEM > MODS
key 3
changes which midi device is being editedenc 2
scrolls the menu to access parameters for the current midi deviceenc 3
changes the value of the selected parameterpassthrough can be used with the example scripts or by attaching it to external scripts, by adding the following code at the head of the script file:
if util.file_exists(_path.code.."passthrough") then
local passthrough = include 'passthrough/lib/passthrough'
passthrough.init()
end
the installation has been successful if PASSTHROUGH
appears in the script’s params menu.
scripts can listen for midi events handled in passthrough and define their callbacks.
-- script-level callbacks for midi event
-- id is the midi device id, data is your midi data
function user_midi_event(id, data)
local msg = midi.to_msg(data)
-- to find the port number, there is a helper function provided
-- port = passthrough.get_port_from_id(id)
end
passthrough.user_event = user_midi_event
raise any issues experienced with passthrough either in the v2 thread on lines or by logging a new issue on the github repo.
wishing to contribute a new feature or change? github pull requests are welcome.
for older versions, check the releases in the repo. releases older than v2.3.0 are legacy, and no longer supported for development