Sign in

username:

password:



Not a member?

Search matlab



Search tips

Subscribe to matlab



matlab by Keywords

Atanh | Autocorrelation | Bandpass Filter | C++ | Conv | Database | Deconv | Excel | FFT | Filter | Filtering | FIR | Fourier Transfrom | FSK | Gaussian Noise | Haykin | IFFT | Image | Java | LFSR | LMS | LPC | MEX | OFDM | QPSK | Radix | Random | Sampling | Segmentation | Simulink | Visual Basic | Waveform | Wavelet

Ads

Discussion Groups

See Also

Embedded SystemsFPGAElectronics

Discussion Groups | Matlab DSP | piano synthesis in MATLAB PLZ HELP!

Technical discussion about Matlab and issues related to Digital Signal Processing.

  

Post a new Thread

piano synthesis in MATLAB PLZ HELP! - garl...@yahoo.com - Dec 21 8:03:11 2011

Hello,

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

*Note: amp is a vector that contains coefficients that represent amplitudes of
each partial

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





(You need to be a member of matlab -- send a blank email to matlab-subscribe@yahoogroups.com )

Re: piano synthesis in MATLAB PLZ HELP! - Brian de Brit - Dec 25 13:22:05 2011

I would imagine different harmonics decay at different rates; probably
lower harmonics decay slower. You should research this a bit.

On 18 December 2011 20:52, <g...@yahoo.com> wrote:

> **
> Hello,
>
> 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
>
> *Note: amp is a vector that contains coefficients that represent
> amplitudes of each partial
>
> 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
>  
>

______________________________
Start your Android Ice Cream Sandwich development on TI's AM35x Sitara ARM Cortex-A8 processor today.



(You need to be a member of matlab -- send a blank email to matlab-subscribe@yahoogroups.com )