View on GitHub

smf-to-ym2151log

smf-to-ym2151log

smf-to-ym2151log

Convert Standard MIDI Files (SMF) to YM2151 register write log in JSON format.

Features

Installation

pip install -r requirements.txt

Usage

python smf_to_ym2151log.py <midi_file>

Example

# Create a test MIDI file
python create_test_midi.py

# Convert it to YM2151 log
python smf_to_ym2151log.py test.mid

This will generate:

Output Format

The YM2151 log JSON follows this format:

{
  "event_count": 50,
  "events": [
    {"time": 0, "addr": "0x08", "data": "0x00"},
    ...
  ]
}

Where:

Development

Running Tests

python -m pytest tests/ -v

Project Structure

smf-to-ym2151log/
├── src/
│   ├── __init__.py
│   ├── midi_parser.py       # Pass A: MIDI to events
│   ├── midi_utils.py        # MIDI utility functions
│   └── ym2151_converter.py  # Pass B: Events to YM2151 log
├── tests/
│   ├── __init__.py
│   ├── test_midi_utils.py
│   └── test_ym2151_converter.py
├── smf_to_ym2151log.py      # Main script
├── create_test_midi.py      # Test MIDI file generator
└── requirements.txt

Libraries Used

License

See LICENSE file.