Now for something a little more compilcated: |
octave:1> h0 = sinegen (44100, 44100, 440) ; octave:2> h0 = h0 .* ad (44100, 5000) ; octave:3> h1 = sinegen (44100, 44100, 440*3.01) ; octave:4> h1 = h1 .* adsr (44100, 2000, 8000, 0.2, 5000) ; octave:5> h2 = sinegen (44100, 44100, 440*5) ; octave:6> h2 = h2 .* adsr (44100, 100, 5000, 0.1, 4000) ; octave:7> h3 = sinegen (44100, 44100, 440*7.01,001) ; octave:8> h3 = h3 .* ad (44100, 200) ; octave:9> sig = h0 + h1 + h2 + h3 ;
This is what is called additive synthesis. For most interesting sounds additive synthesis will require many more components than just the four used in this example. |
Another common synthesis technique is subtractive synthesis where we start with waveform with many sine components and subtract stuff out of it using a filter. |