o
odinpkg.dev
packages / library / Physically_Modelled_Piano_in_Odin

Physically_Modelled_Piano_in_Odin

8b6bbf9library

A simple and far from the good physically modelled pianos, but a nice project to learn more about the subject.

No license · updated 5 months ago

Physically Modelled Piano in Odin

A simple and far from the good physically modelled pianos, but a nice project to learn more about the subject.

Description

This is a physically modeled piano implemented in the Odin programming language that one can give a function with the piano notes, timmings and dynamics, and it will generate a stereo WAV file with the piano music.

Features of de physical modelling of this piano

--- Commuted Waveguide Piano Synthesis ---

- Commuted excitation ( hammer + soundboard combined ).
- Velocity-dependent hammer hardness.
- Calibrated loop filter ( T60 curve matching ).
- Hammer position comb filtering.
- Stiffness dispersion ( inharmonicity ).
- Delay line preloading ( harmonic seeding ).
- Multi-string detuning ( double-decay + chorus ).
- Sympathetic resonance ( pedal coupling ).
- Two-stage damper model ( felt contact + damping ).
- Voice stealing ( 256 voice polyphony ).
- Soundboard body filter ( modal resonances ).
- chroeder reverb with early reflections.
- Stereo keyboard panning.

Musics

Compile - run - play

make

make run  # option 1
make run  # option 2

# To play the wav
ffplay fur_elise.wav

ffplay moonlight.wav  

# To compress to MP3
ffmpeg -i fur_elise.wav -ab 256k fur_elise.mp3
ffmpeg -i moonlight.wav -ab 256k moonlight.mp3

ffplay fur_elise.mp3
ffplay moonlight.mp3

License

MIT Open Source License

Have fun

Best regards,
Joao Carvalho