deepjazz
Use deepjazz for legacy MIDI jazz generation with music21 preprocessing, abstract grammar tokens, Keras/Theano LSTM training, safe diagnostics, and modernization guidance.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- deepjazz
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Use deepjazz for legacy MIDI jazz generation with music21 preprocessing, abstract grammar tokens, Keras/Theano LSTM training, safe diagnostics, and modernization guidance.
- disable-model-invocation
- true
02 资源文件 5
- 参考文档references/dependency-environment.md2.3 KB
- 参考文档references/repo-provenance.md1.9 KB
- 参考文档references/repo-routing-metadata.json317 B
- 参考文档references/troubleshooting.md2.7 KB
- 脚本scripts/check_deepjazz_environment.py5.7 KB
03 SKILL.md 正文
deepjazz Repo Skill
Use this skill when a task involves the deepjazz repository or a deepjazz-style workflow: symbolic MIDI jazz generation, Metheny-style MIDI preprocessing, abstract grammar tokens, note cleanup, Keras/Theano LSTM generation, optional Theano GPU commands, or modernizing the legacy code.
This skill is self-contained. Do not rely on reading original repo scripts at runtime to recover constants, signatures, or workflow boundaries; use the bundled references and scripts below.
First route by task
| User task | Route |
|---|---|
| Inspect whether a MIDI file can work with deepjazz, change melody/accompaniment parts, or debug corpus extraction | sub-skills/midi-preprocessing/ |
| Explain or validate grammar tokens, run parse/unparse/cleanup smoke checks, or debug malformed generated grammar | sub-skills/grammar-and-qa/ |
| Run, adapt, or port the LSTM generation path; avoid playback/training hazards; inspect model settings | sub-skills/lstm-generation/ |
| Diagnose install/import/backend problems that cut across all workflows | references/troubleshooting.md |
| Check whether this skill matches a checkout/source revision | references/repo-provenance.md |
Minimal safe start
-
Treat deepjazz as a legacy script collection, not a modern installable package.
-
For faithful execution, use a Python 2.7-era environment with NumPy/SciPy,
music21, Keras 1.x, and Theano. Readreferences/dependency-environment.mdbefore installing. -
Set
KERAS_BACKEND=theanobefore importing legacy Keras. -
Run the bundled no-training environment check:
python scripts/check_deepjazz_environment.py --expect-theano -
Validate MIDI structure before training:
python sub-skills/midi-preprocessing/scripts/inspect_midi_structure.py --midi-file <input.mid> -
Validate grammar/QA behavior without training:
python sub-skills/grammar-and-qa/scripts/grammar_roundtrip_smoke.py --seed 7 -
Only run full generation after environment, data, and grammar checks pass. The original generation flow trains an LSTM, attempts realtime MIDI playback, and writes MIDI output.
Key distilled facts
- Public source modules:
generator,grammar,preprocess,qa, andlstm. - Verified public signatures:
generate(data_fn, out_fn, N_epochs),build_model(corpus, val_indices, max_len, N_epochs=128),get_musical_data(data_fn),get_corpus_data(abstract_grammars),parse_melody(fullMeasureNotes, fullMeasureChords),unparse_grammar(m1_grammar, m1_chords),prune_grammar(curr_grammar),prune_notes(curr_notes),clean_up_notes(curr_notes). - Default generation settings:
max_len=20,max_tries=1000,diversity=0.5,bpm=130, default epochs128. - The README documents CPU execution and an optional NVIDIA/Theano GPU command; CPU is the safe baseline for this skill.
- The default MIDI workflow is tailored to a Metheny fixture: melody part
5, accompaniment parts0,1,6,7, and solo window offsets476..548.
Shared references and scripts
references/dependency-environment.md: public legacy dependency guidance and safe command sequence.references/troubleshooting.md: cross-cutting install, Python compatibility, data, playback, speed, and optional CUDA troubleshooting.references/repo-provenance.md: source commit, branch, evidence paths, and refresh baseline.references/repo-routing-metadata.json: structured router metadata used only if this skill is later imported into the managed repo-skills library.scripts/check_deepjazz_environment.py: safe dependency/backend/module-signature diagnostic; accepts optional--repo-rootfor inspecting a local deepjazz-style source tree without training.
Non-goals
- Do not treat this as a generic modern music-generation framework.
- Do not claim GPU verification unless a task explicitly verifies the legacy Theano CUDA path.
- Do not run full generation as a quick smoke test; use bundled no-training helpers first.
- Do not expect arbitrary MIDI files to work without adapting part and offset assumptions.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).