Music using proteus and C

I have this homework: make music using programing and Proteus
The code is done but the music sounds terrible. My teacher said that i have to do something with timer2, but i don t know what

here is the code:

#include “p18f4455.h”
#include “delays.h”
#include “pwm.h”

void main ()
{
PORTD = 0; //initializare port D
LATD = 0;
TRISD = 0b00000011;

PORTB = 0; //initializare port B
LATB = 0;
TRISB = 0b00000000;

PORTC = 0; //initializare port C
LATC = 0;
TRISC = 0b00000000;

OSCCONbits.IRCF2 = 1; //configurare oscilatoriu intern
OSCCONbits.IRCF1=1;
OSCCONbits.IRCF0=0;
OSCCONbits.SCS1=1;

while(1)
{

//prima partitura
OpenPWM1 (191); SetDCPWM1 (379); //MI
Delay10KTCYx(100);
OpenPWM1 (191); SetDCPWM1 (379); //MI
Delay10KTCYx(100);
OpenPWM1 (179); SetDCPWM1 (358); //FA
Delay10KTCYx(100);
OpenPWM1 (160); SetDCPWM1 (319); //SOL
Delay10KTCYx(100);
OpenPWM1 (179); SetDCPWM1 (358); //FA
Delay10KTCYx(100);
OpenPWM1 (191); SetDCPWM1 (379); //MI
Delay10KTCYx(100);
OpenPWM1 (211); SetDCPWM1 (425); //RE
Delay10KTCYx(100);
OpenPWM1 (238); SetDCPWM1 (477); //DO JOS
Delay10KTCYx(100);
OpenPWM1 (238); SetDCPWM1 (477); //DO JOS
Delay10KTCYx(100);
OpenPWM1 (211); SetDCPWM1 (425); //RE
Delay10KTCYx(100);
OpenPWM1 (191); SetDCPWM1 (379); //MI
Delay10KTCYx(100);
OpenPWM1 (191); SetDCPWM1 (379); //MI
Delay10KTCYx(100);
OpenPWM1 (211); SetDCPWM1 (425); //RE
Delay10KTCYx(100);
OpenPWM1 (211); SetDCPWM1 (425); //RE
Delay10KTCYx(50);

//a doa partitura

OpenPWM1 (191); SetDCPWM1 (379); //MI
Delay10KTCYx(100);
OpenPWM1 (191); SetDCPWM1 (379); //MI
Delay10KTCYx(100);
OpenPWM1 (179); SetDCPWM1 (358); //FA
Delay10KTCYx(100);
OpenPWM1 (160); SetDCPWM1 (319); //SOL
Delay10KTCYx(100);
OpenPWM1 (160); SetDCPWM1 (319); //SOL
Delay10KTCYx(100);
OpenPWM1 (179); SetDCPWM1 (358); //FA
Delay10KTCYx(100);
OpenPWM1 (191); SetDCPWM1 (379); //MI
Delay10KTCYx(100);
OpenPWM1 (211); SetDCPWM1 (425); //RE
Delay10KTCYx(100);
OpenPWM1 (238); SetDCPWM1 (477); //DO JOS
Delay10KTCYx(100);
OpenPWM1 (238); SetDCPWM1 (477); //DO JOS
Delay10KTCYx(100);
OpenPWM1 (211); SetDCPWM1 (425); //RE
Delay10KTCYx(100);
OpenPWM1 (191); SetDCPWM1 (379); //MI
Delay10KTCYx(100);
OpenPWM1 (211); SetDCPWM1 (425); //RE
Delay10KTCYx(100);
OpenPWM1 (238); SetDCPWM1 (477); //DO JOS
Delay10KTCYx(100);
OpenPWM1 (238); SetDCPWM1 (477); //DO JOS
Delay10KTCYx(50);
}
}