Code Monkey home page Code Monkey logo

piano's Introduction

Open Piano: an open source piano engine based on physical modeling

Summary

What is Open Piano?

Open Piano is an attempt at recreating the characteristic sound of the piano with physical modeling sound synthesis. This allows for greater expressiveness and flexibility in comparison to sampled pianos. There is also no need to download huge libraries of audio samples, since everything is generated in real time.

How do I use it?

DISCLAIMER: I don't discourage you from trying out Open Piano, but please note that this is still alpha quality software. As of now, it is nowhere near commercial plugins like Modartt's Pianoteq (which I own, and love) or Arturia's Piano V.

A first binary release of Open Piano will be published once the project reaches a usable state.

Building

To build the Open Piano JUCE app/plugin, you will need CMake (version 3.15 or above), a C++ compiler (C++17 or above), and the latest version of the JUCE library. Once you clone/download this repository, you need to clone/download a copy of JUCE inside the OpenPianoJUCE/ folder. You end up with this directory structure:

OpenPiano
├── OpenPianoCore/
├   ├── Source/
├   └── CMakeLists.txt
└── OpenPianoJUCE/
    ├── JUCE/
    ├── Source/
    └── CMakeLists.txt
  • Windows/macOS/Linux: if you use a CMake-based IDE like CLion or QtCreator, use it to open CMakeLists.txt and proceed building from there.
  • Windows only: download and install the latest CMake installer, Visual Studio Community IDE, and the Windows SDK. Open CMake, point it to the source folder (OpenPianoJUCE or OpenPianoCore), and generate a VS project to be opened in Visual Studio.
  • macOS only: download and install XCode from the App Store and the CMake installer. Use CMake to generate an XCode project.
  • Linux/macOS and other UNIX/UNIX-based/UNIX-like operating systems: use the command line 😉

Current state and road map

Right now, Open Piano sounds like a strangely out of tune piano with no soundboard and only one string per note. Here's a short list of what needs to be done:

  • Fix repeated hits of the string by the hammer, without resetting the entire string displacement (see here) - Fixed HERE
  • Optimize the FD model to make it... usable - Partially done HERE, but there's room for improvement
  • Take advantage of multithreading - Semi-decent implementation HERE
  • Add string dampers (normal people call it pedal) - Rudimentary implementation HERE
  • Find a mitigation for the fact that higher strings have a decreasingly lower spatial resolution, which makes it impossible to use the entire piano range with reasonable sampling frequencies
  • Simulate multiple strings per note and the double decay phenomenon
  • Simulate the soundboard
  • Find a decent set of physical parameters for all the strings
  • Simulate sympathetic resonances
  • (In case FD shows itself to be too burdensome, consider the possibility of switching to modal analysis)

How does it work?

Everything starts from the differential equation of vibration of a lossy stiff string, hit by a hammer:

To obtain the spatial displacement of each piano string at each temporal instant, we need to solve this equation. There are different approaches: two examples are finite differences (FD) and modal analysis. The idea behind FD is to discretize the differential equation by substituting its derivatives with finite differences - hence the name. Modal analysis, on the other hand, assumes that the solutions of the equation are in modal form, and discretizes the solutions rather than the equation itself. Open Piano uses the FD approach.

Can I contribute to this project?

Once the project reaches a certain usability level, contributions will be welcome.

Are you crazy?

Yes I do. I am. Whatever

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.