How dyci2/somax2 works
Somax 2 is a Max-and-Python system for real-time musical improvisation and composition. A musician supplies MIDI or audio context through Max; the Python runtime manages agents, corpus memory, queries, and scheduling, then produces musical output for Max. Separate corpus-building and classification stages prepare event memories and labels, while features and transforms provide an internal representation and adaptation layer. The README documents multi-agent interaction, manual controls, and a Max library API. Some subsystem links are documented rather than visible in sampled call sites; those are marked dashed.
Main entry points: agent.py Agents · somax_server.py OSC Server · classifier.py Classifiers · corpus_builder.py Corpus Builder
Components 17
Max Interface
- Max Application
- Max JavaScript
max/somax/javascript/computeMemoryPitchClass.js - OSC Server
python/somax/somax_server.py
Corpus Memory
- Corpus Builder
python/somax/somax/corpus_builder/corpus_builder.py - Corpus Updater
python/somax/somax/corpus_builder/threaded_corpus_updater.py - Corpus Memory
python/somax/somax/runtime/corpus.py - Corpus Events
python/somax/somax/runtime/corpus_event.py
Improvisation Runtime
- Agents
python/somax/somax/runtime/agent.py - Corpus Query
python/somax/somax/runtime/corpus_query_manager.py - Player
python/somax/somax/runtime/player.py - Scheduling Handler
python/somax/somax/scheduler/scheduling_handler.py - Event Scheduler
python/somax/somax/scheduler/scheduler.py
Analysis Model
- Classifiers
python/somax/somax/classification/classifier.py - Feature Analysis
python/somax/somax/features/feature.py - Event Transforms
python/somax/somax/runtime/transforms.py - Corpus Labels
python/somax/somax/runtime/label.py
Other components
- Musician
Connections 21
- Musician → Max Application: performs into
- Max Application → OSC Server: controls by OSC
- OSC Server → Agents: configures
python/somax/somax_server.py - OSC Server → Corpus Builder: starts builds
python/somax/somax_server.py - OSC Server → Corpus Updater: starts updates
python/somax/somax_server.py - Agents → Corpus Builder: configures
python/somax/somax/runtime/agent.py - Corpus Builder → Corpus Memory: creates memory
python/somax/somax/corpus_builder/corpus_builder.py - Corpus Builder → Corpus Events: constructs events
python/somax/somax/corpus_builder/corpus_builder.py - Corpus Memory → Corpus Events: stores events
python/somax/somax/runtime/corpus.py - Agents → Corpus Memory: loads memory
python/somax/somax/runtime/agent.py - Agents → Corpus Query: uses queries
python/somax/somax/runtime/agent.py - Agents → Classifiers: configures classification
python/somax/somax/runtime/agent.py - Classifiers → Feature Analysis: classifies features
python/somax/somax/classification/classifier.py - Classifiers → Event Transforms: selects transforms
python/somax/somax/classification/classifier.py - Classifiers → Corpus Labels: produces labels
python/somax/somax/classification/classifier.py - Agents → Scheduling Handler: configures scheduling
python/somax/somax/runtime/agent.py - Scheduling Handler → Event Scheduler: adds events
python/somax/somax/scheduler/scheduling_handler.py - Scheduling Handler → Corpus Events: schedules events
python/somax/somax/scheduler/scheduling_handler.py - Agents → Player: controls playback
python/somax/somax/runtime/agent.py - Player → Max Application: outputs music
- Max Application → Max JavaScript: uses helpers