LMMS Sharing Platform

Share your work with the LMMS community.

All Content      Tutorials      Advanced      Fourier Transform Piano (EARLY ALPHA!!).mmpz

by Sample Text (sampletext)
Size: 16 KB
License: Creative Commons (by)
LMMS Version: 1.2.2
Submitted: 2025-11-18 01:46:17
Updated: 2025-11-18 01:46:17
Popularity:  20   2
Rating:    1
Name: Fourier Transform Piano (EARLY ALPHA!!).mmpz  Download
Description:

Inside this project holds what I have been working on for 10 months.

Comments:
Good work exploring different methods and possibilities. I also attemped to recreate a piano with Fourier analysis. From what I remember, the Korg M1 used piano samples recorded at different octaves. I realized I could replicate this by using a switch in Xpressive to select a different sound for each octave. I first experimented with a Fourier series, and later moved on to using an FFT so I could split each octave’s sample into time windows (or “time bins”, a short analysis frame used by the FFT). I wrote a MATLAB script to run the FFT on each sample, and while I had some limited success, the CPU usage was far too high for real time playback. Reducing the number of harmonics helped the performance, but the sound quality became terrible. It’s unfortunate that LMMS doesn’t include a good built in piano. I’ve looked into how other synthesisers approximate pianos and come up with some rough approximations which only sound good with specific key ranges. I wish we could see how FL Keys works internally, as I remember that sounding OK for my liking years ago. Keep pushing forward. What you recreated already sounds great on that note. Posted by: ewanpettigrew  on 2025-11-18 06:37:02
I had to write a custom Python script to be able to do the fourier analysis, then interpret its data into the XML format that is used in a ZynAddSubFX preset. The crazy thing is, is that because I've separated all the harmonics into 12 oscillators, each with different fundamental frequencies, there's about 1524 harmonics in that one synth, and the CPU usage isn't even that high! But right now, the amplitudes of the harmonics are a jumbled mess where the amplitudes are assigned to the wrong oscillator, because that frequency happened to line up more closely to another oscillator. Posted by: sampletext  on 2025-11-18 14:07:17