passthrough-tuning is a mod of the passthrough mod. the original 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. The -tuning mod here allows you to load various tunings from Scala files and play microtonal scales on your mididevices (and norns engines) as long as they either understand pitchbend or use musicutil.
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
-
microtuning incoming midi using Scala
.sclfiles — retune any connected synth or norns engine to just intonation, historical temperaments, or any custom scale
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.
run the following command in the maiden repl
;install https://github.com/robinmeier/passthrough-tuning
passthrough assigns some midi routing settings for each connected midi device in the norns system menu found at SYSTEM > DEVICES > MIDI :
Activeturns on or off passthrough for this portTargetmay be all connected devices, or individual ones. this is the destination of incoming midi dataInput channelselects which midi channel is listened to for incoming midi dataOutput channelchanges outgoing midi data to a specific midi channel, or leaves unchangedClock outallows/prevents clock messages being outputQuantize midiwraps note data to scales (quantization is set per connected midi device, so different scales can be used if desired)Rootsets the root note of the current scaleScalesets the scale type (Major, Minor.. )CC limitsets the limit of midi CC messages to be sent for every channel per25mstimeframe. 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). thePass alloption allows all CC messages to passthrough, without any kind of limiting. thePass noneoption doesn't allow any midi CC messages to passthrough, effectively removing all of themCrow note outputallows note and gate data to be sent to Monome Crow output pairs1+2or3+4.Crow cc outputallows two streams of control change data to be sent to Monome Crow output pairs 1+2 or 3+4Crow cc out asets the MIDI control change number to assign to the first of the assigned pair ofCrow cc outputCrow cc out bsets the MIDI control change number to assign to the second of the assigned pair ofCrow cc outputTuningselects the microtuning mode:off,musicutil, ormidi pb(see microtuning below)Tuning fileselects a.sclfile from~/dust/data/passthrough/tunings/Tuning rootsets the root MIDI note (0–127, shown as note name e.g. C4). This is the key that plays scale degree 0 at its standard 12-TET pitch. Changing this shifts both the keyboard mapping and the pitch register — e.g. root C4 plays degree 0 at 261 Hz, root A4 plays degree 0 at 440 Hz.PB voicessets how many simultaneous voices are available inmidi pbmode:1,4,8, or16PB base chsets the first MIDI channel used for the pitch-bend voice pool inmidi pbmodePB range (st)sets the pitch bend range in semitones:1,2,4,12, or24— must match the pitch bend range configured on your target synth
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 2returns toSYSTEM > MODSkey 3changes which midi device is being editedenc 2scrolls the menu to access parameters for the current midi deviceenc 3changes the value of the selected parameter
passthrough 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
passthrough can retune incoming MIDI notes using Scala .scl files. place your .scl files in:
~/dust/data/passthrough/tunings/
the folder is created automatically on first run. the Tuning file parameter lists all .scl files found there. many free scale libraries are available online — the Scala scale archive contains thousands of historical and microtonal tunings.
key mapping: each MIDI key plays one scale degree in order. Key root = degree 0, key root+1 = degree 1, and so on. After N keys the scale period repeats one octave higher, where N is the number of degrees in the .scl file. A 5-note pentatonic scale therefore repeats every 5 keys; a 30-note scale spans 30 consecutive keys per octave.
adjusting mode: changing Tuning root adjusts the pitch register along with the keyboard mapping — it sets the key that plays degree 0 at its standard 12-TET frequency. this keeps temperament independent of transposition: set the root to C4 (261 Hz) to tune in C, or to A4 (440 Hz) to tune in A, with the full scale spreading from that anchor. when tuning is turned off or the port is deactivated, MusicUtil.note_num_to_freq is restored to standard 12-TET (A4=440 Hz).
there are two tuning modes:
patches MusicUtil.note_num_to_freq globally so that any norns engine which uses musicutil for pitch calculation (most do) will automatically play in the selected tuning. no additional configuration of the engine is needed.
the first port with Tuning set to musicutil and Active set to yes determines the active tuning for the whole system. when no such port exists, the standard 12-TET function is restored automatically.
applies microtuning via MIDI pitch bend messages. each simultaneous voice is assigned its own MIDI channel, with a pitch bend applied before the note-on to shift the pitch to the correct tuned frequency.
setup steps:
- set
Tuningtomidi pb - choose a
Tuning fileandTuning root - set
PB voicesto the number of simultaneous notes you need - set
PB base chto the first channel of the voice pool (e.g.1for channels 1–4 with 4 voices) - set
PB range (st)to match the pitch bend range configured on your target synth (the default is2semitones, which is the most common synth default)
pitch bend range: tuning uses coarse + fine decomposition. the MIDI note sent to the synth is the nearest 12-TET semitone to the target pitch, and the pitch bend covers only the residual deviation (always ≤ ±50 cents). this means a PB range of 1 or 2 semitones is always sufficient for any scale, including large ones like 30-note or 31-tone equal temperament.
note: the voice pool channels must be free — passthrough will use them exclusively for tuned voices. if your synth does not respond to pitch bend per channel, use musicutil mode instead or configure your synth for polyphonic pitch bend on the relevant channels.
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
