Skip to content

Commit

Permalink
docs, homunculus overhaul instrument picker, change config to use tom…
Browse files Browse the repository at this point in the history
…l and add `notochord files` command
  • Loading branch information
victor-shepardson committed May 24, 2024
1 parent d2125a9 commit 6c3e916
Show file tree
Hide file tree
Showing 8 changed files with 455 additions and 257 deletions.
23 changes: 14 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,29 @@ run fluidsynth in a terminal. For example, `fluidsynth -v -o midi.portname="flui

Notochord includes several [iipyper](https://github.com/Intelligent-Instruments-Lab/iipyper.git) 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 Notochord harmonizer adds extra concurrent notes for each MIDI note you play in. In a terminal, make sure your notochord Python environment is active and run:
```
notochord harmonizer
```
try `notochord harmonizer --help`
to see more options.

the "homunculus" gives you a UI to manage multiple input, harmonizing or autonomous notochord channels:
The `homunculus` provides a text-based graphical interface to manage multiple input, harmonizing or autonomous notochord channels:
```
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.

If you are using fluidsynth, try:
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](https://www.tobias-erichsen.de/software/loopmidi.html) before starting the app.

There are also two simpler notochord apps: `improviser` and `harmonizer`. The harmonizer adds extra concurrent notes for each MIDI note you play in. In a terminal, make sure your notochord Python environment is active and run:
```
notochord harmonizer
```
try `notochord harmonizer --help`
to see more options.

Development is now focused on `homunculus`, which is intended to subsume all features of `improviser` and `harmonizer`.


## Python API

See the docs for `Notochord.feed` and `Notochord.query` 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.
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "notochord"
version = "0.5.2b0"
version = "0.5.3b0"
description = "Notochord is a real-time neural network model for MIDI performances."
authors = ["Victor Shepardson <victor.shepardson@gmail.com>"]
license = "MIT"
Expand All @@ -15,6 +15,7 @@ tqdm = "^4.64"
sf2utils = "^0.9"
appdirs = "^1.4.4"
iipyper = {path = "../iipyper", develop = true}
toml-file = "^1.0.5"

[tool.poetry.group.dev.dependencies]
mkdocs = "^1.5.3"
Expand Down
9 changes: 8 additions & 1 deletion src/notochord/__main__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import sys
import sys, subprocess

from iipyper import run

from notochord import Notochord
from notochord.app import *

def help():
Expand All @@ -11,6 +12,7 @@ def help():
homunculus: run the Notochord homunculus TUI
harmonizer: run the Notochord harmonizer TUI
improviser: run the Notochord improviser TUI
files: show the location of Notochord models and config files on disk
""")

def _main():
Expand All @@ -28,6 +30,11 @@ def _main():
if sys.argv[1] == 'improviser':
sys.argv = sys.argv[1:]
run(improviser)
if sys.argv[1] == 'files':
d = Notochord.user_data_dir()
print(d)
# os.system(f"open '{d}'")
subprocess.run(('open', d))
else:
help()
except IndexError:
Expand Down
33 changes: 29 additions & 4 deletions src/notochord/app/homunculus.css
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,40 @@ MixerButtons Button {
height:3;
}

InstrumentSelect Grid {
grid-size: 8 16;
ModalScreen {
align: center middle;
}
InstrumentSelect Button {

ModalScreen Grid {
grid-size: 4 7;
grid-gutter: 1 1;
# grid-rows: 1fr 3;
padding: 0 1;
width: 35;
height: 22;
border: thick $background 80%;
background: $surface;
}
InstrumentGroup {
border: none;
min-width: 5;
height: 2;

}
InstrumentSelect Grid {
grid-size: 4 5;
}
Instrument {
border: none;
min-width: 5;
min-height: 3;
}

# InstrumentSelect Button {
# border: none;
# min-width: 5;
# height: 2;

# }

/* MixerButtons Button {
height: 5;
Expand Down
Loading

0 comments on commit 6c3e916

Please sign in to comment.