Download presentation
Presentation is loading. Please wait.
Published byGeorge Marsland Modified over 10 years ago
1
Mohammed Almajhad Final Project Dr. Kepuska
2
Intro My project idea is based on playing sound on different effects as we see these days. Also, adding a volume gain to these sound effects with out affecting the default mode. I also added a choice of increasing or decreasing the volume manually on the default mode. LED’s will be changing as we choose different mode
3
Project contains : Sound Effects Volume Gain on sound effects Increase or decrease Volume manually
4
Chorus static int input=0,delay=0; int x,y=0; delay=(int)((1-(cos(6.28*0.4*input/5000)))*20); //eq'n for delay = D/2(1-(cos(2*pi*n*f)) delay=input-delay; //usage of the delay in the output equation if (delay<0) { delay=5000+delay; //if the value of the delay go below 0, it retakes 5000 samples } //it basically "goes back to the start" buffer1[input]=(iChannel0LeftIn>>8); //shift to the right to make it 16 bits (short) buffer2[input]=(iChannel0RightIn>>8); x=(int)(buffer1[input]+2*buffer1[delay]/3); //2/3 is alpha, which is like a volume control;it controls the intensity of the effect's signal y=(int)(buffer2[input]+2*buffer1[delay]/3); //x and y both have 16 bits stored in them if(input>=5000-1) //if the number of samples go beyond 5000, resets it to 0 input = 0; else input++; iChannel0LeftOut=(x<<8); iChannel0RightOut=(y<<8); //shift back x and y to make them 24 bits to output as sound Volume_UP();
5
Echo static int input=0; int x,y=0; buffer1[input]=(iChannel0LeftIn>>8)+(0.6*buffer1[input]); buffer2[input]=(iChannel0RightIn>>8)+(0.6*buffer2[input]); x=(int)buffer1[input]; y=(int)buffer2[input]; if(input>=5000-1) input = 0; else input++; iChannel0LeftOut=(x<<8 ); iChannel0RightOut=(y<<8); Volume_UP();
6
Volume Gain iChannel0LeftOut = (loudness)*(iChannel0LeftOut); iChannel0RightOut = (loudness)*(iChannel0RightOut); iChannel1LeftOut = (loudness)*(iChannel1LeftOut); iChannel1RightOut = (loudness)*(iChannel1RightOut);
7
Increasing or Decreasing if (*pFIO_FLAG_C == 0x0400) { // confirm PF10 interrupt handling *pFIO_FLAG_C = 0x0400; //PF11 : Volume up if (sound != 0) { sound--; } FIO_ANOM_0311_FLAG_W(0x0400,pFIO_FLAG_C); } if (*pFIO_FLAG_C == 0x0800) { // confirm PF10 interrupt handling *pFIO_FLAG_C = 0x0800; sound++; //PF10 : Volume Down if (sound >= 5) { sound =1; } FIO_ANOM_0311_FLAG_W(0x0800,pFIO_FLAG_C); }
8
The End Any questions about the project or suggestions to improve the project?
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.