Developer_Onboarding
This contributor guide explains the design intent, source layout, module boundaries, invariants, canonical names, and source anchors behind Project-DJ-Engine (PDJE) and PDJE-Godot-Plugin. Godot users who only need to call the extension should start with Core_Engine instead.
What PDJE Is
PDJE is organized around four integration surfaces:
PDJE the main facade for playback, editor access, and the core data line.
PDJE_Input low-latency keyboard, mouse, and MIDI ingestion.
PDJE_JUDGE::JUDGE timing-sensitive note matching built on synchronized input and audio clocks.
PDJE_UTIL reusable database, fuzzy-search, image/WebP, STFT, MIR, ONNX Runtime, and Beat This functionality. Current utility interfaces use direct returns and exceptions rather than the removed shared Result/Status layer.
Choose Your Starting Path
If you need playback, player control, or track/music lookup, start with Core_Engine.
If you need to author or edit project content, read Core_Engine for the entrypoints, then move to Editor_Workflows.
If you need keyboard, mouse, or MIDI input capture, read Input_Engine.
If you are building rhythm-game style timing and scoring, read Judge_Engine after Input_Engine.
If you need shared live state between modules, read Data_Lines.
If you need editor data formats or timeline serialization details, read Editor_Format after Editor_Workflows.
If you are integrating from Godot, use the GDScript workflows in the module guides and keep Godot wrapper names distinct from native C++ names.
If you need AI helper APIs, ONNX Runtime model execution, or Beat This beat/downbeat detection, read Util_Engine.
How To Read This Project
Recommended reading order:
Read Project-DJ-Engine for the high-level module overview. It also now carries the broader use-case and project-automation context.
Read Getting Started for the guide map.
Read Core_Engine to understand the main facade and runtime flow.
Read Editor_Workflows if your application creates or mutates project content.
Read Input_Engine if your application touches live input.
Read Judge_Engine if your application performs note matching.
Read Data_Lines before you poll live state from another module or thread.
Read Editor_Format if you generate or inspect editor-side data on disk.
Use API Reference only after the workflow docs above.
The hand-written docs explain recommended workflows. The generated API explains what symbols exist. Those are not the same thing.
Build And Configuration Reality
Current build facts from the source tree:
CMake minimum is 3.12.
The project requires C++20.
Conan is part of the expected dependency flow. The linked CMakeLists.txt defaults to a locally generated Conan toolchain file when no toolchain is supplied; that generated file is not stored in the source repository.
PDJE_DYNAMIC controls static vs shared library builds.
PDJE_DEVELOP_INPUT controls whether the input and judge module libraries are built.
Wrapper build options are contributor concerns; public Godot calls must be verified against Wrapper_Includes/ rather than inferred from native targets.
PDJE_TEST enables doctest-based unit tests and CTest registration.
PDJE_DEV_TEST enables legacy/manual developer test executables.
ONNX Runtime is part of the maintained utility dependency surface for PDJE_UTIL::ai; Beat This detection also requires a valid .onnx model path in the current checkout or wrapper call.
Practical meaning:
PDJE itself is the always-built core library.
PDJE_MODULE_INPUT and PDJE_MODULE_JUDGE exist only when PDJE_DEVELOP_INPUT=ON.
On Windows, enabling the input path also enables the subprocess executable used by the Raw Input transport.
The current tree carries production input implementations for Linux and Windows.
macOS input is not implemented in-tree.
Project Mental Model
Core runtime facade lives under include/core/ and exposes the main public entrypoint include/core/interface/PDJE_interface.hpp.
Editor and authoring subsystem also lives under include/core/, but spans both include/core/MainObjects/editorObject/ and include/core/editor/. It is a major part of the project, not just a helper around InitEditor().
Input lives under include/input/ and exposes include/input/PDJE_Input.hpp.
Judge lives under include/judge/ and exposes include/judge/PDJE_Judge.hpp.
Utility lives under include/util/ and exposes include/util/PDJE_Util.hpp, with direct-include extensions for image/WebP, STFT, and AI helper headers.
Global shared infrastructure lives under include/global/ and provides data lines, clocks, crypto, RAII, and logging helpers used across modules.
The tree also contains older or legacy areas such as trashbin and DEPRECATE. Do not assume those are active build paths just because they appear in generated API pages.
Useful Domain Knowledge
DJ and playback terms:
music usually means a concrete audio asset plus metadata.
track usually means a higher-level authored object that can reference mix and note structures plus music metadata.
deck means a playback slot or source lane inside a DJ-style workflow.
cue means a specific seek/play start position.
BPM is beats per minute and appears in both playback and chart timing contexts.
FX means runtime effect processing such as filter, EQ, echo, or roll.
Rhythm-game terms:
rail is the gameplay lane or logical input destination a note belongs to.
note is an authored gameplay event with timing and rail metadata.
judgment window means the timing tolerance around the expected note time.
Audio timing terms:
frame means one sample frame at the current sample rate.
sample rate controls how frame positions map to time.
callback cadence means how often the audio backend asks for more audio.
microsecond is the fine-grained timing unit used for synchronized input/audio judgment.
AI and music-analysis terms:
ONNX model means a model file loaded through the utility AI surface; availability and deployment path depend on the current checkout and build configuration.
Beat This means the Beat This beat/downbeat detection pipeline exposed through PDJE_UTIL::ai::BeatThisDetector and the Godot Beat This wrapper classes.
beat/downbeat timestamp means a detected musical beat or downbeat position reported in seconds.
log-mel spectrogram means the frontend representation produced before Beat This ONNX inference.
Input terms:
backend means the platform-specific input implementation that was selected.
MIDI port means a live hardware or virtual MIDI input endpoint.
input_arena means the keyboard/mouse transport exposed by PDJE_INPUT_DATA_LINE.
Storage and authoring terms:
root DB means the database root used by the core/editor path.
project-local editor state means the working timeline and metadata state managed by editorObject before content is pushed back into the root DB.
SQLite is used in the relational storage layer.
RocksDB is used in the key-value storage layer.
Cap’n Proto is used for binary translation/serialization in the core DB pipeline.
editor JSON means the timeline-oriented JSON representation described in Editor_Format.
First Real Workflows
Playback-first integration flow:
Build the project with the desired options.
Construct PDJE with the root database path.
Search for music or track objects through SearchMusic() or SearchTrack().
Create a player with InitPlayer().
Pull a PDJE_CORE_DATA_LINE if another module needs live playback state.
Add PDJE_Input only if you need live keyboard, mouse, or MIDI capture.
Add PDJE_JUDGE::JUDGE only if you need synchronized note matching.
Editor-first authoring flow:
Build the project with the desired options.
Construct PDJE with the root database path.
Initialize the editor through InitEditor().
Acquire the editorObject through GetEditorObject().
Create or open project content, then mutate it through the editor workflow.
Render or push the result back toward the root DB.
Optionally use preview playback through the editor/player bridge.
Use these pages for the detailed workflows:
Contributor Orientation
If you are modifying the repository rather than only embedding the engine, start here:
Main public facade: include/core/interface/PDJE_interface.hpp
Playback implementation: include/core/MainObjects/audioPlayer/
Editor facade object: include/core/MainObjects/editorObject/
Editor timeline, linter, and serialization core: include/core/editor/
Input implementation: include/input/
Judge implementation: include/judge/
Utility layer: include/util/
Utility AI layer: include/util/ai/
Shared infrastructure: include/global/
Tests: tests/, including unit, smoke, and C ABI coverage.
Public hand-written documentation: the public site’s hand-written source pages.
Generated API lookup: the public site’s generated API sources.
Important project quirks:
In the Core repository, include/ is not headers-only. It also contains a large amount of implementation .cpp code.
Editor history, timeline mutation, and render/push logic are not fully described by the top-level PDJE header. Read the editor-specific paths and manual docs before changing that subsystem.
Common Mistakes
Do not assume the generated API pages define the recommended integration order.
Do not assume input and judge are always built. That depends on PDJE_DEVELOP_INPUT.
Do not infer Godot coverage from native interfaces. Verify registered wrapper classes and methods in Wrapper_Includes/.
Do not assume editor support is only InitEditor() plus one or two helper calls. editorObject is a real subsystem with mutation, history, and persistence workflows.
Do not assume Editor_Format explains the full editor operation model. It explains data shapes, not the complete editing lifecycle.
Do not assume legacy or deprecated paths are part of the active runtime.
Do not assume macOS input support exists in the current source tree.
Do not mix Godot wrapper names with native C++ names when reading examples.