How Can I Improve My MATLAB Piano Synthesis to Sound Less Like a Kazoo?

In summary, the conversation is about an individual seeking help in synthesizing a piano sound using MATLAB. They are currently using a signal with 24 partials and an ADSR envelope, but the sound produced is more like a kazoo. The individual is looking for ways to add the percussive strike of the hammer and inharmonicities to improve the sound. A suggestion is made to record a sample note and modify the playback speed to change the pitch.
  • #1
rhcp13
1
0
Hello,

I'm not sure if this is the right place to write this thread, but I have a question about attempting to synthesize a piano in MATLAB. I am very new to MATLAB and DSP in general and my project is trying to create a piano sound using whatever means (FM synthesis, additive synthesis, etc... whatever is simplest). My program asks the user for a note number (1-88) and should produce the tone with a piano timbre. Right now, I have a signal that is build on the fundamental plus 24 partials with an ADSR envelope for the entire signal. Here is some of the sample code:

srate = 44100;

ff = 27.5*2^((noteNumber-1)/12);

t = (0:1/srate:2);

for i = 1:25
y = y + amp(i)*cos(2*pi*ff*i*t);
end

The sound I am producing is more like that of a kazoo. I know that I need to add the percussive strike of the hammer on the piano strings and some inharmonicities as well but do not know how to go about that? Any help/code would be greatly appreciated. Thank you very much
 
Physics news on Phys.org

1. What is piano synthesis?

Piano synthesis is the process of digitally recreating the sound of a piano using mathematical algorithms. This allows for the creation of realistic piano sounds without the need for actual physical instruments.

2. How does piano synthesis work?

In Matlab, piano synthesis involves using a combination of mathematical models and digital signal processing techniques to generate the individual notes and sounds of a piano. These models take into account factors such as the physical properties of the piano strings and the way a pianist strikes the keys.

3. What are the advantages of using Matlab for piano synthesis?

Matlab is a powerful programming tool that allows for precise control and manipulation of sound. This makes it ideal for piano synthesis as it can accurately recreate the complex and nuanced sounds of a piano. Additionally, Matlab has a wide range of built-in functions and tools that can aid in the creation of realistic piano sounds.

4. Can I use piano synthesis in Matlab to create my own unique sounds?

Yes, one of the major advantages of using Matlab for piano synthesis is the ability to customize and create unique sounds. By adjusting the parameters of the mathematical models, you can create a wide range of sounds that go beyond the traditional piano sound.

5. Are there any limitations to piano synthesis in Matlab?

While Matlab is a powerful tool for piano synthesis, it does have some limitations. The quality and realism of the synthesized piano sound may not be as high as that of a real piano. Additionally, the complexity of the programming and technical knowledge required may be a barrier for some users.

Similar threads

  • Mechanics
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
10
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
3K
  • Astronomy and Astrophysics
Replies
7
Views
4K
Back
Top