Download - Microcomputer Systems 1

Transcript
Page 1: Microcomputer Systems 1

MICROCOMPUTER SYSTEMS 1

SulTan BINHUMOODFinal Project Presentation

Page 2: Microcomputer Systems 1

PROJECT INFO

• My project idea is based on playing sound

displaying different effects seen in everyday

experiences.

Page 3: Microcomputer Systems 1

EFFECTS

CHORUSchorus effect (sometimes chorusing effect) occurs when individual sounds are roughly the same and nearly (but never exactly) the same pitch converge and are perceived as one

ECHOA time-delayed electronic reflection of a speaker's voice.

Page 4: Microcomputer Systems 1

CHORUS - CODING

• for(i = 0; i < BUFLEN; i++)• {• delay = (int)((1 - (cos(6.28 * 0.4 * input / 1000))) * 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 = 1000 + delay; //if the value of the delay go below 0, it retakes 5000 samples• } //it basically "goes back to the start"

• buffer1[input] = (short) (pIn[i * 2]); • buffer2[input] = (short) (pIn[i * 2 + 1]);

• 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 >= 1000 - 1) //if the number of samples go beyond 5000, resets it to 0• input = 0;• else• input++;•

• pOut[i * 2]= (x);• pOut[i * 2 + 1]= (y); // display output in the output buffer• }• }

Page 5: Microcomputer Systems 1

ECHO - CODING

• void Echo_Effect(short *pIn, short *pOut)• {• int i;• short buffer1[1000];• short buffer2[1000];• static int input = 0; • int x, y=0;

• for(i = 0; i < BUFLEN; i++)• {• buffer1[input] = (pIn[i * 2]) + (0.6 * buffer1[input]);• buffer2[input] = (pIn[i * 2 + 1]) + (0.6 * buffer2[input]);

• x = (int) (buffer1[input]);• y = (int) (buffer2[input]);•

• if(input>= 1000-1)• input = 0;• else• input++; •

• pOut[i * 2] = (x);• pOut[i * 2 + 1] = (y); // display output in the output buffer•

• }• }

Page 6: Microcomputer Systems 1

RUN PROJECT

• Run the actual project and show how the effects work.

• > First select Passthrough to show the actual sound

• > Next show Chorus Effect

• > Show Echo Effect

Page 7: Microcomputer Systems 1

THE END

• Any questions about the project or suggestions to improve the project?