d9 $ midicmd "start" # s "midi"
let melody = slow 6 $ "0 2 [4 8 .] [3 4 3] 8 4 9"
d9 $ midicmd "start" # s "midi"
d1
$ note
((scaleP scalePattern
$ off 4 ((+ 2 ).slow 2)
$ off 1 (inversion.slow 2)
$ off 3 (inversion.slow 3)
$ off 1.5 ((+ 2).rev.slow 2)
$ generateMelodicSeed
))#s "[pe-gtr:10,midi]" #gain 1 #orbit 0 #midichan 1
Linear Predictive Coding (LPC)
Linear predictive coding is a set of analysis and re-synthesis techniques. It is often used for data compression of speech but also has application for cross-synthesis, pitch corrections, and other more experimental techniques. It works by modeling a source signal as a set of all-pole bandpass filters excited by either a noise source or a pulse-wave. The coefficients of these filters are estimated using linear regression and animated over time to create the illusion of speech. As a data compression technique it can achieve up to a 17:1 reduction in data for a speech signal.
It excels at modelling speech but can also be highly successful in modelling other monophonic sounds that include pitched and unpitched moments.
When modelling speech, the noise source is used to excite the filters during consonants and the pulse wave is used to excite the filters during vowels.
How it works
A given input signal
In order to create the model above we need values for our filter and we need to know if we should use noise or a pitched sound for our source. If we want a pitched sound we also need to know what pitch we should use.
Estimating filter coefficients
If we can find the coeficcients
Note: in order to do this our signal needs to be longer than the
Given
x(n) = x_{0} \cdot a + e(n) x(n+1) = x_{1} \cdot a + e(n) ... x(n+N) = x_{N} \cdot a + e(n+N) $$
Each equation contains our
We can rewrite our equations as:
Notice that
In the method of least squares, we try to minimize that value of
Estimating the residual, e(n)
We need to know the following: - the power of the signal x(n) - the pitch of x(n) ... this will require pitch detection
Analysis
We break the signal up into windows
something something Yule-Walker equations and FFT for faster
implementation... they provide a way to get