Notochord is a real-time neural network model for MIDI performances.
Project description
Notochord (Documentation | Paper | Video)
Notochord is a neural network model for MIDI performances. This package contains the training and inference model implemented in pytorch, as well as interactive MIDI processing apps using iipyper.
Getting Started
Using your python environment manager of choice (e.g. virtualenv, conda), make a new environment with a Python version at least 3.10. Then pip install notochord.
For developing notochord, see our dev repo
Install fluidsynth (optional)
fluidsynth is a General MIDI synthesizer which you can install from the package manager. On macOS:
brew install fluidsynth
fluidsynth needs a soundfont to run, like this one: https://drive.google.com/file/d/1-cwBWZIYYTxFwzcWFaoGA7Kjx5SEjVAa/view
You can run fluidsynth in a terminal. For example, fluidsynth -v -o midi.portname="fluidsynth" -o synth.midi-bank-select=mma ~/'Downloads/soundfonts/Timbres of Heaven (XGM) 4.00(G).sf2'
Notochord Homunculus
Notochord includes several iipyper apps which can be run in a terminal. They have a clickable text-mode user interface and connect directly to MIDI ports, so you can wire them up to your controllers, DAW, etc.
The homunculus provides a text-based graphical interface to manage multiple input, harmonizing or autonomous notochord voices:
notochord homunculus
You can set the MIDI in and out ports with --midi-in and --midi-out. If you use a General MIDI synthesizer like fluidsynth, you can add --send-pc to also send program change messages. More information in the Homunculus docs, or run notochord homunculus --help
If you are using fluidsynth as above, try:
notochord homunculus --send-pc --midi-out fluidsynth --thru
Note: on windows, there are no virtual MIDI ports and no system MIDI loopback, so you may need to attach some MIDI devices or run a loopback driver like loopMIDI before starting the app.
If you pass homunculus a MIDI file using the --midi-prompt flag, it will play as if continuing after the end of that file.
Adding the --punch-in flag will automatically switch voices to input mode when MIDI is received and back to auto after some time passes.
Python API
See the docs for Notochord.feed and Notochord.sample for the low-level Notochord inference API which can be used from Python code. notochord/app/simple_harmonizer.py provides a minimal example of how to build an interactive app.
OSC server
You can also expose the inference API over Open Sound Control:
notochord server
this will run notochord and listen continously for OSC messages.
Tidal interface
see notochord/tidalcycles in iil-examples repo (updated examples coming soon):
add Notochord.hs to your tidal boot file. Probably replace the tidal <- startTidal line with something like:
:script ~/iil-examples/notochord/tidalcycles/Notochord.hs
let sdOscMap = (superdirtTarget, [superdirtShape])
let oscMap = [sdOscMap,ncOscMap]
tidal <- startStream defaultConfig {cFrameTimespan = 1/240} oscMap
In a terminal, start the python server as described above.
In Supercollider, step through examples/notochord/tidalcycles/tidal-notochord-demo.scd which will receive from Tidal, talk to the python server, and send MIDI on to a synthesizer. There are two options, either send to fluidsynth to synthesize General MIDI, or specify your own mapping of instruments to channels and send on to your own DAW or synth.
Train your own Notochord model (GPU recommended)
Selec the train option when installing:
pip install notochord[train]
preprocess the data:
notochord prep --data_path /path/to/midi/files --dest_path /path/to/data/storage
launch a training job:
notochord train --data_dir /path/to/data/storage --log_dir /path/for/tensorboard/logs --model_dir /path/for/checkpoints --results_dir /path/for/other/logs
progress can be monitored via tensorboard:
tensorboard --logdir /path/for/tensorboard/logs
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file notochord-0.8.0b4.tar.gz.
File metadata
- Download URL: notochord-0.8.0b4.tar.gz
- Upload date:
- Size: 91.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7aa6cb18d4274c3004755a30ef48290723403c7b2a309563c606ddd95f456756
|
|
| MD5 |
8625244b817f3d7e2bdd1ae64854ecf1
|
|
| BLAKE2b-256 |
0055dfa313b4ea755a7b7436ad9f95841367991c4651fe595b266762a6bcfa2e
|
File details
Details for the file notochord-0.8.0b4-py3-none-any.whl.
File metadata
- Download URL: notochord-0.8.0b4-py3-none-any.whl
- Upload date:
- Size: 101.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7d3080bc9a72e845563eeaf9764ec0e6df7a7357fce96a193177fb6d5d9ef463
|
|
| MD5 |
2f592a98fec35837856039d9918daaa3
|
|
| BLAKE2b-256 |
f679035d72bce7a64f24eae344dc6c6cd6f641f45c774ebfd717915464bd4b7f
|