YM2151 event log editor (TUI interface). Written in Rust.
This is a terminal-based JSON editor for YM2151 synthesizer event logs. It assists in visualizing and editing YM2151 event data, with a particular focus on timing adjustment and event inspection.
Requires Rust 1.70 or later.
# Clone the repository
git clone https://github.com/cat2151/ym2151-log-editor.git
cd ym2151-log-editor
# Build
cargo build --release
# Run with a specified JSON file
cargo run -- path/to/your/file.json
# Launch editor with a specified file
./target/release/ym2151-log-editor your_log.json
| Key | Action |
|---|---|
| β/β | Move between events |
| / or ENTER | Insert a new event before the current line |
| DELETE | Delete the current event |
| 0-9 | Set wait time (0-9 milliseconds, cumulative mode only) |
| P | Preview playback (plays the entire JSON) |
| T | Toggle time display mode (Cumulative β Timestamp) |
| S | Save file |
| Q or ESC | Exit application |
The editor handles YM2151 event logs in JSON format:
{
"events": [
{
"time": 0.0,
"addr": "20",
"data": "4F"
},
{
"time": 0.01,
"addr": "08",
"data": "78"
}
]
}
time: Absolute timestamp (in seconds)addr: YM2151 register address (hexadecimal)data: Register data value (hexadecimal)Displays the wait time (delta) from the previous event. This is useful for editing timing, allowing you to view and adjust delays between events.
Example:
0.000000 20 4F β First event (time 0)
0.010000 40 16 β 10ms after the previous
0.010000 KeyON 78 β 10ms after the previous
Displays the absolute time from the start. This is the internal format used when saving files.
Example:
0.000000 20 4F β 0ms from start
0.010000 40 16 β 10ms from start
0.020000 KeyON 78 β 20ms from start
Press the T key to toggle between these modes.
Events for register 0x08 (KeyON/KeyOFF register) are displayed as βKeyONβ instead of β08β to improve readability:
0.010000 KeyON 78 β Easily identify KeyON/OFF events
0.500000 KeyON 00
src/
βββ main.rs - Entry point and event loop
βββ app.rs - Application state and logic
βββ models.rs - Data structures (Ym2151Event, Ym2151Log)
βββ ui.rs - UI rendering
cargo build # Development build
cargo build --release # Optimized build
Sample test data is provided in test_data/sample.json:
cargo run -- test_data/sample.json
Refer to IMPLEMENTATION_PLAN.md for detailed implementation plans and future roadmap.
See the LICENSE file for details.
For a complete roadmap, refer to IMPLEMENTATION_PLAN.md.