;------------------------------------------------------------------------- ; Beginners Classic Waveshapes and Spectra Demo ; by Reginald Bain April 2002 ;------------------------------------------------------------------------- ;---------------------------------- ;- Harmonic partial relationships - ;---------------------------------- f1 0 16384 10 1 ; Sine wave, f0 f2 0 16384 10 0 1 ; Sine wave, 2f0 f3 0 16384 10 0 0 1 ; Sine wave, 3f0 f4 0 16384 10 0 0 0 1 ; Sine wave, 4f0 f5 0 16384 10 0 0 0 0 1 ; Sine wave, 5f0 f6 0 16384 10 1 1 1 1 1 ; Complex tone: f0, 2f0, 3f0, 4f0, 5f0 f7 0 16384 10 0 1 1 1 1 ; Complex tone, fundamental missing: ; 2f0, 3f0, 4f0, 5f0 ;----------------------------------------- ;- Nearly harmonic partial relationships - ;----------------------------------------- f11 0 16384 9 100 1 0 ; Sine wave, f0 f12 0 16384 9 201 1 0 ; Sine wave, 2.01f0 f13 0 16384 9 295 1 0 ; Sine wave, 2.95f0 f14 0 16384 9 402 1 0 ; Sine wave, 4.02f0 f15 0 16384 9 495 1 0 ; Sine wave, 4.95f0 f16 0 16384 9 100 1 0 201 1 0 295 1 0 402 1 0 495 1 0 ; Complex tone: ; f0, 2.01f0, 2.95f0, 4.02f0, 4.95f0 ;------------------------------------ ;- Inharmonic partial relationships - ;------------------------------------ f21 0 16384 9 100 1 0 ; Sine wave, f0 f22 0 16384 9 230 1 0 ; Sine wave, 2.3f0 f23 0 16384 9 260 1 0 ; Sine wave, 2.6f0 f24 0 16384 9 440 1 0 ; Sine wave, 4.4f0 f25 0 16384 9 470 1 0 ; Sine wave, 4.7f0 f26 0 16384 9 100 1 0 230 1 0 260 1 0 440 1 0 470 1 0 ; Complex tone: ; f0, 2.3f0, 2.6f0, 4.4f0, 4.7f0 ;-------------------------------------------------------------------------------------- ;- Classic waveforms: sine, sawtooth, square, triangle, and pulse with 1:3 duty cycle - ;-------------------------------------------------------------------------------------- f30 0 16384 10 1 ; Sine wave f31 0 16384 10 1 .5 .333333 .25 .2 .166667 .142857 .125 .111111 .1 .090909 .083333 .076923 ; Band-limited sawtooth wave f32 0 16384 7 1 16385 -1 ; Ideal sawtooth wave f33 0 16384 10 1 0 .333333 0 .2 0 .142857 0 .111111 0 .090909 0 .076923 ; Band-limited square wave f34 0 16384 7 1 8192 1 0 -1 8192 -1 ; Ideal square wave f35 0 16384 10 1 0 .111111 0 .04 0 .020408 0 .012345 0 .008264 0 .005917 ; Band-limited triangle wave f36 0 16384 7 0 4096 1 8192 -1 4097 0; Ideal triangle wave f37 0 16384 10 1 .5 .333333 0 .25 .2 0 .142857 .125 0 .1 .090909 0 ; Band-limited pulse with 1:3 duty cycle f38 0 16384 7 1 5462 1 0 -1 10923 -1 ; Ideal pulse with with 1:3 duty cycle ;============================================================================================================= ;= C O M P L E X T O N E S D E R I V E D F R O M T H E F I B O N A C C I & L U C A S S E Q U E N C E = ;============================================================================================================= ;---------------------------------------------------------------------------------------------- ;- Harmonic partial relationships and relative amplitudes dervied from the Fibonacci sequence - ;---------------------------------------------------------------------------------------------- ;- Partial No. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 6 17 18 19 20 21 f50 0 16384 10 0 .8 .5 0 .3 0 0 .2 0 0 0 0 .1 f51 0 16384 10 1.3 .8 .5 0 .3 0 0 .2 0 0 0 0 .1 0 0 0 0 0 0 0 .1 ;----------------------------------------------------------------------------------------------- ;- Inarmonic partial relationships and relative amplitudes dervied from the Fibonacci sequence - ;----------------------------------------------------------------------------------------------- ; Fibonacci Partials 1.3 2.1 3.4 5.5 8.9 14.4 23.3 f60 0 16384 9 130 .89 0 210 .55 0 340 .34 0 550 .21 0 890 .13 0 1440 .05 0 233 .05 0 ;------------------------------------------------------------------------------------------- ;- Inarmonic partial relationships and relative amplitudes dervied from the Lucas sequence - ;------------------------------------------------------------------------------------------- ; Lucas Partials 1.1 1.8 2.9 4.7 7.6 12.3 19.9 f61 0 16384 9 110 1 0 180 .89 0 290 .55 0 470 .34 0 760 .21 0 1230 .13 0 1990 .08 0 ;======================================== ;= A M P L I T U D E E N V E L O P E S = ;======================================== f90 0 1025 7 0 128 1 128 .8 256 .6 256 .6 257 0 ; Linear envelope f91 0 1025 7 0 128 1 128 .8 256 .5 384 .3 129 0 ; Linear envelope with Fibonacci relationships f92 0 1025 7 0 128 1 128 .7 256 .4 384 .3 129 0 ; Linear envelope with Lucas relationships ; Complex tone with harmonic partial relationships ; Sta Dur Amp Pitch Table Env i1 0 1 10000 8.09 1 90 ; f0, f0 = 440 Hz. i1 + . 10000 8.09 2 90 ; 2f0 i1 + . 10000 8.09 3 90 ; 3f0 i1 + . 10000 8.09 4 90 ; 4f0 i1 + . 10000 8.09 5 90 ; 5f0 i1 + 4 10000 8.09 6 90 ; f0, 2f0, 3f0, 4f0, 5f0 i1 + 4 10000 8.09 6 90 ; 2f0, 3f0, 4f0, 5f0 (fundamental missing) s ; Complex tone with nearly harmonic partial relationships ; Sta Dur Amp Pitch Table Env i2 0 1 10000 8.09 11 90 i2 + . 10000 8.09 12 90 i2 + . 10000 8.09 13 90 i2 + . 10000 8.09 14 90 i2 + . 10000 8.09 15 90 i2 + 4 10000 8.09 16 90 s ; Complex tone with inharmonic partial relationships ; Sta Dur Amp Pitch Table Env i2 0 1 10000 8.09 21 90 i2 + . 10000 8.09 22 90 i2 + . 10000 8.09 23 90 i2 + . 10000 8.09 24 90 i2 + . 10000 8.09 25 90 i2 + 4 10000 8.09 26 90 s ; Classic waveforms: sine, sawtooth, square, triangle, and pulse with 1:3 duty cycle (DC) ; Sta Dur Amp Pitch Table Env i1 0 2 10000 8.09 1 90 ; Sine wave i1 + . 10000 8.09 31 90 ; Band-limited sawtooth i1 + . 10000 8.09 32 90 ; Ideal sawtooth i1 + . 10000 8.09 33 90 ; Band-limited square (DC=1:2) i1 + . 10000 8.09 34 90 ; Ideal square (DC=1:2) i1 + . 10000 8.09 35 90 ; Band-limited triangle i1 + . 10000 8.09 36 90 ; Ideal triangle i1 + . 10000 8.09 37 90 ; Band-limited pulse (DC=1:3) i1 + . 10000 8.09 38 90 ; Ideal pulse (DC=1:3) s ; Complex tone with harmonic partial relationships and ADDSR amplitude envelope derived from the Fibonacci sequence ; Sta Dur Amp Pitch Table Env i1 0 4 10000 8.09 50 91 i1 + . 10000 8.09 51 91 s ; Complex tone with inharmonic partial relationships and ADDSR amplitude envelope derived from the Fibonacci sequence ; Sta Dur Amp Pitch Table Env i2 0 4 10000 8.09 60 91 s ; Complex tone with inharmonic partial relationships and ADDSR amplitude envelope derived from the Lucas sequence ; Sta Dur Amp Pitch Table Env i2 0 4 10000 8.09 61 92 s