Presentation is loading. Please wait.

Presentation is loading. Please wait.

EZ-Additive Synthesizer By Max Bastien 12/14/07. Problem Statement Mystery of keyboards reproducing a wide range of sounds from any particular instrument.

Similar presentations


Presentation on theme: "EZ-Additive Synthesizer By Max Bastien 12/14/07. Problem Statement Mystery of keyboards reproducing a wide range of sounds from any particular instrument."— Presentation transcript:

1 EZ-Additive Synthesizer By Max Bastien 12/14/07

2 Problem Statement Mystery of keyboards reproducing a wide range of sounds from any particular instrument with just one digital sample played or none at all.

3 What is a Synthesizer? A synthesizer is an electronic musical instrument Creates sounds by manipulating an analog signal using various techniques.

4 Various Techniques Additive Synthesis Subtractive Synthesis FM Synthesis Wavetable Synthesis

5 Additive Technique Additive Synthesis is the process of summing such sinusoids to produce a wide variety of composite signals. An input signal is modified by however many functions with a variable Amplitude, Frequency and Phase values then the resultant signal is multiplied by the summation.

6 Key Aspects Frequency Amplitude Phase

7 Specifications Main Output Switch – PF8 Pressed once – all outputs and Led4 are inactive (this is the default case at start-up) Pressed for a second time - all outputs and Led4 are active Pressed for a 3rd time – resets back to case state of pressed once Additive Synthesis Toggle – PF9 Pressed once – Synthesis function and Led5 are inactive (default case) Pressed twice - Synthesis function and Led5 are active Pressed for a third time – reset back to case state of pressed once Volume Increment Toggle – PF10 Default case – Volume is set to 0 (mute) Pressed once to ten times – volume increments by 10 Pressed for an eleventh time – reset back to default case Frequency Increment Toggle – PF10 Default case – All frequency set to 200 Pressed once to ten times – frequencies increments by 100 Pressed for an eleventh time – reset back to default case

8 Essential Code Fragments void AddSynth(float a1, float a2, float a3,float a4,int f1,int f2,int f3,int f4) { int substitute = iChannel0LeftIn << 8; static int x = 0; float fi1 = pi/3; float fi2 = pi/3; float fi3 = pi/3; float fi4 = pi/3; float sine1 = a1*sinf(2*pi*f1*x+fi1); float sine2 = a2*sinf(2*pi*f2*x+fi2); float sine3 = a3*sinf(2*pi*f3*x+fi3); float sine4 = a4*sinf(2*pi*f4*x+fi4); float synoutput = substitute * (sine1 + sine2 + sine3 + sine4); //increment sample size x++; if(x >= 150) x = 0; iChannel0LeftIn = synoutput; iChannel0RightIn = synoutput; //outputing sound iChannel0LeftIn = iChannel0LeftIn >> 8; iChannel0RightIn = iChannel0RightIn >> 8; }

9 EX_INTERRUPT_HANDLER(Sport0_RX_ISR) { // confirm interrupt handling *pDMA1_IRQ_STATUS = 0x0001; ////////PF8 deafult case if (Counter1==0) { //Turn all Leds OFF - no output but8=0x00; } //If button is toggled all output and Led4 active if (Counter1==1) { // copy processed data from variables into dma output buffer iTxBuffer1[INTERNAL_DAC_L0] = iChannel0LeftOut; iTxBuffer1[INTERNAL_DAC_R0] = iChannel0RightOut; //Turn LED4 ON but8=0x01; } Interrupt Handler

10 Cont’d ////////PF9 default case if (Counter2==0){ //turn Led5 off but9=0x00; } if (Counter2==1) { //Make channel 0 active iChannel0LeftIn = iRxBuffer1[INTERNAL_ADC_L0]; iChannel0RightIn = iRxBuffer1[INTERNAL_ADC_R0 ]; //Turn Led5 ON but9=0x02; //Call function for sound production AddSynth(a1, a2, a3, a4, f1, f2, f3, f4); //Make output active iChannel0LeftOut = iChannel0LeftIn; iChannel0RightOut = iChannel0RightIn; } *pFlashA_PortB_Data = but8|but9|but10; }

11 Flags EX_INTERRUPT_HANDLER(FlagA_ISR) { if (*pFIO_FLAG_C == 0x0100) //Checks PF8 { // confirm interrupt handling *pFIO_FLAG_C = 0x0100; //Increment Count Counter1++; if(Counter1==2) Counter1=0; } else if (*pFIO_FLAG_C == 0x0200) //Checks PF9 { // confirm interrupt handling *pFIO_FLAG_C = 0x0200; Counter2++; if(Counter2==2) Counter2=0; } else if (*pFIO_FLAG_C == 0x0400) //Checks PF10 { *pFIO_FLAG_C = 0x0400; a1, a2, a3, a4 += 10; if (a1, a2, a3, a4 >= 100) a1, a2, a3, a4 = 0; } else if (*pFIO_FLAG_C == 0x0800) //Checks PF11 { *pFIO_FLAG_C = 0x0800; f1, f2, f3, f4 +=100; if (f1, f2, f3, f4 >= 1300) f1, f2, f3, f4 = 200; }

12 Results Project = success running w/o errors Practical Uses Special effects Replication of instruments Sounds cards


Download ppt "EZ-Additive Synthesizer By Max Bastien 12/14/07. Problem Statement Mystery of keyboards reproducing a wide range of sounds from any particular instrument."

Similar presentations


Ads by Google