MIDI Score Sampler

Prang: MIDI Score Sampler – Create Musical Magic with Your Keyboard

Update: Prang has been ported to the Teensy 4.1, and the project is now available on GitHub. While it may not warrant a separate article, this update is worth mentioning for those following the project’s progress. The Teensy 4.1 offers built-in USB hosting and an SD reader, making it faster and easier to assemble. This update ensures a swifter, more cost-effective product.

Disclaimer: Prang is a moderately complex project that involves some soldering. It is licensed under GPL due to necessary modifications to a GPL-licensed library included in the project.

Prang is your gateway to musical creativity. It serves as a MIDI “score sampler,” allowing you to bring musical scores to life by playing notes on your keyboard or MIDI controller. This innovative project empowers you to incorporate sections of MIDI compositions into your performances, seamlessly triggered by a simple keystroke.

How Prang Works:

Prang sits between your keyboard’s USB connection and your computer, intercepting all USB MIDI traffic. It then manipulates and injects this traffic with MIDI data from MIDI files. The heart of Prang consists of a circuit that isn’t entirely displayed here, which includes a screen, an encoder, and buttons.

Hardware Components:

To build Prang, you’ll need the following components:

  1. ESP32S3 DevkitC or a similar microcontroller.
  2. USB2.0 Host Shield (requires modification).
  3. SD reader module.
  4. ILI9341 or compatible TFT/LCD/OLED display.
  5. Rotary encoder.
  6. Two momentary buttons.
  7. USB cables, soldering iron, and tweezers.

Modifying the USB2.0 Host Shield:

The USB2.0 Host Shield requires modification to provide the correct voltage (5V) to the USB host port. This involves removing a resistor and soldering a 5V wire to the VBUS connection. This modification ensures compatibility with various MIDI devices.

Wiring and Extensibility:

Wiring Prang is manageable if you have experience with circuits. The code provides guidance on how to set up the project. Additionally, Prang’s design allows for extensibility, making it suitable for various MIDI applications.

Software Requirements:

  • PlatformIO is necessary to build this project due to its dependencies, which are fetched from the PlatformIO repository.
  • Ensure your platforms and libraries are up to date, as this project relies on relatively new components.
  • MIDI-OX or similar MIDI routing software can be helpful for managing MIDI on your PC.

Using Prang:

  1. Upon startup, Prang prompts you to insert an SD card with at least one MIDI file.
  2. If multiple MIDI files are present, you can select the one you want to use.
  3. Specify the base or root octave for mapping tracks.
  4. Choose a quantization level (optional).
  5. Save your settings (optional).

Now you can start playing music. Prang allows you to adjust the tempo multiplier, and each track maintains its own tempo. Keys are mapped to MIDI file tracks, offering a seamless way to enhance your performances.

How Prang Operates:

Prang acts as a USB Host to your MIDI device, intercepting MIDI messages. It processes and quantizes notes, ensuring accurate playback. The main application thread controls the user interface, and the MIDI processing occurs on a high-priority thread.

Coding Prang:

Prang relies on various libraries developed by the creator. The MIDI processing is handled by the SFX library, the graphical interface by the GFX library, and threading by the FreeRTOS thread pack. While most code is authored by the creator, some parts come from 3rd-party libraries, especially the MIDI drivers and encoder library.

Prang opens up a world of musical possibilities by seamlessly integrating MIDI compositions with your live performances. Its versatile hardware design and the power of the SFX library make it an excellent choice for MIDI enthusiasts and musicians looking to experiment with new musical experiences. Whether you’re creating new gear or modifying Prang to suit your needs, let the magic of MIDI flow through your fingertips.