Skip to content

CrypticCodeworks/DPX1-SDS-Utility

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MIDI Sample Dump Standard (SDS) for DPX-1

A fully functional Python implementation of the MIDI Sample Dump Standard (SDS) protocol for transmitting WAV files to vintage samplers like the Oberheim DPX-1.

Features

  • Three Operational Modes:
    • Single sample transmission
    • Bulk folder transmission with auto-incrementing sample numbers
    • Play patch mode for testing samples on your sampler
  • Automatic WAV file conversion to 12-bit mono format compatible with DPX-1
  • Support for WAV files of any bit depth (8, 16, 24, 32 bits)
  • Automatic stereo to mono conversion
  • Interactive MIDI port selection
  • Two transmission modes:
    • Open Loop: Direct transmission without handshaking (faster)
    • Closed Loop: Transmission with handshaking and packet acknowledgment
  • Loop configuration (one-shot and sustain loop modes)
  • Memory usage calculation for DPX-1 (shows estimated KB/MB before sending)
  • Progress bar during transmission
  • Robust error handling - application never crashes
  • Continuous menu loop for multiple operations
  • Complete implementation of MIDI SDS standard (January 1986 spec)
  • Tested and verified with Oberheim DPX-1 sampler

Installation

1. Clone the repository

git clone https://github.com/CrypticCodeworks/DPX1-SDS-Utility.git
cd DPX1-SDS-Utility

2. Create and activate virtual environment

python3 -m venv midi_sds_venv
source midi_sds_venv/bin/activate  # On macOS/Linux
# OR
midi_sds_venv\Scripts\activate  # On Windows

3. Install dependencies

pip install -r requirements.txt

Dependencies:

  • mido==1.3.2 - MIDI library for Python
  • python-rtmidi==1.5.8 - Real-time MIDI backend
  • numpy==1.26.4 - Audio array processing

Usage

Interactive Mode

source midi_sds_venv/bin/activate  # Activate virtual environment
python src/main.py

The application presents a main menu with four options:

  1. Send single sample - Send one WAV file at a time
  2. Send folder (bulk) - Send an entire folder of WAV files with auto-incrementing sample numbers
  3. Play patch - Test samples already loaded in your sampler
  4. Exit - Exit the application

After completing any operation, you'll be asked "Return to main menu? [Y/n]"

Single Sample Mode

The program will guide you through:

  1. Select WAV file: Enter the file path or drag and drop the file
  2. Select MIDI port: Choose the MIDI output port from the list
  3. Configure SDS parameters:
    • MIDI channel (0-15)
    • Sample number (0-16383)
    • Loop mode (one-shot or sustain loop)
    • Transmission mode (Open Loop or Closed Loop)
  4. Memory calculation: Shows estimated memory usage in DPX-1 (e.g., ~129.20 KB)
  5. Start transmission: Confirm and the program will send the sample

Bulk Send Mode

Send an entire folder of WAV files:

  1. Select folder: Enter the folder path containing WAV files
  2. View files: See the list of WAV files found
  3. Configure starting sample number: Choose where to start (0-16383)
  4. Configure MIDI channel: Applies to all samples (0-15)
  5. Select loop mode: Applies to all samples (one-shot or sustain loop)
  6. Select MIDI port: Choose output port
  7. Select transmission mode: Open or Closed Loop
  8. Memory calculation: Shows total memory usage for all files
  9. Confirmation summary: Review total samples, sample numbers, and memory
  10. Transmission: Sends all samples sequentially with auto-incrementing numbers
  11. Final report: Shows success/failure count

Play Patch Mode

Test samples already loaded in your sampler:

  1. Select MIDI port: Choose output port
  2. Select MIDI channel: (0-15)
  3. Enter patch/sample number: (0-127)
  4. Select MIDI note: e.g., C2=36, C3=48, C4=60
  5. Set velocity: (1-127, default 100)
  6. Set duration: (0.1-10.0 seconds, default 2.0)
  7. Playback: Sample plays on your sampler
  8. Option to play another patch

Example Session

============================================================
     ██████╗ ██████╗ ██╗  ██╗     ██╗
     ██╔══██╗██╔══██╗╚██╗██╔╝    ███║
     ██║  ██║██████╔╝ ╚███╔╝     ╚██║
     ██║  ██║██╔═══╝  ██╔██╗      ██║
     ██████╔╝██║     ██╔╝ ██╗     ██║
     ╚═════╝ ╚═╝     ╚═╝  ╚═╝     ╚═╝
============================================================
    MIDI Sample Dump Standard (SDS) Utility
    Optimized for Oberheim DPX-1
============================================================

Main Menu:
  1. Send single sample
  2. Send folder (bulk)
  3. Play patch (test samples)
  4. Exit

Select option (1-4): 1

Enter WAV file path (or drag and drop file):
> /path/to/your/sample.wav

Loading WAV file: /path/to/your/sample.wav

WAV File Information:
  Sample Rate: 44100 Hz
  Original Channels: 2
  Original Bit Depth: 24 bits
  Number of Samples: 88200
  Duration: 2.00 seconds
  Converted to: 12-bit mono
  Estimated memory in DPX-1: ~129.20 KB

Available MIDI Output Ports:
  1. IAC Driver Bus 1
  2. USB MIDI Device

Select port (1-2) [1]: 1
Opened output port: IAC Driver Bus 1

============================================================
SDS Configuration
============================================================
MIDI Channel (0-15) [0]: 0
Sample Number (0-16383) [0]: 1

Loop Mode:
  1. One-shot (no loop)
  2. Sustain loop

Select mode (1-2) [1]: 1

Dump Mode:
  1. Open Loop (no handshaking, faster)
  2. Closed Loop (with handshaking, requires MIDI input)

Select mode (1-2) [1]: 1

Generating SDS messages...
Generated 1 header + 735 data packets

============================================================
Starting MIDI SDS Transmission
============================================================

Ready to send. Proceed? [Y/n]: y

Sending...
Progress: 735/735 packets (100.0%)

Transmission completed successfully!

Return to main menu? [Y/n]: y

Project Structure

DPX1-SDS-Utility/
├── src/
│   ├── main.py           # Main application with interactive menu
│   ├── wav_processor.py  # WAV file processing (12-bit conversion)
│   ├── sds_encoder.py    # SDS protocol encoder
│   └── midi_handler.py   # MIDI port handling and transmission
├── wavs/                 # Sample WAV files for testing
├── requirements.txt      # Project dependencies
├── README.md            # This file
├── CLAUDE.md            # Developer documentation for Claude Code
├── TECHNICAL_GUIDE.md   # Comprehensive technical documentation
└── CONTRIBUTING.md      # Contribution guidelines

MIDI SDS Specification

This project fully implements the MIDI Sample Dump Standard adopted in January 1986 by the MIDI Manufacturers Association, specifically optimized for vintage samplers like the Oberheim DPX-1.

Critical Implementation Details for DPX-1

12-bit Unsigned Format:

  • DPX-1 uses 12-bit resolution (not 16-bit)
  • Unsigned representation: 0x000 = full negative, 0x800 = zero, 0xFFF = full positive
  • Conversion formula: unsigned_value = signed_value + 2048

Loop Points Configuration:

  • For one-shot (no loop): loop_start = loop_end = last_sample
  • For sustain loop: loop_start and loop_end define the loop region
  • Important: Setting both to 0 creates a 1-sample loop (brief click sound)

Timing Requirements for Vintage Hardware:

  • Delay after header: 3 seconds (increased for DPX-1)
  • Delay between packets: 50ms (prevents buffer overruns)

Message Format

Dump Header (21 bytes):

F0 7E cc 01 ss ss ee ff ff ff gg gg gg hh hh hh ii ii ii jj F7

Data Packet (127 bytes):

F0 7E cc 02 kk <120 bytes> mm F7

Protocol Features

  • Each data packet contains 120 bytes (60 samples)
  • Support for samples from 8 to 28 bits
  • XOR checksum for data integrity verification
  • Handshaking messages (ACK, NAK, CANCEL, WAIT)
  • Sustain loops with forward and alternating modes

Memory Calculation

DPX-1 Memory Formula:

Memory (bytes) = Number of samples × 1.5 bytes

Why 1.5 bytes per sample?

  • DPX-1 stores samples in 12-bit mono format
  • 12 bits = 1.5 bytes per sample
  • Original WAV bit depth doesn't matter (converted to 12-bit)

Examples:

  • 1 second @ 44.1kHz = 44,100 samples = ~64.60 KB
  • 2 seconds @ 44.1kHz = 88,200 samples = ~129.20 KB
  • 10 seconds @ 44.1kHz = 441,000 samples = ~646.01 KB

System Requirements

  • macOS, Linux, or Windows
  • Python 3.8 or higher
  • At least one available MIDI port
  • MIDI interface or virtual MIDI port

Troubleshooting

No MIDI ports found

On macOS:

  1. Open Audio MIDI Setup
  2. Go to Window > Show MIDI Studio
  3. Double-click "IAC Driver"
  4. Check "Device is online"
  5. Restart the application

On Windows:

  • Install a virtual MIDI driver like loopMIDI or virtualMIDI

On Linux:

  • Make sure ALSA MIDI is properly configured

Error installing python-rtmidi

On macOS:

xcode-select --install

On Linux (Debian/Ubuntu):

sudo apt-get install libasound2-dev libjack-dev

Sample plays as brief click/pop

Problem: Loop points were set to 0,0 Solution: Use one-shot mode which sets both to last sample

Sample loops continuously when it shouldn't

Problem: Wrong loop mode selected Solution: Select "One-shot (no loop)" mode

No sound at all

Problem: May have used LOOP_OFF (0x7F) which DPX-1 doesn't support Solution: Use one-shot mode instead

Noisy/distorted audio

Problem: Incorrect sample encoding Solution: Ensure using unsigned format (signed + 2048), not two's complement

Contributing

We welcome bug reports and pull requests! Please see CONTRIBUTING.md for guidelines.

Support This Project

If you find this project useful and it helps you work with your vintage sampler, consider supporting its development!

Ko-fi

Your support helps maintain and improve this project. Thank you! 🙏

License

This project is open source and available for educational and commercial use.

Credits

Developed by: PelidaSynth Technology: Python 3, mido, numpy, python-rtmidi Target Hardware: Oberheim DPX-1 (compatible with other SDS samplers) Protocol: MIDI Sample Dump Standard (MMA/JMSC, January 1986 specification)

Additional Resources

  • TECHNICAL_GUIDE.md - Comprehensive technical documentation with detailed explanations, examples, and problem-solving timeline
  • CLAUDE.md - Developer documentation for working with Claude Code

Tested Hardware

Oberheim DPX-1 - Fully tested and verified

  • 12-bit sample transmission
  • One-shot and sustain loop modes
  • Open Loop transmission (recommended)
  • Memory calculation accurate

Other SDS-compatible samplers should work but may require timing adjustments.

About

No description, website, or topics provided.

Resources

Contributing

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

 
 
 

Contributors

Languages