Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
.DS_Store
bard
logmind
logmind-go
chatbridge
chroma/js
node_modules/
.next/
__pycache__/
.env*
2 changes: 2 additions & 0 deletions midi_meta/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.env
*.db
26 changes: 26 additions & 0 deletions midi_meta/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@

-include .env
export

.PHONY: help
help: ## Prints out the description of the Make targets available
@grep -E '^[a-zA-Z0-9_-]+:.*?## ' Makefile | awk 'BEGIN {FS = ":.*?## "}; {printf "%-20s %s\n", $$1, $$2}'

.PHONY: run-openai
run-openai: REQUIRED_ENV := OPENAI_API_KEY MODEL_NAME INPUT_FILE OUTPUT_FILE
run-openai: check-env ## Runs the metadata gather process on the specified input file
python main.py --model-type openai --model-name "${MODEL_NAME}" "${INPUT_FILE}" "${OUTPUT_FILE}"

write-updates: REQUIRED_ENV := OUTPUT_DIR METADATA_FILE MIDI_DIR
write-updates: check-env ## Saves the new metadata into an updated set of MIDI file(s)
python meta_writer.py --output-dir "${OUTPUT_DIR}" "${METADATA_FILE}" "${MIDI_DIR}"


.PHONY: check-env
check-env:
@for var in $${REQUIRED_ENV}; do \
if [ -z "$${!var}" ]; then \
echo "Missing required environment variable: $$var"; \
exit 1; \
fi; \
done
14 changes: 14 additions & 0 deletions midi_meta/Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
openai = "*"
ollama = "*"
mido = "*"

[dev-packages]

[requires]
python_version = "3.12"
347 changes: 347 additions & 0 deletions midi_meta/Pipfile.lock

Large diffs are not rendered by default.

40 changes: 40 additions & 0 deletions midi_meta/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@

### Setup

```
$ PATH="/Users/martyross/.local/bin:$PATH"
```


### Orchestrations

#### Read the Metadata

```shell
$ python meta_reader.py ~/repos/noodnik2/mzb/samples/src/240818-nuvi/gs/l100* --output ~/tmp/meta_reader_l100.json
```

#### Add the LMM Metadata

```shell
$ python main.py --model-type openai --model-name gpt-4 ~/tmp/meta_reader_l100.json ~/tmp/lmm_output_l100.json
```

### Update the Database

```shell
$ python fmm.py --update < ~/tmp/lmm_output_l100.json
```

### Render the `.m4a` from the `.mid`

...

### Produce the `exiftool` Commands

Needs some work to select the files and link them to the new `.m4a` rendered versions.

```shell
$ python fmm.py --query l1001_04.mid l1002_02.mid ...
```

1 change: 1 addition & 0 deletions midi_meta/env-template
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
OPENAI_API_KEY=
Binary file added midi_meta/file_metadata.db
Binary file not shown.
Loading