Skip to content
This repository was archived by the owner on Nov 23, 2023. It is now read-only.

Commit 9463932

Browse files
merge, add license
2 parents ce960db + 3e939a1 commit 9463932

11 files changed

Lines changed: 741 additions & 159 deletions

File tree

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2022 Intelligent Instruments Lab
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Readme.md

Lines changed: 59 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
# Structure
1+
# Repository Structure
22

33
- iipyper: python package for easy MIDI, OSC, event loops
4-
- notochord: python package for defining+training pytorch RNN models
5-
- notebooks: jupyter notebooks
4+
- notochord: python package for the Notochord MIDI performance model
5+
- notochord: package source code
66
- scripts: helper scripts for training, data preprocessing etc
77
- examples:
88
- iipyper: basic usage for iipyper
99
- notochord: interactive MIDI apps with notochord and SuperCollider
10+
- tidalcycles: notochord interface to TidalCycles
1011
- bela: [Bela](https://bela.io) examples in C++, Pure Data and so on
1112
- faust: [Faust](https://faustdoc.grame.fr/) examples
1213
- tidalcycles [TidalCycles](https://tidalcycles.org) examples
@@ -15,26 +16,75 @@
1516

1617
# Setup
1718

19+
clone the repository:
20+
```
21+
git clone https://github.com/Intelligent-Instruments-Lab/iil-python-tools.git
22+
cd iil-python-tools
23+
```
24+
25+
we manage python dependencies with `conda`. If you don't have an anaconda/miniconda python install already, download an installer from https://docs.conda.io/en/latest/miniconda.html or use `brew install --cask miniconda` on mac.
26+
27+
you can check that this worked with `which python` -- it should have 'miniconda' in the path
28+
29+
now set up a python environment:
1830
```
1931
conda env create -f environment.yml
2032
conda activate iil-python-tools
2133
pip install -e notochord
2234
pip install -e iipyper
2335
```
36+
this will install all dependencies in a conda environment called `iil-python-tools`, and do an editable install of notochord and iipyper so you can hack on them.
2437

2538
# notochord
26-
## Train a model
39+
download a model checkpoint (e.g. `notochord_lakh_20G.ckpt`) from the releases page: https://github.com/Intelligent-Instruments-Lab/iil-python-tools/releases
40+
41+
## Run python server
42+
In a terminal, make sure the `iil-python-tools` conda environment is active (`conda activate iil-python-tools`) and run:
2743
```
28-
python notochord/scripts/lakh_prep.py --data_path /path/to/midi/files --dest_path /path/to/data/storage
29-
python notochord/train.py --data_dir /path/to/data/storage --log_dir /path/for/tensorboard logs --model_dir /path/for/checkpoints train
44+
python -m notochord server --checkpoint ~/Downloads/notochord_lakh_20G.ckpt
45+
```
46+
this will run notochord and listen continously for OSC messages.
47+
48+
`examples/notochord/generate-demo.scd` and `examples/notochord/harmonize-demo.scd` are example scripts for interacting with the notochord server from SuperCollider.
49+
50+
## Tidal interface
51+
52+
see `examples/notochord/tidalcycles`:
53+
54+
add `Notochord.hs` to your tidal boot file. Probably replace the `tidal <- startTidal` line with something like:
3055
```
56+
:script ~/iil-python-tools/examples/notochord/tidalcycles/Notochord.hs
3157
32-
## Run OSC app
58+
let sdOscMap = (superdirtTarget, [superdirtShape])
59+
let oscMap = [sdOscMap,ncOscMap]
3360
61+
tidal <- startStream defaultConfig {cFrameTimespan = 1/240} oscMap
62+
```
63+
64+
In a terminal, start the python server as described above.
65+
66+
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.
67+
68+
### Install fluidsynth (optional)
69+
fluidsynth (https://github.com/FluidSynth/fluidsynth) is a General MIDI synthesizer which you can install from the package manager. On mac:
70+
```
71+
brew install fluidsynth
72+
```
73+
fluidsynth needs a soundfont to run, like this one: https://drive.google.com/file/d/1-cwBWZIYYTxFwzcWFaoGA7Kjx5SEjVAa/view
74+
75+
run fluidsynth in a terminal (see the fluidsynth block in `examples/notochord/tidalcycles/tidal-notochord.scd` for an example command).
76+
77+
## Train your own Notochord model (GPU recommended)
78+
79+
preprocess the data:
80+
```
81+
python notochord/scripts/lakh_prep.py --data_path /path/to/midi/files --dest_path /path/to/data/storage
82+
```
83+
launch a training job:
3484
```
35-
python examples/notochord/server.py --checkpoint /path/to/my/model.ckpt
85+
python notochord/train.py --data_dir /path/to/data/storage --log_dir /path/for/tensorboard/logs --model_dir /path/for/checkpoints --results_dir /path/for/other/logs train
3686
```
37-
step through `examples/notochord/generate.scd` in SuperCollider IDE
87+
progress can be monitored via tensorboard.
3888

3989
# Develop
4090

0 commit comments

Comments
 (0)